[2103.14586] Understanding Robustness of Transformers for Image Classification

Significance

Keep calm and use vision-transformer

Keypoints

  • Show robustness of vision transformer in terms of input perturbations
  • Show robustness of vision transformer in terms of model perturbations

Review

Background

Interest in Transformers for its application to computer vision problems has been explosive since the introduction of the Vision Transformer (ViT). Many attempts are being made to apply ViT-like models to solve various real-life problem. But are ViTs safe? This work addresses that the robustness of ViT has not been extensively studied by far, and experiments are in need to deploy this type of model safely. Robustness of ViT with respect to the ResNet in terms of input perturbations and model perturbations are confirmed by a wide range of experiments.

Keypoints

Show robustness of vision transformer in terms of input perturbations

The robustness of ViT to input perturbations is studied with the following model settings. 210329-1 Models used for the experiments

The first result presents robustness of the ViT and ResNet models with datasets that include natural corruptions (ImageNet-C), real-world distribution shifts (ImageNet-R), and natural adversarial examples (ImageNet-A). 210329-2 Input perturbation robustness Results confirm the robustness of ViT for various input perturbations when compared to ResNet.

Study on adversarial perturbations including two standard approaches to compute the perturbation (FGSM, PGD) and the spatial transformation (rotation, translation) also confirmed the robustness of the ViT 210329-3 Adversarial perturbation robustness

It is additionally demonstrated that scaling up the ViT results in a faster trend of error rate decrement when compared to the ResNet, irrespective of the type of input perturbation. 210329-4 Scaling up and model performance This might suggest the rich potential of the ViT when trained on large datasets, but also can mean that the ViT should be used with caution when the number of data is limited.

Show robustness of vision transformer in terms of model perturbations

Robustness of the ViT is studied with respect to model perturbations. 210329-5 Model perturbation robustness When a whole block, or one of its components (MLP, self-attention layer) is removed from the pre-trained ViT model, classification accuracy was still comparable to that of the full model (except for the first block of the ViT). Further removing several blocks while keeping the first block showed gradual decrement of the classification performance. The results indicate the existence of redundancy within the ViT, especially for larger models. The model redundancy is also studied by the authors as the layer correlation, which is not discussed in this post.

The last experiment is done by restricting the attention between the patches that lie within a certain distance. 210329-6 Attention restriction robustness The degradation of performance is not apparent until the restriction becomes tight enough to a certain level. This phenomenon might be related to the (non-)locality inductive bias of the ViT models discussed in my previous post.

Related

Share

Comment

#image-generation #multi-modal #language-model #retrieval-augmentation #robotics #forecasting #psychiatry #instruction-tuning #diffusion-model #notice #graph-neural-network #responsible-ai #privacy-preserving #scaling #mixture-of-experts #generative-adversarial-network #speech-model #contrastive-learning #self-supervised #image-representation #image-processing #object-detection #pseudo-labeling #scene-text-detection #neural-architecture-search #data-sampling #long-tail #graph-representation #zero-shot #metric-learning #federated-learning #weight-matrix #low-rank #vision-transformer #computer-vision #normalizing-flow #invertible-neural-network #super-resolution #image-manipulation #thread-summarization #natural-language-processing #domain-adaptation #knowledge-distillation #scene-text #model-compression #semantic-segmentation #instance-segmentation #video-understanding #code-generation #graph-generation #image-translation #data-augmentation #model-pruning #signal-processing #text-generation #text-classification #music-representation #transfer-learning #link-prediction #counterfactual-learning #medical-imaging #acceleration #transformer #style-transfer #novel-view-synthesis #point-cloud #spiking-neural-network #optimization #multi-layer-perceptron #adversarial-training #visual-search #image-retrieval #negative-sampling #action-localization #weakly-supervised #data-compression #hypergraph #adversarial-attack #submodularity #active-learning #deblurring #object-tracking #pyramid-structure #loss-function #gradient-descent #generalization #bug-fix #orthogonality #explainability #saliency-mapping #information-theory #question-answering #knowledge-graph #robustness #limited-data #recommender-system #anomaly-detection #gaussian-discriminant-analysis #molecular-graph #video-processing