Explainable Deep Learning for Pneumonia Detection from Chest X-Rays
DOI:
https://doi.org/10.63544/q2p0c527Keywords:
Pneumonia Detection, Chest X-ray, Explainable AI, Grad-CAM, Transfer Learning, Convolutional Neural Network, Deep Learning, Medical ImagingAbstract
Pneumonia is a leading cause of morbidity and mortality worldwide, and timely diagnosis from chest X-ray imaging is essential for effective treatment. Manual interpretation of radiographs is time-consuming and depends on the availability of experienced radiologists, motivating automated diagnostic support. Deep learning achieves strong accuracy in medical image classification, but its opacity limits clinical trust, since practitioners require justification for each prediction. This paper presents an explainable deep learning framework for pneumonia detection from chest X-rays that combines transfer learning with Gradient-weighted Class Activation Mapping (Grad-CAM). We fine-tune two pre-trained convolutional neural network backbones, MobileNetV2 and VGG16, to distinguish pneumonia from normal cases on a dataset of 5,232 training and 624 test images, and compare them across accuracy, precision, recall, F1-score, and area under the curve. The MobileNetV2 model achieves the best performance with 88.30 percent accuracy, an F1-score of 0.901, a precision of 0.959, and an area under the curve of 0.957, outperforming VGG16. Grad-CAM then produces visual heatmaps that localise the lung regions most responsible for each prediction, allowing validation of the model's reasoning against regions of radiological opacity. The framework delivers accurate diagnoses alongside interpretable visual explanations that localise pathological regions, supporting radiologist trust and the practical deployment of automated screening in clinical workflows.
REFERENCES
[1] World Health Organization, “Pneumonia in children,” WHO Fact Sheet, 2022.
[2] T. Cherian et al., “Standardized interpretation of paediatric chest radiographs for the diagnosis of pneumonia in epidemiological studies,” Bulletin of the World Health Organization, vol. 83, no. 5, pp. 353–359, 2005.
[3] World Health Organization, Standardization of Interpretation of Chest Radiographs for the Diagnosis of Pneumonia in Children. Geneva: WHO, 2001.
[4] C. J. Williams et al., “Variability and accuracy in the interpretation of chest radiographs for paediatric pneumonia,” Pediatric Radiology, vol. 43, no. 8, pp. 1017–1025, 2013.
[5] M. I. Neuman et al., “Variability in the interpretation of chest radiographs for the diagnosis of pneumonia in children,” Journal of Hospital Medicine, vol. 7, no. 4, pp. 294–298, 2012.
[6] G. Litjens et al., “A survey on deep learning in medical image analysis,” Medical Image Analysis, vol. 42, pp. 60–88, 2017.
[7] Y. LeCun, Y. Bengio, and G. Hinton, “Deep learning,” Nature, vol. 521, no. 7553, pp. 436–444, 2015.
[8] P. Rajpurkar et al., “CheXNet: Radiologist-level pneumonia detection on chest X-rays with deep learning,” arXiv preprint arXiv:1711.05225, 2017.
[9] M. Raghu, C. Zhang, J. Kleinberg, and S. Bengio, “Transfusion: Understanding transfer learning for medical imaging,” in Proc. Advances in Neural Information Processing Systems (NeurIPS), 2019, pp. 3347–3357.
[10] H. C. Shin et al., “Deep convolutional neural networks for computer-aided detection: CNN architectures, dataset characteristics and transfer learning,” IEEE Transactions on Medical Imaging, vol. 35, no. 5, pp. 1285–1298, 2016.
[11] N. Tajbakhsh et al., “Convolutional neural networks for medical image analysis: Full training or fine tuning?,” IEEE Transactions on Medical Imaging, vol. 35, no. 5, pp. 1299–1312, 2016.
[12] S. S. Yadav and S. M. Jadhav, “Deep convolutional neural network based medical image classification for disease diagnosis,” Journal of Big Data, vol. 6, no. 1, p. 113, 2019.
[13] Z. C. Lipton, “The mythos of model interpretability,” Communications of the ACM, vol. 61, no. 10, pp. 36–43, 2018.
[14] A. Holzinger, G. Langs, H. Denk, K. Zatloukal, and H. Müller, “Causability and explainability of artificial intelligence in medicine,” WIREs Data Mining and Knowledge Discovery, vol. 9, no. 4, p. e1312, 2019.
[15] E. J. Topol, “High-performance medicine: The convergence of human and artificial intelligence,” Nature Medicine, vol. 25, no. 1, pp. 44–56, 2019.
[16] R. R. Selvaraju, M. Cogswell, A. Das, R. Vedantam, D. Parikh, and D. Batra, “Grad-CAM: Visual explanations from deep networks via gradient-based localization,” in Proc. IEEE International Conference on Computer Vision (ICCV), 2017, pp. 618–626.
[17] X. Wang, Y. Peng, L. Lu, Z. Lu, M. Bagheri, and R. M. Summers, “ChestX-ray8: Hospital-scale chest X-ray database and benchmarks on weakly-supervised classification and localization of common thorax diseases,” in Proc. IEEE CVPR, 2017, pp. 2097–2106.
[18] D. S. Kermany et al., “Identifying medical diagnoses and treatable diseases by image-based deep learning,” Cell, vol. 172, no. 5, pp. 1122–1131, 2018.
[19] S. Rajaraman et al., “Visualization and interpretation of convolutional neural network predictions in detecting pneumonia in pediatric chest radiographs,” Applied Sciences, vol. 8, no. 10, p. 1715, 2018.
[20] O. Stephen, M. Sain, U. J. Maduh, and D. U. Jeong, “An efficient deep learning approach to pneumonia classification in healthcare,” Journal of Healthcare Engineering, vol. 2019, p. 4180949, 2019.
[21] K. Simonyan and A. Zisserman, “Very deep convolutional networks for large-scale image recognition,” in Proc. International Conference on Learning Representations (ICLR), 2015.
[22] K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition,” in Proc. IEEE CVPR, 2016, pp. 770–778.
[23] M. Sandler, A. Howard, M. Zhu, A. Zhmoginov, and L. C. Chen, “MobileNetV2: Inverted residuals and linear bottlenecks,” in Proc. IEEE CVPR, 2018, pp. 4510–4520.
[24] B. Zhou, A. Khosla, A. Lapedriza, A. Oliva, and A. Torralba, “Learning deep features for discriminative localization,” in Proc. IEEE CVPR, 2016, pp. 2921–2929.
[25] I. Ahmad et al., “Deep learning for chest X-ray diagnosis with explainable AI: A review,” IEEE Access, vol. 10, pp. 78895–78917, 2022.
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Hadiya Ali , Hamza Gulshad, Imran Ullah , Maha Asghar, Muhammad Adnan (Author)

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.