Skip to main content
QUICK REVIEW

[Paper Review] Adversarial Token Attacks on Vision Transformers

Ameya Joshi, Gauri Jagatap|arXiv (Cornell University)|Oct 8, 2021
Adversarial Robustness in Machine LearningComputer Science51 references9 citations
TL;DR

This paper introduces a block-sparse, patch-based adversarial attack targeting Vision Transformers (ViTs) by perturbing specific image patches, revealing that ViTs are significantly more vulnerable to such token-level attacks than ResNets, with robust accuracy dropping to near zero using just 1% of pixels. The method demonstrates that ViTs are less robust than ResNets and MLP-Mixer under realistic, sparse, and structured attacks, challenging prior claims of ViT robustness under $ε$-bounded attacks.

ABSTRACT

Vision transformers rely on a patch token based self attention mechanism, in contrast to convolutional networks. We investigate fundamental differences between these two families of models, by designing a block sparsity based adversarial token attack. We probe and analyze transformer as well as convolutional models with token attacks of varying patch sizes. We infer that transformer models are more sensitive to token attacks than convolutional models, with ResNets outperforming Transformer models by up to $\sim30\%$ in robust accuracy for single token attacks.

Motivation & Objective

  • To investigate the robustness of Vision Transformers (ViTs) and other architectures to targeted, structured perturbations at the token level.
  • To address the gap in understanding real-world adversarial threats by designing a practical, block-sparse attack that mimics physical patch attacks.
  • To challenge prior claims of ViT robustness by demonstrating that their self-attention mechanism is sensitive to sparse, localized token manipulations.
  • To compare the performance of ViT, DeIT, ResNets, WideResNet, and MLP-Mixer under identical token attack conditions across varying patch sizes and budgets.

Proposed method

  • Proposes a block-sparse adversarial attack where the attacker perturbs non-overlapping image patches (tokens) based on gradient magnitude to maximize misclassification.
  • Imposes a token budget constraint, limiting the number of patches that can be modified, to simulate realistic, sparse attacks.
  • Uses gradient-based saliency maps to identify the most influential patches for perturbation, ensuring targeted and efficient attack success.
  • Extends the attack to mixed-norm settings with a fixed $ε$-bounded $Ø∞$ norm per pixel to assess imperceptibility and robustness.
  • Applies the attack across multiple architectures: ViT, DeIT, ResNet, WideResNet, and MLP-Mixer, under varying patch sizes and token budgets.
  • Evaluates robust accuracy under both sparse (1x1 pixels) and block-sparse (16x16 patches) constraints to compare attack strength and realism.

Experimental results

Research questions

  • RQ1Are Vision Transformers more vulnerable to structured, patch-based attacks than convolutional networks like ResNets under realistic threat models?
  • RQ2How does the robustness of ViTs and other architectures vary with increasing patch size and token budget in block-sparse attacks?
  • RQ3Why do prior studies claim ViTs are more robust than ResNets under $ε$-bounded attacks, and does this hold under token-level attacks?
  • RQ4Can ViTs compensate for small, localized perturbations, and at what scale does their vulnerability become pronounced?
  • RQ5How does distillation or architectural design (e.g., MLP-Mixer) affect robustness under token-based attacks?

Key findings

  • For single-token attacks, ResNets outperform ViTs by up to ~30% in robust accuracy, indicating ViTs are significantly more sensitive to individual token manipulations.
  • With just 1% of pixels perturbed (256 pixels on ImageNet), ViT-224's robust accuracy drops to 13.62% under a 16×16 patch attack, while ResNet-101 maintains 49.50% under the same conditions.
  • When patch size matches the model’s token size, ViTs and DeIT show near-zero robust accuracy (e.g., 4.98% for ViT-384), while ResNets retain 32.89% robust accuracy.
  • MLP-Mixer outperforms ViT in robustness under larger patch attacks, suggesting that attention mechanisms alone do not ensure robustness.
  • The study reveals that prior claims of ViT robustness under $ε$-bounded attacks are misleading when evaluated under realistic, structured token attacks.
  • Sparse attacks (1×1 pixels) are stronger than patch attacks under the same sparsity budget, but patch attacks are more practical and reveal deeper architectural vulnerabilities in ViTs.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.