Command Palette
Search for a command to run...
Haiping Wu Bin Xiao Noel Codella Mengchen Liu Xiyang Dai Lu Yuan Lei Zhang

Abstract
We present in this paper a new architecture, named Convolutional vision Transformer (CvT), that improves Vision Transformer (ViT) in performance and efficiency by introducing convolutions into ViT to yield the best of both designs. This is accomplished through two primary modifications: a hierarchy of Transformers containing a new convolutional token embedding, and a convolutional Transformer block leveraging a convolutional projection. These changes introduce desirable properties of convolutional neural networks (CNNs) to the ViT architecture (\ie shift, scale, and distortion invariance) while maintaining the merits of Transformers (\ie dynamic attention, global context, and better generalization). We validate CvT by conducting extensive experiments, showing that this approach achieves state-of-the-art performance over other Vision Transformers and ResNets on ImageNet-1k, with fewer parameters and lower FLOPs. In addition, performance gains are maintained when pretrained on larger datasets (\eg ImageNet-22k) and fine-tuned to downstream tasks. Pre-trained on ImageNet-22k, our CvT-W24 obtains a top-1 accuracy of 87.7\% on the ImageNet-1k val set. Finally, our results show that the positional encoding, a crucial component in existing Vision Transformers, can be safely removed in our model, simplifying the design for higher resolution vision tasks. Code will be released at \url{https://github.com/leoxiaobin/CvT}.
Code Repositories
Benchmarks
| Benchmark | Methodology | Metrics |
|---|---|---|
| image-classification-on-cifar-10 | CvT-W24 | Percentage correct: 99.39 |
| image-classification-on-cifar-100 | CvT-W24 | Percentage correct: 94.09 |
| image-classification-on-flowers-102 | CvT-W24 | Accuracy: 99.72 |
| image-classification-on-imagenet | CvT-13 (384 res) | GFLOPs: 16.3 Number of params: 20M Top 1 Accuracy: 83% |
| image-classification-on-imagenet | CvT-21 (384 res, ImageNet-22k pretrain) | GFLOPs: 25 Number of params: 32M Top 1 Accuracy: 84.9% |
| image-classification-on-imagenet | CvT-13 | GFLOPs: 4.5 Top 1 Accuracy: 81.6% |
| image-classification-on-imagenet | CvT-13-NAS | GFLOPs: 4.1 Number of params: 18M Top 1 Accuracy: 82.2% |
| image-classification-on-imagenet | CvT-W24 (384 res, ImageNet-22k pretrain) | Top 1 Accuracy: 87.7% |
| image-classification-on-imagenet | CvT-21 (384 res) | GFLOPs: 24.9 Top 1 Accuracy: 83.3% |
| image-classification-on-imagenet | CvT-21 | GFLOPs: 7.1 Top 1 Accuracy: 82.5% |
| image-classification-on-imagenet-real | CvT-W24 (384 res, ImageNet-22k pretrain) | Accuracy: 90.6% Number of params: 277M Top 1 Accuracy: 87.7% |
| image-classification-on-oxford-iiit-pets-1 | CvT-W24 | Accuracy: 94.73 |
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.