A Novel CNN with Spatial and Channel Attention for Automated Chest X-Ray Diagnosis
Abstract
This study proposes a novel Convolutional Neural Network (CNN) approach with both spatial and channel attention mechanisms to improve automated chest X-ray image classification. The architecture integrates Squeeze-and-Excitation (SE) Blocks for channel attention and a spatial method to focus on informative regions of the sample, thereby enhancing both local and global feature extraction. The model processes input images of size 224×224×3 and comprises three convolutional blocks, each consisting of Conv2D, Batch Normalization, SE Blocks, Spatial Attention, MaxPooling, and Dropout layers. The dataset, sourced from Kaggle, contains 6,000 chest X-ray images categorized into three classes: Lung Opacity, Normal, and Viral Pneumonia. A standardized preprocessing pipeline was employed, including resizing, normalization (rescaling pixel values to [0, 1]), and real-time augmentation via TensorFlow’s ImageDataGenerator. The model was trained for 10 epochs using a batch size of 32. It achieved a final test accuracy of 93.01%, with a peak validation accuracy of 88.57%, and an Area Under the Curve (AUC) score of 97.22%.
Full Text:
PDFDOI: https://doi.org/10.31449/inf.v49i3.9065
This work is licensed under a Creative Commons Attribution 3.0 License.








