MedMNIST PyTorch Classifier & Grad-CAM Explorer

MedResNet Residual CNN + Pure-PyTorch Forward/Backward Hook Grad-CAM on Held-Out PneumoniaMNIST Chest X-Rays

View GitHub Repo →
Held-Out Test ROC-AUC
0.9673
Validation ROC-AUC
0.9968
Test Accuracy / Macro F1
88.78% / 0.873
Unit Test Suite
3/3 Pytest Pass
Grad-CAM Saliency Grid

Pure-PyTorch Grad-CAM heatmaps extracted from stage3.conv2 via forward and full backward hooks, global-average-pooling class-score gradients into channel weights and upsampling to input resolution to audit which lung opacity regions drive each clinical prediction.

ROC Curve

Evaluated once on 624 untouched PneumoniaMNIST held-out test images using inverse-frequency class-weighted CrossEntropyLoss, AdamW, and cosine annealing.

Confusion Matrix

Balanced sensitivity and specificity across Normal vs Pneumonia paediatric chest radiographs, verified by deterministic seeding and 3/3 passing pytest checks.