generative adversarial networks - sahin olut...image to text (image captioning - generative...

30
Generative Adversarial Networks Sahin Olut Department of Computer Engineering Istanbul Technical University November 4, 2017 Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 1 / 23

Upload: others

Post on 19-Jun-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Generative Adversarial Networks

Sahin Olut

Department of Computer EngineeringIstanbul Technical University

November 4, 2017

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 1 / 23

Page 2: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Outline

1 MotivationWhy should we study generative models?Some results from recent GAN works

2 How does GAN work?GAN ArchitectureFormutalation of GANTraining procedure of GANs

3 Applications of GANsComputer VisionReinforcement Learning

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 2 / 23

Page 3: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Motivation Why should we study generative models?

Outline

1 MotivationWhy should we study generative models?Some results from recent GAN works

2 How does GAN work?GAN ArchitectureFormutalation of GANTraining procedure of GANs

3 Applications of GANsComputer VisionReinforcement Learning

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 3 / 23

Page 4: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Motivation Why should we study generative models?

Motivation

We can restore the missing data by generative models. (Imageinpaiting, super-resolution)

We can generate new examples to enhance our classifier networks.(Data augmentation strategy)

If we want our computers to understand, we have to teach them tocreate. (I do not understand what I cannot create. – RichardFeynman)

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 4 / 23

Page 5: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Motivation Why should we study generative models?

Motivation

We can restore the missing data by generative models. (Imageinpaiting, super-resolution)

We can generate new examples to enhance our classifier networks.(Data augmentation strategy)

If we want our computers to understand, we have to teach them tocreate. (I do not understand what I cannot create. – RichardFeynman)

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 4 / 23

Page 6: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Motivation Why should we study generative models?

Motivation

We can restore the missing data by generative models. (Imageinpaiting, super-resolution)

We can generate new examples to enhance our classifier networks.(Data augmentation strategy)

If we want our computers to understand, we have to teach them tocreate. (I do not understand what I cannot create. – RichardFeynman)

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 4 / 23

Page 7: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Motivation Some results from recent GAN works

Outline

1 MotivationWhy should we study generative models?Some results from recent GAN works

2 How does GAN work?GAN ArchitectureFormutalation of GANTraining procedure of GANs

3 Applications of GANsComputer VisionReinforcement Learning

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 5 / 23

Page 8: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Motivation Some results from recent GAN works

Recent works

Photo-Realistic Single Image Super-Resolution Using a GenerativeAdversarial Network [Ledig et al., 2016]

Figure: Work by Ledig et al., 2016

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 6 / 23

Page 9: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Motivation Some results from recent GAN works

Recent works

Plug & Play Generative Networks: Conditional Iterative Generation ofImages in Latent Space [Nguyen et al., 2017]

Figure: Synthetic images generated from ImageNet classes.

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 7 / 23

Page 10: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

How does GAN work? GAN Architecture

Outline

1 MotivationWhy should we study generative models?Some results from recent GAN works

2 How does GAN work?GAN ArchitectureFormutalation of GANTraining procedure of GANs

3 Applications of GANsComputer VisionReinforcement Learning

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 8 / 23

Page 11: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

How does GAN work? GAN Architecture

Discriminator and Generator Networks

What is a generative model?

Discriminator’s role in GAN is to predict whether the input isgenerated or sampled from training data.

The aim of generator is to capture the distribution of the trainingdata.

According to Goodfellow et al., it is a minimax game betweengenerator and discriminator where generator tries to fooldiscriminator.(There are some debates about it.)

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 9 / 23

Page 12: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

How does GAN work? GAN Architecture

Discriminator and Generator Networks

What is a generative model?

Discriminator’s role in GAN is to predict whether the input isgenerated or sampled from training data.

The aim of generator is to capture the distribution of the trainingdata.

According to Goodfellow et al., it is a minimax game betweengenerator and discriminator where generator tries to fooldiscriminator.(There are some debates about it.)

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 9 / 23

Page 13: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

How does GAN work? Formutalation of GAN

Outline

1 MotivationWhy should we study generative models?Some results from recent GAN works

2 How does GAN work?GAN ArchitectureFormutalation of GANTraining procedure of GANs

3 Applications of GANsComputer VisionReinforcement Learning

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 10 / 23

Page 14: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

How does GAN work? Formutalation of GAN

The description of GANs leads us to formulation for loss:

minG

maxD

V (D,G ) = Ex∼pdata(x)[logD(x)]+Ez∼pz (z)[log(1−D(G (z)))]

(1)

Where both networks rely on gradients flowing through discriminator.

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 11 / 23

Page 15: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

How does GAN work? Training procedure of GANs

Outline

1 MotivationWhy should we study generative models?Some results from recent GAN works

2 How does GAN work?GAN ArchitectureFormutalation of GANTraining procedure of GANs

3 Applications of GANsComputer VisionReinforcement Learning

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 12 / 23

Page 16: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

How does GAN work? Training procedure of GANs

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 13 / 23

Page 17: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

How does GAN work? Training procedure of GANs

GAN Framework

From now and on, we have a basic grasp of GAN, therefore we can codeour own GAN! The starter code can be found in my GitHub Repository:github.com/norveclibalikci/InzvaGanStarter

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 14 / 23

Page 18: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Applications of GANs Computer Vision

Outline

1 MotivationWhy should we study generative models?Some results from recent GAN works

2 How does GAN work?GAN ArchitectureFormutalation of GANTraining procedure of GANs

3 Applications of GANsComputer VisionReinforcement Learning

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 15 / 23

Page 19: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Applications of GANs Computer Vision

Computer Vision Applications

Image generation(Plug and Play GAN)

Style transfer(CycleGAN)

Image inpainting, super-resolution(SRGAN)

Image to text (Image captioning - Generative Adversarial Text toImage Synthesis)

There are many applications which are not covered above.

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 16 / 23

Page 20: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Applications of GANs Computer Vision

Computer Vision Applications

Image generation(Plug and Play GAN)

Style transfer(CycleGAN)

Image inpainting, super-resolution(SRGAN)

Image to text (Image captioning - Generative Adversarial Text toImage Synthesis)

There are many applications which are not covered above.

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 16 / 23

Page 21: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Applications of GANs Reinforcement Learning

Outline

1 MotivationWhy should we study generative models?Some results from recent GAN works

2 How does GAN work?GAN ArchitectureFormutalation of GANTraining procedure of GANs

3 Applications of GANsComputer VisionReinforcement Learning

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 17 / 23

Page 22: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Applications of GANs Reinforcement Learning

Applications to real life

Discriminator can be rewarded for labeling correctly and a new losscan be defined by that way. (Still on research)

Generating environment and test for reinforcement learningapplications.

Simulating particle experiments like they do in CERN.

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 18 / 23

Page 23: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Limitations of GAN

Many things can be done with GANs however, GANs have limitations aswell.

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 19 / 23

Page 24: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Limitations of GAN

There is no training procedure that has been proven to be successful.

Sometimes discriminator learns faster than generator(predictseverything correctly), which leads a gradient problem to generator. Insome cases, it is vice-versa as well.

After from some point, generator keeps generating similar examples.

Losses of models are not meaningful as classifier’s. It just keeposcillating back and forth.

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 20 / 23

Page 25: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Limitations of GAN

There is no training procedure that has been proven to be successful.

Sometimes discriminator learns faster than generator(predictseverything correctly), which leads a gradient problem to generator. Insome cases, it is vice-versa as well.

After from some point, generator keeps generating similar examples.

Losses of models are not meaningful as classifier’s. It just keeposcillating back and forth.

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 20 / 23

Page 26: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Limitations of GAN

There is no training procedure that has been proven to be successful.

Sometimes discriminator learns faster than generator(predictseverything correctly), which leads a gradient problem to generator. Insome cases, it is vice-versa as well.

After from some point, generator keeps generating similar examples.

Losses of models are not meaningful as classifier’s. It just keeposcillating back and forth.

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 20 / 23

Page 27: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Limitations of GAN

There is no training procedure that has been proven to be successful.

Sometimes discriminator learns faster than generator(predictseverything correctly), which leads a gradient problem to generator. Insome cases, it is vice-versa as well.

After from some point, generator keeps generating similar examples.

Losses of models are not meaningful as classifier’s. It just keeposcillating back and forth.

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 20 / 23

Page 28: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Limitations of GAN

Loss graphic of a GAN

Figure: Taken from http://www.rricard.me

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 21 / 23

Page 29: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Summary

Summary

GANs are very powerful tools for generating new samples from datayet it has serious issues.

GAN uses semi-supervised approach therefore, there is no need fordata-labeling.

Unsupervised learning is the cake of true AI. (Yann LeCun, Head ofFacebook Research)

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 22 / 23

Page 30: Generative Adversarial Networks - sahin olut...Image to text (Image captioning - Generative Adversarial Text to Image Synthesis) There are many applications which are not covered above

Appendix For Further Reading

For Further Reading I

Chintala et al.GAN Hacksgithub.com/soumith/ganhacks

Goodfellow et al.Generative Adversarial NetworksarXiv: 1406.2661, 2014.

Sahin Olut (ITU Vision Lab) Generative Adversarial Networks November 4, 2017 23 / 23