Background: Chest X-ray (CXR) image classification remains a critical tool in COVID-19 and pneumonia diagnosis. While segmentation of lung fields is commonly assumed to improve deep learning classification performance, recent evidence suggests that segmentation may also remove clinically relevant contextual cues. Attention mechanisms, particularly those that combine spatial and channel information, have shown potential to enhance model focus and generalizability. Objective: This study investigates the effectiveness of the proposed Self-Adaptive Convolutional Block Attention Module (SA-CBAM) in improving CXR image classification performance when tested on both segmented and unsegmented images. In addition, the benefit of hybridization of Convolutional Neural Network (CNN) with a Long Short-Term Memory (LSTM) network is evaluated. Methods: A U-Net segmentation model was used to extract lung regions from the COVID-QU-Ex dataset. Multiple model variants were implemented and compared, including a baseline CNN, CNN models integrated with several channel–spatial attention mechanisms, and the proposed SA-CBAM. In addition, hybrid architectures combining CNN with LSTM networks were evaluated. All models were assessed on both segmented and unsegmented CXR pipelines using accuracy, recall, specificity, F1-score, and Matthews Correlation Coefficient (MCC) as primary performance metrics. Results: Models trained on unsegmented CXR consistently outperformed those trained on segmented images. The proposed CNN-SA-CBAM improved baseline CNN performance from 88.42% to 90.08% accuracy and from 82.82% to 85.36% MCC when trained on unsegmented data. Further hybridization with an LSTM network produced the highest performance, where the CNN-SA-CBAM-LSTM achieved 99.90% accuracy and 99.85% MCC on unsegmented CXR. Despite segmentation producing visually clearer attention maps, classification performance was lower, suggesting potential loss of subtle contextual cues outside the segmented lung boundaries. Conclusion: The findings demonstrate that SA-CBAM significantly enhances CXR classification performance, particularly when applied to unsegmented images and further combined with LSTM. This study challenges the common assumption that segmentation always improves classification accuracy and highlights the importance of preserving contextual information. Future work will focus on adaptive or soft segmentation strategies that retain peripheral cues while preserving anatomical interpretability.
Shaari et al. (Tue,) studied this question.