Publication date: Sep 01, 2025
Pneumonia is a severe respiratory disease caused by bacterial, viral, or fungal infections and remains a leading cause of morbidity and mortality worldwide, particularly among high-risk populations such as infants, young children, the elderly, and immunocompromised individuals. Early and accurate diagnosis is crucial for improving patient outcomes. In this study, we propose a novel Dual-Branch Attention Fusion Network (D-BAFN) based on transfer learning to enhance the accuracy of pneumonia classification in chest x-ray images. The proposed network adopts a dual-branch feature extraction architecture, combining a pre-trained convolutional neural network (ResNet-18) and a structural state-space model (Mamba Vision) to capture complementary local and global contextual features. A self-attention mechanism is further integrated to adaptively weight and fuse the extracted features, thereby improving the representation of key lesion regions. Experiments were conducted on two publicly available chest x-ray datasets: a pediatric pneumonia dataset for binary classification (normal versus pneumonia) and a multi-source dataset containing pneumonia, COVID-19, and normal cases for multiclass classification. Extensive data augmentation, transfer learning, and hyperparameter optimization were employed to maximize model performance. The proposed D-BAFN achieved a top accuracy of 97. 78% +/- 0. 12 on the binary classification dataset, and an accuracy of 97. 20% +/- 0. 15, F1 score of 0. 972 +/- 0. 006, AUC of 0. 997 +/- 0. 001, recall of 0. 978 +/- 0. 005, and precision of 0. 966 +/- 0. 004 on the multiclass dataset. These results highlight the model’s effectiveness and robustness, offering a promising AI-assisted diagnostic tool for early and precise detection of pneumonia and other pulmonary diseases in clinical settings.

Semantics
| Type | Source | Name |
|---|---|---|
| disease | MESH | pneumonia |
| disease | MESH | fungal infections |
| disease | MESH | morbidity |
| disease | MESH | COVID-19 |
| disease | MESH | pulmonary diseases |