Fast Vision Transformers with HiLo Attention

要約

タイトル:HiLo Attentionを用いた高速なVision Transformers

要約:
– Vision Transformer(ViT)は、コンピュータビジョン分野において最近最も重要なブレークスルーの一つとして注目されており、その効率的な設計はFLOPsのような間接メトリックに基づいています。しかし、直接的なスループットのような直接メトリックとの明らかなギャップがあるため、我々はターゲットプラットフォーム上の直接速度評価を、効率的なViTの設計原則として提案しています。
– 我々は、単純で効果的なViTであるLITv2を導入しました。LITv2は、異なるモデルサイズのスペクトル全体で既存の最新技術に比べて優れたパフォーマンスを発揮し、より高速な速度で実行できます。
– LITv2の中核には、新しいSelf-Attentionメカニズムがあり、それをHiLoと呼びます。HiLoは、画像中の高周波数が局所的で微細な詳細を捉え、低周波数がグローバルな構造に注目することをインスピレーションにしており、マルチヘッドSelf-Attention層は異なる周波数の特性を無視してしまうため、Attentio層内の高/低周波数のパターンを分離することを提案しています。これにより、高周波数を各ローカルウィンドウ内のSelf-Attentionでエンコードする一方、低周波数は各ウィンドウと入力フィーチャマップ内の各クエリ位置からの平均プールされた低周波数キーと値の間でグローバルなAttentionを行う別のグループに分けます。
– LITv2は、GPUやCPU上でのFLOPs、速度、メモリ消費を包括的にベンチマークすることで、HiLoが既存のAttentionメカニズムよりも優れていることを示しており、例えば、CPU上で空間減衰Attentionより1.4倍、ローカルウィンドウAttentionより1.6倍速いことがわかりました。HiLoによって強化されたLITv2は、画像分類、密な検出、セグメンテーションなどの主流のビジョンタスクに堅牢なバックボーンを提供します。GitHub上でのコードはこちらhttps://github.com/ziplab/LITv2。

主な要点:
– Vision Transformer(ViT)は、コンピュータビジョンにおいて重要なブレークスルーである
– LITv2は、異なるモデルサイズにおいて優れたパフォーマンスを発揮する単純で効果的なViTである
– HiLoは、Self-Attention層内の高/低周波数のパターンを分離し、モデルの効率化に役立つ新しいSelf-Attentionメカニズムである
– LITv2は、HiLoによって強化され、画像分類、密な検出、セグメンテーションなどの主流のビジョンタスクに堅牢なバックボーンを提供する
– HiLoによって、既存のAttentionメカニズムよりも優れた速度、メモリ消費結果を得ることができ、例えば、CPU上で空間減衰Attentionより1.4倍、ローカルウィンドウAttentionより1.6倍速いことがわかった

要約(オリジナル)

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.4x faster than spatial reduction attention and 1.6x 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.

arxiv情報

著者 Zizheng Pan,Jianfei Cai,Bohan Zhuang
発行日 2023-04-19 12:04:13+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, OpenAI

カテゴリー: cs.AI, cs.CV, cs.LG パーマリンク