When Vision Transformers Outperform ResNets without Pre-training or Strong Data Augmentations
arXiv:2106.01548
Abstract
Vision Transformers (ViTs) and MLPs signal further efforts on replacing hand-wired features or inductive biases with general-purpose neural architectures. Existing works empower the models by massive data, such as large-scale pre-training and/or repeated strong data augmentations, and still report optimization-related problems (e.g., sensitivity to initialization and learning rates). Hence, this paper investigates ViTs and MLP-Mixers from the lens of loss geometry, intending to improve the models' data efficiency at training and generalization at inference. Visualization and Hessian reveal extremely sharp local minima of converged models. By promoting smoothness with a recently proposed sharpness-aware optimizer, we substantially improve the accuracy and robustness of ViTs and MLP-Mixers on various tasks spanning supervised, adversarial, contrastive, and transfer learning (e.g., +5.3\% and +11.0\% top-1 accuracy on ImageNet for ViT-B/16 and Mixer-B/16, respectively, with the simple Inception-style preprocessing). We show that the improved smoothness attributes to sparser active neurons in the first few layers. The resultant ViTs outperform ResNets of similar size and throughput when trained from scratch on ImageNet without large-scale pre-training or strong data augmentations. Model checkpoints are available at \url{https://github.com/google-research/vision_transformer}.
ICLR 2022 (spotlight)
References in corpus (9)
- Fast is better than free: Revisiting adversarial training
- Do ImageNet Classifiers Generalize to ImageNet?
- VATT: Transformers for Multimodal Self-Supervised Learning from Raw Video, Audio and Text
- Do You Even Need Attention? A Stack of Feed-Forward Layers Does Surprisingly Well on ImageNet
- Are we done with ImageNet?
- Multiscale Vision Transformers
- Neural Architecture Search on ImageNet in Four GPU Hours: A Theoretically Inspired Perspective
- Practical Gauss-Newton Optimisation for Deep Learning
- Pay Attention to MLPs
Cited by in corpus (8)
- Attention Mechanisms in Computer Vision: A Survey
- Video Transformers: A Survey
- Efficient Sharpness-aware Minimization for Improved Training of Neural Networks
- Discrete Representations Strengthen Vision Transformer Robustness
- Can Vision Transformers Perform Convolution?
- ExpPoint-MAE: Better interpretability and performance for self-supervised point cloud transformers
- CAP: Co-Adversarial Perturbation on Weights and Features for Improving Generalization of Graph Neural Networks
- How Well Do Sparse Imagenet Models Transfer?