SlideShare a Scribd company logo
1 of 32
Download to read offline
Kaggle勉強会: 肺塞栓症コンペ
開催時期:2020/12/26まで(約2ヶ月間)
2021/4/18 @634kami
https://www.kaggle.com/c/rsna-str-pulmonary-embolism-detection/overview
コンペ概要
- 胸部CT画像から肺塞栓症(Pulmonary Embolism、PE)を予測
- 肺塞栓症の存在に加えて、その特徴についても
2値で予測
wikipedia より
肺血栓塞栓症(はいけっせんそくせんしょう、英語 : Pulmonary thromboembolism;
PTE)は身体の血流によって体内から運ばれてきた血栓が栓子となって肺動脈が閉塞
すること(塞栓)である。血栓以外の物質が栓子となった場合も含めて、肺塞栓症(英語 :
Pulmonary embolism; PE)という。
データ概要
データ容量:912.92 GB!!
形式:画像+テーブル
1. dicom で与えられた CT の検査結果
2. テーブルによる追加情報
● StudyInstanceUID - データ内の各検査(exam/study)の一意のID
● SeriesInstanceUID - 検査中の各シリーズに固有のID
● SOPInstanceUID - 検査内の各画像に固有のID
● pe_present_on_image - 画像レベル: 画像上にPEが存在するか
● negative_exam_for_pe - 検査レベル: PEが存在する画像があるか
● qa_motion - 検査で放射線技師がモーションアーチファクトの問題を指摘したか
● qa_contrast - 放射線技師が検査で造影に問題があると指摘したか
● flow_artifact - 参考値
● rv_lv_ratio_gte_1 - 検査レベル: 検査に含まれる RV/LV 比が >= 1 であるか
● rv_lv_ratio_lt_1 - 検査レベル: 検査に含まれるRV/LV比が1未満であるか
● leftsided_pe - 検査レベル: 画像の左側に PE が存在するか
● chronic_pe - 検査レベル: PE が慢性的なものであるか
● true_filling_defect_not_pe - PE ではない疾患があるか
● rightsided_pe - 検査レベル: 検査中の画像の右側に PE が存在するか
● acute_and_chronic_pe - 検査レベル: PEが急性および慢性の両方であるか
● central_pe - 検査レベル: 画像の中心部に PE が存在するか
● indeterminate - 検査レベル: 検査は PE に対して陰性ではないが、QA の問題により
試験レベルの最終的なラベルセットを作成できなかった
検査数
train: 7279 studies
public: 650 studies
private: 1517 studies
※RV/LV Ratio は心臓の右心房・左心房の比
<StudyInstanceUID>/<SeriesInstanceUID>/<SOPInstanceUID>.dcm
慢性か急性か
RV/LV比はどうか
(PEのせいで右心房に負担 )
PEが大体
どの辺か
※RV/LV Ratio は心臓の右心房・左心房の比
造影に問題あり
ラベルについての説明
ラベルは論理的に一貫性を
保つ必要がある
塞栓があると血液が細くなる
→血液の圧力が高くなる
→心臓の右側に負担
→心臓の右側が大きくなる
評価指標:
複雑な weighted log loss
Exam Level
  i: ラベル, j: exam, w_ j
Image Level(PEが存在するか)
 i: exam番号, k: exam中のimage番号, w = 0.07361963
これらの weighted log loss の平均を取る
Label Weight
Negative for PE 0.0736196319
Indeterminate 0.09202453988
Chronic 0.1042944785
Acute & Chronic 0.1042944785
Central PE 0.1877300613
Left PE 0.06257668712
Right PE 0.06257668712
RV/LV Ratio >= 1 0.2346625767
RV/LV Ratio < 1 0.0782208589
Exam level (w_ j)
exam level
image level
コンペのその他の特徴
ノートブック提出コンペ
- 推論時間(提出時の制限)
- CPUノートブック<= 9時間の実行時間
- GPUノートブック<= 9時間の実行時間
- 提出されたカーネルはトレーニングセットにアクセスできない(事前に学習する必要あり)
- プライベートテストセットはパブリックテストセットの約
3倍(230GB対70GB)
inclass コンペではこの形式はできないが、実際の
Kaggleのコンペだと良くある形式
(多少)使われていたフレームワーク:MONAI
PyTorch ベースのヘルスケア用ディープラーニングフレームワーク
何が便利か?→3D データを扱うのが楽!
・3D のモデル構築
・3D データのオーグメンテーション
(MONAI 3D CNN Baseline)
マシンスペック・計算資源(学習時)
3Dデータなのでまとめて学習させようとすると結構なメモリが必要?
→ 推論ならまだしも学習では16 GBくらいのVRAM だと厳しそう
・https://www.kaggle.com/boliu0/monai-3d-cnn-training
 GPUs (32G each) and 32 CPU cores locally with batch size 48
 → Kaggle Notebokk では batch size 8 に
・2位:24GB NVIDIA QUADRO RTX 6000(60万くらい?)x 4
学習や推論にかかる時間
推論だけで...
・public test: 1~2h
・private test: 4~8h
という人もいた
Saving time and GPU before submitting
高速な実験について
23位の人のソリューション
今回はデータ量が膨大
・trainデータの30%
・小さい画像
・小さいモデル
・チャンネル数は3→1に
→ちゃんと学習させるのは良い結果が出てから
上位の解法
多かった解法としては
1. EfficientNet で画像ごとに特徴量抽出
2. Transformer, Bi-LSTM などで検査のSeries を sequencial なデータとして処理
という流れ。
連続するスライスをうまくsequencial なデータとして扱えるかが鍵だった模様。
5位
1位
画像ごとに特徴量を抽出→resize→biGRU
2位
上位到達のポイント:前処理
肺をbboxで検出して拡大する(1位)
- 1検査あたり4枚をアノテーションし
て学習
- Efficientnet-b0 をバックボーンとし
て使用
上位到達のポイント:前後の画像とあわせて学習
● 隣接するスライスや前後のスライスをあわせて、3つのチャンネルに1枚ずつ入れて学習させるとうまく予
測できる
● 医師も前後のスライスと合わせて診断を行っていた
● 血管は前後のスライスを見ると段々と細くなっていくことがわかるらしい
● 1枚だけだと普通の血管との違いが分からなかったりする?
上位到達のポイント:後処理
Label Consistency Requirement Details
検査(study/exam) に対する出力結果は論理的に一貫性がある必要がある:
→無視すると入賞できない
例:画像レベルでPEが存在すると(p>0.5) と予測したら、検査レベルでも存在する
(p>0.5) とする
1位の後処理
for each study:
if the original predictions satisfy the consistency requirement
do nothing
else
change the original predictions into consistent positive predictions, and compute loss between them
change the original predictions into consistent negative predictions, and compute loss between them
choose from the positive and negative predictions based on which causes the smaller loss
リンク
- 1位:画像ごとに特徴量抽出→次元を揃えてbi-GRU
- 2位:画像ごとにefficientnetで特徴量抽出→transformer + 心臓に注目した3dモデル
- 5位:画像ごとにefficientnetで特徴量抽出→Bi-LSTM, Bert transformer
- 7位:画像ごとにefficientnetで特徴量抽出→transformer
- 10位:efficientnet + 3d
時系列モデル
時系列に関するタスクの分類
普通のNN 画像キャプショニング テキストの感情分析 翻訳
遅延モデル(全部読み込んで予測) 同期モデル
動画(フレームごと)
今度こそわかるぞRNN, LSTM編
シーケンスモデル:RNN
● 前の中間層を次の出力に用いる
デメリット
● 勾配消失問題
● 重み衝突
(短期で重要な情報と、長期で重要な情報につい
て、どちらの重みを大きくするのか?)
● 短期の時系列なら良いが、長期間の情報を保持で
きない
シーケンスモデル:LSTM
● RNNのデメリット回避
● 中間層を変更して長期の時系列でも学習可能に
シーケンスモデル:GRU
LSTMを少し簡略したモデル
● 入力ゲートと忘却ゲートを「更新ゲート」と
して1つのゲートに統合
Bi-directional RNN
過去の情報に加えて、未来の情報も用いる
未来の情報がないと予測できない
語順が関係なさそうな言語で良い精度が出る
(日本語とか)
シーケンスモデルについて
参考:RNNからTransformerまでの歴史を辿る
~DNNを使ったNLPを浅く広く勉強~
Seq2Seq
時系列データ→1次元化→時系列の答え
時系列を加味したオートエンコーダみたいな
もの
前知識:Attention
全体を見ると余分な情報も含んでいる(普通の
CNN, RNNなど)
→必要なところに注目する(Attention)
例:画像の背景情報を無視して対象物だけに注目したい
例:文章中の特定の単語に注目したい
わかりやすい動画:Deep Learning入門:Attention(注意)
Transformer
● 高性能
● 学習が早い
○ 推論時のDecoder 以外はまとめて学習可
● self-attention
めっちゃ分かりやすい: 図で理解するTransformer
BERT
Bidirectional Encoder Representations from Transformers

● GPT-1とは違い双方向の学習をするよ

● transformer のエンコーダを使うよ

● 大量のラベルなしデータで事前学習をするよ

● すごく性能が良いよ

最後に
● LAIMEって学生団体で定期的に機械学習の勉強会してます
● 勉強会以外にも招待制コンペとかやってます
● 公式ページ:https://laime-ml.github.io/

More Related Content

Featured

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
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming LanguageSimplilearn
 

Featured (20)

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
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 

Kaggle勉強会: RSNA STR pulmonary_embolism_detection