Fast Vision Transformers with HiLo Attention
Zizheng Pan, Jianfei Cai, Bohan Zhuang
摘要
Vision Transformers (ViTs) have triggered the most recent and significant breakthroughs in computer vision. Their efficient designs are mostly guided by the indirect metric of computational complexity, i.e., FLOPs, which however has a clear gap with the direct metric such as throughput. Thus, we propose to use the direct speed evaluation on the target platform as the design principle for efficient ViTs. Particularly, we introduce LITv2, a simple and effective ViT which performs favourably against the existing state-of-the-art methods across a spectrum of different model sizes with faster speed. At the core of LITv2 is a novel self-attention mechanism, which we dub HiLo. HiLo is inspired by the insight that high frequencies in an image capture local fine details and low frequencies focus on global structures, whereas a multi-head self-attention layer neglects the characteristic of different frequencies. Therefore, we propose to disentangle the high/low frequency patterns in an attention layer by separating the heads into two groups, where one group encodes high frequencies via self-attention within each local window, and another group encodes low frequencies by performing global attention between the average-pooled low-frequency keys and values from each window and each query position in the input feature map. Benefiting from the efficient design for both groups, we show that HiLo is superior to the existing attention mechanisms by comprehensively benchmarking FLOPs, speed and memory consumption on GPUs and CPUs. For example, HiLo is 1.4× faster than spatial reduction attention and 1.6× faster than local window attention on CPUs. Powered by HiLo, LITv2 serves as a strong backbone for mainstream vision tasks including image classification, dense detection and segmentation. Code is available at https://github.com/ziplab/LITv2 .
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 37 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- MogaNet: Multi-order Gated Aggregation Network 引用了 A ConvNet for the 2020s
- MogaNet: Multi-order Gated Aggregation Network 引用了 Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
- MogaNet: Multi-order Gated Aggregation Network 引用了 Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions
- MogaNet: Multi-order Gated Aggregation Network 引用了 Training data-efficient image transformers & distillation through attention
- FastViT: A Fast Hybrid Vision Transformer using Structural Reparameterization 引用了 A ConvNet for the 2020s
- FastViT: A Fast Hybrid Vision Transformer using Structural Reparameterization 引用了 Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
- FastViT: A Fast Hybrid Vision Transformer using Structural Reparameterization 引用了 Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions
- FastViT: A Fast Hybrid Vision Transformer using Structural Reparameterization 引用了 Training data-efficient image transformers & distillation through attention
- Rethinking Vision Transformers for MobileNet Size and Speed 引用了 Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
- Rethinking Vision Transformers for MobileNet Size and Speed 引用了 Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions
- Rethinking Vision Transformers for MobileNet Size and Speed 引用了 Training data-efficient image transformers & distillation through attention
- A ConvNet for the 2020s 引用了 Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
- A ConvNet for the 2020s 引用了 Training data-efficient image transformers & distillation through attention
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows 引用了 Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows 引用了 Training data-efficient image transformers & distillation through attention
- Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions 引用了 Training data-efficient image transformers & distillation through attention
- SHViT: Single-Head Vision Transformer with Memory Efficient Macro Design 引用了 FastViT: A Fast Hybrid Vision Transformer using Structural Reparameterization
- SHViT: Single-Head Vision Transformer with Memory Efficient Macro Design 引用了 Rethinking Vision Transformers for MobileNet Size and Speed
- SHViT: Single-Head Vision Transformer with Memory Efficient Macro Design 引用了 A ConvNet for the 2020s
- SHViT: Single-Head Vision Transformer with Memory Efficient Macro Design 引用了 Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
- SHViT: Single-Head Vision Transformer with Memory Efficient Macro Design 引用了 Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions
- SHViT: Single-Head Vision Transformer with Memory Efficient Macro Design 引用了 Training data-efficient image transformers & distillation through attention
引用它的顶会 Paper37
- FastViT: A Fast Hybrid Vision Transformer using Structural ReparameterizationPavan Kumar Anasosalu Vasu, James Gabriel, Jeff Zhu, Oncel Tuzel 等ICCV 2023 · 341 次引用
- Rethinking Vision Transformers for MobileNet Size and SpeedYanyu Li, Ju Hu, Yang Wen, Georgios Evangelidis 等ICCV 2023 · 300 次引用
- Focal Network for Image RestorationYuning Cui, Wenqi Ren, Xiaochun Cao, Alois KnollICCV 2023 · 204 次引用
- MogaNet: Multi-order Gated Aggregation NetworkSiyuan Li, Zedong Wang, Zicheng Liu, Cheng Tan 等ICLR 2024 · 151 次引用
- SHViT: Single-Head Vision Transformer with Memory Efficient Macro DesignSeokju Yun, Youngmin RoCVPR 2024 · 117 次引用
它引用的 Paper36
- Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu 等ICCV 2021 · 31,683 次引用
- Training data-efficient image transformers & distillation through attentionHugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa 等ICML 2021 · 8,974 次引用
- A ConvNet for the 2020sZhuang Liu, Hanzi Mao, Chao-Yuan Wu, Christoph Feichtenhofer 等CVPR 2022 · 6,782 次引用
- Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without ConvolutionsWenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan 等ICCV 2021 · 4,909 次引用
- Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 次引用
相关 Paper
- You Only Need Less Attention at Each Stage in Vision TransformersShuoxi Zhang, Hanpeng Liu, Stephen Lin, Kun HeCVPR 2024 · 19 次引用
- Less Is More: Pay Less Attention in Vision TransformersZizheng Pan, Bohan Zhuang, Haoyu He, Jing Liu 等AAAI 2022 · 109 次引用
- Multi-Criteria Token Fusion with One-Step-Ahead Attention for Efficient Vision TransformersSanghyeok Lee, Joonmyung Choi, Hyunwoo J. KimCVPR 2024
- Sparsifiner: Learning Sparse Instance-Dependent Attention for Efficient Vision TransformersCong Wei, Brendan Duke, Ruowei Jiang, Parham Aarabi 等CVPR 2023
- CF-ViT: A General Coarse-to-Fine Method for Vision TransformerMengzhao Chen, Mingbao Lin, Ke Li, Yunhang Shen 等AAAI 2023 · 105 次引用
