TL;DR
This paper introduces GNS-HFA, a powerful new method for generating transferable adversarial attacks against Vision Transformers (ViTs). By identifying and scaling "mild" gradients to prevent overfitting and targeting high-frequency image features that ViTs are uniquely sensitive to, the authors achieve state-of-the-art attack success rates that significantly outperform existing methods on both ViT and CNN architectures.
The Problem: Transferability in ViT Attacks
Adversarial attacks expose vulnerabilities in AI models by adding imperceptible noise to inputs, causing incorrect predictions. In "black-box" scenarios, attackers lack access to the target model's internal parameters, so they rely on "transferable attacks": crafting an adversarial image on a local "surrogate" model and hoping it successfully fools the target model.
While transferable attacks work well on Convolutional Neural Networks (CNNs), they often fail on Vision Transformers (ViTs) due to structural differences. Previous attempts to fix this focused on penalizing "extreme" gradients (very large or small values), but these methods often overfit the surrogate model, leading to poor transferability. The authors set out to find a more fine-grained way to edit gradients and exploit the specific ways ViTs process images compared to CNNs.
The GNS-HFA Approach
The authors propose a two-pronged approach called GNS-HFA:
- Gradient Normalization Scaling (GNS): Instead of just removing extreme gradients, the authors discovered that "mild" gradients (those with small magnitudes) are actually the primary cause of overfitting in ViTs. GNS identifies these mild gradients at the channel level and applies a $tanh$-based scaling function. This "soft" editing prevents the attack from becoming too specialized to the surrogate model's quirks while preserving the information needed for a successful attack.
- High-Frequency Adaptation (HFA): ViTs rely more heavily on high-frequency information (like sharp edges and fine textures) than CNNs. HFA exploits this by using a Discrete Cosine Transform (DCT) to move the image into the frequency domain. It then applies a mask to specifically target and perturb high-frequency regions before transforming the image back.
Evaluation Setup
The researchers evaluated their method using 1,000 randomly selected images from the ILSVRC 2012 (ImageNet) validation set. They tested the transferability of attacks across a wide range of models:
- 8 ViT variants: Including LeViT, PiT, DeiT, ViT-B/16, TNT, ConViT, Visformer, and CaiT.
- 7 CNN models: Including standard architectures like Inception-v3/v4 and ResNet-101, as well as models specifically trained to resist adversarial attacks (ensemble-adversarial models).
Key Insights
- The "Mild Gradient" Culprit: The most surprising finding is that small, "mild" gradients—not just the extreme ones—are the main drivers of overfitting in ViT attacks. Removing or scaling these mild gradients significantly boosts how well an attack transfers to a new model.
- Frequency Domain Sensitivity: ViTs and CNNs "attend" to different parts of an image's frequency spectrum. Visualizations confirm that ViTs focus much more on high-frequency details, making them highly vulnerable to targeted noise in those specific bands.
- Fine-Grained vs. Coarse Editing: Previous methods treated entire functional regions (like an entire attention layer) the same. GNS-HFA operates at the channel level, allowing for much more precise "editing" of the gradients during the attack's training phase.
Performance Highlights
GNS-HFA achieved massive performance gains over existing state-of-the-art (SOTA) methods like TGR and PNA:
- Average Improvement: The method showed a 33.54% average improvement in Attack Success Rate (ASR) on ViT models and a 42.05% improvement on CNN models.
- Cross-Architecture Success: Attacks generated on a ViT surrogate were highly effective at "fooling" CNNs, and vice versa, proving the robustness of the transferability.
- Breaking Defenses: Even against models specifically hardened with adversarial training, GNS-HFA maintained high success rates, often outperforming competitors by double-digit margins.
Limitations and Future Directions
- Perturbation Visibility: As with many adversarial attacks, increasing the attack's strength makes it more successful but also more visible to the human eye. Finding the perfect balance remains an ongoing challenge.
- Computational Cost: The use of DCT/IDCT and multiple frequency samples adds some computational overhead to the attack generation process compared to simpler spatial-domain methods.
- Future Directions: The authors suggest that exploring even more sophisticated frequency-domain masks or adaptive scaling techniques could further unveil vulnerabilities in safety-critical ViT applications.
Summary updated