MedResNet Residual CNN + Pure-PyTorch Forward/Backward Hook Grad-CAM on Held-Out PneumoniaMNIST Chest X-Rays
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.
Evaluated once on 624 untouched PneumoniaMNIST held-out test images using inverse-frequency class-weighted CrossEntropyLoss, AdamW, and cosine annealing.
Balanced sensitivity and specificity across Normal vs Pneumonia paediatric chest radiographs, verified by deterministic seeding and 3/3 passing pytest checks.