Deep Learning Approach for Pneumonia Prediction from X-Rays using A Pretrained Densenet Model

Authors

  • Ahmad Zein Al Wafi Universitas Negeri Semarang, Indonesia
  • Febry Putra Rochim Universitas Negeri Semarang, Indonesia
  • Aisya Fathimah Universitas Negeri Semarang, Indonesia

DOI:

https://doi.org/10.31961/eltikom.v9i1.1457

Keywords:

Deep Learning, , DenseNet, Pneumonia Prediction, Pretrained Model

Abstract

Pneumonia remains a major global health concern, particularly affecting young children and older adults, contributing to significant morbidity and mortality. Traditional diagnostic methods using chest CT scans are time-consuming and prone to errors due to the reliance on manual interpretation. This study investigates the application of DenseNet architectures DenseNet121, DenseNet169, and DenseNet201—for automated pneumonia detection from chest X-ray images. The dataset, obtained from the Guangzhou Women and Children’s Medical Center, consists of 5,216 training images and 624 testing images categorized into normal and pneumonia cases. Data augmentation techniques, including rotation, normalization, and shear, were applied to improve training efficiency. The DenseNet models were pre-trained on ImageNet and fine-tuned by adding fully connected layers with 256 neurons and sigmoid activation. The models were trained for 20 epochs using the Adam optimizer and binary cross-entropy loss function. Performance evaluation revealed that DenseNet201 outperformed the other models, achieving a precision of 0.99 and a recall of 0.61 for normal cases (F1-score of 0.75) and a precision of 0.81 with a recall of 0.99 for pneumonia cases (F1-score of 0.89). These findings demonstrate that DenseNet201 provides a reliable and effective solution for automated pneumonia detection, offering improved diagnostic efficiency and accuracy compared to traditional methods.

Downloads

Download data is not yet available.

References

M. Assefa, “Multi-drug resistant gram-negative bacterial pneumonia: etiology, risk factors, and drug resistance patterns,” Pneumonia, vol. 14, no. 1, p. 4, May 2022, doi: 10.1186/s41479-022-00096-z.

C. Cilloniz, C. Dela Cruz, W. H. Curioso, and C. H. Vidal, “World Pneumonia Day 2023: the rising global threat of pneumonia and what we must do about it,” European Respiratory Journal, vol. 62, no. 5, p. 2301672, Nov. 2023, doi: 10.1183/13993003.01672-2023.

K. K. Yadav and S. Awasthi, “Childhood Pneumonia: What’s Unchanged, and What’s New?,” Indian J Pediatr, vol. 90, no. 7, pp. 693–699, Jul. 2023, doi: 10.1007/s12098-023-04628-3.

Y. Li et al., “Global, regional, and national disease burden estimates of acute lower respiratory infections due to respiratory syncytial virus in children younger than 5 years in 2019: a systematic analysis,” The Lancet, vol. 399, no. 10340, pp. 2047–2064, May 2022, doi: 10.1016/S0140-6736(22)00478-0.

Y. M. Al-Worafi, “Nosocomial Pneumonia Management in Developing Countries,” in Handbook of Medical and Health Sciences in Developing Countries, Cham: Springer International Publishing, 2024, pp. 1–23. doi: 10.1007/978-3-030-74786-2_51-1.

V. Uskoković, “Health economics matters in the nanomaterial world: Cost-effectiveness of utilizing an inhalable antibacterial nano-material for the treatment of multidrug-resistant pneumonia,” Technol Soc, vol. 66, p. 101641, Aug. 2021, doi: 10.1016/j.techsoc.2021.101641.

C. Cilloniz, C. Dela Cruz, W. H. Curioso, and C. H. Vidal, “World Pneumonia Day 2023: the rising global threat of pneumonia and what we must do about it,” European Respiratory Journal, vol. 62, no. 5, p. 2301672, Nov. 2023, doi: 10.1183/13993003.01672-2023.

C. Scelfo, F. Menzella, M. Fontana, G. Ghidoni, C. Galeone, and N. C. Facciolongo, “Pneumonia and Invasive Pneumococcal Diseas-es: The Role of Pneumococcal Conjugate Vaccine in the Era of Multi-Drug Resistance,” Vaccines (Basel), vol. 9, no. 5, p. 420, Apr. 2021, doi: 10.3390/vaccines9050420.

K. More, P. Jawale, S. Bhattad, and J. Upadhyay, “Pneumonia Detection using Deep Learning,” in 2021 International Conference on Smart Generation Computing, Communication and Networking (SMART GENCON), IEEE, Oct. 2021, pp. 1–5. doi: 10.1109/SMARTGENCON51891.2021.9645844.

M. Caban and E. Małecka-Wojciesko, “Gaps and Opportunities in the Diagnosis and Treatment of Pancreatic Cancer,” Cancers (Ba-sel), vol. 15, no. 23, p. 5577, Nov. 2023, doi: 10.3390/cancers15235577.

C. H. Barrios, “Global challenges in breast cancer detection and treatment,” The Breast, vol. 62, pp. S3–S6, Mar. 2022, doi: 10.1016/j.breast.2022.02.003.

W. Khan, N. Zaki, and L. Ali, “Intelligent Pneumonia Identification From Chest X-Rays: A Systematic Literature Review,” IEEE Ac-cess, vol. 9, pp. 51747–51771, 2021, doi: 10.1109/ACCESS.2021.3069937.

K. Zimna et al., “Lung Ultrasonography in the Evaluation of Late Sequelae of COVID-19 Pneumonia—A Comparison with Chest Computed Tomography: A Prospective Study,” Viruses, vol. 16, no. 6, p. 905, Jun. 2024, doi: 10.3390/v16060905.

R. Sivarajah, M. L. Dinh, and A. Chetlen, “Errors in Breast Imaging: How to Reduce Errors and Promote a Safety Environment,” J Breast Imaging, vol. 3, no. 2, pp. 221–230, Mar. 2021, doi: 10.1093/jbi/wbaa118.

L. Zhang, X. Wen, J.-W. Li, X. Jiang, X.-F. Yang, and M. Li, “Diagnostic error and bias in the department of radiology: a pictorial es-say,” Insights Imaging, vol. 14, no. 1, p. 163, Oct. 2023, doi: 10.1186/s13244-023-01521-7.

B. Fawver et al., “Seeing isn’t necessarily believing: Misleading contextual information influences perceptual-cognitive bias in radiolo-gists.,” J Exp Psychol Appl, vol. 26, no. 4, pp. 579–592, 2020, doi: 10.1037/xap0000274.

N. N. Khanna et al., “Economics of Artificial Intelligence in Healthcare: Diagnosis vs. Treatment,” Healthcare (Switzerland), vol. 10, no. 12, Dec. 2022, doi: 10.3390/healthcare10122493.

Y. Liu, H. Pu, and D.-W. Sun, “Efficient extraction of deep image features using convolutional neural network (CNN) for applications in detecting and analysing complex food matrices,” Trends Food Sci Technol, vol. 113, pp. 193–204, Jul. 2021, doi: 10.1016/j.tifs.2021.04.042.

M. Tsuneki, “Deep learning models in medical image analysis,” J Oral Biosci, vol. 64, no. 3, pp. 312–320, Sep. 2022, doi: 10.1016/j.job.2022.03.003.

A. W. Salehi et al., “A Study of CNN and Transfer Learning in Medical Imaging: Advantages, Challenges, Future Scope,” Sustainabil-ity, vol. 15, no. 7, p. 5930, Mar. 2023, doi: 10.3390/su15075930.

T. Pavlović, T. Popović, and S. Čakić, “Breast Cancer Detection Using ResNet and DenseNet Architecture,” in 2025 29th International Conference on Information Technology (IT), IEEE, Feb. 2025, pp. 1–4. doi: 10.1109/IT64745.2025.10930260.

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 Diag-nose Intracranial Hemorrhage in CT Scanning,” Curr Pharm Des, vol. 28, no. 4, pp. 287–295, Feb. 2022, doi: 10.2174/1381612827666211213143357.

M. A. Hasnain, H. Malik, M. M. Asad, and F. Sherwani, “Deep learning architectures in dental diagnostics: a systematic comparison of techniques for accurate prediction of dental disease through x-ray imaging”, doi: 10.1108/IJICC-08-2023-0230.

R. Bhuria and S. Gupta, “Innovative AI Solutions for Pneumonia Detection: Exploring DenseNet-161 in Medical Imaging,” in 2024 5th International Conference on Data Intelligence and Cognitive Informatics (ICDICI), IEEE, Nov. 2024, pp. 638–643. doi: 10.1109/ICDICI62993.2024.10810835.

F. Gou, J. Liu, C. Xiao, and J. Wu, “Research on Artificial-Intelligence-Assisted Medicine: A Survey on Medical Artificial Intelligence,” Diagnostics, vol. 14, no. 14, p. 1472, Jul. 2024, doi: 10.3390/diagnostics14141472.

I. Griffin et al., “Evaluating Acute Pulmonary Changes in Coronavirus Disease 2019: A Comparative Analysis of Computed Tomog-raphy, Chest Radiography, Lung Ultrasound, Magnetic Resonance Imaging, and Positron Emission Tomography with Fluorodeoxy-glucose Modalities,” Seminars in Ultrasound, CT and MRI, 2024, doi: 10.1053/j.sult.2024.02.007.

D. R. Sarvamangala and R. V. Kulkarni, “Convolutional neural networks in medical image understanding: a survey,” Mar. 01, 2022, Springer Science and Business Media Deutschland GmbH. doi: 10.1007/s12065-020-00540-3.

P. D. Koprinkova-Hristova, K. S. Yadav, H. Ying, and Y.-F. Li, “Disrupted visual input unveils the computational details of artificial neural networks for face perception,” Frontiers in Computational Neuroscience, vol. 16, p. 1054421, 2022.

L. Chen, S. Li, Q. Bai, J. Yang, S. Jiang, and Y. Miao, “Review of image classification algorithms based on convolutional neural net-works,” Nov. 01, 2021, MDPI. doi: 10.3390/rs13224712.

A. A. Barbhuiya, R. K. Karsh, and R. Jain, “CNN based feature extraction and classification for sign language,” Multimed Tools Appl, vol. 80, no. 2, pp. 3051–3069, Jan. 2021, doi: 10.1007/s11042-020-09829-y.

L. Pinto-Coelho, “How Artificial Intelligence Is Shaping Medical Imaging Technology: A Survey of Innovations and Applications,” Dec. 01, 2023, Multidisciplinary Digital Publishing Institute (MDPI). doi: 10.3390/bioengineering10121435.

V. Sreeprada and Dr. K. Vedavathi, “Lung Cancer Detection from X-Ray Images using Hybrid Deep Learning Technique,” Procedia Comput Sci, vol. 230, pp. 467–474, 2023, doi: 10.1016/j.procs.2023.12.102.

M. Hasan Fadlun and U. Hayati, “Klasifikasi Tumor Otak menggunakan Convolutional Neural Network dan Transfer Learning,” Jurnal Informatika dan Rekayasa Perangkat Lunak , vol. 6, no. 1, pp. 289–295, 2024.

N. Hasan, Y. Bao, A. Shawon, and Y. Huang, “DenseNet Convolutional Neural Networks Application for Predicting COVID-19 Using CT Image,” SN Comput Sci, vol. 2, no. 5, Sep. 2021, doi: 10.1007/s42979-021-00782-7.

H. Chen et al., “Accurate classification of white blood cells by coupling pre-trained ResNet and DenseNet with SCAM mechanism,” BMC Bioinformatics, vol. 23, no. 1, Dec. 2022, doi: 10.1186/s12859-022-04824-6.

K. Pierre et al., “Applications of Artificial Intelligence in the Radiology Roundtrip: Process Streamlining, Workflow Optimization, and Beyond,” Semin Roentgenol, vol. 58, no. 2, pp. 158–169, Apr. 2023, doi: 10.1053/j.ro.2023.02.003.

D. S. Kermany et al., “Identifying Medical Diagnoses and Treatable Diseases by Image-Based Deep Learning,” Cell, vol. 172, no. 5, pp. 1122-1131.e9, Feb. 2018, doi: 10.1016/j.cell.2018.02.010.

Y. Hou, Z. Wu, X. Cai, and T. Zhu, “The application of improved densenet algorithm in accurate image recognition,” Sci Rep, vol. 14, no. 1, pp. 1–14, Dec. 2024, doi: 10.1038/S41598-024-58421-Z;SUBJMETA=1042,117,639,705,794;KWRD=COMPUTATIONAL+SCIENCE,COMPUTER+SCIENCE,SOFTWARE.

Y. D. Zhang, S. C. Satapathy, X. Zhang, and S. H. Wang, “COVID-19 Diagnosis via DenseNet and Optimization of Transfer Learning Setting,” Cognit Comput, vol. 16, no. 4, pp. 1649–1665, Jul. 2024, doi: 10.1007/S12559-020-09776-8/TABLES/13.

X. Yu, N. Zeng, S. Liu, and Y.-D. Zhang, “Utilization of DenseNet201 for diagnosis of breast abnormality,” Mach Vis Appl, vol. 30, no. 7–8, pp. 1135–1144, Oct. 2019, doi: 10.1007/s00138-019-01042-8.

P. Ormeño-Arriagada, E. Navarro, C. Taramasco, G. Gatica, and J. P. Vásconez, “Deep Learning Techniques for Oral Cancer Detec-tion: Enhancing Clinical Diagnosis by ResNet and DenseNet Performance,” 2025, pp. 59–72. doi: 10.1007/978-3-031-75144-8_5.

A. Mohan, “ENHANCED MULTIPLE DENSE LAYER EFFICIENTNET,” 2024.

J. Li et al., “Detection of hidden pediatric elbow fractures in X-ray images based on deep learning,” J Radiat Res Appl Sci, vol. 17, no. 2, p. 100893, Jun. 2024, doi: 10.1016/j.jrras.2024.100893.

Zia-Ur-Rehman et al., “Classification of Alzheimer disease using DenseNet-201 based on deep transfer learning technique,” PLoS One, vol. 19, no. 9, Sep. 2024, doi: 10.1371/journal.pone.0304995.

M. R. Khare and R. H. Havaldar, “Predicting the anterior slippage of vertebral lumbar spine using Densenet-201,” Biomed Signal Process Control, vol. 86, Sep. 2023, doi: 10.1016/j.bspc.2023.105115.

Downloads

Published

29-06-2025

How to Cite

[1]
Wafi, A.Z.A. et al. 2025. Deep Learning Approach for Pneumonia Prediction from X-Rays using A Pretrained Densenet Model. Jurnal ELTIKOM : Jurnal Teknik Elektro, Teknologi Informasi dan Komputer. 9, 1 (Jun. 2025), 98–106. DOI:https://doi.org/10.31961/eltikom.v9i1.1457.

Issue

Section

Articles