SlideShare a Scribd company logo
1 of 26
Download to read offline
pix2pixで
ハンバーガーの自動着色
慶應SFC 環境情報 3年 都築本成
目次
● 結果
○ 画像
○ データセット
○ 実験の詳細
● pix2pixとは
○ AutoEncoder + GAN
■ 全体画像
○ AutoEncoderはU-Net
○ GANはPatchGAN
●
結果 (test-data)
結果 (test-data)
データセット
● Instagramからハンバーガー画像を大量に集めてくれた人がいる
○ https://qiita.com/knok/items/5bc8386a57c157279455
● そこからさらに
- ハンバーガーがメイン
- おいしそう
な画像を目視で選んだ
● お腹が空く
● Train = 400枚
● Test = 140枚
● データは画像単位でユニークを確認。TrainとTestに重複なし
● データセットを見せる
実験の詳細
● 1epoch = 400画像しかつかっていない
● 200epoch
● 手元のGTX1060 6Gで3時間30分
● 簡単なタスクを選んだとはいえ、GANにしては非常に安定しており、収束が速い
● pix2pixすごい!
実験の詳細
結果 (test-data)
結果
● ham_test/index.htmlを見せる
さらに結果
● trainデータはハンバーガーのみ
● きちんとtrainデータから学習しているかどうかを確かめるため、
ハンバーガー以外の白黒画像をGeneratorに入れてみる
結果
結果
結果
● ham_random/index.htmlを見せる
pix2pixとは
● 画像の変換ができる
● 色塗り、航空写真から地図、超解像にも使える
● PaintsChainerもこれの亜種らしい
● 2016/11がv1
● 林くんの発表と似ています
GAN
pix2pixとは
cGANの亜種
- Generator: AutoEncoderが画像を変換する。Discriminatorを騙すように学習。
- Discriminator: CNNが(線画, 本物画像)を与えられた時はreal,
(線画, 変換画像)を与えられた時はfakeと見分けられるように学習
GeneratorとDiscriminatorが敵対的に学習する
AutoEncoderとは
- Encoder: 画像をCNNで畳み込んで、20次元程度に落とす
- Decoder: 20次元からもとの(256*256)次元に復元する。
inputとoutputの画素単位の違いが少なくなるように学習すると、EndoderとDecoderの
接続点で画像の情報が圧縮される。
画素単位の誤差をL1 Lossという
U-Net AutoEncoderの亜種
skip-connection
U-Net
● AutoEncoder + Skip-Connection
● Skip-Connectionで詳細情報を捉え、深いEncoderで全体の情報を捉える
pix2pixとは
cGANの亜種
- Generator: AutoEncoderが画像を変換する。Discriminatorを騙すように学習。
- Discriminator: CNNが(線画, 本物画像)を与えられた時はreal,
(線画, 変換画像)を与えられた時はfakeと見分けられるように学習
GeneratorとDiscriminatorが敵対的に学習する
PatchGAN
● モノクロ絵と生成画像をlayer方向に重ねる
● 最終Mapが30*30*1になるように5回畳み込み。kerner_size4, stride2
● それぞれの場所の本物度を出力。最終出力はそれらの平均
● 最終Mapから逆にたどると、そのpixelは画像の一部しか見ていないことになる
PatchGAN
● 論文だと70 * 70patchが良いとされている
● patchが何を指すかは論文を読んでもよくわからない
AutoEncoder vs pix2pix
● AutoEncoderはDがL1 loss (pixel誤差)
● pix2pixはDがGAN
AutoEncoder vs pix2pix
● pix2pixではAutoEncoderで使われていたL1 LossをGANに置き換えたと
ころがキモっぽい
● L1 Lossは画素ごとの誤差なので、Gが汎化するためにはぼやけた画像を
出力したほうが有利
● GANならぼやけた画像を簡単に見破り、GのLossが上がるため、Gは鮮明
な画像を出力するようになる
L1 Loss vs PatchGAN
● L1+GANのLossが優秀
● あわせ技
● 今回はLoss(G)=Loss(GAN)+100*Loss(L1)
資料
● pix2pix paper
[1611.07004] Image-to-Image Translation with Conditional Adversarial Networks:
https://arxiv.org/abs/1611.07004
● 使用した実装
affinelayer/pix2pix-tensorflow: https://github.com/affinelayer/pix2pix-tensorflow
● ラーメンでやっている記事
Qiita: https://qiita.com/octpath/items/acaf5b4dbcb4e105a8d3

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
 

pix2pixで自動着色