Abstract
As the COVID-19 pandemic puts pressure on healthcare systems worldwide, the computed tomography image based AI diagnostic system has become a sustainable solution for early diagnosis. However, the model-wise vulnerability under adversarial perturbation hinders its deployment in practical situation. The existing adversarial training strategies are difficult to generalized into medical imaging field challenged by complex medical texture features. To overcome this challenge, we propose a Contour Attention Preserving (CAP) method based on lung cavity edge extraction. The contour prior features are injected to attention layer via a parameter regularization and we optimize the robust empirical risk with hybrid distance metric. We then introduce a new cross-nation CT scan dataset to evaluate the generalization capability of the adversarial robustness under distribution shift. Experimental results indicate that the proposed method achieves state-of-the-art performance in multiple adversarial defense and generalization tasks. The code and dataset are available at https://github.com/Quinn777/CAP.
Introduction
Deep learning models for medical imaging face two major hurdles before they can be safely deployed in clinics: adversarial vulnerability and distribution shift. Small, imperceptible perturbations added to a CT scan can trick a model into misdiagnosing a patient. Standard adversarial training (AT) often fails in medicine because medical images have complex, subtle textures that are easily confused with noise. Furthermore, a model trained on data from one hospital might fail when used on data from another due to differences in CT scanners and patient demographics. Existing defense methods often "overfit" to specific noise types or destroy important structural information during data augmentation, leading to poor generalization.
The CAP Framework
To address these challenges, we propose the Contour Attention Preserving (CAP) framework. CAP forces Vision Transformers (ViTs) to focus on stable anatomical structures—specifically lung contours—to maintain diagnostic accuracy even when input data is corrupted or comes from an unfamiliar source.
The framework consists of three pillars:
- Contour-Preserving Data Augmentation: Using a self-guided filter to extract lung cavity edges, ensuring the model retains critical anatomical landmarks during training.
- Attention Parameter Regularization: Injecting contour information into the ViT architecture via "negative weight noise." This forces the attention mechanism to prioritize the lung area over irrelevant features like the spine.
- Hybrid Distance Metric: Introducing Square Error (SE) for external minimization to avoid "gradient vanishing" issues common with KL divergence, ensuring smoother convergence during adversarial updates.
Experimental Evaluation
We evaluated CAP using several datasets, including SARS-COV-2 (Brazil), MosMed (Russia), and a new cross-nation benchmark, COVID19-C, containing 1,747 images from 10 different countries.
Key Results
- State-of-the-Art Robustness: CAP achieved the highest adversarial accuracy across five attack types, improving upon the previous best method (FAT) by 4.34% on average using a Visformer-Tiny backbone.
- Superior Generalization: On the COVID19-C dataset, CAP outperformed SOTA baselines by over 3% on average, demonstrating its ability to handle distribution shifts across different countries.
- Interpretability: Saliency maps reveal that CAP produces sharper, more anatomically correct focus areas compared to vanilla training or TRADES.
Conclusion
CAP significantly improves the robustness and generalization of COVID-19 diagnostic models by anchoring their reasoning in stable anatomical priors. While a slight "robustness-accuracy trade-off" exists, the gains in safety and cross-site reliability are substantial. Future work will explore applying these contour-preserving techniques to other organ-based diagnoses where structural boundaries are critical.
Summary updated