Upgrade to Pro — share decks privately, control downloads, hide ads and more …

[Journal club] Vision Transformer with Deformable Attention

[Journal club] Vision Transformer with Deformable Attention

More Decks by Semantic Machine Intelligence Lab., Keio Univ.

Other Decks in Technology

Transcript

  1. Vision Transformer with Deformable Attention Zhuofan Xia1, Xuran Pan1, Shiji

    Song1, Li Erran Li2, Gao Huang1,3 (1Tsinghua University , 2AWS AI, Amazon , 3Beijing Academy of Artificial Intelligence) 慶應義塾⼤学 杉浦孔明研究室 和⽥唯我 Xia, Z., Pan, X., Song, S., Li, L. E., & Huang, G. (2022). Vision Transformer with Deformable Attention. CVPR22 CVPR 2022
    和田唯我 / Yuiga Wada
  2. o 受容野 (receptive field) • 画像内の⼀つのクエリから情報を得る際に, 関係を捉えうる範囲 ⇒ 各モデルごとに受容野は異なる 背景

    : 画像認識モデルにはそれぞれ固有の受容野が存在 3 CNN Swin Transformer [Liu+, ICCV21] Vision Transformer [Dosovitskiy+, ICLR20]
  3. 背景 : 受容野を変形できるAttentionが望まれる 4 o Vision Transformer [Dosovitskiy+, ICLR20] •

    CNNよりも広範囲な受容野を持つが, 計算量が⼤きい o Sparse Transformer • 計算量を落とすため, 受容野を狭める → 広範囲の関係性を捉えられない • 例 : Swin Transformer [Liu+, ICCV21] , PVT [Wang+, ICCV21] 計算量を抑えつつ, 物体ごとに受容野を変形できるAttention機構が望まれる
  4. 既存研究 : DeformableなAttentionには改善の余地がある 5 o Deformable Convolution (DCN) [Dai+, ICCV17]

    • カーネルに対してoffsetを⽤いることで, 受容野を変形する o Deformable DETR [Zhu+, 2020] • DETRにDeformable モジュールを追加 • 通常のAttentionだと計算量が⼤きい → Keyの次元を"! = 4 として計算量を削減 ⇒ 重要な情報が失われているという指摘 ⇒ 次元を減らすことなく受容野を変形できるAttentionの必要性 DCN [Dai+, CCV17]
  5. 提案⼿法 : Deformable Attention Transformer o Deformable Attention Transformer (DAT)

    o 4-stageで構成 o (前半) Shift-Window Attention (後半) Deformable Attention o 新規性 o Deformable Attentionの提案 → 物体ごとに受容野を変形して学習 6
  6. 提案⼿法 : Deformable Attention 7 o Deformable Attention o ⼊⼒画像

    %と参照点 & % でAttentionを計算 o グリッドからoffset分ずらした点を参照点 & % とする ⇒ 変形された受容野を実現
  7. Step1 : 格⼦点からのoffsetを計算 1. ⼊⼒画像 % を線形変換し, クエリ ' を計算

    2. サブネットワーク ("##$%& より, 格⼦点 * からのoffset Δ* を計算 * ∈ ℝ'!×)!×* , ' = %. + , Δ* = ("##$%& ' 8 "! ≔ " $ , & ! ≔ & $ ,!""#$% - Δ-
  8. Step2 : bilinear補間により参照点から特徴量を計算 (2/2) 10 • すなわち 10 , 11

    近傍にある参照点から, 距離に応じた加重和を取る ' $" , $# , :
  9. Step3 : 変形された参照点をKey, ValueとしてAttentionを計算 1. bilinear補間された参照点 & % を線形変換して 5

    6 , & 7を計算 2. クエリ 'と参照点から得られた 5 6 , & 7 とでAttentionを計算 11 offset情報を⽤いた Positional Embeddingを付与
  10. Ablation : Deformable Attentionは後半のみの配置が最良 15 • Deformable AttentionはStage3 / Stage4

    のみの配置が最良 ⇒ Stage1 / Stage2では, ⽐較的局所的な特徴を学習させた⽅が良い ✔ → Deformable Attention / 空 → Shift-Window Attention
  11. まとめ 16 ü Deformable Attention Transformer (DAT)を提案 ü Deformable Attentionにより物体ごとに受容野を変形して学習

    • Deformable Attentionは後半のStageに配置するのが最良 ü 様々な画像処理タスクでSwin Transformerを超える精度を記録