DetectViT detects ViT backdoors via anomalous attention patterns
DetectViT can identify backdoor attacks in vision transformers at test time with 100% true positive rate and 0.17% false positive rate
AI/ML arXiv 18 Nov 2026 Defense Prototype evidence
Published as “DetectViT: Test-time Backdoor Detection for Vision Transformers via Inter-Head Attention Discrepancy”
Why it matters
DetectViT enables practical, low-overhead backdoor screening for deployed ViT-based systems without needing clean data or model outputs.
Summary
DetectViT detects backdoor samples in Vision Transformers by measuring two attention anomalies-high inter-head overlap and high variance in attention concentration-using only the model's attention weights and a tiny OOD calibration set. It achieves perfect true-positive detection (100%) with a false-positive rate as low as 0.17% on the BadCLIP attack, and runs faster than all baselines (≈0.016 s per sample). However, under adaptive attacks that explicitly penalize its detection scores, detection rates can collapse (e.g., TPR 0.32% on BadCLIP), showing the method is not universally robust.
What they found 2
- DetectViT attains 100% true positive rate and 0.17% false positive rate on BadCLIP.
“achieving a true positive rate of 100% and a false positive rate of 0.17% on BadCLIP.”
- DetectViT has the lowest per-sample detection time among all evaluated methods.
“DetectViT achieves the lowest detection time across all four settings.”
Caveats 4
- Scons + Svar 0.32 0.61 14.93 61.42
- Scons + Svar 0.00 0.26 11.00 83.00
- First, it cannot defend against OOD-as-trigger attacks [36], where the backdoor is activated by natural OOD features without any crafted trigger, making poisoned samples indistinguishable from clean ones at inference time.
- Second, the detection signals rely on CLS-to-patch attention weights, which may not generalize to architectures without a CLS token, leaving extension to such settings as future work.
What’s new here 4
- Detects backdoors without any training data, model outputs, or trigger knowledge.
- Uses inter-head attention consistency and entropy variance as detection signals, a focus on internal ViT dynamics.
- Works across classification and captioning tasks, handling models with free-form text outputs.
- Requires only a handful (64-128) of OOD samples and adds negligible inference overhead.