Generative Adversarial Networks
Today’s class
Supervised vs Unsupervised Learning
Credit: cs231n, Stanford
Supervised Learning
Data: (x, y)
x is data, y is label
Goal: Learn a function to map x -> y
Examples: Classification, regression, object detection, semantic segmentation, image captioning, etc.
Supervised vs Unsupervised Learning
Credit: cs231n, Stanford
Supervised Learning
Data: (x, y)
x is data, y is label
Goal: Learn a function to map x -> y
Examples: Classification, regression, object detection, semantic segmentation, image captioning, etc.
Cat
Classification
Supervised vs Unsupervised Learning
Credit: cs231n, Stanford
Supervised Learning
Data: (x, y)
x is data, y is label
Goal: Learn a function to map x -> y
Examples: Classification, regression, object detection, semantic segmentation, image captioning, etc.
Object Detection
Supervised vs Unsupervised Learning
Credit: cs231n, Stanford
Supervised Learning
Data: (x, y)
x is data, y is label
Goal: Learn a function to map x -> y
Examples: Classification, regression, object detection, semantic segmentation, image captioning, etc.
Semantic Segmentation
Supervised vs Unsupervised Learning
Credit: cs231n, Stanford
Supervised Learning
Data: (x, y)
x is data, y is label
Goal: Learn a function to map x -> y
Examples: Classification, regression, object detection, semantic segmentation, image captioning, etc.
Image Captioning
Supervised vs Unsupervised Learning
Credit: cs231n, Stanford
Unsupervised Learning
Data: x
Just data, no labels!
Goal: Learn some underlying hidden structure of the data
Examples: Clustering, dimensionality reduction, feature learning, density estimation, etc.
Supervised vs Unsupervised Learning
Credit: cs231n, Stanford
Unsupervised Learning
Data: x
Just data, no labels!
Goal: Learn some underlying hidden structure of the data
Examples: Clustering, dimensionality reduction, feature learning, density estimation, etc.
K-Means Clustering
Supervised vs Unsupervised Learning
Credit: cs231n, Stanford
Unsupervised Learning
Data: x
Just data, no labels!
Goal: Learn some underlying hidden structure of the data
Examples: Clustering, dimensionality reduction, feature learning, density estimation, etc.
(Principal Component Analysis) Dimensionality Reduction
Supervised vs Unsupervised Learning
Credit: cs231n, Stanford
Unsupervised Learning
Data: x
Just data, no labels!
Goal: Learn some underlying hidden structure of the data
Examples: Clustering, dimensionality reduction, feature learning, density estimation, etc.
Generative Advarsarial Networks (Distribution learning)
Autoencoders
Unsupervised approach for learning a lower-dimensional feature representation from unlabeled training data
Credit: cs231n, Stanford
Autoencoders
Unsupervised approach for learning a lower-dimensional feature representation from unlabeled training data
Originally: Linear + nonlinearity (sigmoid)
Later: Deep, fully-connected
Later: ReLU CNN
Credit: cs231n, Stanford
Autoencoders
Unsupervised approach for learning a lower-dimensional feature representation from unlabeled training data
Originally: Linear + nonlinearity (sigmoid)
Later: Deep, fully-connected
Later: ReLU CNN
Z usually smaller than X
(Dimensionality Reduction)
Credit: cs231n, Stanford
Q: Why dimensionality
reduction?
Autoencoders
Unsupervised approach for learning a lower-dimensional feature representation from unlabeled training data
Originally: Linear + nonlinearity (sigmoid)
Later: Deep, fully-connected
Later: ReLU CNN
Z usually smaller than X
(Dimensionality Reduction)
Credit: cs231n, Stanford
Q: Why dimensionality
reduction?
A: Want features to capture meaningful factors of variation in data
Autoencoders
How to learn this feature representation?
Credit: cs231n, Stanford
Autoencoders
How to learn this feature representation?
Train such that features can be used to reconstruct original data “Autoencoding” - encoding itself
Credit: cs231n, Stanford
Autoencoders
How to learn this feature representation?
Train such that features can be used to reconstruct original data “Autoencoding” - encoding itself
Originally: Linear + nonlinearity (sigmoid)
Later: Deep, fully-connected
Later: ReLU CNN
Credit: cs231n, Stanford
Autoencoders
How to learn this feature representation?
Train such that features can be used to reconstruct original data “Autoencoding” - encoding itself
Decoder: 4-layer upconv
Encoder: 4-layer conv
Input Data
Reconstructed Data
Credit: cs231n, Stanford
Autoencoders
Train such that features can be used to reconstruct original data
L2 Loss Function
Decoder: 4-layer upconv
Encoder: 4-layer conv
Input Data
Credit: cs231n, Stanford
Reconstructed Data
Autoencoders
Train such that features can be used to reconstruct original data
L2 Loss Function
Decoder: 4-layer upconv
Encoder: 4-layer conv
Input Data
Credit: cs231n, Stanford
Reconstructed Data
Doesn’t use labels!
Credit: cs231n, Stanford
Autoencoders
Reconstructed Data
Encoder: 4-layer conv
Decoder: 4-layer upconv
Input Data
After training, throw away decoder
Autoencoders
Credit: cs231n, Stanford
Autoencoders
Credit: cs231n, Stanford
Loss Function (Softmax, etc.)
Encoder can be used to initialize a supervised model
Autoencoders
Credit: cs231n, Stanford
Encoder can be used to initialize a supervised model
Loss Function (Softmax, etc.)
Fine- tune encoder jointly with classifier
Train for final task
(sometimes with
small data)
Credit: cs231n, Stanford
Generative Adversarial Networks
Ian Goodfellow et al., “Generative Adversarial Nets”, NIPS 2014
Sample from a simple distribution, e.g. random noise. Learn transformation to training distribution.
Generative Adversarial Networks
Credit: cs231n, Stanford
Ian Goodfellow et al., “Generative Adversarial Nets”, NIPS 2014
Sample from a simple distribution, e.g. random noise. Learn transformation to training distribution.
A neural network can be used to represent
this complex transformation?
Training GANs: Two-player game
Credit: cs231n, Stanford
Ian Goodfellow et al., “Generative Adversarial Nets”, NIPS 2014
Generator network: try to fool the discriminator by generating real-looking images
Discriminator network: try to distinguish between real and fake images
Training GANs: Two-player game
Credit: cs231n, Stanford
Generator network: try to fool the discriminator by generating real-looking images
Discriminator network: try to distinguish between real and fake images
Ian Goodfellow et al., “Generative Adversarial Nets”, NIPS 2014
Fake and real images copyright Emily Denton et al. 2015.
Training GANs: Two-player game
Figure: Ian Goodfellow NIPS Talk
Ian Goodfellow et al., “Generative Adversarial Nets”, NIPS 2014
Generator network: try to fool the discriminator by generating real-looking images
Discriminator network: try to distinguish between real and fake images
Training GANs: Two-player game
Ian Goodfellow et al., “Generative Adversarial Nets”, NIPS 2014
After training, use generator network to generate new images
Fake and real images copyright Emily Denton et al. 2015.
Credit: cs231n, Stanford
Training GANs: Two-player game
Credit: cs231n, Stanford
Generator network: try to fool the discriminator by generating real-looking images
Discriminator network: try to distinguish between real and fake images
Ian Goodfellow et al., “Generative Adversarial Nets”, NIPS 2014
Training GANs: Two-player game
Credit: cs231n, Stanford
Generator network: try to fool the discriminator by generating real-looking images
Discriminator network: try to distinguish between real and fake images
Ian Goodfellow et al., “Generative Adversarial Nets”, NIPS 2014
Training GANs: Two-player game
Credit: cs231n, Stanford
Ian Goodfellow et al., “Generative Adversarial Nets”, NIPS 2014
Generative Adversarial Nets
Generated Samples [MNIST Database, Toronto Face Database (TFD)]
Nearest neighbor from training set
Ian Goodfellow et al., “Generative Adversarial Nets”, NIPS 2014
Generative Adversarial Nets
Generated Samples [CIFAR-10 Database]
convolutional discriminator and Fully connected model “deconvolutional” generator
Nearest neighbor from training set
Ian Goodfellow et al., “Generative Adversarial Nets”, NIPS 2014
DCGAN
Radford et al, “Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks”, ICLR 2016
Deep Convolutional Generative Adversarial Nets
Generator
DCGAN
Deep Convolutional Generative Adversarial Nets
Radford et al, “Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks”, ICLR 2016
DCGAN
Radford et al, “Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks”, ICLR 2016
Deep Convolutional Generative Adversarial Nets
DCGAN
Deep Convolutional Generative Adversarial Nets
Generated bedrooms after one training pass through the LSUN dataset.
Amazing!
Radford et al, “Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks”, ICLR 2016
Image-to-Image Translation with Conditional Adversarial Networks
Phillip et al. 2017
Unpaired image to image translation using cycle consistency adversarial networks
Jun-Yan Zhu et al. 2017
“The GAN Zoo”
https://github.com/hindupuravinash/the-gan-zoo
“The GAN Zoo”
https://github.com/hindupuravinash/the-gan-zoo
“The GAN Zoo”
And Many More …………….......
https://github.com/hindupuravinash/the-gan-zoo
GANs: Things to Remember
Take game-theoretic approach: learn to generate from training distribution through 2-player game
Pros:
Cons:
Active areas of research: