University of Wales Trinity Saint David
Improving Model Generalization of Pneumonia Detection from Chest Xray Images Using Deep Learning and Transfer Learning
Abstract
dc:description.abstractPneumonia continues to be a major global health threat and one of the leading causes of mortality, with chest X-rays serving as the primary diagnostic tool. Despite their promise, deep learning models for pneumonia detection often face limitations in generalization, performing strongly on familiar datasets but losing accuracy when applied to unseen data from different clinical environments. This study addresses that challenge by applying transfer learning with ResNet152 and DenseNet201 to improve generalization in pneumonia detection using chest Xray images. Publicly available datasets, including the COVID-19 Radiography Database and the Chest X-ray (COVID-19 & Pneumonia) dataset, were merged, pre-processed, and balanced prior to training. Model optimization involved freezing and unfreezing layers, adjusting learning rates, and applying various data augmentation strategies. Performance was evaluated with metrics such as accuracy, precision, recall, F1-score, error rate, and AUC-ROC, and further validated using an independent external dataset. Experimental results showed that DenseNet201 consistently outperformed ResNet152, reaching 93.2% accuracy with an AUC of 0.9916 on the main dataset and 88.3% accuracy with an AUC of 0.9742 on the external dataset. By comparison, ResNet152 achieved 86.4% accuracy (AUC 0.9665) on the main dataset and 84.6% accuracy (AUC 0.9573) on the external dataset. Confusion matrix analysis revealed that most errors occurred between Normal and Pneumonia classes, mirroring real world diagnostic challenges. In conclusion, DenseNet201 demonstrated superior robustness and generalization compared to ResNet152, highlighting its suitability for clinical application and underscoring the necessity of external validation in medical AI research.
Degree
thesis:*- Name dc:type.qualificationname
- msc
- Level dc:type.qualificationlevel
- masters
- Grantor dc:publisher.institution
- University of Wales Trinity Saint David
- Year dc:date.issued
- 2025
Author and committee
dc:creator, dc:contributor.*- Author dc:creator
-
- Kochamparampil Anil, Akhil
Subjects
dc:subject × 2Identifiers
dc:identifier.*- Dc Identifier Grantnumber
- UWTSD
- OAI identifier oai:identifier
- oai:repository.uwtsd.ac.uk:4143