EfficientFormer: Vision Transformers at MobileNet Speed
By Yanyu Li, Geng Yuan, Yang Wen, Eric Hu, Georgios Evangelidis, Sergey Tulyakov, Yanzhi Wang, Jian Ren. Neural Information Processing Systems, 2022
661 citations recorded by the source corpus.
Vision Transformers (ViT) have shown rapid progress in computer vision tasks, achieving promising results on various benchmarks. However, due to the massive number of parameters and model design, \textit{e.g.}, attention mechanism, ViT-based models are generally times slower than lightweight convolutional networks. Therefore, the deployment of ViT for real-time applications is particularly challenging, especially on resource-constrained hardware such as mobile devices. Recent efforts try to reduce the computation complexity of ViT through network architecture search or hybrid design with MobileNet block, yet the inference speed is still unsatisfactory. This leads to an important question: can transformers run as fast as MobileNet while obtaining high performance? To answer this, we first revisit the network architecture and operators used in ViT-based models and identify inefficient designs. Then we introduce a dimension-consistent pure transformer (without MobileNet blocks) as a design paradigm. Finally, we perform latency-driven slimming to get a series of final models dubbed EfficientFormer. Extensive experiments show the superiority of EfficientFormer in performance and speed on mobile devices. Our fastest model, EfficientFormer-L1, achieves $79.2\%$ top-1 accuracy on ImageNet-1K with only $1.6$ ms inference latency on iPhone 12 (compiled with CoreML), which runs as fast as MobileNetV2$\times 1.4$ ($1.6$ ms, $74.7\%$ top-1), and our largest model, EfficientFormer-L7, obtains $83.3\%$ accuracy with only $7.0$ ms latency. Our work proves that properly designed transformers can reach extremely low latency on mobile devices while maintaining high performance.
Subfields: Computer Vision and Pattern Recognition, Electrical and Electronic Engineering
View Paper: https://www.semanticscholar.org/paper/dd1139cfc609c2f3263d02e97176d5275caebc0a
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Computer Vision and Pattern Recognition
In Electrical and Electronic Engineering
- Yonghong Tian
- Liuliang Yuan
- Man Yao
- Boxing Xu
- Zhaokun Zhou
- Jiakui Hu
- Guoqi Li
- Raghuraman Krishnamoorthi
Citations in the corpus
- Rep ViT: Revisiting Mobile CNN From ViT Perspective (2023, methodology): “In practice, we utilize the iPhone 12 as the test device and Core ML Tools [1] as the compiler, like [35, 36, 60].”
- Rethinking Vision Transformers for MobileNet Size and Speed (2022, methodology): “Still, the sophisticated reshaping and indexing operations are not even supported on resourceconstrained devices [47].”
- Spike-driven Transformer (2023, methodology): “Typical optimization methods include convolution and self-attention mixing [54, 55], Transformer’s own mechanism (token mechanism [56, 57], self-attention [58, 59], multi-head [60, 61] and so on) optimization, etc.”
- EfficientSAM: Leveraged Masked Image Pretraining for Efficient Segment Anything (2023, methodology): “This trick has been used in many follow-up works including LeViT[22], EfficientFormer[35], Next-ViT[33], Tiny-ViT[61], Castling-ViT[66], EfficientViT[38].”
- MambaVision: A Hybrid Mamba-Transformer Vision Backbone (2024, neutral): “Recent efforts like Efficient-Former [18] and FasterViT [10] focused on optimizing efficiency-accuracy trade-offs, achieving competitive performance with high throughput through carefully designed hybrid architectures.”
- FastViT: A Fast Hybrid Vision Transformer using Structural Reparameterization (2023, background): “FastViT-SA24 attains similar performance as EfficientFormer-L7 while having 3.8 × less parameters, 2.7 less FLOPs and 2.7 lower latency.”