Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Twins: Revisiting the Design of Spatial Attention in Vision Transformers

About

Very recently, a variety of vision transformer architectures for dense prediction tasks have been proposed and they show that the design of spatial attention is critical to their success in these tasks. In this work, we revisit the design of the spatial attention and demonstrate that a carefully-devised yet simple spatial attention mechanism performs favourably against the state-of-the-art schemes. As a result, we propose two vision transformer architectures, namely, Twins-PCPVT and Twins-SVT. Our proposed architectures are highly-efficient and easy to implement, only involving matrix multiplications that are highly optimized in modern deep learning frameworks. More importantly, the proposed architectures achieve excellent performance on a wide range of visual tasks, including image level classification as well as dense detection and segmentation. The simplicity and strong performance suggest that our proposed architectures may serve as stronger backbones for many vision tasks. Our code is released at https://github.com/Meituan-AutoML/Twins .

Xiangxiang Chu, Zhi Tian, Yuqing Wang, Bo Zhang, Haibing Ren, Xiaolin Wei, Huaxia Xia, Chunhua Shen• 2021

Related benchmarks

TaskDatasetResultRank
Image ClassificationCIFAR-10 (test)--
3381
Semantic segmentationADE20K (val)
mIoU48.8
2731
Object DetectionCOCO 2017 (val)
AP46.9
2454
Image ClassificationImageNet-1K 1.0 (val)
Top-1 Accuracy83.7
1866
Image ClassificationImageNet (val)
Top-1 Acc83.3
1206
ClassificationImageNet-1K 1.0 (val)
Top-1 Accuracy (%)83.7
1155
Instance SegmentationCOCO 2017 (val)
APm0.432
1144
Semantic segmentationADE20K
mIoU46.7
936
Image ClassificationImageNet-1k (val)
Top-1 Accuracy83.7
840
Image ClassificationImageNet 1k (test)
Top-1 Accuracy83.7
798
Showing 10 of 28 rows

Other info

Code

Follow for update