Case Study 04 · Computer Vision · Transfer Learning

Chest X-Ray Classifier

Fine-tuning ResNet50 to classify pneumonia from chest X-rays — taking accuracy from 66.7% to 90.1% through transfer learning, differential learning rates, and data augmentation, with Grad-CAM for interpretability.

The problem

A ResNet50 trained out-of-the-box on the chest X-ray dataset plateaued at 66.7% accuracy — barely better than guessing the majority class, and not trustworthy for anything clinical. The goal was to raise accuracy meaningfully while keeping recall high (missing real pneumonia cases is the costly failure mode) and making the model's decisions inspectable rather than a black box.

Approach

  1. Started from ImageNet-pretrained ResNet50 rather than training from scratch.
  2. Applied transfer learning with differential learning rates — earlier, more general layers fine-tune slower than the later, task-specific layers.
  3. Used data augmentation (rotation, zoom, flips) to reduce overfitting on a relatively small medical imaging dataset.
  4. Evaluated on a held-out set of 624 test images, tracking recall specifically because false negatives (missed pneumonia) matter more than false positives here.
  5. Added Grad-CAM visualizations so predictions can be inspected against the actual image regions the model attended to, instead of trusting a bare softmax score.

Tech stack

  • PyTorch
  • ResNet50
  • Transfer Learning
  • Grad-CAM

Results

  • Accuracy improved from 66.7% to 90.1%.
  • 96% recall and 89% precision on the test set.
  • 0.9647 ROC-AUC.
  • Only 15 false negatives out of 390 pneumonia cases in the 624-image test set.