Pneumonia Disease Detection Using Chest X-Rays and Machine Learning
Abstract
:1. Introduction and Background
Background
- How correctly will the models identify pneumonia using chest X-rays compared to already existing work?
- How effective is the CNN model developed ground up compared to the pretrained model ResNet-50 for accurately detecting pneumonia?
- To what extent do advanced image processing techniques, in particular augmentation, affect the detection of pneumonia using chest X-rays and deep learning algorithms?
- What is the impact of dataset size on the performance of the models?
2. Methodology
- No Lung Opacity/Not Normal: no lung abnormalities detected;
- Normal: abnormalities unrelated to pneumonia;
- Lung Opacity: opacities that are visible, indicating pneumonia presence.
- Pneumonia (1): from Lung Opacity category;
- Non-Pneumonia (0): from No Lung Opacity and Not Normal and Normal categories.
- No Lung Opacity/Not Normal—39.1%;
- Normal—29.3%;
- Lung Opacity—31.6%.
2.1. Data Augmentation
2.2. CNN Model Development and Training
2.3. ResNet-50 Development and Training
2.4. Evaluation Metrics
3. Results
3.1. Quantitative Presentation and Evaluation of CNN Models and ResNet50 Model Is Shown in Table 4
3.2. CNN Model Trained on the Original Dataset Without Augmentation
3.3. Comparison of CNN Models and ResNet50 Model for Sensitivity and Specificity
3.4. CNN Model Trained with Original Data with Augmentation
3.5. CNN Trained on a Reduced Dataset with Augmentation Without Augmentation
3.6. CNN Model Performance with Reduced Dataset with Augmentation
3.7. ResNet Model Performance with Original Data with Augmentation
3.8. Qualitative Evaluation of CNN and ResNet50 Models
4. Discussion
Clinical Implications of the Visual Quality Improvements
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Rehman, M.U.; Shafique, A.; Khan, K.H.; Khalid, S.; Alotaibi, A.A.; Althobaiti, T.; Ramzan, N.; Ahmad, J.; Shah, S.A.; Abbasi, Q.H. Novel privacy preserving non-invasive sensing-based diagnoses of pneumonia disease leveraging deep network model. Sensors 2022, 22, 461. [Google Scholar] [CrossRef] [PubMed]
- Kareem, A.; Liu, H.; Sant, P. Review on Pneumonia Image Detection: A Machine Learning Approach. Hum. Centric Intell. Syst. 2022, 2, 31–43. [Google Scholar] [CrossRef]
- Harsono, I.W.; Liawatimena, S.; Cenggoro, T.W. Lung nodule detection and classification from Thorax CT-scan using RetinaNet with transfer learning. J. King Saud Univ. Comput. Inf. Sci. 2022, 34, 567–577. [Google Scholar] [CrossRef]
- Aydoğdu, M.; Ozyilmaz, E.; Aksoy, H.; Gürsel, G.; Ekim, N. Mortality prediction in community acquired pneumonia requiring mechanical ventilation, values of pneumonia and intensive care unit severity scores. Tuberk. Toraks. 2010, 58, 25–34. [Google Scholar] [PubMed]
- Li, Y.; Zhang, Z.; Dai, C.; Dong, Q.; Badrigilan, S. Accuracy of deep learning for automated detection of pneumonia using chest X-ray images: A systematic review and meta-analysis. Comput. Biol. Med. 2020, 123, 103898. [Google Scholar] [CrossRef] [PubMed]
- Tahir, A.M.; Chowdhury, M.E.; Khandakar, A.; Al-Hamouz, S.; Abdalla, M.; Awadallah, S.; Reaz, M.B.I.; Al-Emadi, N. A systematic approach to the design and characterization of a smart insole for detecting vertical ground reaction force (vGRF) in gait analysis. Sensors 2020, 20, 957. [Google Scholar] [CrossRef]
- Zhang, D.; Ren, F.; Li, Y.; Na, L.; Ma, Y. Pneumonia Detection from Chest X-ray Images Based on Convolutional Neural Network. Electronics 2021, 10, 1512. [Google Scholar] [CrossRef]
- Yaseliani, M.; Hamadani, A.Z.; Maghsoodi, A.I.; Mosavi, A. Pneumonia Detection Proposing a Hybrid Deep Convolutional Neural Network Based on Two Parallel Visual Geometry Group Architectures and Machine Learning Classifiers. IEEE Access 2022, 10, 62110–62128. [Google Scholar] [CrossRef]
- Alharbi, A.H.; Hosni Mahmoud, H.A. Pneumonia Transfer Learning Deep Learning Model from Segmented X-rays. Healthcare 2022, 10, 987. [Google Scholar] [CrossRef]
- Al Mamlook, R.E.; Chen, S.; Bzizi, H.F. Investigation of the Performance of Machine Learning Classifiers for Pneumonia Detection in Chest X-ray Images. In Proceedings of the 2020 IEEE International Conference on Electro Information Technology (EIT), Chicago, IL, USA, 31 July–1 August 2020; pp. 098–104. [Google Scholar] [CrossRef]
- Chouhan, V.; Singh, S.K.; Khamparia, A.; Gupta, D.; Tiwari, P.; Moreira, C.; Damaševičius, R.; de Albuquerque, V.H.C. A novel transfer learning-based approach for pneumonia detection in chest X-ray images. Appl. Sci. 2020, 10, 559. [Google Scholar] [CrossRef]
- Kadry, S.; Nam, Y.; Rauf, H.; Rajinikanth, V.; Lawal, I. Automated Detection of Brain Abnormality using Deep-Learning-Scheme: A Study. In Proceedings of the 2021 Seventh International Conference on Bio Signals, Images, and Instrumentation (ICBSII), Chennai, India, 25–27 March 2021; pp. 1–5. [Google Scholar]
- Artemi, M.; Liu, H. Image Optimization using Improved Gray-Scale Quantization for Content-Based Image Retrieval. In Proceedings of the 2020 IEEE 6th International Conference on Optimization and Applications (ICOA), Beni Mellal, Morocco, 20–21 April 2020; pp. 1–6. [Google Scholar] [CrossRef]
- Albawi, S.; Mohammed, T.A.; Al-Azawi, S. Understanding of a Convolutional Neural Network. In Proceedings of the 2017 International Conference on Engineering and Technology (ICET), Antalya, Turkey, 21–23 August 2017; pp. 1–6. Available online: https://www.researchgate.net/publication/319253577_Understanding_of_a_Convolutional_Neural_Network (accessed on 16 December 2024).
- Krizhevsky, A.; Sutskever, I.; Hinton, G.E. ImageNet classification with deep convolutional neural networks. Adv. Neural Inf. Process. Syst. 2012, 25, 1097–1105. [Google Scholar] [CrossRef]
- Weiss, K.; Khoshgoftaar, T.M.; Wang, D. A survey of transfer learning. J. Big Data 2016, 3, 9. [Google Scholar] [CrossRef]
- Yang, Z.; Zhao, Q. A Multiple Deep Learner Approach for X-ray Image-Based Pneumonia Detection. In Proceedings of the 2020 International Conference on Machine Learning and Cybernetics (ICMLC), Adelaide, Australia, 2 December 2020; pp. 70–75. [Google Scholar]
- Rahman, T.; Chowdhury, M.; Khandakar, A.; Islam, K.; Islam, K.; Mahbub, Z.; Kadir, M.A.; Kashem, S. Transfer learning with deep convolutional neural network (CNN) for pneumonia detection using chest X-ray. Appl. Sci. 2020, 10, 3233. [Google Scholar] [CrossRef]
- Zubair, S.; Shah, U.; Abd-Alrazeq, A.; Alam, T.; Househ, M. An Efficient Method to Predict Pneumonia from Chest X-Rays Using Deep Learning Approach. In The Importance of Health Informatics in Public Health During a Pandemic; Mantas, J., Hasman, A., Househ, M.S., Gallos, P., Zoulias, E., Eds.; IOS Press: Amsterdam, The Netherlands, 2020; Volume 272, pp. 457–460. [Google Scholar]
- Kundu, R.; Das, R.; Geem, Z.W.; Han, G.-T.; Sarkar, R. Pneumonia detection in chest Xray images using an ensemble of deep learning models. PLoS ONE 2021, 16, e0256630. Available online: https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0256630 (accessed on 16 December 2024). [CrossRef]
- Rajain, R.; Nagrath, P.; Kataria, G.; Kaushik, V.S.; Hemanth, D.J. Pneumonia detection in chest X-ray images using convolutional neural networks and transfer learning. Measurement 2020, 165, 108046. [Google Scholar]
- Wang, X.; Peng, Y.; Lu, L.; Lu, Z.; Bagheri, M.; Summers, R.M. ChestX-ray8: Hospital-Scale Chest X-ray Database and Benchmarks on Weakly-Supervised Classification and Localization of Common Thorax Diseases. In Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, USA, 21–26 July 2017. [Google Scholar]
- Rajaraman, S.; Candemir, S.; Kim, I.; Thoma, G.; Antani, S. Visualization and interpretation of convolutional neural network predictions in detecting pneumonia in pediatric chest radiographs. Appl. Sci. 2018, 8, 1715. [Google Scholar] [CrossRef]
- Sharma, H.; Jain, J.; Bansal, P.; Gupta, S. Feature Extraction and Classification of Chest X-ray Images Using CNN to Detect Pneumonia. In Proceedings of the 2020 10th International Conference on Cloud Computting, Data Science & Engineering (Confluence), Noida, India, 29–31 January 2020; pp. 227–231. [Google Scholar]
- Stephen, O.; Sain, M.; Maduh, U.J.; Jeong, D.U. An efficient deep learning approach to pneumonia classification in healthcare. J. Healthc. Eng. 2019, 2019, 4180949. [Google Scholar] [CrossRef]
- Manickam, A.; Jiang, J.; Zhou, Y.; Sagar, A.; Soundrapandiyan, R.; Samuel, R.D.J. Automated pneumonia detection on chest X-ray images: A deep learning approach with different optimizers and transfer learning architectures. Measurement 2021, 184, 109953. Available online: https://www.sciencedirect.com/science/article/pii/S0263224121008885 (accessed on 10 June 2024). [CrossRef]
- Rajpurkar, P.; Irvin, J.; Zhu, K.; Yang, B.; Mehta, H.; Duan, T.; Ding, D.; Bagul, A.; Langlotz, C.; Shpanskaya, K.; et al. Chexnet: Radiologist-level pneumonia detection on chest x-rays with deep learning. arXiv 2017, arXiv:1711.05225. [Google Scholar]
- Mabrouk, A.; Redondo, R.P.D.; Dahou, A.; Elaziz, M.A.; Kayed, M. Pneumonia Detection on chest X-ray images Using Ensemble of Deep Con-volutional Neural Networks. Appl. Sci. 2022, 12, 6448. [Google Scholar] [CrossRef]
- Arun Kumar, V.; Nikitha, B.; Anjali, B.; Sirichandana, A.; Harshitha, D. Machine Learning Model for Pneumonia Detection from Chest X-Rays. J. Cardiovasc. Dis. Res. JCDR 2023, 14, 271–282. [Google Scholar]
- Razavian, A.S.; Azizpour, H.; Sullivan, J.; Carlsson, S. CNN features off-the-shelf: An astounding baseline for recognition. In Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition Workshops, Columbus, OH, USA, 23–28 June 2014; pp. 512–519. Available online: https://ieeexplore.ieee.org/document/6910029 (accessed on 10 June 2024).
Class | Percentage in Dataset |
---|---|
Normal | 29.3% |
No Lung opacity/Not Normal | 39.1% |
Lung Opacity | 31.6% |
Patient Sex | |
---|---|
1 | 17,216 |
0 | 13,011 |
Augmentation | Rate | Function |
---|---|---|
Rotation range | 20 | Randomly rotates the image within the range that is specified |
Width shift range | 0.2 | Randomly rotates the image within the degree that is specified |
Height shift Range | 0.2 | Shifts the image in a vertical direction by a fraction of the total height |
Zoom range | 0.2 | Zooms in and out of the image randomly |
Horizontal flip | True | Flip the image randomly Sets out the way pixels created are filled when the image is Nearest transformed |
Fill mode | Nearest | Transformed |
Accuracy | Precsion | Recall | F1 Score | AUC | |
---|---|---|---|---|---|
CNN original dataset with no augmentation | 0.79 | 0.76 | 0.73 | 0.74 | 0.85 |
CNN original data with augmentation | 0.79 | 0.76 | 0.73 | 0.74 | 0.82 |
CNN reduced dataset with no augmentation | 0.75 | 0.72 | 0.67 | 0.68 | 0.78 |
CNN reduced dataset with augmentation | 0.77 | 0.74 | 0.71 | 0.72 | 0.80 |
Accuracy | Precsion | Recall | F1 Score | AUC | |
---|---|---|---|---|---|
ResNet-5- Original data with augmentation | 0.74 | 0.73 | 0.63 | 0.63 | 0.75 |
Model Type | Sensitivity (%) | Specificity (%) |
---|---|---|
Original Dataset (No Augmentation) | 70.6% | 84.4% |
Original Dataset (With Augmentation) | 71% | 81.7% |
Reduced Dataset (No Augmentation) | 67.6% | 80.1% |
Reduced Dataset (With Augmentation) | 67.2% | 77.2% |
ResNet-50 Model (With Augmentation) | 71.7% | 74.7% |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Usman, C.; Rehman, S.U.; Ali, A.; Khan, A.M.; Ahmad, B. Pneumonia Disease Detection Using Chest X-Rays and Machine Learning. Algorithms 2025, 18, 82. https://doi.org/10.3390/a18020082
Usman C, Rehman SU, Ali A, Khan AM, Ahmad B. Pneumonia Disease Detection Using Chest X-Rays and Machine Learning. Algorithms. 2025; 18(2):82. https://doi.org/10.3390/a18020082
Chicago/Turabian StyleUsman, Cathryn, Saeed Ur Rehman, Anwar Ali, Adil Mehmood Khan, and Baseer Ahmad. 2025. "Pneumonia Disease Detection Using Chest X-Rays and Machine Learning" Algorithms 18, no. 2: 82. https://doi.org/10.3390/a18020082
APA StyleUsman, C., Rehman, S. U., Ali, A., Khan, A. M., & Ahmad, B. (2025). Pneumonia Disease Detection Using Chest X-Rays and Machine Learning. Algorithms, 18(2), 82. https://doi.org/10.3390/a18020082