Mini Project · B.Tech AIDS · 2024–25

Detecting Pneumonia
with Deep Learning

A CNN trained on 5,863 chest X-ray images achieves 92.6% accuracy — matching the diagnostic performance of trained radiologists.

92.6%
Accuracy
94.4%
Recall
0.971
AUC-ROC
5,863
Training images

How it works

Five stages transform a raw chest X-ray into an accurate clinical prediction in under one second.

1

Data Collection

5,863 labeled chest X-rays from Kaggle — Normal & Pneumonia classes

2

Preprocessing

Resize to 150×150, normalize pixels, apply augmentation

3

CNN Training

4 convolutional blocks learn to extract pneumonia-specific features

4

Evaluation

Accuracy, recall, F1-score, AUC-ROC on held-out test set

5

Prediction

Upload any chest X-ray — get Normal or Pneumonia + confidence score

Watch the CNN learn

Real-time animation of how signals propagate through the neural network. Each circle is a neuron — brighter means more active.

Live stats

ArchitectureShallow
Total neurons15
Connections
Active neurons0
Signal pulses0

Legend

Input neurons
Hidden neurons
Output — Normal
Output — Pneumonia
Active pulse

Controls

5
3

Try the detector

Upload a chest X-ray image or select a sample to see the CNN prediction pipeline in action.

Upload chest X-ray

JPG, PNG, BMP — any size
Click or drag & drop

Or try a sample case:

Select a sample or upload an image to see the prediction.

Evaluation results

Tested on 624 held-out images never seen during training. Recall is the most critical metric — it measures how many pneumonia cases are caught.

92.6%
Accuracy
578/624 correct
93.9%
Precision
Low false-positive rate
94.4%
Recall
Critical: catches pneumonia
94.1%
F1 Score
Balanced precision/recall
0.971
AUC-ROC
Excellent discrimination

Confusion matrix

Predicted NormalPredicted Pneumonia
Actual NormalTN = 210
Correctly identified
FP = 24
False alarm
Actual PneumoniaFN = 22
Missed — critical!
TP = 368
Correctly caught

Only 22 pneumonia cases were missed. The model prioritises high recall to minimise missed diagnoses.

Training history

CNN architecture

Four convolutional blocks extract progressively abstract features, followed by a fully connected classifier head outputting a single sigmoid probability.

Conv2D layers
4 blocks
32 → 64 → 128 → 256 filters
Input shape
150×150×3
Normalised RGB image
Parameters
~3.2M
Trainable weights
Output
Sigmoid
Binary probability [0, 1]

Project team

B.Tech Mini Project — Department of Artificial Intelligence and Data Science · 2024–25

S

Sharukesh M

Register No.11142301AD02104
Model design & training
I

Prathyusha Engineering College

AIDS Department
Academic year 2024–25

Dataset & references

Kaggle Chest X-Ray Images (Pneumonia) — Paul Mooney · Kermany et al. (2018), Cell 172(5) · TensorFlow 2.x Documentation · Rajpurkar et al. CheXNet (2017) · WHO Pneumonia Statistics 2022