Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
pix2pixで自動着色
Search
Motonari
February 06, 2018
Programming
1.4k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
pix2pixで自動着色
グレースケール化した画像をpix2pixでカラーに復元してみた。
簡単にするため、データセットはハンバーガーのみ。
Motonari
February 06, 2018
More Decks by Motonari
See All by Motonari
検索Editer
motonari728
1
580
Other Decks in Programming
See All in Programming
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5.2k
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
1.1k
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
SREの越境 / SRE Collaboration
y0hgi
2
310
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
4
3.5k
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
170
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
180
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
220
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
420
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
380
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
290
カツオ、ご期待ください
suneo3476
0
190
Featured
See All Featured
HDC tutorial
michielstock
2
960
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
How to Talk to Developers About Accessibility
jct
2
580
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
460
Navigating Weather and Climate Data
rabernat
0
560
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
480
Bash Introduction
62gerente
615
220k
Optimising Largest Contentful Paint
csswizardry
37
4k
GitHub's CSS Performance
jonrohan
1033
470k
Navigating Team Friction
lara
192
16k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
890
Transcript
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