A Hybrid Deep Learning Approach for Pneumonia Detection from Chest X-Ray Images Using Custom CNN and Transfer Learning

Main Article Content

Indrajit Pal
Ashoktaru Pal

Abstract

Pneumonia remains an important worldwide health concern, significantly affecting vulnerable populations such as children and the elderly. The timely and precise diagnosis of pneumonia using chest X-ray (CXR) imaging is essential; however, manual interpretation often faces challenges due to complex visual characteristics and inherent diagnostic subjectivity. This study introduces a hybrid deep learning framework that merges a customized Convolutional Neural Network (CNN) with the MobileNetV2 architecture, aimed at improving automated pneumonia classification in CXR images. The approach is structured into five primary phases: data preprocessing and increase, baseline CNN design, transfer learning utilizing VGG16 and
MobileNetV2, hybrid model integration, and thorough evaluation, including Grad-CAM visualizations. The dataset was meticulously separated into training, validation, and testing sets, employing augmentation techniques to enhance model robustness. Individual models, namely the standalone CNN, VGG16, and MobileNetV2, recorded accuracies of 87.98%, 90.06%, and
85.26%, respectively, while the hybrid model achieved a superior test accuracy of 90.06% with minimal loss. Notably, the hybrid architecture evidenced high F1-scores of 0.86 for NORMAL and 0.92 for PNEUMONIA classes, demonstrating an effective balance of precision and recall, further validated by Grad-CAM visualizations that illustrate clinically relevant areas of focus. Despite certain limitations such as dataset size and potential class imbalances, the proposed model effectively enhances pneumonia detection, positioning itself as a valuable asset for clinical decision-making, particularly in resource-limited surroundings.

Article Details

How to Cite
Pal, I., & Pal, A. (2025). A Hybrid Deep Learning Approach for Pneumonia Detection from Chest X-Ray Images Using Custom CNN and Transfer Learning. INFOCOMP Journal of Computer Science, 24(2). Retrieved from https://infocomp.dcc.ufla.br/index.php/infocomp/article/view/5322
Section
Machine Learning and Computational Intelligence

References

[1] Abdou, M. A. Literature review: Efficient

deep neural networks techniques for medical

image analysis. Neural Computing and Appli-

cations, 34(8):5791–5812, 2022.

[2] Aggarwal, R., Sounderajah, V., Martin, G.,

Ting, D. S., Karthikesalingam, A., King, D.,

Ashrafian, H., and Darzi, A. Diagnostic ac-

curacy of deep learning in medical imaging:

a systematic review and meta-analysis. NPJ

digital medicine, 4(1):65, 2021.

[3] Ahmed, S. B., Solis-Oba, R., and Ilie, L.

Explainable-ai in automated medical report

generation using chest x-ray images. Applied

Sciences, 12(22):11750, 2022.

[4] Alharbi, A. H. and Hosni Mahmoud, H. A.

Pneumonia transfer learning deep learning

model from segmented x-rays. In Healthcare,

volume 10, page 987. MDPI, 2022.

[5] Ali, M., Shahroz, M., Akram, U., Mushtaq,

M. F., Altamiranda, S. C., Obregon, S. A.,

Díez, I. D. L. T., and Ashraf, I. Pneumonia

detection using chest radiographs with novel

efficientnetv2l model. IEEE Access, 2024.

[6] Alshanketi, F., Alharbi, A., Kuruvilla, M.,

Mahzoon, V., Siddiqui, S. T., Rana, N., and

Tahir, A. Pneumonia detection from chest x-

ray images using deep learning and transfer

learning for imbalanced datasets. Journal of

Imaging Informatics in Medicine, pages 1–20,

2024.

[7] Alsharif, R., Al-Issa, Y., Alqudah, A. M., Qas-

mieh, I. A., Mustafa, W. A., and Alquran,

H. Pneumonianet: Automated detection and

classification of pediatric pneumonia using

chest x-ray images and cnn approach. Elec-

tronics, 10(23):2949, 2021.

[8] Avola, D., Bacciu, A., Cinque, L., Fagioli, A.,

Marini, M. R., and Taiello, R. Study on trans-

fer learning capabilities for pneumonia classifi-

cation in chest-x-rays images. Computer Meth-

ods and Programs in Biomedicine, 221:106833,

2022.

[9] Barakat, N., Awad, M., and Abu-Nabah, B. A.

A machine learning approach on chest x-rays

for pediatric pneumonia detection. Digital

Health, 9:20552076231180008, 2023.

[10] Barragán-Montero, A., Javaid, U., Valdés, G.,

Nguyen, D., Desbordes, P., Macq, B., Willems,

S., Vandewinckele, L., Holmström, M., Löf-

man, F., et al. Artificial intelligence and ma-

chine learning for medical imaging: A technol-

ogy review. Physica Medica, 83:242–256, 2021.

[11] Bhati, D., Neha, F., and Amiruzzaman, M.

A survey on explainable artificial intelligence

(xai) techniques for visualizing deep learning

models in medical imaging. Journal of Imag-

ing, 10(10):239, 2024.

[12] Canbek, G., Taskaya Temizel, T., and Sa-

giroglu, S. Ptopi: A comprehensive re-

view, analysis, and knowledge representa-

tion of binary classification performance mea-

sures/metrics. SN Computer Science, 4(1):13,

2022.

[13] Chiwariro, R. and Wosowei, J. B. Compar-

ative analysis of deep learning convolutional

neural networks based on transfer learning for

pneumonia detection. Int. J. Res. Appl. Sci.

Eng. Technol, 11(1):1161–1170, 2023.

[14] Colin, J. and Surantha, N. Interpretable deep

learning for pneumonia detection using chest

x-ray images. Information, 16(1):53, 2025.

[15] Gu, C. and Lee, M. Deep transfer learn-

ing using real-world image features for med-

ical image classification, with a case study

on pneumonia x-ray images. Bioengineering,

11(4):406, 2024.

[16] Guan, H. and Liu, M. Domain adapta-

tion for medical image analysis: a survey.

IEEE Transactions on Biomedical Engineer-

ing, 69(3):1173–1185, 2021.

[17] Hasani, N., Farhadi, F., Morris, M. A.,

Nikpanah, M., Rhamim, A., Xu, Y., Pariser,

A., Collins, M. T., Summers, R. M., Jones, E.,

et al. Artificial intelligence in medical imaging

and its impact on the rare disease community:

threats, challenges and opportunities. PET

clinics, 17(1):13, 2022.

[18] Hosseinzadeh Taher, M. R., Haghighi, F.,

Feng, R., Gotway, M. B., and Liang, J. A

systematic benchmarking analysis of transfer

learning for medical image analysis. In Do-

main Adaptation and Representation Trans-

fer, and Affordable Healthcare and AI for Re-

source Diverse Global Health: Third MIC-

CAI Workshop, DART 2021, and First MIC-

CAI Workshop, FAIR 2021, Held in Conjunc-

tion with MICCAI 2021, Strasbourg, France,

September 27 and October 1, 2021, Proceed-

ings 3, pages 3–13. Springer, 2021.

[19] Ibrahim, A. U., Ozsoz, M., Serte, S., Al-

Turjman, F., and Yakoi, P. S. Pneumonia clas-

sification using deep learning from chest x-ray

images during covid-19. Cognitive computa-

tion, 16(4):1589–1601, 2024.

[20] Irede, E. L., Aworinde, O. R., Lekan, O. K.,

Amienghemhen, O. D., Okonkwo, T. P.,

Onivefu, A. P., and Ifijen, I. H. Medical imag-

ing: a critical review on x-ray imaging for the

detection of infection. Biomedical Materials &

Devices, pages 1–45, 2024.

[21] Lavazza, L. and Morasca, S. Common prob-

lems with the usage of f-measure and accu-

racy metrics in medical research. IEEE Access,

11:51515–51526, 2023.

[22] Malik, H., Anees, T., Chaudhry, M. U., Gono,

R., Jasiński, M., Leonowicz, Z., and Bernat,

P. A novel fusion model of hand-crafted fea-

tures with deep convolutional neural networks

for classification of several chest diseases using

x-ray images. IEEE Access, 11:39243–39268,

2023.

[23] Müller, D., Soto-Rey, I., and Kramer, F. To-

wards a guideline for evaluation metrics in

medical image segmentation. BMC Research

Notes, 15(1):210, 2022.

[24] Musha, A., Al Mamun, A., Tahabilder, A.,

Hossen, M. J., Jahan, B., and Ranjbari, S. A

deep learning approach for covid-19 and pneu-

monia detection from chest x-ray images. In-

ternational Journal of Electrical & Computer

Engineering (2088-8708), 12(4), 2022.

[25] Neshat, M., Ahmed, M., Askari, H., Thi-

lakaratne, M., and Mirjalili, S. Hybrid

inception architecture with residual connec-

tion: fine-tuned inception-resnet deep learning

model for lung inflammation diagnosis from

chest radiographs. Procedia Computer Sci-

ence, 235:1841–1850, 2024.

[26] Nirthika, R., Manivannan, S., Ramanan, A.,

and Wang, R. Pooling in convolutional neural

networks for medical image analysis: a survey

and an empirical study. Neural Computing and

Applications, 34(7):5321–5347, 2022.

[27] Radočaj, P. and Martinović, G. Interpretable

deep learning for pediatric pneumonia diagno-

sis through multi-phase feature learning and

activation patterns. Electronics, 14(9):1899,

2025.

[28] Rajeashwari, S. and Arunesh, K. En-

hancing pneumonia diagnosis with ensemble-

modified classifier and transfer learning in

deep-cnn based classification of chest radio-

graphs. Biomedical Signal Processing and

Control, 93:106130, 2024.

[29] Sathyanarayanan, S. and Tantri, B. R. Con-

fusion matrix-based performance evaluation

metrics. African Journal of Biomedical Re-

search, pages 4023–4031, 2024.

[30] Sharma, S. and Guleria, K. A deep learn-

ing based model for the detection of pneumo-

nia from chest x-ray images using vgg-16 and

neural networks. Procedia Computer Science,

218:357–366, 2023.

[31] Shilpa, N., Banu, W. A., and Metre, P. B. Rev-

olutionizing pneumonia diagnosis: Ai-driven

deep learning framework for automated detec-

tion from chest x-rays. IEEE Access, 2024.

[32] Souid, A., Sakli, N., and Sakli, H. Classifi-

cation and predictions of lung diseases from

chest x-rays using mobilenet v2. Applied Sci-

ences, 11(6):2751, 2021.

[33] Sufian, M. A., Hamzi, W., Sharifi, T., Za-

man, S., Alsadder, L., Lee, E., Hakim, A.,

and Hamzi, B. Ai-driven thoracic x-ray diag-

nostics: Transformative transfer learning for

clinical validation in pulmonary radiography.

Journal of Personalized Medicine, 14(8):856,

2024.

[34] Suganyadevi, S., Seethalakshmi, V., and Bal-

asamy, K. A review on deep learning in med-

ical image analysis. International Journal of

Multimedia Information Retrieval, 11(1):19–

38, 2022.

[35] Thakur, P. S., Sheorey, T., and Ojha, A. Vgg-

icnn: A lightweight cnn model for crop disease

identification. Multimedia Tools and Applica-

tions, 82(1):497–520, 2023.

[36] Thanapol, P., Lavangnananda, K., Bouvry, P.,

Pinel, F., and Leprévost, F. Reducing over-

fitting and improving generalization in train-

ing convolutional neural network (cnn) under

limited sample sizes in image recognition. In

2020-5th International Conference on Infor-

mation Technology (InCIT), pages 300–305.

IEEE, 2020.

[37] Tripathi, A., Singh, T., Nair, R. R., and Du-

raisamy, P. Improving early detection and

classification of lung diseases with innovative

mobilenetv2 framework. IEEE Access, 2024.

[38] Tripathi, M. Analysis of convolutional neu-

ral network based image classification tech-

niques. Journal of Innovative Image Process-

ing (JIIP), 3(02):100–117, 2021.

[39] Tsuneki, M. Deep learning models in medical

image analysis. Journal of Oral Biosciences,

64(3):312–320, 2022.

[40] Wang, R., Lei, T., Cui, R., Zhang, B., Meng,

H., and Nandi, A. K. Medical image segmenta-

tion using deep learning: A survey. IET image

processing, 16(5):1243–1267, 2022.

[41] Zhu, W., Qiu, P., Chen, X., Li, H., Wang, H.,

Lepore, N., Dumitrascu, O. M., and Wang, Y.

Beyond mobilenet: An improved mobilenet for

retinal diseases. In International Conference

on Medical Image Computing and Computer-

Assisted Intervention, pages 56–65. Springer,

2023.