Built to order

Pneumonia Detection from Chest X-ray using CNN

A medical-imaging AI that classifies chest X-rays as normal or pneumonia using a fine-tuned CNN (ResNet/MobileNet). The app shows the prediction with confidence and Grad-CAM heatmaps over lung regions, plus a batch-screening dashboard — a high-impact healthcare AI project with real clinical datasets.

AI & Machine Learning PythonMachine LearningComputer VisionDeep LearningHealthcare AICNNTensorFlowMedical ImagingSoftware
Pneumonia detection project thumbnail showing a chest X-ray with the lung region highlighted by a Grad-CAM heatmap and classification result.
More project photos (3)

The problem

The Pneumonia Detection system is a healthcare-AI final-year project that classifies chest X-ray images as normal or pneumonia-positive using a fine-tuned convolutional neural network. The model is trained on the NIH Chest X-ray dataset (112,000+ frontal-view images) and fine-tunes a ResNet50/MobileNetV2 backbone pre-trained on ImageNet — the transfer-learning story alone answers a dozen viva questions. The LungScan Streamlit app returns the prediction with a confidence score and overlays Grad-CAM heatmaps on the lung regions that drove the decision, so the examiner sees visual proof, not just a number. A batch-screening dashboard lets you process a folder of X-rays and export results for your report's evaluation chapter.

This is a built-to-order software project: code, trained model weights and the complete viva kit (report, PPT, Q&A) are prepared fresh for you.

SYSTEM FLOW

3 components 4 connections

Live flow
Drag to explore
100%
userUser

Uploads a chest X-ray or drops a folder for batch screening.

Follow the working sequence

How it works

  1. A chest X-ray is uploaded to the LungScan app (or dropped into the batch folder).
  2. The preprocessing pipeline resizes and normalizes the image and applies CLAHE contrast enhancement so lung opacities stand out.
  3. The fine-tuned CNN (ResNet50/MobileNetV2) extracts deep features and outputs a pneumonia probability.
  4. Grad-CAM back-projects the prediction onto the X-ray, highlighting the infiltrated lung regions in a heatmap.
  5. The dashboard shows the verdict, confidence and heatmap per image, and aggregates batch results into the metrics tables used in your report.

Project features

  • Normal vs. pneumonia binary classification of chest X-rays with confidence score
  • Transfer learning on ResNet50/MobileNetV2 pre-trained backbones
  • Grad-CAM heatmaps overlaid on lung regions as visual evidence
  • LungScan Streamlit app — upload, predict and visualize in one click
  • Batch-screening dashboard: process folders of X-rays, export CSV results
  • Class-imbalance handling (weighted loss / augmentation) documented in the report
  • Training notebooks with ROC curves, confusion matrix and per-class metrics
  • CLAHE contrast enhancement and lung-aware preprocessing pipeline
  • Evaluation chapter: accuracy, sensitivity, specificity, F1 and AUC

What is included

  • Complete source code (training, evaluation, inference, Streamlit app)
  • Trained model weights (.h5) — demos run on any laptop CPU
  • Data preparation scripts and augmentation pipeline
  • Project report PDF (clinical background, literature survey, methodology, results, ethics)
  • PPT presentation for final review
  • Viva Q&A preparation document (CNNs, transfer learning, Grad-CAM, ROC/AUC, class imbalance)
  • Setup guide (environment, dependencies, dataset download steps)

Advantages

  • Normal vs. pneumonia binary classification of chest X-rays with a confidence score, built on transfer learning (ResNet50/MobileNetV2 pre-trained backbones).
  • Grad-CAM heatmaps overlaid on lung regions give visual evidence for each prediction — examiners and doctors can see what the model looked at.
  • LungScan Streamlit app: upload, predict and visualize in one click, plus a batch-screening dashboard that processes folders of X-rays and exports CSV results.
  • Class-imbalance handling (weighted loss / augmentation) documented in the report, and training notebooks with ROC curves, confusion matrix and per-class metrics.
  • CLAHE contrast enhancement and a lung-aware preprocessing pipeline improve robustness across scan qualities.
  • Evaluation chapter with accuracy, sensitivity, specificity, F1 and AUC — the standard clinical-AI metric set, ready for the report.

Disadvantages

  • This is an educational screening demonstrator, not a certified diagnostic device — predictions must never be used for real clinical diagnosis or treatment decisions.
  • The model is trained on adult frontal chest X-rays; performance on pediatric images, lateral views or scans from different equipment is not validated.
  • Accuracy depends on image quality — rotated, cropped or low-contrast scans degrade results, which the report's error analysis documents honestly.

Limitations & prerequisites

  • This is an educational screening demonstrator, not a certified diagnostic device — predictions must never be used for real clinical diagnosis or treatment decisions.
  • The model is trained on adult frontal chest X-rays; performance on pediatric images, lateral views or scans from different equipment is not validated.
  • Accuracy depends on image quality — rotated, cropped or low-contrast scans degrade results, which the report's error analysis documents honestly.
Components & software requirements
  • Python 3.10, TensorFlow/Keras (transfer learning, training)
  • OpenCV (CLAHE enhancement, preprocessing), NumPy, scikit-learn
  • Matplotlib/Seaborn (ROC curves, confusion matrix, training plots)
  • Streamlit web app (LungScan) — no frontend coding needed for demos
  • NIH Chest X-ray dataset (112,000+ images) for training and evaluation
  • Trained weights shipped as .h5 file — CPU inference in seconds
Download free synopsis (PDF)

Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.

Kermany et al. (2018), Identifying Medical Diagnoses and Treatable Diseases by Image-Based Deep Learning, Cell 172(5)

Get a quotation