A Hybrid CNN-Random Forest Architecture for Automated Pneumonia Classification from Chest X-Ray Radiographs
Abstract
Pneumonia is a major respiratory disease in children and requires fast, reliable diagnosis to reduce severe outcomes. Chest X-ray imaging is widely used in clinical practice, but manual interpretation is subject to inter-observer variability. This paper presents a comparative study of Baseline CNN (DL-Based) and Hybrid CNN with RF as Classifier for binary pneumonia classification. The study uses 5,840 pediatric chest X-ray images for model development and validation, comprising 5,216 training samples and 624 validation samples, under three data settings: original, undersampled, and oversampled. Experimental results show that Hybrid CNN with RF as Classifier consistently improves validation performance while significantly reducing computational cost relative to Baseline CNN (DL-Based). The best configuration, Hybrid CNN (RF-Gini) on undersampled data, achieves 86% accuracy, 82% macro recall, 89% macro precision, and 84% macro F1-score. In addition to improving predictive metrics, the hybrid pipeline delivers a substantial efficiency advantage, making it more suitable for iterative model development and deployment in resource-constrained environments. These findings indicate that the hybrid approach is a practical and effective alternative for automated pneumonia screening from chest radiographs.