Preprint / Version 1

Effects of Hyperparameters and Data Augmentation on Deep Learning Models for Pneumonia Classification from Chest X-ray Images

Authors

  • Saanvi Chawla Polygence
  • Morteza Sarmadi

DOI:

https://doi.org/10.58445/57d32s48

Keywords:

Pneumonia Detection, Deep Learning, Hyperparameter Optimization, Feature Importance, Chest X-ray, Data Augmentation

Abstract

More than 2 million people die annually from pneumonia around the world. Pneumonia is the second most misdiagnosed condition leading to hospital readmission, which displays the difficulty of accurate and timely diagnosis. Various studies have applied deep learning (DL), including hybrids and ensembles, to medical analysis, yielding promising results. However, these models utilized have led to high computational costs as well as a consumption of resources. The datasets used to train the models have also shown class imbalance and a lack of diversity in the data. In this paper, we analyzed the effects of hyperparameters on DL models to optimize the performance of these models trained on a balanced Kaggle pneumonia chest X-ray dataset. We evaluated five architectures (MobileNetV2, VGG16, InceptionV3, EfficientNetB0, ResNet50) across four hyperparameters– learning rate, batch size, target epochs, and data augmentation– conducting 450 total simulations. After accumulating the data, feature importance was rank-ordered using XGBoost (XGB) and Random Forest (RF), with decision trees extracted from RF. Key findings of this study involved learning rate being the most influential hyperparameter and augmentation resulting in higher accuracy and F1-score than non-augmented data. Furthermore, RF and XGB hyperparameter importance ranking varied within each model but remained the same whether evaluated by accuracy or F1-score, with XGB consistently achieving a higher predictive fit. This study provides a practical framework for future work related to optimizing DL models for classifying pneumonia or other diseases based on medical images.

References

[1] Centers for Disease Control and Prevention. “FastStats: Pneumonia.” National Center for Health Statistics, cdc.gov/nchs/fastats/pneumonia.htm.

[2] Kheirdoust, Azam, et al. “Evaluation of Machine Learning Methods Developed for Prediction and Diagnosis of Pneumonia: A Systematic Review.” Health Science Reports, vol. 8, no. 12, 30 Nov. 2025, article e71446, doi.org/10.1002/hsr2.71446.

[3] UNICEF. “Pneumonia.” UNICEF Data: Monitoring the Situation of Children and Women, data.unicef.org/topic/child-health/pneumonia/.

[4] Reed, Shawn D., et al. “Attributable Cost of Adult Hospitalized Pneumonia Beyond the Acute Episode.” Pharmacoeconomics, vol. 39, no. 3, 2021, pp. 325–337. PubMed Central, pmc.ncbi.nlm.nih.gov/articles/PMC8160038/.

[5] Izadnegahdar, R., et al. “Childhood Pneumonia in Developing Countries.” The Lancet Respiratory Medicine, vol. 1, 2013, pp. 574–584, 11 thelancet.com/journals/lanres/article/PIIS2213-2600(13)70075-4/abstract.

[6] Popovsky, Erica Y., and Todd A. Florin. “Community-Acquired Pneumonia in Childhood.” Encyclopedia of Respiratory Medicine, edited by Sam M. Janes, 2nd ed., Academic Press, 2022, pp. 119–131, doi.org/10.1016/B978-0-08-102723-3.00013-5.

[7] Ullah, Nadir, et al. “Diagnostic Approach to Pneumonia in Immunocompromised Hosts.” Journal of Clinical Medicine, vol. 14, no. 2, 2025, article 389, doi.org/10.3390/jcm14020389.

[8] Alshanketi, Faisal, et al. “Pneumonia Detection from Chest X-Ray Images Using Deep Learning and Transfer Learning for Imbalanced Datasets.” Journal of Imaging Informatics in Medicine, vol. 38, no. 4, 2025, pp. 2021–2040, doi.org/10.1007/s10278-024-01334-0.

[9] Kundu, Rohit, et al. “Pneumonia Detection in Chest X-Ray Images Using an Ensemble of Deep Learning Models.” PLOS ONE, vol. 16, no. 9, 7 Sept. 2021, article e0256630, doi.org/10.1371/journal.pone.0256630.

[10] Effah, Clement Yaw, et al. “Machine Learning-Assisted Prediction of Pneumonia Based on Non-Invasive Measures.” Frontiers in Public Health, vol. 10, 28 July 2022, article 938801, doi.org/10.3389/fpubh.2022.938801.

[11] Han, Yan, et al. “Pneumonia Detection on Chest X-Ray Using Radiomic Features and Contrastive Learning.” Proceedings of the IEEE International Symposium on Biomedical Imaging, 2021, pp. 247–251, doi.org/10.1109/isbi48211.2021.9433853.

[12] Shilpa, N., et al. “Revolutionizing Pneumonia Diagnosis: AI-Driven Deep Learning Framework for Automated Detection from Chest X-Rays.” IEEE Access, 15 Nov. 2024, doi.org/10.1109/ACCESS.2024.3498944.

[13] Xu, Zhijing, and Haoyang Zhang. “Pneumonia Detection from Enhanced Chest X-Ray Images Based on Double SGAN Model.” Scientific Reports, vol. 16, no. 1, 19 Feb. 2026, article 9922, doi.org/10.1038/s41598-026-39785-w.

[14] Slimi, Houmem, et al. “Trustworthy Pneumonia Detection in Chest X-Ray Imaging Through Attention-Guided Deep Learning.” Scientific Reports, vol. 15, 2025, article 40029, doi.org/10.1038/s41598-025-23664-x.

[15] Bhattarai, Pankaj, et al. “Detection of Pneumonia Using Machine Learning.” Proceedings of the 5th International Conference on Information Management & Machine Intelligence (ICIMMI ’23), article 159, ACM, 13 May 2024, pp. 1–11, doi.org/10.1145/3647444.3652464.

[16] Murtaza, Yusuf. “Chest X-Ray Pneumonia Balanced Dataset.” Kaggle,

kaggle.com/datasets/yusufmurtaza01/chest-xray-pneumonia-balanced-dataset.

[17] Wang, Ruinan, et al. “Efficient Hyperparameter Importance Assessment for CNNs.” arXiv, 11 Oct. 2024, doi.org/10.48550/arXiv.2410.08920.

[18] Bengio, Yoshua. “Practical Recommendations for Gradient-Based Training of Deep Architectures.” arXiv, 2012, arxiv.org/pdf/1206.5533.

Downloads

Posted

2026-11-15