arXiv reaDer
すべての画像が 16x16 ワードに値するわけではありません: アダプティブ シーケンス長のダイナミック ビジョン トランスフォーマー
Not All Images are Worth 16x16 Words: Dynamic Vision Transformers with Adaptive Sequence Length
Vision Transformers (ViT) は、大規模な画像認識で目覚ましい成功を収めています。彼らはすべての 2D 画像を固定数のパッチに分割し、それぞれがトークンとして扱われます。一般に、より多くのトークンで画像を表すと、予測精度が高くなりますが、計算コストも大幅に増加します。精度と速度の間で適切なトレードオフを達成するために、トークンの数は経験的に 16x16 に設定されます。この論文では、すべての画像には独自の特性があり、理想的にはトークン数は個々の入力ごとに条件付けられるべきであると主張します。実際、私たちは、4x4 トークンの数だけで正確に予測できる「簡単な」画像がかなりの数存在することを確認しましたが、「難しい」画像のごく一部だけが、より細かい表現を必要とします。この現象に触発されて、各入力画像に適切な数のトークンを自動的に構成する Dynamic Transformer を提案します。これは、テスト時に適応的な方法で順次アクティブ化されるトークンの数を増やした複数のトランスフォーマーをカスケードすることによって達成されます。つまり、十分に信頼できる予測が生成されると、推論は終了します。さらに、Dynamic Transformer のさまざまなコンポーネント間で効率的な機能の再利用と関係の再利用のメカニズムを設計して、冗長な計算を減らします。 ImageNet、CIFAR-10、および CIFAR-100 に関する広範な経験的結果は、理論的な計算効率と実際の推論速度の両方の点で、私たちの方法が競合ベースラインを大幅に上回っていることを示しています。
Vision Transformers (ViT) have achieved remarkable success in large-scale image recognition. They split every 2D image into a fixed number of patches, each of which is treated as a token. Generally, representing an image with more tokens would lead to higher prediction accuracy, while it also results in drastically increased computational cost. To achieve a decent trade-off between accuracy and speed, the number of tokens is empirically set to 16x16. In this paper, we argue that every image has its own characteristics, and ideally the token number should be conditioned on each individual input. In fact, we have observed that there exist a considerable number of "easy" images which can be accurately predicted with a mere number of 4x4 tokens, while only a small fraction of "hard" ones need a finer representation. Inspired by this phenomenon, we propose a Dynamic Transformer to automatically configure a proper number of tokens for each input image. This is achieved by cascading multiple Transformers with increasing numbers of tokens, which are sequentially activated in an adaptive fashion at test time, i.e., the inference is terminated once a sufficiently confident prediction is produced. We further design efficient feature reuse and relationship reuse mechanisms across different components of the Dynamic Transformer to reduce redundant computations. Extensive empirical results on ImageNet, CIFAR-10, and CIFAR-100 demonstrate that our method significantly outperforms the competitive baselines in terms of both theoretical computational efficiency and practical inference speed.
updated: Mon May 31 2021 16:04:10 GMT+0000 (UTC)
published: Mon May 31 2021 16:04:10 GMT+0000 (UTC)
参考文献 (このサイトで利用可能なもの) / References (only if available on this site)
被参照文献 (このサイトで利用可能なものを新しい順に) / Citations (only if available on this site, in order of most recent)
Amazon.co.jpアソシエイト