Pneumonia Detection from Chest X-Ray Using Transfer Learning
Authors: Mr. Peddinti Manoj, Mr. Selvaraj Harish, Mr. V. Srinivasulu, Mr. Vemulapati Sandeep Reddy, Mrs. P. Leelavathi, Dr. R. Karunia Krishnapriya, Mr. Pandreti Praveen, Mr. N. Vijaya Kumar
Pneumonia is a severe respiratory disease that requires timely and accurate diagnosis to prevent complications. Traditional diagnostic technique depends on skilled radiologists, which can be difficult and prone to mistakes. In this work, we provide a pretrained ResNet-50 model and transfer learning for an automated pneumonia diagnosis system. The approach classifies instances as normal or pneumonia-positive based on chest x-ray images. To improve pneumonia-specific feature extraction, the transfer method refines the last 20 layers of ResNet-50, which was first trained on ImageNet, using pre-extracted features, To provide better model generalization, the dataset is pre-processed using image augmentation techniques. The model is trained using binarycross-entropy loss and the Adam optimizer, and it achieves 95.35% accuracy on validation data.The trained model is deployed in real time using Gradio on Hugging Faces,resulting in an intuitive user interface. The suggested approach improves the accuracy and efficiency of pneumonia identification, highlighting its potential as a computer-aided diagnostic (CAD) tool in medical imaging.
Introduction
Overview:
Pneumonia is a serious lung infection that inflames the air sacs, causing breathing difficulties and potentially life-threatening complications. Traditional diagnostic methods (e.g., X-rays and clinical exams) require skilled interpretation and can be slow. To improve diagnostic speed and accuracy, this study presents a deep learning-based pneumonia detection system leveraging transfer learning with the ResNet-50 model.
Key Features of the Proposed System:
Model Used: ResNet-50 (pretrained on ImageNet).
Transfer Learning Strategy: Final 20 layers of ResNet-50 are unfrozen and fine-tuned using pneumonia-specific X-ray images.
Deployment Platform: Hugging Face Spaces with a Gradio-based web interface for real-time detection.
Methodology:
Data Collection & Preprocessing:
Chest X-ray images classified as “normal” or “pneumonia.”
Images resized, normalized, and augmented (rotation, flipping, zooming) for better generalization.
Model Design:
Base model: ResNet-50 with the top layers removed.
Accessible online for medical professionals through Gradio interface.
Comparative Performance with Other Models:
Model
Accuracy
Precision
Recall
F1-Score
ResNet-50 (Proposed)
95.35%
95.10
94.50
94.80
CNN
90.20%
89.50
88.90
89.20
VGG16
92.30%
91.70
91.20
91.40
MobileNet
93.10%
92.50
92.00
92.20
Literature Review Insights:
Transfer learning has emerged as a preferred method due to the high computational cost of training CNNs from scratch.
Models like CheXNet, VGG16, and InceptionV3 have been effective in prior pneumonia classification tasks.
Common issues in current systems include dataset imbalance, model interpretability, and generalization across populations.
Conclusion
In this work, we created a dep learning-based pneumonia detection system utilizing the ResNet-50 model and transfer learning. The suggested method attained a model accuracy of 95.35%, proving its usefulness in identifying chest X-ray pictures as pneumonia or normal cases. The system was tuned for high performance using approaches such as data processing, feature extraction, fine-tuning, and model training, The model’s dependability was further confirmed using evaluation criteria such as accuracy, recall, and F1 score. Furthermore, the model’s deployment utilizing Gradio on Hugging face Spaces makes it suitable for real-world applications. Further research might concentrate on increasing accuracy with bigger datasets, using explainable AI approaches, and integrating the model into clinical decision-making systems.
References
[1] Rajpurkar P., Irvin J., Zhu K., Yang B., Mehta H., Duan T., ... & Ng, A. Y. (2017).CheXNet: Radiologist-Level Pneumonia Detection on Chest X-Rays with Deep Learning.
[2] Kermany D., S. Zhang K., & Goldbaum M. (2018). Labelled Optical Coherence Tomography (OCT) and Chest X-Ray Images for Classification.
[3] IEEE- Pneumonia Detection using Deep Learning: The study compares convolutional neural networks and multilayer perceptrons in automating pneumonia detection from chest X-rays.
[4] IEEE-Pneumonia Detection Using Deep Learning Based on Convolutional Neural Network: This research focuses on using CNNs to process chest X-ray images to support accurate pneumonia diagnosis.
[5] Chaudhary, S., et al. \"Detecting COVID-19 and Community Acquired Pneumonia using Chest CT Scan Images with Deep Learning.\" IEEE Access, 2021.
[6] Han, Y., et al. \"Pneumonia Detection on Chest X-ray using Radiomic Features and Contrastive Learning.\" IEEE Access,2021.
[7] El Asnaoui, K., et al. \"Automated Methods for Detection and Classification of Pneumonia based on X-Ray ImagesUsing Deep Learning.\" IEEE Access, 2020.
[8] Mabrouk, A., et al. \"Pneumonia Detection on Chest X-ray Images Using Ensemble of Deep Convolutional Neural Networks.\" IEEE Access, 2023.
[9] Li, X., et al. \"COVID-19 Detection in Chest X-ray Images Using Deep Learning.\" IEEE Access, 2020.
[10] Wang, L., et al. \"A Deep Learning Algorithm for Pneumonia Detection in Chest X-rays.\" IEEE Access, 2019.
[11] Rajpurkar, P., et al. \"Chex Net: Radiologist-Level Pneumonia Detection on Chest X-Rays with Deep Learning.\" IEEE Access, 2017.
[12] Stephen, O., et al. \"Deep Learning for Pneumonia Detection: A Comparative Analysis.\" IEEE Access, 2019.
[13] Eisentraut, L., et al. \"Deep Learning-Based Detection of Tuberculosis Using a Gaussian Chest X-Ray Image Filter as a Software Lens.\" IEEE Access, 2025