Vision Transformers are Robust Learners

Sayak Paul, Pin-Yu Chen
5/17/2021
cs.CVcs.LG
transformer-attention

Official code: sayakpaul/robustness-vit (122 stars, Jupyter Notebook, MIT, PyTorch, last commit 2022-12-03).

Abstract

Transformers, composed of multiple self-attention layers, hold strong promises toward a generic learning primitive applicable to different data modalities, including the recent breakthroughs in computer vision achieving state-of-the-art (SOTA) standard accuracy. What remains largely unexplored is their robustness evaluation and attribution.

Show full abstract

In this work, we study the robustness of the Vision Transformer (ViT) against common corruptions and perturbations, distribution shifts, and natural adversarial examples. We use six different diverse ImageNet datasets concerning robust classification to conduct a comprehensive performance comparison of ViT models and SOTA convolutional neural networks (CNNs), Big-Transfer. Through a series of six systematically designed experiments, we then present analyses that provide both quantitative and qualitative indications to explain why ViTs are indeed more robust learners. For example, with fewer parameters and similar dataset and pre-training combinations, ViT gives a top-1 accuracy of 28.10% on ImageNet-A which is 4.3x higher than a comparable variant of BiT. Our analyses on image masking, Fourier spectrum sensitivity, and spread on discrete cosine energy spectrum reveal intriguing properties of ViT attributing to improved robustness. Code for reproducing our experiments is available at https://git.io/J3VO0.

View on arXivView PDF

Code Implementations(1)

PyTorchMIT

Contains code for the paper "Vision Transformers are Robust Learners" (AAAI 2022).

12218Jupyter Notebook, PythonMar 12, 20213 years agoMIT
computer-visionjaxpytorchrobustnessself-attention+2 more

Similar Papers

Cite this paper

@article{paul2021vision,
  title  = {Vision Transformers are Robust Learners},
  author = {Sayak Paul and Pin-Yu Chen},
  year   = {2021},
  eprint = {2105.07581},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2105.07581}
}

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.07581.svg)](https://codeofpaper.com/paper/2105.07581)

Discussion