Pneumonia Detection from Chest X-Rays Using Deep Convolutional Neural Networks with Class Imbalance Mitigation
Pneumonia remains a leading cause of mortality worldwide, particularly affecting children and the elderly. Early and accurate diagnosis is critical for effective treatment and improved patient outcomes. Chest X-ray (CXR) imaging is the most common diagnostic tool, but its interpretation can be subjective and time-consuming, leading to inter-observer variability. This paper presents a deep learning-based approach for automated pneumonia detection from chest X-ray images. We employ a pre-trained ResNet-18 architecture fine-tuned on a publicly available dataset directory containing 5,860 entries (5,218 in the training folder, 18 in the original validation folder, and 624 in the test folder) (NORMAL and PNEUMONIA classes). To address the inherent class imbalance in medical imaging datasets, we implement a weighted loss function and a weighted random sampler during training. Our data augmentation pipeline incorporates random cropping, horizontal flipping, rotation, and color jittering to enhance model generalization. Two sequential training passes are recorded: the first yields training accuracy 94.27% and validation accuracy 93.30% (validation loss 0.2519), while the second yields training accuracy 96.74% and validation accuracy 95.11% (validation loss 0.2354) and is saved as the best checkpoint. On the held-out test set, the checkpoint achieves 92.63% accuracy and a binary ROC-AUC of 0.9737. The original validation folder is not used; validation is drawn from a random split of the training folder. These results describe the supplied experiment and do not establish external clinical validity.
Authors
- Taruna Patel (ORCID: https://orcid.org/0009-0002-7553-1554)
- Aryan Somanna
- Ranveer Singh
- Jaideep Varma Cherukuri
Institutions
- SRM Institute of Science and Technology (IN)
- Tata Consultancy Services (India) (IN)
Publication Details
- Journal
- Research Square
- Published
- 2026-11-26
- DOI
- https://doi.org/10.21203/rs.3.rs-11879469/v1
- Primary Topic
- COVID-19 diagnosis using AI
- Type
- preprint