Towards Robust Vision Transformer

Xiaofeng Mao, Gege Qi, Yuefeng Chen, Xiaodan Li, Ranjie Duan +3 more
5/17/2021
264 citations
cs.CV
transformer-attention

Official code: alibaba/easyrobust (339 stars, Jupyter Notebook, Apache-2.0, last commit 2024-06-30). 1 more implementation below.

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.

Show full abstract

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}.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
alibaba/easyrobustOfficial339Jupyter NotebookApache-2.02024-06-30
vtddggg/Robust-Vision-TransformerCommunity142Python–2022-08-16
alibaba/easyrobustOfficial100%
Apache-2.0

EasyRobust: an Easy-to-use library for state-of-the-art Robust Computer Vision Research with PyTorch.

33938Jupyter Notebook, PythonFeb 22, 20222 years agoApache-2.0
adversarial-robustnessdeep-learningimage-classificationimagenetpretrained-models+1 more

The implementation of our paper: Towards Robust Vision Transformer (CVPR2022)

14216PythonMay 17, 20214 years ago

Similar Papers

Cite this paper

@article{mao2021towards,
  title  = {Towards Robust Vision Transformer},
  author = {Xiaofeng Mao and Gege Qi and Yuefeng Chen and Xiaodan Li and Ranjie Duan and Shaokai Ye and Yuan He and Hui Xue},
  year   = {2021},
  eprint = {2105.07926},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2105.07926}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2105.07926.svg)](https://codeofpaper.com/paper/2105.07926)

Discussion