SlideShare a Scribd company logo
UTNet:
A Hybrid Transformer Architecture
for Medical Image Segmentation
Yunhe Gao, Mu Zhou, Dimitris Metaxas
Accepted by MICCAI 2021
1.Introduction
2.事前知識
I. Attention
II. Self Attention
III. Multi Head Self Attention
IV. Position Encoding
3.本手法
4.実験
1.Introduction
2.事前知識
I. Attention
II. Self Attention
III. Multi Head Self Attention
IV. Position Encoding
3.本手法
4.実験
Introduction(1/2)
• CNNの欠点
Convは,近傍ピクセルからしか情報を収集しない
⇒ 長距離の依存性を捉えられない
• Transformer
Self-Attentionを用いたTransformerは長距離の依存関係を捉えられる
⇒ 自然言語処理で成功
Introduction(2/2)
• 画像でのTransformer
⇒ 有用だが課題も多い
① 計算量
② 小規模データセットではうまくいかない
- JFT-300Mというような大規模データによる事前学習が有効
- ImageNetでの事前学習ではRes Netにも劣る
本手法:U-Net+Transformer
Hybrid Transformer Network
• CNN + Multi Head Self Attention
• 基本構造はU-Net:変更点2つ
① 各レベル最後のConv層をTranfsormerモジュールに変更
② SelfAttentionの改良
大規模な事前学習を避ける
局所的な特徴の抽出
長距離の依存関係を捉える
1.Introduction
2.事前知識
I. Attention
II. Self Attention
III. Multi Head Self Attention
IV. Position Encoding
3.本手法
4.実験
Attention(1/8)
NN 犬
人は背景を無視して犬だけを注目できる
⇒ CNNでは,画像全体に同じ処理を繰り返す
Attention (2/8)
→ Couv → ReLU → Conv → GAP → Affine →
背景も含めて
画像全体の特徴を平均化
大量のデータを用いることで
前景のみを注目するようにはなるが…
↓
CNNで表現するには,
学習が大変になっているのでは?
↓
Attention
明示的に特定の画像箇所に注目するような
機能をNN上で表現できる →背景は見ない
Attention (3/8):Attention機構
これを,SkipConnectionに掛けることで,
注目すべきでない場所は0に近い値 = 消える
注目すべき場所は1に近い値 = そのまま残る
注目すべきでないと思われる場所は今後に効いてこない
特定の領域に注目(Attention)
Conv
BN
ReLU
GAP
Conv
ReLU
Conv
Sigmoid
Conv層を分岐
注目する領域を
推定するネットワーク
ピクセル毎に
0-1
注目する部分と
しない部分の
マスク
Attention (4/8):特徴マップAttention
縦エッジ
横エッジ
色
模様
CNNでは
様々な特徴マップで判断する
CNNでは,これらの特徴をそのまま次へ渡していく
Attention (5/8):SENet
どの特徴マップが重要かを決めていく
画像の持つ特徴のうち,
どの特徴に注目すべきかを決定する
Conv
BN
ReLU
GAP
Conv
ReLU
Conv
Sigmoid
特定の特徴に注目
Attention (6/8)
𝐴𝑡𝑡𝑒𝑛𝑡𝑖𝑜𝑛 𝑄, 𝐾, 𝑉 = 𝑠𝑜𝑓𝑡𝑚𝑎𝑥
𝑄𝑇
𝐾
𝑑
𝑉
input Memory
output
√次元数で除算することで
勾配消失を防ぐ
𝐴𝑡𝑡𝑒𝑛𝑡𝑖𝑜𝑛 𝒒, 𝐾, 𝑉 = 𝑠𝑜𝑓𝑡𝑚𝑎𝑥
𝒒𝑇
𝐾
𝑑
𝑉
𝐪𝐊 = 𝒒 𝒌1, 𝒌2, … , 𝒌𝑛 = 𝒒𝒌1, 𝒒𝒌2, … , 𝒒𝒌𝑛
𝑠𝑜𝑓𝑡𝑚𝑎𝑥
𝒒𝑇
𝐾
𝑑
𝑉 = 𝑷𝑽 = 𝑝𝒗1, 𝑝𝒗2, … , 𝑝𝒗𝑛
内積を√dで割って
SoftMax
Vの重み付き和
Attention (7/8)
Q
K
V
input
memory
𝒒1 𝒒2, … , 𝒒𝑛
𝒌1 𝒌2, … , 𝒌𝑛
𝒗1 𝒗2, … , 𝒗𝑛
V1,V2に大きい重み
⇒V1,V2に近いベクトルが出る
q1について考える
• 内積で類似度を計算する
(q1とKすべての内積を取る
• 似ているキーに関するバリューを重み付け
• Vの和を取る
*内積=類似度
2つのベクトルが同じ向き⇒内積大
別の向き⇒0
逆の向き⇒-大
すなわち,内積はベクトルの類似度
Attention (8/8)
Q
K:検索対象とクエリの近さを計るための値
V:キーに基づいて,適切な値を出力する
input
memory
● なんでメモリーをKとVに分けるの?
• 注目する点を決定するためのキーベクトル
• 最終的に利用される値を示すバリューベクトル
⇒ これらを分けることで,より表現力が高まる
1.Introduction
2.事前知識
I. Attention
II. Self Attention
III. Multi Head Self Attention
IV. Position Encoding
3.本手法
4.実験
Self Attention(1/4)
Attention
Self-Attention
Q K V
input memory
Q K V
Self
全て同じところからくる
パラメータ変換行列
(学習する
Attention:2つの系列から情報を受け取って,対応関係を調べる
S-Attention:1つの系列の中で,自信を特徴づけるピクセルを調べる
Self Attention(4/4)
a2について考える
• q2は各キーに対して,類似度を計算する
• SoftMaxすると,それぞれ値が出てきた
[小説]と類似度が高いキーは[人気]と[小説]
これらが[小説]のベクトルの
特徴として,バリューの重み付け和に反映される
この 小説 は 人気 です
q1 k1 v1
a1 a2 a3 a4 a5
q2 k2 v2 q3 k3 v3 q4 k4 v4 q5 k5 v5
a21=q2*k1 a22=q2*k2 a24=q2*k4
a23=q2*k3 a25=q2*k5
Softmax
a21’ a22’ a23’ a24’ a25’
0.07 0.3 0.01 0.7 0.02
1.Introduction
2.事前知識
I. Attention
II. Self Attention
III. Multi Head Self Attention
IV. Position Encoding
3.本手法
4.実験
Multi Head Self Attention
各単語に対して
1組のQ, K,Vを持たせるのではなく,
複数のヘッドを作って
それぞれのヘッドで潜在表現を計算する
a1
q11 k11 v11 q12 k12 v12
ヘッドを複数用意することで
それぞれが異なる潜在表現の空間から
有益な情報を取ってこれる
1.Introduction
2.事前知識
I. Attention
II. Self Attention
III. Multi Head Self Attention
IV.Position Encoding
3.本手法
4.実験
1.Introduction
2.事前知識
I. Attention
II. Self Attention
III. Multi Head Self Attention
IV. Position Encoding
3.本手法
4.実験
本手法:Self-Attentionの改良(2/2)
画像は境界領域を除いて,多くの画素が類似している
⇒ 全てを計算するのは冗長で非効率的!
ほとんどの情報は最大の特異値に集中する
キーとバリューをダウンサンプリングする
手法は様々あるが,今回はバイリニア補間でダウンサンプリング
計算量を大きく落とせる
(本手法では,ダウンサンプリングのサイズは8としている
本手法:アーキテクチャ
• CNN+MHSA
• エンコーダとデコーダの各レベルに
Transformer Encoder
Transformer Decoder
を適用し,
複数スケールから
長距離依存性を収集する
※元の解像度ではTransformer-Moduleを使わない
浅い層では,詳細なテクスチャに焦点を当て,
グローバルな関係を収集するのに有用でない
可能性があるため
1.Introduction
2.事前知識
I. Attention
II. Self Attention
III. Multi Head Self Attention
IV. Position Encoding
3.本手法
4.実験
実験(1/2)
• マルチラベルベンダ
• MRI(心臓)
左心室(LV)
右心室(RV)
左心室心筋(MYO)
• A社
• B社
セグメンテーション
DICEで評価
各75枚MRI … TRAIN
実験(2/2)
A社
B社
C社
D社
• 詳細
• Epoch 150
• 学習率 0.05
• Optimizer SGD
• Batch Size 16
各50枚MRI … TEST
性能比較
自分の研究へ
• U-Netベース+Transformer Module
• 計算量の削減も1つ大きな要素
TransformerやAttentionは重い
このモデルなら動かせる
非常に有用
資料
U-Net
• エンコーダ・デコーダ型のネットワーク
• 単純なデコーダでは,位置情報が捉えられない
⇒ 各階層でエンコーダの特徴マップをデコーダの特徴マップに結合
アップサンプリング時に位置情報が加わる
バイリニア補間(1/2)
• 隣接する画素間の画素値を計算することで,拡大・縮小しても
滑らかな画像を生成する
• 画素の周辺縦横方向に以下の補間を行う
https://www.frontier.maxell.co.jp/blog/posts/40.html
バイリニア補間(2/2)
• 元の画素に近いほど,数値を大きく
• 元の画素に遠いほど,数値を小さく
Self Attention(2/4)
Self Attentionは, 前のhidden layer全ての位置を参照する
⇒ CNNは局所的な参照しかできない
Conv S-Attention
Self Attention(3/4)
◎ 全結合と何が違う?
- 全結合だとパラメータが多くなりすぎる
表現力が高くなりすぎる
シンプル重い
- Attention
安定した学習
限られたデータを用いた学習でも高い精度
Position Encoding
今までのモデルで欠けているものは?
⇒ 入力系列の順序を表現すること
各入力にPosition Encoding Vectorを追加する
本手法では,Relative Position Encoding を用いる
𝑎 + 𝑒 = 𝑎𝑒
入力 Position
encoding
vector
これを入力にする
本手法:Self-Attentionの改良(1/2)
コンテキスト集約行列の計算量はO(n2d)
𝑠𝑜𝑓𝑡𝑚𝑎𝑥
𝒒𝑇𝐾
𝑑
𝑉
𝒒 𝒌1, 𝒌2, … , 𝒌𝑛
d キー等の埋め込み次元
一般に,特徴マップの解像度が大きいとき
n >> d
ロバスト性の分析
※ ロバスト性 … 外部からどれだけ影響しにくいか
今回は,Trainにないデータをどれだけ性能を出せるか
• C,Dを見ると,本手法が最もロバスト性が高い
(局所的なテクスチャだけでなく,グローバルな関係を見れている

More Related Content

Featured

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 

Featured (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Paper_UTNet.pptx

Editor's Notes

  1. UTNet: 医用画像セグメンテーションのためのハイブリッドトランスフォーマーアーキテクチャ を紹介します.
  2. では,まずイントロから説明していきます.
  3. 次にSelfAttentionを説明しましょう.
  4. 次にMultiHeadSelfAttentionです.
  5. 最後に,PositionEncodingという技術もあるのですが,ちょっとこれは省かせてください.
  6. やっとここまでで前提知識が終わりまして, 本手法では何を提案しているかという話に入ります.
  7. 最後に実験です.
  8. ベースはU-Netです. U-Netは,エンコーダ・デコーダ型のネットワークです. 単純なデコーダでは,位置情報が捉えられません. そこで,各階層でエンコーダの特徴マップをデコーダの特徴マップに結合します. そうすることによって,アップサンプリング時に位置情報が加わり,位置情報が補完できるというモデルです.
  9. SelfAttentionとCNNの比較ですが, SelfAttentionは,前の隠れ層すべての位置を把握します これに対して,CNNは局所的な参照しかできません. 下の図のようになっています.