Source-linked AI summary

Beyond Accuracy: Quantifying Pulmonary Attribution in Anatomy-Guided Chest X-Ray Classification Under Domain Shift

Abdullah Al Mamun, Md. Nasif Osman Khansur, Md Ashraful Hossen Akash, Md. Kishor Morol, Tze Hui Liew

arXiv:2608.30467v1cs.CV

TL;DR

CXR classifiers can perform well without demonstrating pulmonary attribution, motivating evaluation beyond accuracy. The study introduces DBCA-SegNet-MGAP, which integrates a soft lung prior into classification and measures attribution containment alongside diagnostic and external-shift behavior. MGAP substantially increases pulmonary attribution containment with little internal F1 change, while locked external testing shows that discrimination, calibration, and attribution can diverge.

  • Problem

    Strong CXR classification performance does not establish whether decision-related attribution is concentrated within clinically relevant pulmonary anatomy.

  • Method

    DBCA-SegNet-MGAP combines CNN–Transformer representations, soft lung-mask prediction, MGAP, ALR, cALR@0.9, matched GAP/MGAP comparisons, and locked Shenzhen-to-Montgomery testing.

  • Results

    MGAP increased ALR from 0.3878 ± 0.0098 to 0.7086 ± 0.0104 and cALR@0.9 from 0.5265 ± 0.0101 to 0.9905 ± 0.0018, while weighted F1 remained essentially unchanged; externally, ROC-AUC remained 0.9080 ± 0.0043 but weighted F1 decreased to 0.7528 ± 0.0080 and ECE increased to 0.1683 ± 0.0055.

  • Takeaways & Limitations

    Diagnostic performance, calibration, and pulmonary attribution containment are distinct properties that should be evaluated jointly under internal testing and external domain shift.

  • Takeaways & Limitations

    Because Grad-CAM is computed on the mask-influenced representation, higher pulmonary containment is partly an expected consequence of the intervention being measured.

Abstract

from arXiv · show

Deep-learning models can achieve strong chest X-ray (CXR) classification performance without establishing whether their predictions predominantly rely on pulmonary image content. This study evaluates pulmonary attribution containment as an anatomy-related reliability property distinct from diagnostic performance. We propose DBCA-SegNet-MGAP, a multi-task anatomy-guided CNN-Transformer framework that combines complementary feature representations through bidirectional cross-backbone attention, predicts a soft lung mask, and incorporates this anatomical prior directly into classification through Mask-Guided Adaptive Global Average Pooling (MGAP). Pulmonary attribution containment is quantified using the Anatomical Local Energy Ratio (ALR) and high-intensity cumulative ALR (cALR@0.9). Experiments were repeated across three training seeds using the COVID-19 Radiography Database for four-class internal testing and a locked Shenzhen-to-Montgomery protocol for zero-shot external tuberculosis testing. On COVID-19, the proposed model achieved a weighted F1 of $0.9615 \pm 0.0015$ and macro ROC-AUC of $0.9906 \pm 0.0007$. In an architecture-matched dual-bridge comparison, replacing conventional GAP with MGAP increased ALR from $0.3878 \pm 0.0098$ to $0.7086 \pm 0.0104$ and cALR@0.9 from $0.5265 \pm 0.0101$ to $0.9905 \pm 0.0018$, while weighted F1 remained essentially unchanged ($0.9618 \pm 0.0015$ vs. $0.9615 \pm 0.0015$). Under locked external transfer to Montgomery, ROC-AUC remained $0.9080 \pm 0.0043$ and pulmonary ALR remained $0.6466 \pm 0.0081$, whereas weighted F1 decreased to $0.7528 \pm 0.0080$ and ECE increased to $0.1683 \pm 0.0055$. These findings show that diagnostic discrimination, calibration, and pulmonary attribution containment are distinct model properties and support their joint evaluation under internal testing and external domain shift.

1. Introduction

The introduction frames pulmonary attribution containment, calibration, and external robustness as distinct from diagnostic performance. It presents DBCA-SegNet-MGAP and controlled evaluations to make anatomical attribution measurable and testable.

  • Motivation: Strong CXR diagnostic performance does not establish whether predictions use diagnostically meaningful pulmonary evidence.Non-pulmonary image borders, embedded text, acquisition characteristics, and dataset signatures may correlate with labels.
  • Motivation: Learning pulmonary anatomy accurately does not necessarily mean the classifier uses pulmonary features during classification.An auxiliary segmentation task can coexist with classification that aggregates pulmonary and extrapulmonary information.
  • Approach: MGAP uses a jointly predicted soft lung mask to weight spatial features during normalized pooling while retaining the complete radiograph for feature encoding.This differs from hard cropping and directly incorporates the anatomical prior into classification.
  • Evaluation: ALR and cALR@0.9 quantify cohort-level pulmonary attribution containment rather than lesion localization, causal explanation, or diagnostic correctness.The study also uses architecture-matched GAP and MGAP comparisons, repeated across three training seeds.
  • Approach: DBCA-SegNet-MGAP combines ResNet-50 and Swin-Tiny representations through bidirectional feature exchange and jointly predicts a continuous lung probability map.The lung map supports both auxiliary anatomical supervision and mask-guided feature aggregation.
  • Evaluation: The evaluation separates diagnostic competence, pulmonary attribution containment, calibration, and external robustness under internal and locked external testing.The study does not claim universal superiority of a particular backbone, attention block, or pooling architecture.

2. Related Work

Prior work combines CNNs, Transformers, anatomical guidance, and saliency analysis, but leaves open whether learned pulmonary anatomy is used by classification. This study positions direct anatomical aggregation and cohort-level attribution measurement as the experimental gap.

  • Hybrid representation learning: CNNs provide localized texture and morphology biases, while hierarchical Transformers provide complementary contextual modeling for CXR representation learning.Hybrid methods exploit both properties, but cross-attention alone is not the central contribution here.
  • Anatomical guidance: Anatomical guidance has been implemented through lung cropping, part-aware representations, auxiliary segmentation, spatial attention, and feature refinement.These approaches demonstrate that anatomical priors can influence thoracic classification.
  • Anatomical guidance: Successful lung segmentation does not establish that the final classifier relies strongly on pulmonary features.An auxiliary decoder may predict lung anatomy well while the classifier continues aggregating extrapulmonary information.
  • Explainability and attribution: Qualitative Grad-CAM and Layer-CAM visualizations provide limited evidence about cohort-wide attribution, localization, or explanation faithfulness.The study therefore uses quantitative pulmonary containment metrics rather than selected heatmaps alone.
  • Explainability and attribution: ALR measures attribution mass inside the pulmonary field, while cALR@0.9 tests whether the strongest retained attribution is pulmonary.Neither metric is interpreted as lesion localization, explanation faithfulness, or causal reasoning.
  • Research gap: The unresolved gap is connecting a learned pulmonary prior to classifier aggregation while isolating that intervention and testing reliability under cohort shift.The framework treats anatomical prediction, anatomical use, diagnostic performance, and external reliability as related but separate properties.

3. Methodology

The study uses separate COVID-19 and TB tracks to evaluate diagnostic, anatomical, calibration, and external-shift properties. Its hierarchy combines baselines, capacity control, matched GAP/MGAP comparisons, and locked Montgomery testing.

  • Study design: The retrospective computational design evaluates diagnostic discrimination, probability calibration, pulmonary segmentation, pulmonary attribution containment, and external robustness.External robustness is assessed through a locked cross-cohort TB experiment.
  • Study tracks: The COVID-19 track performs four-class classification, while the TB track develops and internally tests on Shenzhen before external testing on Montgomery.The task-specific models use separate classifier outputs and checkpoints.
  • Experimental hierarchy: The experimental hierarchy includes conventional pretrained baselines, a lightweight capacity control, architecture-matched GAP/MGAP conditions, and the complete DBCA-SegNet-MGAP framework.Montgomery is reserved for external testing and excluded from training, selection, recalibration, normalization adaptation, and threshold optimization.
  • Datasets: The COVID-19 Radiography Database contains 21,165 radiographs with paired lung masks and fixed training, selection, and held-out internal-test partitions.Image-level partitioning was used because reliable patient identifiers were not consistently exposed, which is retained as a study limitation.
  • Datasets: Shenzhen contains 662 frontal CXRs with fixed training, model-selection, and internal-test partitions, paired with teacher-generated pulmonary pseudo-masks.These pseudo-masks provide auxiliary supervision but are not independent expert reference standards.
  • Datasets: Montgomery contains 138 frontal CXRs with manual left- and right-lung masks whose union defines the pulmonary reference region, and all cases are reserved for external testing.The dataset includes 80 Normal and 58 TB cases.

3.3. Data preparation and reproducibility

Data preparation uses explicit image–mask manifests, fixed stratified partitions, deterministic preprocessing, synchronized augmentation, class balancing, and reproducible execution across training seeds.

  • Manifest construction: Image–mask manifests record paths, labels, dataset identity, mask associations, and provenance, with invalid or empty inputs terminating processing.Missing directories, masks, unreadable images, and empty manifests are not silently removed.
  • Partitioning: COVID-19 and Shenzhen partitions were generated once with split seed 42 and kept fixed throughout the multi-seed experiments.Ordered image identifiers and split fingerprints were stored and checked on resumed runs.
  • Preprocessing: COVID-19 images received CLAHE enhancement, while Shenzhen used curated stored images and Montgomery received predefined CLAHE before external inference.The dataset-specific preprocessing rule was fixed before Montgomery testing and not selected using Montgomery outcomes.
  • Preprocessing: Images were aspect-ratio resized to a longest dimension of 224 pixels, zero-padded to 224×224, and paired masks were resized with nearest-neighbor interpolation.ImageNet normalization was then applied.
  • Augmentation: Training-only augmentation was applied synchronously to image–mask pairs, while selection and test images received deterministic preprocessing only.The policy included limited shifts, scaling, rotation, brightness/contrast changes, and horizontal flipping.
  • Balancing and reproducibility: A weighted random sampler with replacement addressed class imbalance, and deterministic generators plus disabled cuDNN benchmarking supported reproducible execution.The setup initialized Python, NumPy, PyTorch, worker, and sampling generators for each seed.

3.4. Proposed DBCA-SegNet-MGAP framework

DBCA-SegNet-MGAP combines complementary CNN and Transformer representations with bidirectional cross-backbone interaction, pulmonary segmentation, and mask-guided classification.

  • Encoder and feature exchange: The framework combines ResNet-50 and Swin-Tiny representations through intermediate bidirectional cross-backbone interactions.The architecture integrates local convolutional features with hierarchical Transformer context.
  • Encoder and feature exchange: BCAB1 and BCAB2 exchange features at 28 × 28 and 14 × 14 resolutions before final 7 × 7 multi-scale fusion.The updated ResNet representation is propagated through the final ResNet stage, allowing the second interaction to influence classification.
  • Pulmonary segmentation: A progressive decoder reconstructs a continuous lung probability map from fused features and multiscale ResNet skip connections.The decoder uses five upsampling stages with skip features at 14 × 14, 28 × 28, 56 × 56, and 112 × 112.
  • Mask-guided classification: MGAP uses the predicted soft lung mask to continuously weight normalized spatial feature aggregation before classification.The mask is retained as a soft weighting mechanism rather than converted into a hard crop, followed by dropout and a linear classifier.
  • Mask-guided classification: Architecture-matched GAP controls retain the same preceding representation while omitting soft-mask weighting.This design isolates the anatomical aggregation intervention from changes in upstream representation.

3.5. Multi-task training and optimization

The study jointly optimizes disease classification and pulmonary segmentation using specified cross-entropy, label-smoothing, binary cross-entropy, and Dice objectives under a shared AdamW training configuration.

  • Training objectives: Disease classification uses cross-entropy with label smoothing α = 0.05.The loss is defined for the reference class y.
  • Training objectives: Pulmonary decoding uses binary cross-entropy with logits plus soft Dice loss.The segmentation objective operates on predicted mask probabilities and reference pixels.
  • Optimization configuration: Models train for 30 epochs with AdamW, an initial learning rate of 2 × 10^-4, cosine annealing toward 10^-6, and effective batch size 16.Gradients are clipped at norm 1.0, training uses FP32, and the best checkpoint is selected by model-selection weighted F1.

3.6. Baselines and controlled experimental design

The experimental design compares conventional pretrained classifiers with capacity controls and architecture-matched GAP/MGAP conditions to isolate representation and pooling effects.

  • Diagnostic baselines: Four pretrained classifiers—ResNet-50, Swin-Tiny, DenseNet-121, and ConvNeXt-Tiny—serve as conventional diagnostic baselines.Each uses its pretrained feature extractor, conventional GAP, dropout, and a task-specific linear classifier.
  • Controlled comparisons: The factorial mechanism experiment crosses late fusion, single-bridge BCAB1, and dual-bridge BCAB1+BCAB2 representations with GAP or MGAP.A lightweight EfficientNet-B0/TinyViT-5M pair provides capacity control but is not used to infer the BCAB effect.

3.7. Evaluation and statistical analysis

Evaluation spans diagnostic performance, calibration, segmentation, pulmonary attribution containment, external transfer, and computational complexity, with three-seed variability reported as sample SD.

  • Diagnostic performance and calibration: Diagnostic evaluation reports accuracy, weighted F1, macro F1, and ROC-AUC, while binary TB testing additionally reports threshold-dependent sensitivity and specificity.Multiple metrics are retained because metric choice can alter interpretation and ranking.
  • Diagnostic performance and calibration: Calibration is summarized using 15-bin Expected Calibration Error, with B_m denoting samples assigned to confidence bin m.ECE compares accuracy and confidence within confidence bins.
  • Segmentation: Lung segmentation is evaluated with Dice after thresholding predicted lung masks at 0.5, using dataset-specific reference masks.These measurements assess lung-field segmentation rather than disease-lesion localization.
  • Pulmonary attribution containment: Grad-CAM quantifies pulmonary attribution using ALR and cALR@0.9, while Layer-CAM provides a complementary higher-resolution qualitative view.The metrics describe attribution containment, not lesion localization, explanation faithfulness, or causal evidence.
  • Statistical and computational analysis: Results are independently repeated with seeds 12, 42, and 112 and summarized as mean ± sample SD, which is not treated as a formal confidence interval.Throughput is interpreted only as a within-study comparison because it depends on hardware and implementation.
  • External testing: External transfer freezes the Shenzhen-selected checkpoint before evaluating all 138 Montgomery radiographs without target-domain training, recalibration, or threshold optimization.ROC-AUC, weighted F1, ECE, and pulmonary attribution are reassessed under the locked protocol.

4. Results

DBCA-SegNet-MGAP maintained strong internal diagnostic performance while substantially increasing pulmonary attribution containment through MGAP, with distinct behavior across conventional metrics, calibration, and external transfer.

  • Internal diagnostic performance: 0.9615 ± 0.0015 weighted F1 and 0.9906 ± 0.0007 macro ROC-AUC were achieved on the four-class COVID-19 test set.ECE was 0.0247 ± 0.0013 across three training seeds.
  • Internal diagnostic performance: 0.9963±0.0009 F1 made COVID-19 the most consistently classified class, while Lung Opacity was the most difficult at 0.9372 ± 0.0024.Viral Pneumonia achieved 0.9798±0.0011 and Normal 0.9611 ± 0.0013.
  • Pulmonary attribution: 0.7086 ± 0.0104 ALR was highest for DBCA-SegNet-MGAP, despite Swin-Tiny having slightly higher weighted F1 and macro AUC.Swin-Tiny had weighted F1 0.9627, macro AUC 0.9934, and ALR 0.2415.
  • Pulmonary attribution: Replacing GAP with MGAP increased dual-bridge ALR from 0.3878 ± 0.0098 to 0.7086 ± 0.0104 and cALR@0.9 from 0.5265 ± 0.0101 to 0.9905 ± 0.0018.Weighted F1 remained essentially unchanged in the matched comparison.
  • Segmentation and attribution: 0.9849±0.0010 Dice with GAP versus 0.9812±0.0014 with MGAP contrasted with ALR values of 0.3878 and 0.7086, respectively.Accurate lung-mask prediction did not by itself imply concentrated classifier attribution.
  • External transfer: 0.7528 ± 0.0080 Montgomery weighted F1 and 0.1683 ± 0.0055 ECE followed locked Shenzhen-to-Montgomery transfer, while ROC-AUC was 0.9080 ± 0.0043.The transfer used no target-domain fine-tuning, recalibration, checkpoint reselection, or threshold optimization.
  • External transfer: 0.6293 ± 0.0079 Montgomery ALR with DBCA-Light + MGAP accompanied weighted F1 decreasing from 0.7509 ± 0.0068 to 0.5440 ± 0.0069.The lightweight MGAP configuration also had lower AUC than its GAP counterpart.
  • Model complexity and efficiency: 86.9% lower parameter count characterized the lightweight configurations, but they did not reproduce the complete framework’s overall external reliability profile.Within the complete architecture, MGAP did not increase parameter count or checkpoint size and throughput remained similar.

5. Discussion

The discussion argues that diagnostic competence, pulmonary attribution, calibration, and external robustness are separable properties. MGAP consistently changed attribution containment more than diagnostic performance, but pulmonary containment alone did not ensure transferable or clinically valid behavior.

  • Diagnostic competence and pulmonary attribution: Similar diagnostic performance can coexist with substantially different pulmonary-attribution distributions, so conventional metrics do not determine attribution concentration.Swin-Tiny slightly exceeded DBCA-SegNet-MGAP in weighted F1 and macro AUC but had less than half its mean ALR.
  • Diagnostic competence and pulmonary attribution: ALR and cALR provide a reproducible containment-oriented view that remains narrower than lesion localization or causal explanation.The metrics address whether attribution is pulmonary-contained rather than whether it identifies lesions.
  • MGAP as a controlled anatomical aggregation intervention: MGAP increased ALR by approximately 0.32 across late-fusion, single-bridge, and dual-bridge representations while producing smaller, representation-dependent weighted-F1 changes.Its most reproducible consequence was altering attribution distribution rather than diagnostic performance.
  • MGAP as a controlled anatomical aggregation intervention: Higher Dice with GAP but much lower ALR than MGAP shows that accurate pulmonary anatomy prediction is not equivalent to preferential pulmonary classifier attribution.Connecting the soft mask directly to normalized aggregation makes the relationship operational rather than implicit.
  • External transfer: 0.65 approximate ALR and near-0.99 cALR@0.9 were retained on Montgomery even as threshold-dependent performance and calibration worsened.External robustness therefore comprises multiple properties that can transfer differently.
  • Strong pulmonary containment is not sufficient for robust transfer: High pulmonary containment in DBCA-Light + MGAP did not prevent a sharp external weighted-F1 decline relative to DBCA-Light + GAP.Containment alone did not guarantee disease features that generalized across cohorts.
  • Strong pulmonary containment is not sufficient for robust transfer: Whole-lung containment can coexist with cohort-specific pulmonary texture, acquisition effects, projection differences, and non-pathological variation.Pulmonary containment should therefore remain one reliability dimension rather than a surrogate for robustness or clinical validity.
  • Efficiency and reliability: 86.9% lower complexity was achievable, but no evaluated configuration simultaneously optimized diagnostic performance, calibration, anatomical containment, external transfer, and computational efficiency.Efficiency and reliability were treated as separate properties.

6. Conclusion and Future Work

The study shows that diagnostic performance, pulmonary attribution containment, calibration, and external robustness are distinct properties that should be evaluated jointly. External transfer preserved some reliability measures while degrading diagnostic performance and calibration, supporting a reliability-oriented rather than deployment-ready interpretation.

  • Conclusion: 0.9615 ± 0.0015 weighted F1 and 0.9906 ± 0.0007 macro ROC-AUC were achieved on the four-class COVID-19 task.These results were averaged across three training seeds.
  • Conclusion: ALR increased from 0.3878 ± 0.0098 to 0.7086 ± 0.0104 and cALR@0.9 from 0.5265 ± 0.0101 to 0.9905 ± 0.0018 when GAP was replaced with MGAP, while weighted F1 remained essentially unchanged.The comparison used the complete dual-BCAB representation.
  • Conclusion: 0.9080 ± 0.0043 ROC-AUC and strong pulmonary attribution containment were retained on Montgomery, while weighted F1 decreased to 0.7528 ± 0.0080 and ECE increased to 0.1683 ± 0.0055.The locked Shenzhen-to-Montgomery experiment showed that reliability properties did not transfer equally.
  • Conclusion: Pulmonary containment is not sufficient evidence of robust generalization, because the lightweight MGAP configuration combined strong containment with substantial external diagnostic degradation.This counterexample separates attribution containment from external diagnostic robustness.
  • Limitations: ALR and cALR should remain containment metrics rather than evidence of lesion localization, causal reasoning, or clinical correctness.The framework should therefore be viewed as a controlled reliability-oriented research framework rather than evidence of clinical deployment readiness.
  • Future Work: Future work should expand multi-center and prospective external evaluation, use expert lesion annotations and perturbation-based faithfulness tests, and investigate independent calibration cohorts and clinically motivated operating points.The paper also identifies model compression, lower-cost cross-backbone interaction, and reliability-aware knowledge distillation as future directions.
Loading 2608.30467v1…