Skip to main content
QUICK REVIEW

[Paper Review] Towards Robust Vision Transformer

Xiaofeng Mao, Gege Qi|arXiv (Cornell University)|May 17, 2021
Advanced Neural Network ApplicationsComputer Science51 references9 citations
TL;DR

This paper proposes Robust Vision Transformer (RVT) and its enhanced version RVT∗, which improve model robustness against adversarial examples, distribution shifts, and image corruptions by identifying harmful components in standard Vision Transformers and introducing two plug-and-play techniques: position-aware attention scaling (PAAS) and patch-wise augmentation. RVT∗ achieves state-of-the-art performance on multiple robustness benchmarks, including top-1 accuracy on ImageNet-C, ImageNet-Sketch, and ImageNet-R.

ABSTRACT

Recent advances on Vision Transformer (ViT) and its improved variants have shown that self-attention-based networks surpass traditional Convolutional Neural Networks (CNNs) in most vision tasks. However, existing ViTs focus on the standard accuracy and computation cost, lacking the investigation of the intrinsic influence on model robustness and generalization. In this work, we conduct systematic evaluation on components of ViTs in terms of their impact on robustness to adversarial examples, common corruptions and distribution shifts. We find some components can be harmful to robustness. By using and combining robust components as building blocks of ViTs, we propose Robust Vision Transformer (RVT), which is a new vision transformer and has superior performance with strong robustness. We further propose two new plug-and-play techniques called position-aware attention scaling and patch-wise augmentation to augment our RVT, which we abbreviate as RVT*. The experimental results on ImageNet and six robustness benchmarks show the advanced robustness and generalization ability of RVT compared with previous ViTs and state-of-the-art CNNs. Furthermore, RVT-S* also achieves Top-1 rank on multiple robustness leaderboards including ImageNet-C and ImageNet-Sketch. The code will be available at \url{https://github.com/alibaba/easyrobust}.

Motivation & Objective

  • To systematically evaluate the impact of key components in Vision Transformers (ViTs) on model robustness, including adversarial examples, common corruptions, and distribution shifts.
  • To identify components in existing ViT architectures that degrade robustness despite improving standard accuracy.
  • To design a new Vision Transformer architecture, RVT, using only robust components to improve generalization and robustness.
  • To develop two plug-and-play techniques—position-aware attention scaling (PAAS) and patch-wise augmentation—to further enhance robustness and accuracy in ViTs.
  • To validate RVT and RVT∗ on ImageNet and six robustness benchmarks, demonstrating superior trade-offs between standard accuracy and robustness.

Proposed method

  • Proposes Robust Vision Transformer (RVT) by replacing harmful components in standard ViTs with robust alternatives, focusing on patch embedding, position encoding, transformer blocks, and classification head.
  • Introduces position-aware attention scaling (PAAS), a method that filters noisy position correlations in self-attention by learning to scale attention maps based on position-aware correlation strength.
  • Develops a patch-wise augmentation technique that applies data augmentations (e.g., random crop, noise, flip) directly to patch sequences, increasing training diversity and reducing overfitting.
  • Applies PAAS across multiple transformer blocks, with ablation showing optimal performance when applied to 5–10 blocks, achieving saturation in gains.
  • Combines PAAS and patch-wise augmentation into RVT∗, a plug-and-play enhancement applicable to any ViT backbone.
  • Employs standard training protocols on ImageNet with ablation studies to validate component contributions across different ViT variants (e.g., DeiT-Ti, ConViT-Ti, PiT-Ti).

Experimental results

Research questions

  • RQ1Which components in Vision Transformers negatively impact robustness despite improving standard accuracy?
  • RQ2How does the choice of position embedding and attention mechanism affect robustness to adversarial examples and distribution shifts?
  • RQ3Can a Vision Transformer be systematically redesigned using only robust components to achieve better robustness without sacrificing accuracy?
  • RQ4To what extent can plug-and-play techniques like PAAS and patch-wise augmentation improve both standard and robust accuracy across different ViT architectures?
  • RQ5How does the proposed RVT compare to state-of-the-art CNNs and ViTs on multiple robustness benchmarks, including ImageNet-C, ImageNet-Sketch, and ImageNet-R?

Key findings

  • RVT-S∗ achieves top-1 accuracy of 46.9% on ImageNet-Sketch and 35.0% on ImageNet-R, setting new state-of-the-art results on both benchmarks.
  • On ImageNet-C, RVT-S∗ achieves top-1 robust accuracy, outperforming previous SOTA models.
  • The combination of PAAS and patch-wise augmentation improves standard accuracy by over 1% and robust accuracy by over 5% on average across multiple ViT architectures.
  • Applying PAAS to 5–10 transformer blocks yields the best performance gain, with further application showing diminishing returns.
  • Patch-wise augmentation with random Gaussian noise provides the most significant robustness improvement among tested augmentations.
  • RVT and RVT∗ demonstrate superior trade-offs between FLOPs, standard accuracy, and robustness compared to both ViTs and state-of-the-art CNNs.

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.