Skip to main content
QUICK REVIEW

[Paper Review] Reveal of Vision Transformers Robustness against Adversarial Attacks

Ahmed Aldahdooh, Wassim Hamidouche|arXiv (Cornell University)|Jun 7, 2021
Adversarial Robustness in Machine LearningComputer Science55 references7 citations
TL;DR

This paper investigates the robustness of Vision Transformers (ViTs) and their variants against various $L_p$-norm and color channel perturbation (CCP) adversarial attacks, comparing them with CNNs. Using experiments on ImageNet-1k, it finds that vanilla and hybrid ViTs are more robust than CNNs under both white-box and adaptive attacks, particularly under $L_p$-based and RayS attacks, while ViTs show limited response to preprocessing defenses that reduce high-frequency components.

ABSTRACT

The major part of the vanilla vision transformer (ViT) is the attention block that brings the power of mimicking the global context of the input image. For better performance, ViT needs large-scale training data. To overcome this data hunger limitation, many ViT-based networks, or hybrid-ViT, have been proposed to include local context during the training. The robustness of ViTs and its variants against adversarial attacks has not been widely investigated in the literature like CNNs. This work studies the robustness of ViT variants 1) against different Lp-based adversarial attacks in comparison with CNNs, 2) under adversarial examples (AEs) after applying preprocessing defense methods and 3) under the adaptive attacks using expectation over transformation (EOT) framework. To that end, we run a set of experiments on 1000 images from ImageNet-1k and then provide an analysis that reveals that vanilla ViT or hybrid-ViT are more robust than CNNs. For instance, we found that 1) Vanilla ViTs or hybrid-ViTs are more robust than CNNs under Lp-based attacks and under adaptive attacks. 2) Unlike hybrid-ViTs, Vanilla ViTs are not responding to preprocessing defenses that mainly reduce the high frequency components. Furthermore, feature maps, attention maps, and Grad-CAM visualization jointly with image quality measures, and perturbations' energy spectrum are provided for an insight understanding of attention-based models.

Motivation & Objective

  • To evaluate the robustness of Vision Transformers (ViTs) and their variants against $L_p$-norm and color channel perturbation (CCP) adversarial attacks.
  • To compare the robustness of ViTs and CNNs under preprocessing defense methods that reduce high-frequency components.
  • To investigate the impact of model architecture depth (number of attention blocks) and tokenization methods on adversarial robustness.
  • To analyze transferability of adversarial examples across ViT and CNN models under black-box and adaptive attack settings.

Proposed method

  • The study uses 1,000 images from the ImageNet-1k validation set to evaluate adversarial robustness.
  • Adversarial examples are generated using PGD-$L_\infty$ with $\epsilon = 4/255$, and tested under preprocessing defenses including local spatial smoothing (SS), non-local mean (NLM), total variation minimization (TVM), JPEG compression (JPEG), cropping and re-scaling (CR), and color channel perturbations (CCP).
  • The expectation over transformation (EOT) framework is applied to generate adaptive adversarial examples robust across a distribution of transformations.
  • Feature maps, attention maps, Grad-CAM visualizations, and DCT-based spectral decomposition of perturbations are used to analyze model behavior.
  • Robustness is measured via attack success rate (ASR) and top-1 error on preprocessed adversarial examples.

Experimental results

Research questions

  • RQ1Are ViT variants more robust than CNNs against $L_0$, $L_1$, $L_2$, and $L_\infty$-based attacks and CCP attacks?
  • RQ2Are ViT variants more robust than CNNs under preprocessed adversarial examples?
  • RQ3Does increasing the number of attention blocks improve robustness against adversarial examples and under preprocessing defenses?
  • RQ4Does enhancing ViT tokenization methods improve robustness against adversarial examples and under preprocessing defenses?

Key findings

  • Vanilla ViTs and hybrid- ViTs are more robust than CNNs under $L_p$-based attacks and CCP attacks, with lower attack success rates on ImageNet-1k.
  • Vanilla ViTs do not respond to preprocessing defenses that reduce high-frequency components, such as local spatial smoothing (SS) and JPEG compression (JPEG), unlike hybrid- ViTs and CNNs.
  • Hybrid- ViT models, particularly T2T-ViT and TNT, show better robustness than vanilla ViTs and ResNets under the EOT framework, especially under SS and JPEG preprocessing.
  • Increasing the number of attention blocks improves robustness against transfer attacks but not against white-box attacks.
  • Enhancing ViT tokenization (e.g., via T2T-ViT or TNT) increases robustness under preprocessing defenses but does not necessarily improve robustness against raw adversarial examples.
  • Transferability of adversarial examples is higher from ViTs to CNNs than vice versa, indicating that ViTs generate more transferable attacks.

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.