Multi-Dataset Benchmarking, Novel DefenseMechanisms, and Mechanistic Analysis ofAttention Collapse in Vision Transformers UnderAdversarial Stress
Vision Transformers (ViTs) have set a new standard of performance across arange of computer-vision benchmarks. However, as these models move towarddeployment in critical settings such as autonomous driving, medical diagnostics,and traffic-sign recognition, their vulnerability to adversarial attacks must beevaluated systematically and holistically. This paper presents an extensive empir-ical study of the adversarial robustness of ViT-Base (ViT-B/16), fine-tuned andevaluated across seven diverse datasets: CIFAR-10, CIFAR-100, Tiny-ImageNet,SVHN, GTSRB, MedMNIST-Path, and ImageNet-1K. We systematically bench-mark thirteen adversarial attack strategies spanning white-box gradient-basedmethods (FGSM, PGD-ℓ∞/ ℓ2/ ℓ1, C&W, AutoAttack, DiffPGD), score-basedblack-box attacks (Square Attack, NES, SPSA), transfer attacks using CNNsurrogates, and physically realizable patch attacks. Our results confirm a catas-trophic norm-dependent vulnerability: while ViTs exhibit natural resilience toℓ1/ℓ2-bounded and corruption-based perturbations—attributable to global self-attention acting as a distributed noise filter—they collapse to near-zero accuracyunder dense ℓ∞ white-box attacks. We provide a mechanistic explanation ofthis failure by analyzing attention entropy, query-key rank collapse, and CLS1token similarity degradation across attack types. To counter these vulnerabilities,we propose three defense strategies: (1) a PGD adversarial training frame-work augmented with patch masking and token dropout; (2) LeCam-regularizedadversarial training (LeCam-AT), a novel approach that enforces distributionalsmoothness in feature space; and (3) an Adaptive Ensemble Defense that dynam-ically routes inputs through specialized subnetworks. The proposed LeCam-AT+ Mask + Dropout defense achieves the best trade-off, recovering 34.2% accu-racy under PGD-ℓ∞ white-box attack compared with 0.04% in the undefendedbaseline, while retaining 92.8% clean accuracy. Full ablation studies, per-classrobustness analyses, extended metrics (F1, AUC, ECE, Brier score, AUROC,certified accuracy), and attention-map visualizations are provided.
Authors
- Kiran Bhowmick (ORCID: https://orcid.org/0000-0002-5689-8273)
- Meera Narvekar (ORCID: https://orcid.org/0000-0003-4602-4094)
- Omprakash Yadav
Institutions
- Dwarkadas J. Sanghvi College of Engineering (IN)
Publication Details
- Journal
- Research Square
- Published
- 2026-12-02
- DOI
- https://doi.org/10.21203/rs.3.rs-9807662/v1
- Primary Topic
- Adversarial Robustness in Machine Learning
- Type
- preprint