Transfer Learning Based CNN Model Optimization for Pneumonia Classification in Chest X-Ray Images
##plugins.themes.bootstrap3.article.main##
Abstract
Pneumonia is a leading cause of child mortality worldwide, and its diagnosis often relies on chest X-ray interpretation, which is prone to human error. This study aims to optimize a Convolutional Neural Network (CNN) model based on transfer learning using the DenseNet-121 architecture for pneumonia classification in chest X-ray images. The model was trained on a Kaggle dataset consisting of two classes: Normal and Pneumonia. Preprocessing included class balancing and data augmentation. Five fine-tuning strategies were tested, ranging from training only the classifier to unfreezing the entire pretrained layers. Evaluation metrics included accuracy, precision, recall, F1-score, and ROC-AUC. Results showed that the strategy of unfreezing Block 3–4 yielded the best performance with 94.39% accuracy, 95.61% F1-score, and 98.04% ROC-AUC. This study demonstrates that selective fine-tuning strategies significantly improve classification performance compared to training only the classifier or the entire network.
##plugins.themes.bootstrap3.article.details##

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
The writer agreed that the article copyright by Smatika journal and the writer has the right to disseminate the paper published without permission in advance.
[2] F. M. Qaimkhani, M. Hussain, Y. Shiren, and J. Xingfang, “Pneumonia Detection Using Deep Learning Methods,” International Journal Of Scientific Advances, vol. 3, no. 3, 2022, doi: 10.51542/ijscia.v3i3.32.
[3] M. Husna, F. Dewi Pertiwi, and A. Saputra Nasution, “FAKTOR-FAKTOR YANG BERHUBUNGAN DENGAN KEJADIAN PNEUMONIA PADA BALITA DI PUSKESMAS SEMPLAK KOTA BOGOR 2020,” PROMOTOR, vol. 5, no. 3, pp. 273–280, May 2022, doi: 10.32832/pro.v5i3.6168.
[4] S. Showkat and S. Qureshi, “Efficacy of Transfer Learning-based ResNet models in Chest X-ray image classification for detecting COVID-19 Pneumonia,” Chemometrics and Intelligent Laboratory Systems, vol. 224, p. 104534, May 2022, doi: 10.1016/j.chemolab.2022.104534.
[5] W. B. Gefter, B. A. Post, and H. Hatabu, “Commonly Missed Findings on Chest Radiographs,” Chest, vol. 163, no. 3, pp. 650–661, Mar. 2023, doi: 10.1016/j.chest.2022.10.039.
[6] D. J. Mollura et al., “Artificial Intelligence in Low- and Middle-Income Countries: Innovating Global Health Radiology,” Radiology, vol. 297, no. 3, pp. 513–520, Dec. 2020, doi: 10.1148/radiol.2020201434.
[7] M. M. Zulfa and C. Sri Kusuma Aditya, “CATARACT CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK (CNN) INCEPTION RESNETV2,” Jurnal Teknik Informatika (Jutif), vol. 5, no. 5, pp. 1299–1307, Oct. 2024, doi: 10.52436/1.jutif.2024.5.5.2340.
[8] E. C. Yaurentius, T. R. D. Saputri, E. Tanuwijaya, and R. E. Sutanto, “COMPARATIVE STUDY OF CNN-BASED ARCHITECTURES ON EYE DISEASES CLASSIFICATION USING FUNDUS IMAGES TO AID OPHTHALMOLOGIST,” Jurnal Teknik Informatika (Jutif), vol. 6, no. 1, pp. 249–257, Feb. 2025, doi: 10.52436/1.jutif.2025.6.1.3699.
[9] T. Rahman et al., “Transfer Learning with Deep Convolutional Neural Network (CNN) for Pneumonia Detection Using Chest X-ray,” Applied Sciences, vol. 10, no. 9, p. 3233, May 2020, doi: 10.3390/app10093233.
[10] N. Nurhaeni, S. E. Prastya, A. Hidayat, and F. N. Anisa, “Pemodelan Sistem Deteksi Parasit Malaria pada Citra Mikroskopis Sel Darah Menggunakan Metode Deep Learning,” SMATIKA JURNAL, vol. 14, no. 02, pp. 409–416, Dec. 2024, doi: 10.32664/smatika.v14i02.1475.
[11] A. W. Salehi et al., “A Study of CNN and Transfer Learning in Medical Imaging: Advantages, Challenges, Future Scope,” Sustainability, vol. 15, no. 7, p. 5930, Mar. 2023, doi: 10.3390/su15075930.
[12] H. E. Kim, A. Cosa-Linan, N. Santhanam, M. Jannesari, M. E. Maros, and T. Ganslandt, “Transfer learning for medical image classification: a literature review,” BMC Med Imaging, vol. 22, no. 1, p. 69, Dec. 2022, doi: 10.1186/s12880-022-00793-7.
[13] 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, p. 122807, May 2024, doi: 10.1016/j.eswa.2023.122807.
[14] M. Salehi, R. Mohammadi, H. Ghaffari, N. Sadighi, and R. Reiazi, “Automated detection of pneumonia cases using deep transfer learning with paediatric chest X-ray images,” Br J Radiol, vol. 94, no. 1121, May 2021, doi: 10.1259/bjr.20201263.
[15] M. E. H. Chowdhury et al., “Can AI Help in Screening Viral and COVID-19 Pneumonia?,” IEEE Access, vol. 8, pp. 132665–132676, 2020, doi: 10.1109/ACCESS.2020.3010287.
[16] A. Alhudhaif, K. Polat, and O. Karaman, “Determination of COVID-19 pneumonia based on generalized convolutional neural network model from chest X-ray images,” Expert Syst Appl, vol. 180, p. 115141, Oct. 2021, doi: 10.1016/j.eswa.2021.115141.
[17] T. Zhou, X. Ye, H. Lu, X. Zheng, S. Qiu, and Y. Liu, “Dense Convolutional Network and Its Application in Medical Image Analysis,” Biomed Res Int, vol. 2022, no. 1, Jan. 2022, doi: 10.1155/2022/2384830.
[18] A. Davila, J. Colan, and Y. Hasegawa, “Comparison of fine-tuning strategies for transfer learning in medical image classification,” Image Vis Comput, vol. 146, p. 105012, Jun. 2024, doi: 10.1016/j.imavis.2024.105012.
[19] Paul Mooney, “Chest X-Ray Images (Pneumonia),” Kaggle. Accessed: Mar. 24, 2025. [Online]. Available: https://www.kaggle.com/datasets/paultimothymooney/chest-xray-pneumonia
[20] A. A. Handoko, M. A. Rosid, and U. Indahyanti, “Implementasi Convolutional Neural Network (CNN) Untuk Pengenalan Tulisan Tangan Aksara Bima,” SMATIKA JURNAL, vol. 14, no. 01, pp. 96–110, Jul. 2024, doi: 10.32664/smatika.v14i01.1196.
[21] V. Praskatama, C. A. Sari, E. H. Rachmawanto, and N. Mohd Yaacob, “PNEUMONIA PREDICTION USING CONVOLUTIONAL NEURAL NETWORK,” Jurnal Teknik Informatika (Jutif), vol. 4, no. 5, pp. 1217–1226, Oct. 2023, doi: 10.52436/1.jutif.2023.4.5.1353.
[22] Y. Azhar, W. Priyo Wicaksono, and Z. Sari, “PNEUMONIA DIAGNOSIS THROUGH DEEP LEARNING: RESNET50V2 MODEL IMPLEMENTATION,” vol. 13, no. 2, 2024, doi: 10.23887/v13i2.72068.