mlsanityData to 7 Oct 2026

ViTGuard: Attention-aware Detection against Adversarial Examples for Vision Transformer

arXiv 2409.13828 ↗First posted 20 Sep 2024cs.CV cs.CRcited by 2

Not on the map. Why?

Abstract (arXiv)

The use of transformers for vision tasks has challenged the traditional dominant role of convolutional neural networks (CNN) in computer vision (CV). For image classification tasks, Vision Transformer (ViT) effectively establishes spatial relationships between patches within images, directing attention to important areas for accurate predictions. However, similar to CNNs, ViTs are vulnerable to adversarial attacks, which mislead the image classifier into making incorrect decisions on images with carefully designed perturbations. Moreover, adversarial patch attacks, which introduce arbitrary perturbations within a small area, pose a more serious threat to ViTs. Even worse, traditional detection methods, originally designed for CNN models, are impractical or suffer significant performance degradation when applied to ViTs, and they generally overlook patch attacks. In this paper, we propose ViTGuard as a general detection method for defending ViT models against adversarial attacks, including typical attacks where perturbations spread over the entire input and patch attacks. ViTGuard uses a Masked Autoencoder (MAE) model to recover randomly masked patches from the unmasked regions, providing a flexible image reconstruction strategy. Then, threshold-based detectors leverage distinctive ViT features, including attention maps and classification (CLS) token representations, to distinguish between normal and adversarial samples. The MAE model does not involve any adversarial samples during training, ensuring the effectiveness of our detectors against unseen attacks. ViTGuard is compared with seven existing detection methods under nine attacks across three datasets. The evaluation results show the superiority of ViTGuard over existing detectors. Finally, considering the potential detection evasion, we further demonstrate ViTGuard's robustness against adaptive attacks for evasion.

Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 74 of its 95 references that are in the map. First posted on arXiv 20 Sep 2024.

Builds on

74 of 95 references.

References · 74

  1. 2017Attention Is All You Needcited by 59,932
  2. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  3. 2023GPT-4 Technical Reportcited by 18,132
  4. 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,082
  5. 2014ImageNet Large Scale Visual Recognition Challengecited by 8,441
  6. 2021Masked Autoencoders Are Scalable Vision Learnerscited by 7,339
  7. 2014Explaining and Harnessing Adversarial Examplescited by 7,287
  8. 2021Emerging Properties in Self-Supervised Vision Transformerscited by 6,893
  9. 2017Towards Deep Learning Models Resistant to Adversarial Attackscited by 6,326
  10. 2020Training data-efficient image transformers & distillation through attentioncited by 4,560
  11. 2016Towards Evaluating the Robustness of Neural Networkscited by 2,976
  12. 2021Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutionscited by 1,960
38 more
  1. 2019Theoretically Principled Trade-off between Robustness and Accuracycited by 1,510
  2. 2020Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attackscited by 1,442
  3. 2015DeepFool: a simple and accurate method to fool deep neural networkscited by 1,315
  4. 2023PaLM 2 Technical Reportcited by 1,154
  5. 2021Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNetcited by 1,096
  6. 2016Practical Black-Box Attacks against Machine Learningcited by 893
  7. 2019Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Prunedcited by 844
  8. 2015The Limitations of Deep Learning in Adversarial Settingscited by 784
  9. 2020Quantifying Attention Flow in Transformerscited by 759
  10. 2021Going deeper with Image Transformerscited by 759
  11. 2019Square Attack: a query-efficient black-box adversarial attack via random searchcited by 682
  12. 2015Distillation as a Defense to Adversarial Perturbations against Deep Neural Networkscited by 675
  13. 2017ZOO: Zeroth Order Optimization based Black-box Attacks to Deep Neural Networks without Training Substitute Modelscited by 656
  14. 2020Transformer Interpretability Beyond Attention Visualizationcited by 620
  15. 2018Improving Transferability of Adversarial Examples with Input Diversitycited by 591
  16. 2016Delving into Transferable Adversarial Examples and Black-box Attackscited by 530
  17. 2017Adversarial Patchcited by 514
  18. 2017Feature Squeezing: Detecting Adversarial Examples in Deep Neural Networkscited by 484
  19. 2022Diffusion Models for Adversarial Purificationcited by 469
  20. 2017Decision-Based Adversarial Attacks: Reliable Attacks Against Black-Box Machine Learning Modelscited by 459
  21. 2021Intriguing Properties of Vision Transformerscited by 446
  22. 2019Evading Defenses to Transferable Adversarial Examples by Translation-Invariant Attackscited by 440
  23. 2019Is Attention Interpretable?cited by 387
  24. 2017Mitigating Adversarial Effects Through Randomizationcited by 382
  25. 2018Defense-GAN: Protecting Classifiers Against Adversarial Attacks Using Generative Modelscited by 362
  26. 2019Nesterov Accelerated Gradient and Scale Invariance for Adversarial Attackscited by 352
  27. 2017Defense against Adversarial Attacks Using High-Level Representation Guided Denoisercited by 329
  28. 2018Characterizing Adversarial Subspaces Using Local Intrinsic Dimensionalitycited by 280
  29. 2017MagNet: a Two-Pronged Defense against Adversarial Examplescited by 268
  30. 2019Cross-Modal Self-Attention Network for Referring Image Segmentationcited by 263
  31. 2021Understanding Robustness of Transformers for Image Classificationcited by 250
  32. 2017Detecting Adversarial Samples from Artifactscited by 244
  33. 2021Vision Transformers are Robust Learnerscited by 208
  34. 2021Are Transformers More Robust Than CNNs?cited by 187
  35. 2021On the Robustness of Vision Transformers to Adversarial Examplescited by 167
  36. 2020Skip Connections Matter: On the Transferability of Adversarial Examples Generated with ResNetscited by 165
  37. 2017Towards Robust Neural Networks via Random Self-ensemblecited by 158
  38. 2022Understanding The Robustness in Vision Transformerscited by 144

50 most cited of 74 All 74 (JSON)

Built on by

Cited by year

Citing papers per year: 2025: 2.

2 papers.