HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

Towards Robust Vision Transformer

Xiaofeng Mao Gege Qi Yuefeng Chen Xiaodan Li Ranjie Duan Shaokai Ye Yuan He Hui Xue

Towards Robust Vision Transformer

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

Code Repositories

alibaba/easyrobust
Official
pytorch
Mentioned in GitHub
vtddggg/Robust-Vision-Transformer
Official
pytorch
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
domain-generalization-on-imagenet-aRVT-Ti*
Top-1 accuracy %: 14.4
domain-generalization-on-imagenet-aRVT-S*
Top-1 accuracy %: 25.7
domain-generalization-on-imagenet-aRVT-B*
Top-1 accuracy %: 28.5
domain-generalization-on-imagenet-cRVT-Ti*
mean Corruption Error (mCE): 57.0
domain-generalization-on-imagenet-cRVT-S*
mean Corruption Error (mCE): 49.4
domain-generalization-on-imagenet-cRVT-B*
mean Corruption Error (mCE): 46.8
domain-generalization-on-imagenet-rRVT-Ti*
Top-1 Error Rate: 56.1
domain-generalization-on-imagenet-rRVT-S*
Top-1 Error Rate: 52.3
domain-generalization-on-imagenet-rRVT-B*
Top-1 Error Rate: 51.3
image-classification-on-imagenetRVT-S*
GFLOPs: 4.7
Number of params: 23.3M
Top 1 Accuracy: 81.9%
image-classification-on-imagenetRVT-Ti*
GFLOPs: 1.3
Number of params: 10.9M
Top 1 Accuracy: 79.2%
image-classification-on-imagenetRVT-B*
GFLOPs: 17.7
Number of params: 91.8M
Top 1 Accuracy: 82.7%

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp