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.

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 (2)

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.

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)

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 abstract (PDF)

Related guides

All guides
Illustration of object tracking showing video frames with bounding boxes and persistent ID labels following people and vehicles, comparing motion prediction and appearance matching.B.E./B.Tech Computer Science and Electronics students building video analytics projects — people counting, vehicle tracking, sports analysis — who have detection working and need

Object Tracking: DeepSORT and ByteTrack Explained

Detection finds objects per frame; tracking keeps their identities across frames. This guide explains tracking-by-detection, Kalman motion models, DeepSORT's appearance embeddings vs ByteTrack's low-confidence box recovery, tracking metrics (HOTA, IDF1, ID switches), and the tuning parameters that determine real-world quality.

Read guide
Illustration of image segmentation showing U-Net's U-shaped encoder-decoder with skip connections producing pixel masks, alongside Mask R-CNN detecting instances with masks.B.E./B.Tech Computer Science and AI/ML students moving from image classification or detection to pixel-level understanding — medical imaging, defect detection, autonomous driving

Image Segmentation: U-Net and Mask R-CNN

When projects need pixel-level answers, segmentation delivers. This guide explains semantic vs instance vs panoptic segmentation, U-Net's encoder-decoder with skip connections, Mask R-CNN's parallel mask head, Dice and IoU evaluation, paired augmentation, and how to choose the right architecture for your data and question.

Read guide
Illustration of Whisper speech-to-text showing sound waves flowing into a neural network and emerging as transcribed text with timestamps and speaker labels.B.E./B.Tech Computer Science and AI/ML students adding speech-to-text to projects — voice assistants, meeting transcription, accessibility tools

Whisper for Speech-to-Text in Student Projects

Whisper transcribes speech in dozens of languages with no training required. This guide covers how it works, choosing among model sizes, running it locally with faster-whisper, handling hour-long audio, timestamps and speaker diarization, multilingual quirks, and honest evaluation with word error rate.

Read guide
Get a quotation