Abstract:
Pneumonia remains a serious health concern, particularly in regions where access to experienced radiologists is limited. Although chest X-rays are commonly used for diagnosis, accurate interpretation often depends on expert judgment, which is not always available in resource- constrained settings. As a result, delayed or incorrect diagnoses are still common. This study explores the use of deep learning techniques to support pneumonia detection from chest X-ray images, while addressing practical challenges such as data imbalance, limited dataset diversity, and lack of model transparency. Rather than relying only on widely used public datasets, this research makes use of a locally collected and radiologist-verified dataset consisting of 1,500 chest X-ray images obtained from a medical facility in Bangladesh. The images were carefully preprocessed using lung-preserving cropping and clinically safe data augmentation in order to reduce noise and improve class balance. A custom-built Convolutional Neural Network (CNN) was developed and compared with several transfer learning models, including VGG19, DenseNet201, MobileNetV2, and ResNet50. Among these, VGG19 produced the best overall results, achieving a test accuracy of 97.88%, while the custom CNN also demonstrated strong performance with 96.00% accuracy. Evaluation was carried out using standard metrics such as accuracy, precision, recall, F1-score, ROC analysis, and confusion matrices.