Discrete Representations Strengthen Vision Transformer Robustness
arXiv:2111.10493
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.
References in corpus (17)
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Neural Discrete Representation Learning
- MLP-Mixer: An all-MLP Architecture for Vision
- Zero-Shot Text-to-Image Generation
- BEiT: BERT Pre-Training of Image Transformers
- AutoAugment: Learning Augmentation Policies from Data
- ImageNet-trained CNNs are biased towards texture; increasing shape bias improves accuracy and robustness
- Do ImageNet Classifiers Generalize to ImageNet?
- Intriguing Properties of Vision Transformers
- When Vision Transformers Outperform ResNets without Pre-training or Strong Data Augmentations
- Are we done with ImageNet?
- How to train your ViT? Data, Augmentation, and Regularization in Vision Transformers
- Self-Challenging Improves Cross-Domain Generalization
- DVAE#: Discrete Variational Autoencoders with Relaxed Boltzmann Priors
- The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution Generalization
- Towards Robust Vision Transformer
- Learning Visual Representations for Transfer Learning by Suppressing Texture