Systematic Hyperparameter Optimization of Convolutional Neural Networks for Pneumonia Detection from Chest X-rays
Abstract
Pneumonia remains a major global health challenge. It is responsible for millions of deaths annually, making it one of the leading causes of mortality worldwide, particularly in low- and middle-income countries, where access to early and accurate diagnosis is often limited. Convolutional neural networks (CNNs) have shown strong potential in medical image classification. However, the performance of these deep learning models depends primarily on the choice of hyperparameters, which determine how effectively the models learn. This study investigates the interaction between multi-factor hyperparameters, which is a major gap in large-scale optimization for medical imaging. The goal is to systematically evaluate these interactions in order to develop a CNN diagnostic model with improved pneumonia detection accuracy. Using the RSNA Pneumonia Detection Challenge dataset, four pre-trained CNN architectures (VGG16, ResNet50, InceptionV3, and MobileNetV2) were trained and tested. Our methodology progressed from single-factor ablation to multi-factor interaction analysis. Two optimization approaches, Random Search (RS) and Bayesian Optimization (BO), were applied across five key hyperparameters: learning rate, epoch count, batch size, dropout rate, and optimizer. Results revealed that learning rate and optimizer had the greatest impact on classification accuracy. InceptionV3 was found to be the best-performing model (learning rate 0.001, batch size 64, dropout 0.1, 40 epochs, Adam optimizer), with a test F1-score of 92.5% and recall of 91.8%. BO consistently outperformed RS in improving CNN performance for pneumonia detection. Overall, these findings highlight that systematic, dataset-specific hyperparameter tuning can greatly enhance the reliability of CNN-based pneumonia detection from chest X-rays.
