Skip to content
All projects
CAP 5516 Medical Image Computing2025

Pneumonia from chest radiographs, and what recall reveals

Transfer learning against training from scratch on chest X-rays, where per class recall shows which way the model leans.

ResNet-34Transfer learningClass imbalanceChest X-ray

82%

Test accuracy

pretrained

0.99

Pneumonia recall

0.55

Normal recall

where the model leans

0.96

Normal precision

The question

The dataset is heavily skewed toward pneumonia cases, so a model can score well by leaning on the majority class. In a screening setting the asymmetry matters enormously: a missed pneumonia carries very different weight from a false alarm.

Approach

ResNet-34 trained two ways, once initialised from ImageNet weights and once from scratch, with everything else held constant. I reported per class precision and recall alongside accuracy, plus confusion matrices and a gallery of the misclassified images.

Class distribution across the train, validation and test splits. The imbalance visible here is what the per class recall later exposes, and what the headline accuracy hides.
Test predictions with the model confidence.

Outcome

The pretrained model reached 82 percent test accuracy, with precision 0.96 and recall 0.55 on normal cases and precision 0.78 with recall 0.99 on pneumonia. Trained from scratch, recall on normal fell to 0.21 while pneumonia recall reached 1.00. Both models leaned heavily toward calling a case pneumonia, and the scratch model leaned further.

What it taught me

Looking at the misclassified images was worth more than any metric. Reading the individual mistakes is how you find out whether the model learned the pathology or the acquisition protocol.

More output

Misclassified cases, which were more informative than the aggregate score.
Confusion matrix showing the asymmetry between classes.
Precision and recall through training.