Detection of pneumonia from chest X-rays using convolutional neural networks

DOI: https://doi.org/10.3846/mla.2025.23905

Abstract

Pneumonia detection from chest X-rays is crucial for early diagnosis, and deep learning models –specifically convolutional neural networks (CNNs) – have shown promise in automating this process. In this study, a CNN using the DenseNet-121 architecture was developed and trained, referred to as LDCS2, to classify chest X-ray images as pneumonia or normal, using a combined dataset from three publicly available sources. The CNN approach was chosen over Vision Transformers (ViT) due to lower computational requirements and better performance with limited data. A traditional training, validation, and testing split was used instead of k-fold cross-validation to reduce execution time. LDCS2 demonstrated excellent discrimination between pneumonia and normal images alongside high computational efficiency. These findings highlight the potential of DenseNet-based CNNs for automated pneumonia diagnosis, particularly in resource-constrained settings.

Article in English.

Pneumonijos nustatymas iš krūtinės ląstos rentgenogramų, naudojant konvoliucinius neuroninius tinklus

Santrauka

Pneumonijos nustatymas iš krūtinės ląstos rentgenogramų yra itin svarbus ankstyvajai diagnostikai, o giliojo mokymosi modeliai – ypač konvoliuciniai neuroniniai tinklai (CNN) – rodo didelį potencialą automatizuojant šį procesą. Šiame tyrime sukurtas ir apmokytas CNN, paremtas DenseNet-121 architektūra ir pavadintas LDCS2, skirtas klasifikuoti krūtinės ląstos rentgeno vaizdams, iš kurių matyti pneumonija arba sveiki plaučiai, naudojant sujungtą duomenų rinkinį iš trijų viešai prieinamų šaltinių. CNN metodas pasirinktas vietoje Vision Transformers (ViT) dėl mažesnių skaičiavimo išteklių reikalavimų ir geresnių rezultatų, kai duomenų kiekis ribotas. Siekiant sutrumpinti vykdymo laiką, vietoje k kartų kryžminės validacijos taikytas tradicinis mokymo, validacijos ir testavimo skaidymas. LDCS2 pademonstravo puikią atskyrimo gebą tarp pneumonijos ir sveikų plaučių vaizdų bei aukštą skaičiavimo efektyvumą. Šie rezultatai pabrėžia DenseNet pagrindu veikiančių CNN potencialą automatizuotai plaučių uždegimo diagnostikai, ypač išteklių stokojančiose aplinkose.

Reikšminiai žodžiai: LDCS2, konvoliuciniai neuroniniai tinklai (CNN), krūtinės ląstos rentgeno vaizdų klasifikavimas, pneumonijos aptikimas, DenseNet-121, medicininis vaizdavimas, gilusis mokymasis sveikatos priežiūros srityje, duomenų augmentacija, perkėliminis mokymasis.

Keywords:

LDCS2, Convolutional Neural Networks (CNNs), chest X-ray classification, pneumonia detection, DenseNet-121, medical imaging, deep learning in healthcare, data augmentation, transfer learning

How to Cite

Bundza, P., & Trinkūnas, J. (2025). Detection of pneumonia from chest X-rays using convolutional neural networks. Mokslas – Lietuvos ateitis / Science – Future of Lithuania, 17. https://doi.org/10.3846/mla.2025.23905

Share

Published in Issue
September 29, 2025
Abstract Views
42

References

Abbas, A., Abdelsamea, M. M., & Gaber, M. M. (2020). Classification of COVID-19 in chest X-ray images using DeTraC deep convolutional neural network. Applied Intelligence, 51, 854–864. https://doi.org/10.1007/s10489-020-01829-7

Albahli, S., & Yar, G. N. A. H. (2021). Fast and accurate detection of COVID-19 along with 14 other chest pathologies using a multi-level classification: Algorithm development and validation study. Journal of Medical Internet Research, 23(6), Article e23693. https://doi.org/10.2196/23693

Das, A. K., Ghosh, S., Thunder, S., Dutta, R., Agarwal, S., & Chakrabarti, A. (2021). Automatic COVID-19 detection from X-ray images using ensemble learning with convolutional neural network. Pattern Analysis and Applications, 24, 1111–1124. https://doi.org/10.1007/s10044-021-00970-4

Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., Uszkoreit, J., & Houlsby, N. (2021). An image is worth 16×16 words: Transformers for image recognition at scale. ArXiv. https://doi.org/10.48550/arXiv.2010.11929

Elshazly, H., Linse, C., Barth, E., & Martinetz, T. (2020). Explainable COVID-19 detection using chest X-rays and transfer learning. ArXiv. https://doi.org/10.48550/arXiv.2012.04833

Han, K., Wang, Y., Chen, H., Chen, X., Guo, J., & Liu, Z. (2022). A survey on vision transformer. IEEE Transactions on Pattern Analysis and Machine Intelligence, 45(1), 87–110. https://doi.org/10.1109/TPAMI.2022.3152247

Hassantabar, S., Ahmadi, M., & Sharifi, A. (2020). Diagnosis and detection of infected tissue of COVID-19 patients based on lung x-ray image using convolutional neural network approaches. Chaos, Solitons & Fractals, 140, Article 110170. https://doi.org/10.1016/j.chaos.2020.110170

Ibrahim, D. M., Elshennawy, N. M., & Sarhan, A. M. (2021). Deep-chest: Multi-classification deep learning model for diagnosing COVID-19, pneumonia, and lung cancer chest diseases. Computers in Biology and Medicine, 132, Article 104348. https://doi.org/10.1016/j.compbiomed.2021.104348

Irmak, E. (2021). COVID-19 disease severity assessment using CNN model. IET Image Processing, 15(8), 1814–1824. https://doi.org/10.1049/ipr2.12153

Irvin, J., Rajpurkar, P., Ko, M., Yu, Y., Ciurea-Ilcus, S., Chute, C., Marklund, H., Haghgoo, B., Ball, R., Shpanskaya, K., Seekins, J., Mong, D. A., Halabi, S. S., Sandberg, J. K., Jones, R., Larson, D. B., Langlotz, C. P., Patel, B. N., Lungren, M. P., & Ng, A. Y. (2019). CheXpert: A large chest radiograph dataset with uncertainty labels and expert comparison. Proceedings of the AAAI Conference on Artificial Intelligence, 33(1), 590–597. https://doi.org/10.1609/aaai.v33i01.3301590

Ismael, A. M., & Şengür, A. (2021). Deep learning approaches for COVID-19 detection based on chest X-ray images. Expert Systems with Applications, 164, Article 114054. https://doi.org/10.1016/j.eswa.2020.114054

Katz, S. E., & Williams, D. J. (2018). Pediatric community-acquired pneumonia in the United States: Changing epidemiology, diagnostic and therapeutic challenges, and areas for future research. Infectious Disease Clinics of North America, 32(1), 47–63. https://doi.org/10.1016/j.idc.2017.11.002

Mooney, P. (2018). Chest X-ray images (Pneumonia). https://www.kaggle.com/paultimothymooney/chest-xray-pneumonia

Moujahid, H., Cherradi, B., El Gannour, O., Bahatti, L., Terrada, O., & Hamida, S. (2020). Convolutional neural network-based classification of pneumonia from chest X-ray images. African Journal of Science, Technology, Innovation and Development, 12(4), 499–506. https://doi.org/10.25046/aj050522

Podder, P., Bhattacharjee, S., & Roy, A. (2021). An efficient method of detection of COVID-19 using Mask R-CNN on chest X-ray images. AIMS Biophysics, 8(3), 281–290. https://doi.org/10.3934/biophy.2021022

Rahman, M. M., Nooruddin, S., Hasan, K. M. A., & Dey, N. K. (2021a). HOG + CNN Net: Diagnosing COVID-19 and pneumonia by deep neural network from chest X-ray images. SN Computer Science, 2, Article 371. https://doi.org/10.1007/s42979-021-00762-x

Rahman, T., Khandakar, A., Qiblawey, Y., Tahir, A., Kiranyaz, S., Kashem, S. I., Chowdhury, M. E. H., Al-Maadeed, S., Zughaier, S. M., & Khan, M. S. (2021). Exploring the effect of image enhancement techniques on COVID-19 detection using chest X-ray images. Computers in Biology and Medicine, 132, Article 104319. https://doi.org/10.1016/j.compbiomed.2021.104319

Rajpurkar, P., Irvin, J., Ball, R. L., Zhu, K., Yang, B., Mehta, H., Duan, T., Ding, D. Y., Bagul, A., Langlotz, C. P., Patel, B. N., Yeung, S. Y., & Ng, A. Y. (2018). Deep learning for chest radiograph diagnosis: A retrospective comparison of the CheXNeXt algorithm to practicing radiologists. PLoS Medicine, 15(11), Article e1002686. https://doi.org/10.1371/journal.pmed.1002686

Rajpurkar, P., Irvin, J., Zhu, K., Yang, B., Mehta, H., Duan, T., Ding, D. Y., Bagul, A., Langlotz, C., Shpanskaya, K., Lungren, M. P., & Ng, A. Y. (2017). CheXNet: Radiologist-level pneumonia detection on chest X-rays with deep learning. ArXiv. https://doi.org/10.48550/arXiv.1711.05225

Roberts, M., Driggs, D., Thorpe, M., Gilbey, J., Yeung, T., Ursprung, S., Aviles-Rivero, A. I., Etmann, C., McCague, C., Beer, L., Weir-McCall, J. R., Teng, Z., Gkrania-Klotsas, E., AIX-COVNET, Rudd, J. H. F., Sala, E., & Schönlieb, C.-B. (2021). Common pitfalls and recommendations for using machine learning to detect and prognosticate for COVID-19 using chest radiographs and CT scans. Nature Machine Intelligence, 3(3), 199–217. https://doi.org/10.1038/s42256-021-00307-0

Rudin, C. (2019). Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead. Nature Machine Intelligence, 1, 206–215. https://doi.org/10.1038/s42256-019-0048-x

Sahiner, B., Pezeshk, A., Hadjiiski, L. M., Wang, X., Drukker, K., Cha, K. H., Summers, R. M., & Giger, M. L. (2019). Deep learning in medical imaging and radiation therapy. Medical Physics, 46(1), e1–e36. https://doi.org/10.1002/mp.13264

Sait, U., KV, G. L., Prajapati, S. P., Bhaumik, R., Kumar, T., Shivakumar, S., & Bhalla, K. (2022). Curated dataset for COVID-19 posterior-anterior chest radiography images (X-Rays). https://doi.org/10.17632/9xkhgts2s6.4

Selvaraju, R. R., Cogswell, M., Das, A., Vedantam, R., Parikh, D., & Batra, D. (2017). Grad-CAM: Visual explanations from deep networks via gradient-based localization. In Proceedings of the IEEE International Conference on Computer Vision (pp. 618–626). IEEE. https://doi.org/10.1109/ICCV.2017.74

Shamshad, F., Khan, S., Zamir, S. W., Khan, M. H., Hayat, M., Khan, F. S., & Fu, H. (2023). Transformers in medical imaging: A survey. Medical Image Analysis, 88, Article 102802. https://doi.org/10.1016/j.media.2023.102802

Shorten, C., & Khoshgoftaar, T. M. (2019). A survey on image data augmentation for deep learning. Journal of Big Data, 6(1), Article 60. https://doi.org/10.1186/s40537-019-0197-0

Tan, M., & Le, Q. V. (2019). EfficientNet: Rethinking model scaling for convolutional neural networks. Proceedings of the International Conference on Machine Learning (pp. 6105–6114). https://doi.org/10.48550/arXiv.1905.11946

Vabalas, A., Gowen, E., Poliakoff, E., & Casson, A. J. (2019). Machine learning algorithm validation with a limited sample size. PLoS ONE, 14(11), Article e0224365. https://doi.org/10.1371/journal.pone.0224365

Varshni, D., Thakral, K., Agarwal, L., Nijhawan, R., & Mittal, A. (2019). Pneumonia detection using CNN based feature extraction. In 2019 IEEE International Conference on Electrical, Computer and Communication Technologies (ICECCT) (pp.1–7). IEEE. https://doi.org/10.1109/ICECCT.2019.8869364

Wang, B., & Zhang, W. (2022). MARnet: Multi-scale adaptive residual neural network for chest X-ray images recognition of lung diseases. Mathematical Biosciences and Engineering, 19(1), 331–350. https://doi.org/10.3934/mbe.2022017

World Health Organization. (2022). Pneumonia. https://www.who.int/news-room/fact-sheets/detail/pneumonia

View article in other formats

CrossMark check

CrossMark logo

Published

2025-09-29

Issue

Section

Information Technologies & Multimedia/Informacinės technologijos ir multimedija

How to Cite

Bundza, P., & Trinkūnas, J. (2025). Detection of pneumonia from chest X-rays using convolutional neural networks. Mokslas – Lietuvos ateitis / Science – Future of Lithuania, 17. https://doi.org/10.3846/mla.2025.23905

Share