Boundary Aligned Superpixel-Guided Dual-Stream Vision Transformer for Pneumonia Detection in Chest CT and X-Ray
Abstract
Pneumonia continues to be a significant cause of death around the globe, and quick and accurate diagnosis based on chest X-rays (CXR) and computed tomography (CT) images is of utmost importance. While transformer-based models that process CXR and CT images have been developed, models often make use of fixed patch tokenization, which can lead to a loss of anatomical boundaries and reduce interpretability from a clinical perspective. We fill this gap with a boundary-aware dual-stream vision transformer to leverage both pixel-level detail for images and region-level superpixel representations to make the architecture adaptable to both modalities. The framework was validated on two publicly available datasets (Kaggle) and one dataset from Dhulikhel Hospital, with accuracies on Kaggle CXR = 98.21%; Dhulikhel CXR = 98.74%; Kaggle CT = 99.73%; and Dhulikhel CT = 97.3%. Furthermore, per-class precision, recall, and F1-scores all exceeded 96%, and all ROC–AUC values exceeded 0.99. In addition to more typical metrics, boundary-aware evaluation revealed good alignment with clinicians with edge-alignment cosine scores ranging from 0.27 to 0.34 for CXR and 0.48 to 0.49 for CT and intra-region variance below 0.015, while observing focused attention distributions as evidenced by Gini coefficients ≈0.58 for CXR, and ≈0.33 for CT. Statistical robustness was also confirmed with 95% bootstrap confidence intervals, all reaching significance over single-stream baselines, and particularly emphasizing reduction in false negatives of pneumonia positive cases. These results show that the proposed approach fills the important gap between high diagnostic accuracy and preserving anatomical boundaries, improving clinical trust and understanding in pneumonia detection.
Fields of Study & Subjects
COVID-19 diagnosis using AI
Image Processing Techniques and Applications
Lung Cancer Diagnosis and Treatment
Publication details
- Journal / source
- IEEE Access
- Publisher
- Institute of Electrical and Electronics Engineers (IEEE)
- Volume
- 14
- Pages
- 35633–35650
- Publication date
- 1 January 2026
- Language
- EN