Comparative Analysis Transfer Learning Models for Early Detection of Pneumonia using Chest X-ray Images

Authors

  • Rachmasari Annisa Rida Universitas Amikom Yogyakarta
  • Majid Rahardi Universitas Amikom Yogyakarta

DOI:

https://doi.org/10.30871/jaic.v9i5.10857

Keywords:

Convolutional Neural Network, DenseNet121, Pneumonia Detection, ResNet50, Transfer Learning

Abstract

Pneumonia is a serious respiratory disease that continues to be a major worldwide health issue, especially in nations that are struggling with limited medical resources. Early and accurate detection is essential to improve patient outcomes and reducing the rate of death. This study compares the performance of two deep learning architectures, DenseNet121 and ResNet50, using transfer learning for pneumonia detection from chest X-ray images. The dataset consists 5,856 images with two classes, NORMAL and PNEUMONIA, split into training 60%, validation 20%, and testing 20%. Pretrained ImageNet weights were used as fixed feature extractors, with a custom classification layers. Evaluation metrics included accuracy, precision, recall, F1-score, and confusion matrix. On the internal test set, DenseNet121 achieved 92% accuracy, with precision 0.79, recall 0.94, and F1-score 0.86 for NORMAL class, and precision 0.98, recall 0.91, and F1-score 0.94 for PNEUMONIA class. ResNet50 reached 81% accuracy, with precision 0.61, recall 0.80, and F1-score 0.70 for NORMAL class, and precision 0.92, recall 0.81, and F1-score 0.86 for PNEUMONIA class. External testing on an independent set of 200 images (100 images per class) yielded 98% accuracy for DenseNet121 and 85% for ResNet50. These results show that DenseNet121 provides better overall performance and lower false-negative risk for pneumonia cases, highlight the potential of DenseNet121 as a foundation for AI-assisted diagnostic tools in clinical practice.

Downloads

Download data is not yet available.

References

[1] S. G. Gundabatini, “Pneumonia Detection using CNN, Resnet and DenseNet,” Int. J. Res. Appl. Sci. Eng. Technol., vol. 12, no. 3, pp. 1680–1686, 2024, doi: 10.22214/ijraset.2024.59145.

[2] E. Longjiang et al., “Image-based deep learning in diagnosing the etiology of pneumonia on pediatric chest X-rays,” Pediatr. Pulmonol., vol. 56, no. 5, pp. 1036–1044, 2021, doi: 10.1002/ppul.25229.

[3] W. Akbar et al., “Pneumonia Detection: A Comprehensive Study of Diverse Neural Network Architectures using Chest X-Rays,” Int. J. Appl. Math. Comput. Sci., vol. 34, no. 4, pp. 679–699, 2024, doi: 10.61822/amcs-2024-0045.

[4] A. W. Salehi, S. Khan, G. Gupta, B. I. Alabduallah, and A. Almjally, “Cnn1.Pdf,” 2023.

[5] P. Szepesi and L. Szilágyi, “Detection of pneumonia using convolutional neural networks and deep learning,” Biocybern. Biomed. Eng., vol. 42, no. 3, pp. 1012–1022, 2022, doi: 10.1016/j.bbe.2022.08.001.

[6] O. Iparraguirre-Villanueva, V. Guevara-Ponce, O. R. Paredes, F. Sierra-Liñan, J. Zapata-Paulini, and M. Cabanillas-Carbonell, “Convolutional Neural Networks with Transfer Learning for Pneumonia Detection,” Int. J. Adv. Comput. Sci. Appl., vol. 13, no. 9, pp. 544–551, 2022, doi: 10.14569/IJACSA.2022.0130963.

[7] D. Nurhamzah, I. W. Sariyanto, N. Luh, and G. Pivin, “Identifikasi Pneumonia pada Citra Rontgen Paru-paru Menggunakan Convolutional Neural Network,” vol. 1, no. 3, pp. 72–77, 2024.

[8] B. F. H. Irfan Handy Office, Rahman Arifuddin, “Klasifikasi Pneumonia menggunakan Metode Convolutional Neural Network,” Techné J. Ilm. Elektrotek., vol. Vol.23, no. No.2, pp. 233–244, 2024.

[9] Z. Zhao, L. Alzubaidi, J. Zhang, Y. Duan, and Y. Gu, “A comparison review of transfer learning and self-supervised learning: Definitions, applications, advantages and limitations,” Expert Syst. Appl., vol. 242, no. December 2023, p. 122807, 2024, doi: 10.1016/j.eswa.2023.122807.

[10] M. Idhom, D. A. Prasetya, P. A. Riyantoko, T. M. Fahrudin, and A. P. Sari, “Pneumonia Classification Utilizing VGG-16 Architecture and Convolutional Neural Network Algorithm for Imbalanced Datasets,” TIERS Inf. Technol. J., vol. 4, no. 1, pp. 73–82, 2023, doi: 10.38043/tiers.v4i1.4380.

[11] A. Alghanmi, “An Accurate Pneumonia Detection Scheme Using Hybrid Algorithms,” Math. Model. Eng. Probl., vol. 12, no. 2, pp. 676–686, 2025, doi: 10.18280/mmep.120231.

[12] T. S. Arulananth, S. W. Prakash, R. K. Ayyasamy, V. P. Kavitha, P. G. Kuppusamy, and P. Chinnasamy, “Classification of Paediatric Pneumonia Using Modified DenseNet-121 Deep-Learning Model,” IEEE Access, vol. 12, no. March, pp. 35716–35727, 2024, doi: 10.1109/ACCESS.2024.3371151.

[13] H. D. Hekmatyar, W. A. Saputra, and C. Ramdani, “Klasifikasi Pneumonia Dengan Deep Learning Faster Region Convolutional Neural Network Arsitektur VGG16 dan ResNet50,” InComTech J. Telekomun. dan Komput., vol. 12, no. 3, p. 186, 2022, doi: 10.22441/incomtech.v12i3.15112.

[14] A. Victor Ikechukwu, S. Murali, R. Deepu, and R. C. Shivamurthy, “ResNet-50 vs VGG-19 vs training from scratch: A comparative analysis of the segmentation and classification of Pneumonia from chest X-ray images,” Glob. Transitions Proc., vol. 2, no. 2, pp. 375–381, 2021, doi: 10.1016/j.gltp.2021.08.027.

[15] T. Berliani, E. Rahardja, and L. Septiana, “Perbandingan Kemampuan Klasifikasi Citra X-ray Paru-paru menggunakan Transfer Learning ResNet-50 dan VGG-16,” J. Med. Heal., vol. 5, no. 2, pp. 123–135, 2023, doi: 10.28932/jmh.v5i2.6116.

[16] C. Neural, “Pneumonia Detection Through CNN and Resnet-50 1 Introductions 2 Related work,” vol. 8, no. 1, pp. 64–72, 2025.

[17] P. Mobilenetv and D. A. N. Densenet, “Perbandingan mobilenetv2 dan densenet121 pada klasifikasi terumbu karang menggunakan convolutional neural network,” vol. 2, no. 3, pp. 930–941, 2025.

[18] A. A. Khan et al., “Detection of Omicron Caused Pneumonia from Radiology Images Using Convolution Neural Network (CNN),” Comput. Mater. Contin., vol. 74, no. 2, pp. 3743–3761, 2023, doi: 10.32604/cmc.2023.033924.

[19] Dr. Sunil L. Bangare, Hrushikesh S. Rajankar, Pavan S. Patil, Karan V. Nakum, and Gopal S. Paraskar, “Pneumonia Detection and Classification using CNN and VGG16,” Int. J. Adv. Res. Sci. Commun. Technol., no. May, pp. 771–779, 2022, doi: 10.48175/ijarsct-3851.

[20] M. Bundea and G. M. Danciu, “Pneumonia Image Classification Using DenseNet Architecture,” Inf., vol. 15, no. 10, 2024, doi: 10.3390/info15100611.

[21] A. Çı, M. Yıldırı, and Y. Eroğlu, “Traitement du Signal Classification of Pneumonia Cell Images Using Improved ResNet50 Model,” Int. Inf. Eng. Technol. Assoc., vol. 38, no. 1, pp. 165–173, 2021.

[22] M. Harahap, Em Manuel Laia, Lilis Suryani Sitanggang, Melda Sinaga, Daniel Franci Sihombing, and Amir Mahmud Husein, “Deteksi Penyakit Covid-19 Pada Citra X-Ray Dengan Pendekatan Convolutional Neural Network (CNN),” J. RESTI (Rekayasa Sist. dan Teknol. Informasi), vol. 6, no. 1, pp. 70–77, 2022, doi: 10.29207/resti.v6i1.3373.

[23] F. Z. Hamlili, M. Beladgham, M. Khelifi, and A. Bouida, “Transfer learning with Resnet-50 for detecting COVID-19 in chest X-ray images,” Indones. J. Electr. Eng. Comput. Sci., vol. 25, no. 3, pp. 1458–1468, 2022, doi: 10.11591/ijeecs.v25.i3.pp1458-1468.

[24] A. H. Alharbi and H. A. Hosni Mahmoud, “Pneumonia Transfer Learning Deep Learning Model from Segmented X-rays,” Healthc., vol. 10, no. 6, 2022, doi: 10.3390/healthcare10060987.

[25] Q. An, W. Chen, and W. Shao, “A Deep Convolutional Neural Network for Pneumonia Detection in X-ray Images with Attention Ensemble,” Diagnostics, vol. 14, no. 4, pp. 1–23, 2024, doi: 10.3390/diagnostics14040390.

[26] J. Colin and N. Surantha, “Interpretable Deep Learning for Pneumonia Detection Using Chest X-Ray Images,” Inf., vol. 16, no. 1, 2025, doi: 10.3390/info16010053.

[27] Q. Zhou, W. Zhu, F. Li, M. Yuan, L. Zheng, and X. Liu, “Transfer Learning of the ResNet-18 and DenseNet-121 Model Used to Diagnose Intracranial Hemorrhage in CT Scanning,” Curr. Pharm. Des., vol. 28, no. 4, pp. 287–295, 2021, http://dx.doi.org/10.2174/1381612827666211213143357.

Downloads

Published

2025-10-06

How to Cite

[1]
R. A. Rida and M. Rahardi, “Comparative Analysis Transfer Learning Models for Early Detection of Pneumonia using Chest X-ray Images”, JAIC, vol. 9, no. 5, pp. 2171–2178, Oct. 2025.

Most read articles by the same author(s)

Similar Articles

1 2 3 4 5 > >> 

You may also start an advanced similarity search for this article.