arXiv reaDer
VisionTransformerの相対位置エンコーディングの再考と改善
Rethinking and Improving Relative Position Encoding for Vision Transformer
相対位置エンコーディング(RPE)は、トランスフォーマーが入力トークンのシーケンス順序をキャプチャするために重要です。一般的な有効性は、自然言語処理で証明されています。ただし、コンピュータビジョンでは、その有効性は十分に研究されておらず、たとえば、相対位置エンコーディングが絶対位置と同等に機能するかどうかなど、物議を醸すままです。これを明確にするために、まず既存の相対位置エンコード方法を確認し、ビジョントランスフォーマーに適用した場合の長所と短所を分析します。次に、画像RPE(iRPE)と呼ばれる2D画像専用の新しい相対位置エンコード方式を提案します。私たちの方法は、方向性相対距離モデリング、およびクエリと自己注意メカニズムへの相対位置埋め込みの間の相互作用を考慮します。提案されたiRPEメソッドはシンプルで軽量です。それらは変圧器ブロックに簡単に差し込むことができます。実験では、提案されたエンコード方法のみにより、DeiTとDETRは、ImageNetとCOCOの元のバージョンに比べて、それぞれ最大1.5%(top-1 Acc)と1.3%(mAP)の安定した改善を得ることが示されています。学習率と重みの減衰。私たちのアブレーションと分析も興味深い発見をもたらし、そのいくつかは以前の理解に反しています。コードとモデルはhttps://github.com/microsoft/Cream/tree/main/iRPEでオープンソース化されています。
Relative position encoding (RPE) is important for transformer to capture sequence ordering of input tokens. General efficacy has been proven in natural language processing. However, in computer vision, its efficacy is not well studied and even remains controversial, e.g., whether relative position encoding can work equally well as absolute position? In order to clarify this, we first review existing relative position encoding methods and analyze their pros and cons when applied in vision transformers. We then propose new relative position encoding methods dedicated to 2D images, called image RPE (iRPE). Our methods consider directional relative distance modeling as well as the interactions between queries and relative position embeddings in self-attention mechanism. The proposed iRPE methods are simple and lightweight. They can be easily plugged into transformer blocks. Experiments demonstrate that solely due to the proposed encoding methods, DeiT and DETR obtain up to 1.5% (top-1 Acc) and 1.3% (mAP) stable improvements over their original versions on ImageNet and COCO respectively, without tuning any extra hyperparameters such as learning rate and weight decay. Our ablation and analysis also yield interesting findings, some of which run counter to previous understanding. Code and models are open-sourced at https://github.com/microsoft/Cream/tree/main/iRPE.
updated: Thu Jul 29 2021 17:55:10 GMT+0000 (UTC)
published: Thu Jul 29 2021 17:55: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アソシエイト