An Explainable AI-Based Deep Learning Approach for Pneumonia Classification Using Chest X-Rays
DOI:
https://doi.org/10.63544/84fzr154Keywords:
Artificial Intelligence, Deep Learning, Pneumonia, Chest X-Ray, Explainable AI, Grad-Cam, Convolutional Neural Network, Medical Image Classification, Computer-Aided Diagnosis, RadiologyAbstract
Pneumonia is a serious disease that affects the lungs, and rapid and proper diagnosis is critical for its effective treatment. CXR is employed due to its relative availability and low cost, along with the fact that it can detect anomalies in the lungs; however, the result of interpretation depends on the quality of the picture, overlapping features, experience of the one who analyzes it, and even the load of work. In the present study, we suggest a deep learning method with an explainable artificial intelligence (XAI) model that classifies pneumonia based on chest x-rays. A labeled CXR dataset comprising 5,856 images was utilized for the development of the model, where the images were labeled as pneumonia and normal based on the reference labels. The dataset was split into train, validation, and independent test sets by employing patient-level splitting to avoid any possible data leakage. Image resizing, normalization, augmentation, and lung region-based pre-processing were performed prior to model training. Accuracy, sensitivity, specificity, precision, F1-score, and area under the receiver operating characteristic curve (AUC) were employed as the metrics for assessing the performance of the model. As shown in the experiment results, the accuracy, sensitivity, specificity, precision, F1-score, and AUC are 94.2%, 95.1%, 93.3%, 93.0%, 94.0%, and 0.97, respectively. The Grad-CAM method mainly focused on the pulmonary regions with radiographic abnormalities and provided the interpretation of model decision processes. It appears that the deep learning model with interpretable mechanism can be a good computer-aided technique for pneumonia screening. Nevertheless, external validation and assessment of the model explanations should be conducted.
REFERENCES
[1] J. Irvin, P. Rajpurkar, K. Ko, Y. Yu, S. Ciurea-Ilcus, C. Chute, H. Marklund, B. Haghgoo, R. Ball, K. Shpanskaya, J. Seekins, D. A. Mong, S. S. Halabi, J. K. Sandberg, R. Jones, D. B. Larson, C. P. Langlotz, B. N. Patel, M. P. Lungren, and A. Y. Ng, “CheXpert: A large chest radiograph dataset with uncertainty labels and expert comparison,” Proc. AAAI Conf. Artif. Intell., vol. 33, no. 01, pp. 590–597, 2019.
[2] D. S. Kermany, M. Goldbaum, W. Cai, C. C. S. Valentim, H. Liang, S. L. Baxter, A. McKeown, G. Yang, X. Wu, F. Yan, J. Dong, M. K. Prasadha, J. Pei, M. Y. L. Ting, J. Zhu, C. Li, S. Hewett, J. Dong, I. Ziyar, et al., “Identifying medical diagnoses and treatable diseases by image-based deep learning,” Cell, vol. 172, no. 5, pp. 1122–1131.e9, 2018, doi: 10.1016/j.cell.2018.02.010.
[3] Y. Li, Z. Zhang, C. Dai, Q. Dong, and S. Badrigilan, “Accuracy of deep learning for automated detection of pneumonia using chest X-ray images: A systematic review and meta-analysis,” Comput. Methods Programs Biomed., vol. 198, Art. no. 103898, 2020, doi: 10.1016/j.cmpb.2020.103898.
[4] D. Meedeniya, H. Kumarasinghe, S. Kolonne, C. Fernando, I. de la Torre Díez, and G. Marques, “Chest X-ray analysis empowered with deep learning: A systematic review,” Appl. Soft Comput., vol. 126, Art. no. 109319, 2022, doi: 10.1016/j.asoc.2022.109319.
[5] P. Rajpurkar, J. Irvin, K. Zhu, B. Yang, H. Mehta, T. Duan, D. Ding, A. Bagul, C. Langlotz, K. Shpanskaya, M. P. Lungren, and A. Y. Ng, “CheXNet: Radiologist-level pneumonia detection on chest X-rays with deep learning,” arXiv preprint arXiv:1711.05225, 2017.
[6] P. Rajpurkar, J. Irvin, R. L. Ball, K. Zhu, B. Yang, H. Mehta, T. Duan, D. Ding, A. Bagul, C. Langlotz, B. Patel, M. Lungren, and A. Ng, “Deep learning for chest radiograph diagnosis: A retrospective comparison of the CheXNeXt algorithm to practicing radiologists,” PLoS Med., vol. 15, no. 11, Art. no. e1002686, 2018, doi: 10.1371/journal.pmed.1002686.
[7] 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 Conf. Comput. Vis. Pattern Recognit. (CVPR), 2017, pp. 2097–2106.
[8] 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 Int. Conf. Comput. Vis. (ICCV), 2017, pp. 618–626.
[9] Y. Yang, G. Mei, and F. Piccialli, “A deep learning approach considering image background for pneumonia identification using explainable AI (XAI),” IEEE/ACM Trans. Comput. Biol. Bioinform., vol. 21, no. 4, pp. 857–868, 2024, doi: 10.1109/TCBB.2022.3190265.
[10] R. Siddiqi and S. Javaid, “Deep learning for pneumonia detection in chest X-ray images: A comprehensive survey,” J. Imaging, vol. 10, no. 8, Art. no. 176, 2024, doi: 10.3390/jimaging10080176.
[11] E. Yazdani, A. Neizehbaz, N. Karamzade-Ziarati, and S. R. Kheradpisheh, “Explainable artificial intelligence for pneumonia classification: Clinical insights into deformable prototypical part network in pediatric chest X-ray images,” J. Med. Imaging Radiat. Sci., vol. 56, no. 5, Art. no. 102023, 2025, doi: 10.1016/j.jmir.2025.102023.
[12] A. S. Tejani, M. E. Klontzas, A. A. Gatti, J. T. Mongan, L. Moy, S. H. Park, C. E. Kahn, Jr., and CLAIM 2024 Update Panel, “Checklist for Artificial Intelligence in Medical Imaging (CLAIM): 2024 Update,” Radiol. Artif. Intell., vol. 6, no. 4, Art. no. e240300, 2024, doi: 10.1148/ryai.240300.
[13] S. H. Park and C. H. Suh, “Reporting guidelines for artificial intelligence studies in healthcare (for both conventional and large language models): What's new in 2024,” Korean J. Radiol., vol. 25, no. 8, pp. 687–690, 2024, doi: 10.3348/kjr.2024.0598.
[14] P. Rajpurkar, J. Irvin, K. Zhu, B. Yang, H. Mehta, T. Duan, D. Ding, A. Bagul, C. Langlotz, K. Shpanskaya, M. P. Lungren, and A. Y. Ng, “CheXNet: Radiologist-level pneumonia detection on chest X-rays with deep learning,” arXiv preprint arXiv:1711.05225, 2017.
[15] H. Yoo, K. H. Kim, R. Singh, S. R. Digumarthy, M. K. Kalra, et al., “Development and validation of a deep learning-based automated detection algorithm for major thoracic diseases on chest radiographs,” JAMA Netw. Open, vol. 2, no. 3, Art. no. e191095, 2019.
[16] “Validating the accuracy of deep learning for the diagnosis of pneumonia on chest X-ray against a robust multimodal reference diagnosis: A post hoc analysis of two prospective studies,” Eur. Respir. J., 2024.
[17] “External validation of deep learning-based automated detection algorithm for chest radiograph: Practical issues in outpatient clinic,” Eur. Radiol., 2023.
[18] “Deep learning models to predict fatal pneumonia using chest X-ray images,” Sci. Rep., 2023.
[19] “Data-driven classification and explainable-AI in the field of lung imaging,” Eur. Radiol. Exp., 2024.
[20] World Health Organization, Guideline on Management of Pneumonia and Diarrhoea in Children Up to 10 Years of Age. Geneva, Switzerland: World Health Organization, 2024.
[21] M. Chaudhari, “Hydrophilic nanofiber barrier coatings for aluminum: Waterborne crosslinking, microstructure–property links, and EIS-based protection,” Genet. Mol. Res., vol. 25, no. 3, Art. no. 3017, Jul. 27, 2026, doi: 10.4238/rhd2k915.
[22] R. Singh, “Brønsted-acid-guided esterification: Mechanistic and kinetic insights for long-chain fatty acid to alkyl ester conversion on a heterogenized porous acid platform,” Int. J. Clin. Res. Med. Sci., vol. 1, no. 1, 2026, doi: 10.67231/rzakra50.
[23] M. A. Jawed, “Managed aquifer recharge with advanced treated municipal effluent: Modelling the impact on groundwater chemistry and native microbial ecology,” Int. J. Res. Technol., vol. 12, no. 3, pp. 128–138, 2024.
[24] U. A. Kithran, A. Khanam, S. Ilyas, R. Yaqoob, and M. Hannan, “Demand forecasting in transportation networks using deep learning,” Spectrum Eng. Sci., pp. 687–700, 2025.
[25] S. M. Ali, M. Hadi, F. Usama, M. S. Khan, M. Iqbal, and S. Ahmad, “From artificial to quantum intelligence: The next frontier of low-carbon energy systems,” in Proc. 2026 Int. Conf. Integrated Intelligence Cognitive Engineering (ICIICE), Dubai, United Arab Emirates, 2026, pp. 1–6, doi: 10.1109/ICIICE69672.2026.11565487.
[26] A. Delshadi, M. D. Rasheed, N. Ahmad, Y. Khan, W. Khan, M. Akram, and M. Sultana, “Artificial intelligence for strengthening cybersecurity in educational technology systems,” Spectrum Eng. Sci., vol. 4, no. 3, pp. 299–311, 2026.
[27] R. Singh, “Bench-scale nanomedicine preparation methods are poorly predictive of scalable manufacturing outcomes: A comparative lab study of liposomal doxorubicin,” Genet. Mol. Res., Sep. 23, 2026. [Online]. Available: https://geneticsmr.com/index.php/gmr/article/view/5540
[28] S. M. Ali, A. J. Ehsan, A. Rahman, M. S. Khan, A. Khan, and S. S. Ali, “Quantum computing–enhanced intelligence for sustainable power systems: Toward next-generation smart grid architectures,” in Proc. 2026 Int. Conf. Integrated Intelligence Cognitive Engineering (ICIICE), Dubai, United Arab Emirates, 2026, pp. 1–6, doi: 10.1109/ICIICE69672.2026.11565373.
[29] U. Iqbal, “AI-powered supplier risk intelligence: Predicting financial and geopolitical supply chain disruptions in U.S. critical industries,” J. Eng. Comput. Intell. Rev., vol. 3, no. 2, pp. 173–193, 2025.
[30] U. Imtiaz, “Ghost Signals: Ethical RF adversarial testing of consumer alarm ecosystems,” in Data Science and Security (IDSCS 2025), S. Shukla, H. Sayama, K. Tiwari, J. P. George, and J. V. Kureethara, Eds., Lecture Notes in Networks and Systems, vol. 1945. Cham, Switzerland: Springer, 2026, doi: 10.1007/978-3-032-24075-0_21.
[31] A. Khan, J. Iqbal, and D. Khan, “Artificial intelligence for financial data protection and business cyber resilience,” J. Comput. Syst. Eng. Insights, vol. 4, no. 2, pp. 30–41, 2026.
[32] M. Chaudhari, “Vapor-phase thin-film polymerization for microbial-resistant surface functionalization,” in Proc. Int. Conf. Sustainable Micro-Nano Materials & Innovative Technology (ICSUMMIT 2026), Vadodara, India, Feb. 2026, doi: 10.2991/978-94-6239-727-9_27.
[33] U. Iqbal, “AI-driven predictive maintenance for U.S. smart manufacturing: Deep learning models for equipment failure prediction and operational resilience,” J. Eng. Comput. Intell. Rev., vol. 3, no. 1, pp. 114–138, 2025.
[34] M. D. Rasheed, W. Khan, M. Imran, N. Ahmad, Y. Khan, M. Akram, and M. Sultana, “Leveraging artificial intelligence for advanced data networking and cybersecurity,” Spectrum Eng. Sci., vol. 4, no. 3, pp. 286–298, 2026.
[35] L. H. Taylor, “Nanotechnology in biomedical engineering: Advances in drug delivery, diagnostics, and cancer therapy in the United States,” Amer. J. Multidisciplinary Knowledge Insights, vol. 4, no. 2, pp. 1–8, 2025.
[36] H. Kit, “The role of artificial intelligence in advancing industrial productivity and economic leadership in the United States,” Int. J. Bus. Integrity Technol. Adv., vol. 2, no. 1, pp. 27–36, 2026.
[37] M. N. Amjad, “AI-enabled engineering project management: Evaluating productivity and risk reduction in the United States,” J. Comput. Syst. Eng. Insights, vol. 3, no. 1, pp. 25–41, 2025.
[38] U. Imtiaz, “Dynamic security certification framework for evolving distributed architectures,” in Data Science and Security (IDSCS 2025), S. Shukla, H. Sayama, K. Tiwari, J. P. George, and J. V. Kureethara, Eds., Lecture Notes in Networks and Systems, vol. 1947. Cham, Switzerland: Springer, 2026, doi: 10.1007/978-3-032-24360-7_32.
[39] M. Z. Islam, I. Ahmed, R. Parveen, S. T. H. Rimon, and J. I. Janjua, “Revolutionizing healthcare for critical diseases with AI and enhancing security via low-latency edge intelligence,” in Proc. 2025 Int. Conf. AI-Driven STEM Education and Learning Technologies (AISTEMEDU), Piscataway, NJ, USA: IEEE, Dec. 2025, pp. 1–6.
[40] I. Kate, “Marketing innovation in the U.S. e-commerce sector: Strategies for success in the evolving digital environment,” Int. J. Bus. Integrity Technol. Adv., vol. 1, no. 2, pp. 1–7, 2025.
[41] U. A. Kithran, S. Ilyas, K. Amber, H. Abbas, and S. Zahid, “AI-based collision prediction and prevention systems in urban traffic,” Spectrum Eng. Sci., vol. 3, no. 12, pp. 1907–1920, 2025.
[42] E. S. Walker, “Artificial intelligence in biomedical engineering: Current advances and future perspectives in the United States,” Amer. J. Multidisciplinary Knowledge Insights, vol. 4, no. 1, pp. 1–8, 2025.
[43] R. Bhattacharya, J. Mukherjee, S. Roy, M. T. Rana, and R. Parveen, “Eco-crypto dynamics: Cointegration of green and non-green cryptocurrencies for sustainable investing,” Adv. Consumer Res., vol. 2, no. 3, 2025.
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Maryam Tariq Maryam Tariq, Fazal Shah (Author)

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