Rethinking Spatial Dimensions of Vision Transformers

Vision Transformer (ViT) extends the application range of transformers from language processing to computer vision tasks as being an alternative architecture against the existing convolutional neural networks (CNN). Since the transformer-based architecture has been innovative for computer vision modeling, the design convention towards an effective architecture has been less studied yet. From the successful design principles of CNN, we investigate the role of spatial dimension conversion and its effectiveness on transformer-based architecture. We particularly attend to the dimension reduction principle of CNNs; as the depth increases, a conventional CNN increases channel dimension and decreases spatial dimensions. We empirically show that such a spatial dimension reduction is beneficial to a transformer architecture as well, and propose a novel Pooling-based Vision Transformer (PiT) upon the original ViT model. We show that PiT achieves the improved model capability and generalization performance against ViT. Throughout the extensive experiments, we further show PiT outperforms the baseline on several tasks such as image classification, object detection, and robustness evaluation. Source codes and ImageNet models are available at https://github.com/naver-ai/pit

PDF Abstract ICCV 2021 PDF ICCV 2021 Abstract

Results from the Paper


Task Dataset Model Metric Name Metric Value Global Rank Result Benchmark
Image Classification ImageNet PiT-B Top 1 Accuracy 84% # 336
Number of params 73.8M # 796
GFLOPs 12.5 # 320
Image Classification ImageNet PiT-S Top 1 Accuracy 81.9% # 542
Number of params 23.5M # 577
GFLOPs 2.9 # 171
Image Classification ImageNet PiT-XS Top 1 Accuracy 79.1% # 713
Number of params 10.6M # 479
GFLOPs 1.4 # 128
Image Classification ImageNet PiT-Ti Top 1 Accuracy 74.6% # 901
Number of params 4.9M # 401
GFLOPs 0.7 # 83

Methods