←
ENFR

Pneumonia detection (chest X-rays)

Epitech school project: classical models and CNNs compared on chest X-rays, and what the test set revealed.

View on GitHub →

The project

Classify chest X-rays as normal or pneumonia. I compared classical models (KNN, Random Forest, SVM, with PCA for dimensionality reduction) with transfer-learning CNNs (EfficientNet, ResNet), with exploratory analysis, preprocessing and error analysis through confusion matrices.

What the test set revealed

On validation, EfficientNet reached 97% accuracy. On the official test set (624 X-rays) it dropped to 74%: it caught every pneumonia but recognised only 31% of normal X-rays. In other words, it answered “pneumonia” almost every time.

ModelAccuracy (test)Pneumonia recallNormal recall
EfficientNet (validation)97%99%92%
EfficientNet (official test)74%100%31%
Random Forest (official test)71%99%26%

What I took from it

A good validation metric proves nothing if the validation set doesn’t look like real data. Look at per-class recall, not just overall accuracy, and test on an independent set before drawing conclusions. It’s the same discipline I now apply to evaluating RAG systems.

Tech stack

MatplotlibEfficientNetResNetPCA