Abstract
Transformer architectures, based on the self-attention mechanism, process images as sequences of patches. This fundamental departure from Convolutional Neural Networks (CNNs) necessitates a re-evaluation of their security, particularly regarding backdoor attacks. In these attacks, a model is poisoned with a trigger that manipulates its output at test time while maintaining high accuracy on clean data. This study compares state-of-the-art architectures, finding that while Vision Transformers (ViT) are generally less robust than CNNs, their attention mechanisms provide a unique opportunity for defense. Specifically, interpretation algorithms can effectively localize triggers in Transformers, enabling a test-time blocking defense that significantly reduces attack success rates.
Introduction: The Backdoor Threat
Deep learning models are increasingly vulnerable to backdoor attacks. An attacker poisons a small fraction of the training dataset by inserting a specific trigger—such as a small pixel patch—and associating it with a target class. For example, a "stop sign" with a "yellow square" might be labeled as a "speed limit sign." The resulting model appears healthy on standard benchmarks but misclassifies images whenever the trigger is present.
As the computer vision community transitions from CNNs to Vision Transformers (ViTs), understanding how these architectural differences impact security is critical. ViTs process images as sequences of patches, a method that differs significantly from the local convolutions of traditional networks.
Methodology and Datasets
The researchers performed a comprehensive evaluation across several architectures and attack types:
- Architectures: CNNs (VGG, ResNet), Vision Transformers (ViT, CaiT), and Feed-Forward Networks (ResMLP).
- Attacks: Three distinct methods were tested: BadNets (visible patches), Hidden Trigger Backdoor Attacks (HTBA) (feature-space optimized triggers), and WaNet (stealthy warping).
- Defense Strategy: The study explored using interpretability maps (Grad-CAM for CNNs and GradRollOut for ViTs) to identify malicious patches. This led to the development of Token Drop, a defense where the model ignores the most influential (likely poisoned) patches.
The study primarily utilized ImageNet, providing a realistic, large-scale environment for testing these vulnerabilities, moving beyond the smaller datasets typically used in backdoor research.
Key Insights: The Attention "Snitch"
A primary finding is that ViTs are "glass cannons"—highly performant but more susceptible to being fooled. The self-attention mechanism likely preserves low-level trigger features throughout the network, whereas CNNs tend to "wash out" these features through pooling layers.
However, the dynamic nature of attention serves as a "snitch." When a ViT is fooled by a trigger, its attention maps clearly highlight the malicious patch. In contrast, CNN heatmaps are often diffuse and fail to isolate the trigger.
Experimental Results
The quantitative results highlight a clear hierarchy of robustness:
- Vulnerability: ViT-Base exhibited an average Attack Success Rate (ASR) of 57.6%, compared to 39.8% for ResNet50.
- Robustness Champion: ResMLP, which uses linear layers instead of self-attention, was the most robust with an average ASR of only 26.0%.
- Defense Efficacy: The "Token Drop" method proved highly effective for ViTs. By masking the most attended-to regions at test time, the ASR for a poisoned ViT-Base dropped from 61.4% to 8.0%.
Conclusion and Future Work
While ViTs present new security challenges, their inherent ability to localize triggers offers a powerful path for defense. The study suggests that incorporating blocking mechanisms during training can further enhance robustness without sacrificing clean accuracy. Future work will explore whether these findings extend to multi-modal models like CLIP and other transformer-based tasks like object detection.
Summary updated