FMViT: マルチ周波数混合型Vision Transformer
FMViT: A multiple-frequency mixing Vision Transformer
November 9, 2023
著者: Wei Tan, Yifeng Geng, Xuansong Xie
cs.AI
要旨
近年、トランスフォーマーモデルはコンピュータビジョンタスクにおいて広く採用されています。しかし、入力トークン数に比例するセルフアテンションの二次的な時間およびメモリ複雑度のため、既存のVision Transformer(ViT)の多くは、TensorRTやCoreMLなどの実用的な産業展開シナリオにおいて効率的な性能を達成する上で課題に直面しています。従来のCNNが優れているこれらのシナリオにおいて、最近ではCNNとトランスフォーマーを組み合わせたハイブリッドアーキテクチャを設計する試みがなされていますが、その全体的な性能は期待に応えていません。これらの課題に対処するため、我々はFMViTという効率的なハイブリッドViTアーキテクチャを提案します。このアプローチでは、高周波特徴と低周波特徴を異なる周波数でブレンドすることでモデルの表現力を向上させ、局所的な情報とグローバルな情報を効果的に捕捉できるようにします。さらに、Convolutional Multigroup Reparameterization(gMLP)、Lightweight Multi-head Self-Attention(RLMHSA)、およびConvolutional Fusion Block(CFB)といった展開に適したメカニズムを導入し、モデルの性能をさらに向上させるとともに計算オーバーヘッドを削減します。我々の実験では、FMViTが既存のCNN、ViT、およびCNN-Transformerハイブリッドアーキテクチャを、さまざまなビジョンタスクにおけるレイテンシーと精度のトレードオフの点で凌駕することが示されています。TensorRTプラットフォームでは、FMViTはImageNetデータセットにおいてResnet101をトップ1精度で2.5%(83.3% vs. 80.8%)上回り、推論レイテンシーを同程度に維持しました。さらに、FMViTはEfficientNet-B5と同等の性能を達成しつつ、推論速度を43%向上させました。CoreMLでは、FMViTはImageNetデータセットにおいてMobileOneをトップ1精度で2.6%上回り、推論レイテンシーはMobileOneと同等でした(78.5% vs. 75.9%)。我々のコードはhttps://github.com/tany0699/FMViTで公開されています。
English
The transformer model has gained widespread adoption in computer vision tasks
in recent times. However, due to the quadratic time and memory complexity of
self-attention, which is proportional to the number of input tokens, most
existing Vision Transformers (ViTs) encounter challenges in achieving efficient
performance in practical industrial deployment scenarios, such as TensorRT and
CoreML, where traditional CNNs excel. Although some recent attempts have been
made to design CNN-Transformer hybrid architectures to tackle this problem,
their overall performance has not met expectations. To tackle these challenges,
we propose an efficient hybrid ViT architecture named FMViT. This approach
enhances the model's expressive power by blending high-frequency features and
low-frequency features with varying frequencies, enabling it to capture both
local and global information effectively. Additionally, we introduce
deploy-friendly mechanisms such as Convolutional Multigroup Reparameterization
(gMLP), Lightweight Multi-head Self-Attention (RLMHSA), and Convolutional
Fusion Block (CFB) to further improve the model's performance and reduce
computational overhead. Our experiments demonstrate that FMViT surpasses
existing CNNs, ViTs, and CNNTransformer hybrid architectures in terms of
latency/accuracy trade-offs for various vision tasks. On the TensorRT platform,
FMViT outperforms Resnet101 by 2.5% (83.3% vs. 80.8%) in top-1 accuracy on the
ImageNet dataset while maintaining similar inference latency. Moreover, FMViT
achieves comparable performance with EfficientNet-B5, but with a 43%
improvement in inference speed. On CoreML, FMViT outperforms MobileOne by 2.6%
in top-1 accuracy on the ImageNet dataset, with inference latency comparable to
MobileOne (78.5% vs. 75.9%). Our code can be found at
https://github.com/tany0699/FMViT.