Lune

NeurIPS2022Top-tier venue

EfficientFormer: Vision Transformers at MobileNet Speed

Yanyu Li, Geng Yuan, Yang Wen, Ju Hu, Georgios Evangelidis, Sergey Tulyakov, Yanzhi Wang, Jian Ren

Abstract

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, 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 latencydriven 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×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 1 . On the downside, transformer models are usually times slower than competitive CNNs [17, 18] . There are many factors that limit the inference speed of ViT, including the massive number of

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

86 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • FastViT: A Fast Hybrid Vision Transformer using Structural Reparameterization cites Searching for MobileNetV3
  • FastViT: A Fast Hybrid Vision Transformer using Structural Reparameterization cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • FastViT: A Fast Hybrid Vision Transformer using Structural Reparameterization cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • FastViT: A Fast Hybrid Vision Transformer using Structural Reparameterization cites Training data-efficient image transformers & distillation through attention
  • Rethinking Vision Transformers for MobileNet Size and Speed cites Searching for MobileNetV3
  • Rethinking Vision Transformers for MobileNet Size and Speed cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Rethinking Vision Transformers for MobileNet Size and Speed cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • Rethinking Vision Transformers for MobileNet Size and Speed cites Training data-efficient image transformers & distillation through attention
  • Rethinking Vision Transformers for MobileNet Size and Speed cites SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers
  • SnapFusion: Text-to-Image Diffusion Model on Mobile Devices within Two Seconds cites Rethinking Vision Transformers for MobileNet Size and Speed
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites Training data-efficient image transformers & distillation through attention
  • Rep ViT: Revisiting Mobile CNN From ViT Perspective cites FastViT: A Fast Hybrid Vision Transformer using Structural Reparameterization
  • Rep ViT: Revisiting Mobile CNN From ViT Perspective cites Searching for MobileNetV3
  • Rep ViT: Revisiting Mobile CNN From ViT Perspective cites Rethinking Vision Transformers for MobileNet Size and Speed
  • Rep ViT: Revisiting Mobile CNN From ViT Perspective cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Rep ViT: Revisiting Mobile CNN From ViT Perspective cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • Rep ViT: Revisiting Mobile CNN From ViT Perspective cites Training data-efficient image transformers & distillation through attention
  • Rep ViT: Revisiting Mobile CNN From ViT Perspective cites SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers
  • Spike-driven Transformer cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Spike-driven Transformer cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • Spike-driven Transformer cites Training data-efficient image transformers & distillation through attention
  • Training data-efficient image transformers & distillation through attention cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers86

  1. Rep ViT: Revisiting Mobile CNN From ViT PerspectiveAo Wang, Hui Chen, Zijia Lin, Jungong Han et al.CVPR 2024 · 500 citations
  2. Spike-driven TransformerMan Yao, Jiakui Hu, Zhaokun Zhou, Li Yuan et al.NeurIPS 2023 · 368 citations
  3. FastViT: A Fast Hybrid Vision Transformer using Structural ReparameterizationPavan Kumar Anasosalu Vasu, James Gabriel, Jeff Zhu, Oncel Tuzel et al.ICCV 2023 · 341 citations
  4. Rethinking Vision Transformers for MobileNet Size and SpeedYanyu Li, Ju Hu, Yang Wen, Georgios Evangelidis et al.ICCV 2023 · 300 citations
  5. SnapFusion: Text-to-Image Diffusion Model on Mobile Devices within Two SecondsYanyu Li, Huan Wang, Qing Jin, Ju Hu et al.NeurIPS 2023 · 300 citations

Builds on42

  1. Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu et al.ICCV 2021 · 31,683 citations
  2. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
  3. SegFormer: Simple and Efficient Design for Semantic Segmentation with TransformersEnze Xie, Wenhai Wang, Zhiding Yu, Anima Anandkumar et al.NeurIPS 2021 · 9,661 citations
  4. Searching for MobileNetV3Andrew Howard, Ruoming Pang, Hartwig Adam, Quoc V. Le et al.ICCV 2019 · 9,163 citations
  5. Training data-efficient image transformers & distillation through attentionHugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa et al.ICML 2021 · 8,974 citations

Related papers

  1. MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision TransformerSachin Mehta, Mohammad RastegariICLR 2022 · 2,162 citations
  2. TopFormer: Token Pyramid Transformer for Mobile Semantic SegmentationWenqiang Zhang, Zilong Huang, Guozhong Luo, Tao Chen et al.CVPR 2022 · 313 citations
  3. MobileOne: An Improved One millisecond Mobile BackbonePavan Kumar Anasosalu Vasu, James Gabriel, Jeff Zhu, Oncel Tuzel et al.CVPR 2023
  4. Real-time Core-Periphery Guided ViT with Smart Data Layout Selection on Mobile DevicesZhihao Shu, Xiaowei Yu, Zihao Wu, Wenqi Jia et al.NeurIPS 2024 · 6 citations
  5. ElasticViT: Conflict-aware Supernet Training for Deploying Fast Vision Transformer on Diverse Mobile DevicesChen Tang, Li Lyna Zhang, Huiqiang Jiang, Jiahang Xu et al.ICCV 2023 · 15 citations
Dusk over the sea between two cliffs drawn in fine vertical lines