MSViT:ビジョントランスフォーマーのための動的混合スケールトークン化
MSViT: Dynamic Mixed-Scale Tokenization for Vision Transformers
July 5, 2023
著者: Jakob Drachmann Havtorn, Amelie Royer, Tijmen Blankevoort, Babak Ehteshami Bejnordi
cs.AI
要旨
Vision Transformersへの入力トークンは、入力画像の内容に関わらず、均等なサイズのパッチとして定義されるため、ほとんど意味的な情報を持ちません。しかし、画像の均一な背景領域を処理するのに、密集した複雑な領域と同程度の計算量を必要とすべきではありません。この問題に対処するため、ViT向けの動的混合スケールトークン化手法であるMSViTを提案します。本手法では、各画像領域に対して最適なトークンスケールを選択する条件付きゲーティング機構を導入し、入力ごとにトークン数を動的に決定します。提案するゲーティングモジュールは軽量で、Transformerバックボーンの選択に依存せず、わずかなトレーニングオーバーヘッドで数エポック(例:ImageNetで20エポック)で学習可能です。さらに、トレーニング中のゲートの条件付き動作を強化するため、バッチシェイピング損失の新しい一般化を導入します。本ゲーティングモジュールは、粗いパッチレベルで局所的に動作するにもかかわらず、意味のあるセマンティクスを学習できることを示します。MSViTを分類とセグメンテーションのタスクで検証し、精度と複雑性のトレードオフが改善されることを確認しました。
English
The input tokens to Vision Transformers carry little semantic meaning as they
are defined as regular equal-sized patches of the input image, regardless of
its content. However, processing uniform background areas of an image should
not necessitate as much compute as dense, cluttered areas. To address this
issue, we propose a dynamic mixed-scale tokenization scheme for ViT, MSViT. Our
method introduces a conditional gating mechanism that selects the optimal token
scale for every image region, such that the number of tokens is dynamically
determined per input. The proposed gating module is lightweight, agnostic to
the choice of transformer backbone, and trained within a few epochs (e.g., 20
epochs on ImageNet) with little training overhead. In addition, to enhance the
conditional behavior of the gate during training, we introduce a novel
generalization of the batch-shaping loss. We show that our gating module is
able to learn meaningful semantics despite operating locally at the coarse
patch-level. We validate MSViT on the tasks of classification and segmentation
where it leads to improved accuracy-complexity trade-off.