SlideShare a Scribd company logo
1 of 25
Chainerを使って
博士研究はじめました
さまこば@samcoba
2018.12.15
1
自己紹介
・Twitter:さまこば@samacoba
・石川県金沢市在住(子育て中)
・10年エンジニア(電気・機械系)
⇒北陸先端科学技術大学院大学(JAIST ) 博士後期課程(学生)
<JAIST>
・大学院(修士・博士)だけの国立大
・石川キャンパスと東京サテライト(品川・社会人コース)
・情報系の講義はほぼ録画してあり、VPNで自宅でも見れる
・年3回石川でオープンキャンパス
2
Chainer・深層学習との関わり
2015 2016 2017 2018 2019
2016.7
Chainer Meetup #03
“Chainerを使って細胞を数えてみた”
2015.6
Chainer公開
2018.4
JAIST 博士入学
2017.3
DiscoGAN
CycleGAN
2015.11
DCGAN
2016.11
pix2pix
2017.3 Qiita
“DiscoGANを使って「教師なし」でお米を数えてみる”
2015.10
深層学習・Chainer
を使い始める
3
https://twitter.com/kaityo256/status/989138383753498624
論文執筆の理想と現実
ロボ太@kaityo256
おそらく
今このへん
4
元々の興味
・カウント(細胞など)を手動で行うことがあった
・画像処理ソフト or プログラムの作成
⇒使いこなすまでに時間がかかる場合や汎用的に使えない
深層学習を使って、調整なしで、自動でカウントできないかなぁ?
5
DiscoGAN
再構成(A)ロス
再構成(A)ロス
GAN(A)ロス
GAN(B)ロス
B識別機
A識別機
変換器A⇒B
変換器A⇒B
変換器B⇒A
変換器B⇒A
A本物
B本物
B偽物
A偽物
A再構成
B再構成
DiscoGAN
https://arxiv.org/abs/1703.05192
A:金髪
(元データ)
B:黒髪
(生成)
A:金髪
(生成)
B:黒髪
(元データ)
変換器A⇒B
変換器B⇒A
CycleGAN(シマウマをウマ)
とぼぼ同じ
黒髪の人と金髪の人のデータを集めるだけで、金髪⇔黒髪の変換ができる 6
ドメインA:
お米画像
ドメインB:
ランダムガウス球画像
位置は一致していない
変換器
A⇒B
変換器
B⇒A
DiscoGAN Network
B 識別機
A 識別機
お米画像Aとランダムガウス球画像Bの一部を切り取り
ドメインA⇔Bの変換器を学習させる
学習時
DiscoGANを使って「教師なし」でお米を数えてみる
512×512の画像1枚
7
変換器
A⇒B
変換器
A⇒B
変換器
B⇒A
変換器
B⇒A
変換結果
A:お米変換
B:ガウス球変換 A:お米再構成
B:ランダムガウス球
A:お米実画像
B:ガウス球再構成
8
変換器
A⇒B
A:お米実画像 ピーク位置検出B:ガウス球変換 元画像+検出位置
カウント方法
カウント自体はニューラルネットではない
(Maxpoolingなど使っている)
元画像をガウス球ドメインに変換することで、カウントをしやすくしている
9
サンプルを変えて実験
M3 ナット(ユニクロ)
・白紙背景
・デジカメで撮影
・512×512にリサイズ
16個 108個
10
白黒2値化
M3 ナット(ユニクロ)
影・反射の影響のため、画像処理でカウントするにはちょっと工夫(専門知識)が必要
16個 108個
11
・ランダムの球の数はハイパーパラメータ
ランダム球の数
見た目で(オーダーが)だいたいあっていれば学習できている
→検討の余地あり
12
ガウス球の数を変えてテスト
16個 108個
Ave = 13個 Ave = 26個 Ave = 52個 Ave = 131個
それぞれ20回ずつテスト 13
テスト結果
16個
108個
Ave = 13個 Ave = 26個 Ave = 52個 Ave = 131個
※カウント成功回数 (90%以上) / 試行回数
5/20 12/20 0/20 1/20
0/20 0/20 0/20 18/20
14
失敗例①
入力
結果
Ave = 52個16個
一つのオブジェクトから複数の球が生成されてしまう
<<
15
失敗例②
入力
結果
Ave = 26個108個
全面黒が生成しやすくなる
>>
16
ランダムサンプリング
4種類それぞれ25%確率でサンプリング
108個
108個
16個
108個
1/20
0/20
結果
※成功回数 / 試行回数
17
ここまでのまとめ
識別機に見せる「テンプレカード」と変換器した「ガウス球変換カード」の分布が異なると
変換器は無理やりテンプレカードに合わせようとするので、望ましい結果にはならない。
ガウス球
変換カード
実画像
0/1
変換器
A⇒B
識別機
18
テンプレカード
(ランダムガウス球)
ここまでのまとめ
識別機に見せる「テンプレカード」と変換器した「ガウス球変換カード」の分布が異なると
変換器は無理やりテンプレカードに合わせようとするので、望ましい結果にはならない。
⇒テンプレカードを調整して配る「ディーラ(仮)」が必要?
ガウス球
変換カード
実画像
0/1
変換器
A⇒B
識別機
108
個
ディーラ
調整して配る
19
テンプレカード
(ランダムガウス球)
<ネットワーク>
・ディーラの出すカードの確率分布をNNで学習できるか?
⇒ChainerのFunctionにあったGumbel softmaxが使えそう
ディーラの設計
<損失>
・ディーラは何を目的(損失関数)として調整するか?
⇒とりあえず変換器と同じようにGANで学習
確率に連動して
サンプリング
zπ
Gumbel softmax
https://arxiv.org/abs/1611.01144
離散値を確率分布に連動して、
サンプリングする微分可能な関数
20
ディーラ(仮)使ったネットワーク
識別機
ガウス球
変換カード
実画像
テンプレカード
変換器
A⇒B
0/1ディーラ
全結合NN(1⇒4 )
1
softmax
Gumbel
softmax
*
*
*
*
sum
0~1の確率 ほぼ0 or 1のサンプリング
0.00
0.01
9.98
0.02
0.67
0.12
0.12
0.10
w=0.2
w= 0.1
w= 0.2
w= 2
0.1
0.2
0.2
2
識別機が間違える方向に
逆伝播させディーラを学習
(変換器とほぼ同じ)
離散的なカードを確率的に制御する
スイッチを学習できる
Ave = 13個
Ave = 26個
Ave = 52個
Ave = 131個
Chainerでは
FunctionやLinkをつなげていけば
簡単に逆伝播できる
※B⇒A変換も同様に行っ
ているがこの図では省略
21
22
M3ナット108個 画像1枚(512×512)
結果動画
動画 32倍速
RTX 2080 1台で学習
Gumbel-Softmax使ってサンプリング
108個
108個
16個
108個
19/20
13/20
結果
※成功回数 / 試行回数
ディーラ(仮)使った結果
23
13 26 52 131
13 26 52 131
学習後の確率分布例
まとめ
課題
・DiscoGANを使って、ほぼ教師なしでカウントができた
・ディーラ(仮)を使うと、幅広くカウントができるようになった
・形状を持ったテンプレカードで数以外の「長さ」なども計測してみる
24
発展
・とても不安定(写真を取り直したらうまくいかないものもあった)
最後に
・世の中早すぎる上、サーベイ不足
⇒近い論文など、教えていただければうれしいです
・もしアプリケーションとして興味がある方がいれば
⇒ご連絡いただければと思います
Twitter:さまこば@samacoba
フォローよろしくお願いします!
今日の資料はtwitterにリンクしてあります
ご清聴ありがとうございました
25

More Related Content

Featured

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
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)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
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
 

Chainerを使って博士研究はじめました