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

Separable Self-attention for Mobile Vision Transformers

About

Mobile vision transformers (MobileViT) can achieve state-of-the-art performance across several mobile vision tasks, including classification and detection. Though these models have fewer parameters, they have high latency as compared to convolutional neural network-based models. The main efficiency bottleneck in MobileViT is the multi-headed self-attention (MHA) in transformers, which requires $O(k^2)$ time complexity with respect to the number of tokens (or patches) $k$. Moreover, MHA requires costly operations (e.g., batch-wise matrix multiplication) for computing self-attention, impacting latency on resource-constrained devices. This paper introduces a separable self-attention method with linear complexity, i.e. $O(k)$. A simple yet effective characteristic of the proposed method is that it uses element-wise operations for computing self-attention, making it a good choice for resource-constrained devices. The improved model, MobileViTv2, is state-of-the-art on several mobile vision tasks, including ImageNet object classification and MS-COCO object detection. With about three million parameters, MobileViTv2 achieves a top-1 accuracy of 75.6% on the ImageNet dataset, outperforming MobileViT by about 1% while running $3.2\times$ faster on a mobile device. Our source code is available at: \url{https://github.com/apple/ml-cvnets}

Sachin Mehta, Mohammad Rastegari• 2022

Related benchmarks

TaskDatasetResultRank
Semantic segmentationADE20K (val)
mIoU42.4
2731
Semantic segmentationPASCAL VOC 2012 (val)
Mean IoU80.3
2040
Image ClassificationImageNet-1K 1.0 (val)
Top-1 Accuracy81.2
1866
Image ClassificationImageNet-1k (val)
Top-1 Accuracy82.4
512
Object DetectionMS-COCO 2017 (val)
mAP27.8
237
Image ClassificationImageNet-1k 1.0 (test)
Top-1 Accuracy0.781
191
Object DetectionMS-COCO (val)
mAP0.295
138
Visual Place RecognitionPitts250k
Recall@192.8
84
Image ClassificationImageNet-1K 1.0 (val)
Top-1 Acc0.834
45
Aerial Image ClassificationAIDER v2 (test)
F1 Score0.875
41
Showing 10 of 19 rows

Other info

Code

Follow for update