SlideShare a Scribd company logo
1 of 30
Carvana 3rd Place Solution
横尾 修平 / @lyakaap
アジェンダ
 自己紹介
 コンペ概要
 自分の手法の紹介
 他の上位者の解法
 振り返って
1
自己紹介
 長野高専 → 筑波大に編入(現在B4)
 コンピュータービジョン系の研究室所属
 like : 🍣、🍜、🀄
2
Carvanaコンペの概要
 正式名称:Carvana Image Masking Challenge
 車画像の背景切り抜きの精度を競う
3
Carvanaコンペの概要
 色々な車の16視点画像
 背景はほぼ均一
 評価指標はDice係数 :
2|𝑋∩𝑌|
𝑋 +|𝑌|
 train: 約5000枚, test: 約100000枚
4
16 view
教師データ
モデルの選択・構築
 セグメンテーション系のコンペではとりあえず U-Net1
 Dilated Convolutionも結構いい感じ
 そこでU-NetとDilated Convolutionを組み合わせた
5
1U-Net: Convolutional Networks for Biomedical Image Segmentation [Olaf Ronneberger, et al. 2015]
U-Net
 U字型で左右対称
 全結合層を持たない
 スキップ結合を持つ
6
Dilated Convolutionとは
 間隔を空けて畳み込むConvolution
 Dilation rate(膨張率)に応じてスキップする幅が変わる
(膨張率=1で通常のConvolution)
 パラメーター数を増やさずに受容野を広げることが出来る
7
Dilated Convolutionの積層
 Multi-Scale Context Aggregation by Dilated Convolutions [Fisher Yu, et al. 2015]
 様々な膨張率のDilated Convolutionを積層させることを提案
8
Conv
U-Netのどの位置に配置するか
 “Bottleneck” (図中赤枠)の部分を置き換える
9
10
U-Net + Dilated Convolution
精度検証(U-Net + DC)
 Bottle Neckの部分を変えたものを3パターン実験(層数は全て同一)
 全て通常のConvolutionを使ったバージョン
 Dilated Convolutionを積層させたバージョン
 Dilated Convolutionを並列に適用させたバージョン
11
通常バージョン 積層バージョン 並列バージョン
0.9905 0.9918 0.9916
input: 256x256px
Pseudo Labeling
 半教師付き学習の一種
 テストデータを疑似の訓練データとして使う方法
 正則化の効果
12
Pseudo Labeling の解説図
13
訓練済み
モデル
Test Data
予測
Pseudo Labeled Data
Train Data
モデル
訓練
1 2
Pseudo Labelingの効果
 スコア及び汎化性能の向上に大きく貢献 (Private LB:34 → 6位)
 Pseudo Labelの正確さはスコアに影響
 Pseudo Labelをどんどん良いものにチェンジ
 ここまで精度に効いた理由
 テストデータの量が多い
 精度が出やすいタスクだった
14
Public LB Private LB
Pseudo Label なし 0.99703 0.99687
Pseudo Label あり 0.99717 0.99719
アンサンブル
 5fold @1536 x 1024px + 6fold @1920 x 1280px
 fold間で変えたもの:
 各種seed(initializer, データの更新の順番)
 Pseudo Labelのサンプリングレート
 TTA(Test Time Augmentation)
 訓練時に使用した水平方向の反転のみ
15
テスト画像に対する予測の評価
 予測の精度が低いテスト画像を特定
 正解が分からないのにどうやって精度が低いか判断する?
 異なるモデル間での予測結果のばらつきを見る
16
テスト画像に対する予測の評価
17
一番安定してる 一番ばらついてる
後処理
 CRF(条件付き確率場)でマスクの後処理
 予測が難しいデータ※にのみ適用
18※ばらつきが大きかったテスト画像上位100枚を「難しいデータ」とした
後処理後未処理の予測結果
スコアは悪化・・・
なぜ上手く行かなかったか
19
 CRFがアグレッシブすぎる
 そもそも予測マスクが酷いことに
なっているケースはごく少数
後処理の前後で変わらなかった部分
後処理により背景とみなされた部分
後処理により車とみなされた部分
結局・・・
 コンペ終了までに適切な後処理の方法が浮かばず
 立ちはだかる0.9973の壁
20
最終スコア
21
※ 0.000001の差:画像一枚あたり2.5ピクセル
(画像一枚で全3682560ピクセル)
他の上位者の解法(5th place, @Kyle)
 色々な解像度で学習させたモデルでのアンサンブル
 1280x1280, 1600x1280, 1918x1280, and 2010x1340
22
 後処理:予測マスクの車領域を検出→車領域内を修正
 「修正するorしない」を車領域の境界からの距離で判断
他の上位者の解法(11th place, @JandJ)
23
 3ステップで学習
 Stage 1:層数の浅いシンプルなU-Netで雑に予測
 Stage 2: Stage 1の予測結果を使って境界付近を
256x256のパッチに切り抜く
 Stage 3: より深いU-NetでパッチごとにRefine
反省点
 予測精度の低いPseudo labelデータを学習に含めてしまった
 CVで別視点・同一車種の画像を別foldに分割してしまった
 締め切り20分前に予測結果を提出しようとしたら間に合わなかった
24
まとめ
 Carvanaコンペは二値分類のセグメンテーションのコンペ
 U-NetとDilated Convolutionを組み合わせた
 後処理が上手く行かず
 Pseudo Labeling・アンサンブルでスコア向上
25
モデルのコード置き場 :
https://github.com/lyakaap/Kaggle-Carvana-3rd-Place-Solution
26
おまけ
設定いろいろ
 Optimizer: RMSprop (learning rate=0.0002)
 Batchsize: 1 (物理的に1が限界だった)
 Data Augmentation: 水平方向の反転のみ
 Loss Function: dice loss1 + binary cross entropy
27
1 dice loss = 1.0 – ダイス係数
他に試したこと
 Model: Tiramisu (U-Net + Dense Net), Normal U-Net
 Upsampling: Pixel Shuffler, Transposed Convolution
 Regularization: Batch Normalization/Renormalization, Dropout, Weight Decay
 Activation: ELU, LeakyReLU, PReLU, RReLU
 Optimizer: momentumSGD, Adadelta, Adam
 Data Augmentation: Rotate, Shift, HSV Shift
28
29

More Related Content

Featured

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
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
 

Featured (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
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
 

Kaggle Carvana 3rd Place Solution

Editor's Notes

  1. では軽くU-Netについて説明したいと思います。U-Netはその名の通り、この図のようなU字型の左右対称なモデルです。 他のCNNを使ったセグメンテーションモデルと同じく、全結合層を持たないFully Convolutionalなモデルになっています。 U-Netは、一旦この図の左側の部分で、畳み込みとマックスプーリングで特徴抽出して、右側の部分で縮んでしまった特徴マップの解像度をアップサンプリング操作で復元していくという処理を内部でするので、Auto Encoderみたいなエンコーダデコーダアーキテクチャとも言えます。 U-Netの最大の特徴としては、デコーダ側から特徴マップが同じ解像度を持ってるエンコーダ側へのスキップ結合を持ってるということです。これによってローカルな情報とグローバルな情報の両方を効率よく使うことが出来ます。
  2. 受容野、つまり一回の畳込みで考慮している範囲
  3. そんなDilated Convolutionをこの論文では積層させようと提案しています。どんな感じで積層させるかと言うと、この画像のように浅い方から順に指数的に膨張率を上げて行くという感じです。 これによって様々なスケールの情報を集約出来るようになります。
  4. で、両方を組み合わせたモデルがこちらです。ノーマルなU-Netに対して変わった部分はBottleNeckの部分だけで、dilation rate、つまり膨張率を1から32まで指数的に増やしていったものを積層しました。工夫点としては、それぞれのdilated convolution層からスキップ結合するルートも生やして最後に総和を取るということもしています。
  5. 一応、本当にDilated Convolutionを適用させることに意味があるのかを、Bottle Neckの部分を変えたものを3パターン実験しました。公平な評価のために、層数などのパラメーターは全て同じものを使っています。 で、1パターン目が全部通常のConvolutionにしたもの、二つ目が積層させたバージョン、これは前スライドのモデルと一緒ですね。で三つ目が積層ではなく並列させるバージョン。これは異なる膨張率のDilated Convolutionに対しては、別々に入力を与えて、最後にそれぞれの出力を足し合わせるというネットワーク構造にしました。
  6. では、このコンペで、かなりのスコア向上の貢献をしてくれたPseudo Labelingについて紹介します。 Pseudo Labelingは半教師付き学習の一種で、Pseudoは日本語で擬似という意味があります。 概要についてざっくりと言うと、テストデータを擬似の訓練データとして使うという方法で、正則化の効果があるそうです。
  7. (ここで使うPseudo Labelは、予測結果をそのまま確率で使ういわゆる"soft"な方法と, 実際のラベルみたいに二値化してから使う"hard"な方法の2パターンが考えられます。一応両方試した結果、前者のsoftな方法の方が良かったです。)
  8. 上の段がPseudo Labelなし、下の段がPseudo Labelありの場合の結果
  9. クロスバリデーションによって出来たモデルを使うことのメリットは二つあって、一つ目が全てのデータを訓練に使用できる、もう一つがアンサンブルのコストが低い デメリットはモデルの多様性が低い 他の上位者は大体このアンサンブル方法
  10. で、あとはすることと言えば予測マスクに対する後処理なんですが、まず後処理をするにあたって、モデルによって得られた予測結果に対して、それぞれがどのくらいイイ線行ってるのか評価する方法を考えました。 何故予測の評価をするかと言うと、どのような後処理の方法が適しているのかがある程度分かるということが理由としてあります。 では正解がわからないのにどうやって精度を測るんだということについてなんですが、アンサンブル前の異なるモデル間での予測結果の分散を計算して、ばらつきを見るようにしました。
  11. 本当にこの方法が予測精度の評価が出来ていそうかという疑問は残るので、一番ばらつきが小さかった、あるいは大きかった画像を、マスクを重ねてみて目で確認してみました。見ての通りばらつき値が小さく安定していると思われる画像は、目で見ても上手にセグメンテーション出来ていることが確認できました。逆にばらつきが大きい方は車の内部の方に穴が空いてしまっていて、上手く予測出来ていません。 このことから、ある程度正しく予測の評価が出来ていそうで、難しい画像がちゃんと特定出来ていることが分かりました。
  12. で、具体的にどんな後処理をしたかについてですが、CRFを使いました。CRFは、条件付き確率場によって、色や周辺のピクセル情報を使ってセグメンテーションをRefineするというものです。
  13. では何故上手く行かなかったかについて、他のCRFを適用した例についても確認して考えてみました。 これは難しさランキング100位以内にランクインした画像が後処理の前後でどうなったかについて色を付けて可視化した結果です。どうやらよく見てみるとアンテナの部分が赤くなっていて、背景とされてしまっているようです。逆にタイヤホイールの空洞の部分は緑色になっていて、車とされてしまったようです。これから分かる通り、CRFはかなり悪い方向にアグレッシブに働いていそうだという感じでした。 また、そもそも10万枚の予測マスクのうち、前スライドで紹介した例のように車の部分にぽっかり穴が開いている事は珍しく、ほとんどの誤りが境界付近に現れていることが原因だったので 少なくともCRF以外の方法を後処理に使うべきでした。
  14. あとはこの人は後処理に力を入れていて、予測マスクの車領域をまず検出して、車領域内で穴が空いてしまった部分を塞いで修正ということをしています。ただ何も考えずに全ての穴を塞いでしまうと、タイヤホイールの穴の部分も塞いでしまうので、車領域の境界からの距離で塞ぐか塞がないかを決めるという工夫をしています。
  15. threshold
  16. “睡眠とランキングはトレードオフ” by onodera (Instacart 2nd Place Solution)