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

Institutions

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
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

Multi-Dataset Benchmarking, Novel DefenseMechanisms, and Mechanistic Analysis ofAttention Collapse in Vision Transformers UnderAdversarial Stress

Kiran Bhowmick, Meera Narvekar, Omprakash Yadav
Research Square
Adversarial Robustness in Machine Learning
preprint

Multi-Dataset Benchmarking, Novel DefenseMechanisms, and Mechanistic Analysis ofAttention Collapse in Vision Transformers UnderAdversarial Stress

Kiran Bhowmick, Meera Narvekar, Omprakash Yadav
preprint en

Abstract

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.

Research Square
Dwarkadas J. Sanghvi College of Engineering (IN)
Adversarial Robustness in Machine Learning
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon