Publication date: May 18, 2026
Background: Viral Pneumonia and Tuberculosis continue to represent a significant burden on global public health, relying heavily on chest X-rays for screening and diagnosis. Although deep learning systems offer promising diagnostic support, the traditional manual tuning of hyperparameters for Convolutional Neural Networks is often inefficient and computationally expensive, frequently resulting in suboptimal or overly heavy architectures. Methods: To address these challenges, this study proposes a hybrid framework that employs metaheuristic algorithms, specifically the Whale Optimization Algorithm, Grey Wolf Optimizer, and Cuckoo Search to automatically optimize the architecture and training parameters of a custom neural network for the multi-class classification of Normal, Viral Pneumonia, and Tuberculosis cases. The proposed approach was evaluated using a rigorous stratified k-fold cross-validation protocol on a balanced, multi-source dataset. Results: The experimental results demonstrate that the model optimized by the Whale Optimization Algorithm statistically outperforms manually configured baselines, achieving the highest diagnostic accuracy and specificity. Furthermore, a critical finding of this research is the substantial improvement in computational efficiency; the automated optimization reduced the computational load by approximately 74% and the storage requirements by 63%, making the model viable for deployment in resource-constrained environments. Conclusions: Finally, to ensure clinical reliability, the decision-making process was validated using Gradient-weighted Class Activation Mapping, which confirmed that the network successfully learns to identify clinically relevant pulmonary structures while ignoring confounding artifacts.
Open Access PDF
| Concepts | Keywords |
|---|---|
| Basel | chest X-ray |
| Optimizer | explainable AI (XAI) |
| Pneumonia | hyperparameter tuning |
| Viral | metaheuristic optimization |
| Whale |
Semantics
| Type | Source | Name |
|---|---|---|
| disease | MESH | Viral Pneumonia |
| disease | MESH | Tuberculosis |
| pathway | KEGG | Tuberculosis |
| drug | DRUGBANK | Flunarizine |