SOTAVerified

Discrete Representations Strengthen Vision Transformer Robustness

2021-11-20ICLR 2022Code Available0· sign in to hype

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

Code Available — Be the first to reproduce this paper.

Reproduce

Code

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.

Tasks

Benchmark Results

DatasetModelMetricClaimedVerifiedStatus
ImageNet-CDiscreteViT (Im21k)mean Corruption Error (mCE)38.74Unverified
ImageNet-CDiscreteViTmean Corruption Error (mCE)46.22Unverified
ImageNet-CDrViTmean Corruption Error (mCE)46.22Unverified
ImageNet-RDiscreteViTTop-1 Error Rate44.74Unverified
ImageNet-SketchDrViTTop-1 accuracy44.72Unverified
Stylized ImageNetDiscreteViTTop 1 Accuracy22.19Unverified

Reproductions