HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

Discrete Representations Strengthen Vision Transformer Robustness

Chengzhi Mao Lu Jiang Mostafa Dehghani Carl Vondrick Rahul Sukthankar Irfan Essa

Discrete Representations Strengthen Vision Transformer Robustness

Abstract

Vision Transformer (ViT) is emerging as the state-of-the-art architecture for image recognition. While recent studies suggest that ViTs are more robust than their convolutional counterparts, our experiments find that ViTs trained on ImageNet are overly reliant on local textures and fail to make adequate use of shape information. ViTs thus have difficulties generalizing to out-of-distribution, real-world data. To address this deficiency, we present a simple and effective architecture modification to ViT's input layer by adding discrete tokens produced by a vector-quantized encoder. Different from the standard continuous pixel tokens, discrete tokens are invariant under small perturbations and contain less information individually, which promote ViTs to learn global information that is invariant. Experimental results demonstrate that adding discrete representation on four architecture variants strengthens ViT robustness by up to 12% across seven ImageNet robustness benchmarks while maintaining the performance on ImageNet.

Benchmarks

BenchmarkMethodologyMetrics
domain-generalization-on-imagenet-cDiscreteViT
Number of params: 87M
mean Corruption Error (mCE): 46.22
domain-generalization-on-imagenet-cDrViT
mean Corruption Error (mCE): 46.22
domain-generalization-on-imagenet-cDiscreteViT (Im21k)
Number of params: 87M
mean Corruption Error (mCE): 38.74
domain-generalization-on-imagenet-rDiscreteViT
Top-1 Error Rate: 44.74
domain-generalization-on-imagenet-sketchDrViT
Top-1 accuracy: 44.72
domain-generalization-on-stylized-imagenetDiscreteViT
Top 1 Accuracy: 22.19
image-classification-on-imagenetDiscreteViT
Top 1 Accuracy: 85.07%
image-classification-on-objectnetViT-B (Discrete 512x512)
Top-1 Accuracy: 46.62

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