Rethinking Spatial Dimensions of Vision Transformers
Byeongho Heo, Sangdoo Yun, Dongyoon Han, Sanghyuk Chun, Junsuk Choe, Seong Joon Oh
Code Available — Be the first to reproduce this paper.
ReproduceCode
- github.com/naver-ai/pitOfficialIn paperpytorch★ 246
- github.com/rwightman/pytorch-image-modelsIn paperpytorch★ 36,538
- github.com/martinsbruveris/tensorflow-image-modelstf★ 291
- github.com/naver-ai/pflayerpytorch★ 84
- github.com/ttt496/vit-pytorchpytorch★ 12
- github.com/IMvision12/keras-vision-modelspytorch★ 8
- github.com/hatimwen/paddle_pitpaddle★ 5
- github.com/ahmedelmahy/myownvitpytorch★ 2
- github.com/conceptofmind/PiT-flaxjax★ 0
- gitlab.com/birder/birderpytorch★ 0
Abstract
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
Tasks
Benchmark Results
| Dataset | Model | Metric | Claimed | Verified | Status |
|---|---|---|---|---|---|
| ImageNet | PiT-Ti | Top 1 Accuracy | 74.6 | — | Unverified |
| ImageNet | PiT-B | Top 1 Accuracy | 84 | — | Unverified |
| ImageNet | PiT-S | Top 1 Accuracy | 81.9 | — | Unverified |
| ImageNet | PiT-XS | Top 1 Accuracy | 79.1 | — | Unverified |