A research team led by Adekanmi Adegun and Serestina Viriri has engineered an explainable artificial intelligence framework that couples a DenseNet-169 deep convolutional neural network with a self-attention mechanism to classify diverse respiratory conditions from chest radiographs. By embedding a complete Query-Key-Value self-attention block into a hierarchical convolutional backbone alongside a two-tier explanation pipeline, the investigators established that deep neural networks can deliver superior diagnostic accuracy while exposing the internal and post-hoc mathematical rationales that govern individual medical predictions. Testing on benchmark collections confirmed that this integrated architecture improves disease recognition across both general respiratory ailments and coronavirus infections while operating within practical computational boundaries suited for clinical environments.
Diagnostic assessment of thoracic conditions remains one of the most critical challenges in global healthcare, as pulmonary illnesses represent leading causes of human mortality worldwide. Clinical evaluations rely heavily on medical imaging modalities such as standard chest radiographs, computed tomography, magnetic resonance imaging, and positron emission tomography. In routine practice, manual scrutiny of chest X-ray images is demanding, time-consuming, and prone to diagnostic error because of observer fatigue and inter-reader variability. Although machine learning and standard convolutional neural networks have been applied extensively to analyze radiographic examinations, conventional computer vision models struggle to isolate subtle pathological patterns from complex, variegated lung tissue. Large proportions of medical images contain anatomical structures that do not directly inform specific pathological diagnoses, creating background noise that complicates feature extraction. Incorporating dedicated attention mechanisms directly tackles this limitation by prioritizing salient regions of interest while capturing long-range spatial correlations across distributed radiographic fields.
The structural backbone of the proposed framework relies on DenseNet-169, an established convolutional architecture composed of four dense blocks separated by three transitional down-sampling operations. Within each dense block, individual layers operate with three-by-three convolutional kernels, Rectified Linear Unit activation functions, and batch normalization procedures, maintaining direct feed-forward connections that concatenate the feature vectors produced by all antecedent layers. This direct connectivity pattern preserves information transmission across varying depths, minimizes feature redundancy, and systematically enriches the volume of feature maps available for downstream classification. The network receives three-channel radiographic inputs with spatial dimensions of 224 by 224 pixels, initially processed through standard convolutional and pooling layers to generate high-level feature abstractions before reaching the custom self-attention module. DenseNet-169 serves as an optimal foundation because its dense parameter reuse allows high representational expressiveness while avoiding the excessive memory footprints that characterize bulkier convolutional architectures.
To overcome the localized receptive field constraints inherent to standard convolution, the researchers integrated a multi-channel self-attention module that explicitly models dependencies between spatially separated image elements. The self-attention block projects the incoming high-level feature representations into three distinct linear spaces—Query, Key, and Value—using separate one-by-one convolutional operations. Within this formulation, the Query vector encodes targeting information about an anatomical element, the Key defines the contextual content of comparing elements, and the Value carries the underlying semantic contribution to be aggregated. Scaled dot products between Query and Key representations establish dynamic compatibility scores, which are normalized through a softmax function and multiplied by the Value matrices to generate context-aware spatial representations. The attention module subsequently executes element-wise multiplication across feature channels, concatenating the resulting representations into a cohesive matrix that is evaluated by global average pooling and directed into final classification layers.
Transparency represents a fundamental hurdle in deploying artificial intelligence systems into real-world healthcare settings, as clinicians frequently reject predictive algorithms whose computational logic remains obscured. To address this opacity, the authors structured a dual-stage interpretability pipeline that combines intrinsic, layer-wise feature interrogation with post-hoc visual attribution. The intrinsic stage conducts channel-by-channel pixel evaluations within the intermediate layers, computing an attention weighting function that measures compatibility scores between query representations and feature vectors. Applying Rectified Linear Unit activations across these projections isolates positive influence channels that explicitly reinforce target disease classes while separating them from negative weights that suppress specific diagnostic categories. This internal audit reveals that the model makes decisions by balancing opposing channel contributions rather than relying on uniform activation, providing medical practitioners with an understandable breakdown of intermediate representations as radiographic data propagates toward deeper decision layers.
The second tier of the explanatory framework applies Gradient-weighted Class Activation Mapping directly after the final classification layer to produce localized, two-dimensional heatmaps over the original chest radiographs. By calculating the gradients of predicted disease scores with respect to the final convolutional feature maps, Grad-CAM highlights specific thoracic zones that drove the network’s automated classification. While Score-CAM generates tightly concentrated activation zones that pinpoint isolated pathological anomalies, Grad-CAM produces broader, continuous saliency fields that encompass diffuse inflammatory patterns. Because respiratory pathologies frequently manifest as multi-focal or anatomically extensive infiltrates, the broader Grad-CAM visualizations provide comprehensive coverage of distributed pulmonary changes, while Score-CAM helps isolate dominant localized foci, confirming that combining distinct explanatory perspectives clarifies model behavior.
Preparing raw radiographs for model training required a structured pre-processing and augmentation protocol to maintain stability and prevent overfitting on small image cohorts. Radiographs were resized to uniform dimensions of 224 by 224 pixels with aspect ratios preserved through center-cropping, followed by pixel normalization using standard ImageNet channel statistics to achieve zero mean and unit variance. Training data underwent stochastic on-the-fly augmentations, including random horizontal flipping, subtle perspective warping up to a magnitude of 0.10, rotations within plus or minus 10 degrees, zoom scaling up to 110 percent, and brightness and contrast modulations within a 0.20 variance window. The network was trained using the Adam optimizer with an initial learning rate between 1e-4 and 3e-3 identified through automated learning rate range finding. Training progressed across 20 epochs with a batch size of 64, weight decay set to 0.01, and a label smoothing factor of 0.1 on Linux virtual instances equipped with Nvidia T4 GPUs.
Validation experiments were conducted on two publicly accessible radiographic datasets to evaluate diagnostic performance across distinct pathological profiles. The first test environment utilized the Respiratory Diseases Dataset, comprising 6,743 chest radiographs divided into nine discrete diagnostic categories: 1,340 normal cases, 1,060 pneumonia infections, 678 higher density inflammations, 629 lower density inflammations, 644 obstructive pulmonary cases, 594 degenerative infectious diseases, 658 encapsulated lesions, 596 mediastinal changes, and 544 general chest changes. Under randomized dataset allocation with 80 percent allocated to training and 20 percent reserved for validation, the baseline DenseNet-169 network recorded 98.00 percent across accuracy, precision, recall, and F1-score. Incorporating the full self-attention module improved all four metrics to 99.00 percent. The training trajectory exhibited progressive convergence without late divergence between training and validation loss curves, achieving an eventual training accuracy of 99.40 percent alongside a low training loss of 0.6 percent.
Confusion matrix assessments on the respiratory diseases cohort demonstrated tangible diagnostic enhancements across challenging clinical categories. The attention-enhanced DenseNet-169 correctly identified 277 normal control scans compared to 269 identified by the standalone baseline. The hybrid model similarly improved the identification of degenerative infectious diseases from 120 to 121 cases, higher density inflammations from 126 to 129 cases, lower density inflammations from 131 to 135 cases, obstructive pulmonary diseases from 121 to 123 cases, and pneumonia from 206 to 208 cases, while maintaining matched detection counts for encapsulated lesions and mediastinal variations. In parallel, evaluations on the COVID-19 dataset, which encompasses 21,165 images spanning positive COVID-19 cases, normal lungs, lung opacity, and viral pneumonia, demonstrated that self-attention elevated overall diagnostic accuracy from 95.00 percent to 97.00 percent, with precision, recall, and F1-scores improving to 97.00, 98.00, and 97.00 percent, respectively, outperforming benchmark systems such as LungMaxViT and DarkCovidNet.
To isolate the precise algorithmic contribution of the self-attention components, the researchers executed a systematic ablation study comparing the proposed full Query-Key-Value structure against degraded variants. In the QV-only variation, which eliminated key projections and computed attention weights directly through queries, overall classification accuracy dropped to 95.19 percent, precision fell to 96.06 percent, and the F1-score dropped to 95.54 percent due to impaired matching flexibility. The QK-only architecture, which omitted dedicated value projections, produced an accuracy of 95.19 percent and an F1-score of 95.81 percent. The complete QKV model consistently outperformed both degraded configurations, securing 96.58 percent accuracy and a 97.12 percent F1-score. Furthermore, pairing the self-attention block with DenseNet-169 surpassed rival combinations built on VGG16, ResNet101, and EfficientNetB5, with DenseNet-169 achieving the highest area under the receiver operating characteristic curve at 99.57 percent while utilizing only 12,491,140 backbone parameters.
A critical consideration for real-world translation is whether complex explainability mechanisms impose excessive computational latency during inference. Benchmarking the baseline DenseNet-169 against the fully augmented network revealed that incorporating the self-attention module and two-stage explanation framework expanded the total parameter count from 12,491,140 to 15,952,261, representing a 27.71 percent increase. This architectural expansion elevated runtime GPU memory utilization by 211.07 megabytes, shifting total memory consumption from 2781.14 megabytes to 2992.21 megabytes, an increase of 7.59 percent. However, inference latency increased by only 0.62 milliseconds per examination, rising from 48.08 milliseconds to 48.70 milliseconds, a negligible 1.31 percent operational delay. Because the post-hoc explanatory heatmaps are generated without altering the underlying classification output, the framework demonstrates that high diagnostic precision, robust model explainability, and near-instantaneous execution can be successfully unified within modern computer-assisted radiographic diagnosis.
Subject of Research: Explainable deep learning framework combining DenseNet-169 and self-attention for respiratory disease classification
Article Title: Explainable Self-attention-based deep learning system for lung diseases classification and analysis
Article References: Adegun, A., & Viriri, S. (2026). Explainable Self-attention-based deep learning system for lung diseases classification and analysis. Informatics in Medicine Unlocked, Article 101840. https://doi.org/10.1016/j.imu.2026.101840
Image Credits: AI Generated
DOI: 10.1016/j.imu.2026.101840
Keywords: deep learning, DenseNet-169, self-attention mechanism, explainable artificial intelligence, chest radiography, Grad-CAM, Score-CAM, respiratory disease classification, COVID-19 detection, convolutional neural networks, medical image analysis, feature map visualization, ablation study, computational latency, pulmonary imaging, diagnostic transparency
News Source: Ophelia Keating. (November 24, 2026). Explainable Deep Learning System Improves Lung Disease Diagnosis From Chest Radiographs. Scienmag.



