generative adversarial networks...generative adversarial nets. neurips. longer version goodfellow,...
Embed Size (px)
TRANSCRIPT

Generative adversarial networks
Hakan Bilen
Machine Learning Practical - MLP Lecture 1323 January 2019
http://www.inf.ed.ac.uk/teaching/courses/mlp/
Slide credits: Ian Goodfellow

Generative modeling
โ Density estimation
โ Sample generation
2

Why are generative models useful?
โ Test of our intellectual ability to use high dimensional probability distributions
โ Learn from simulated data and transfer it to real world
โ Complete missing data (including multi-modal)
โ Realistic generation tasks (image and speech)
3

Next video frame prediction
Lotter et al 2016
4Lotter et al. Deep Predictive Coding Networks for Video Prediction and Unsupervised Learning, ICLRโ17

Photo-realistic super-resolution
5Ledig et al. Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network, CVPRโ17

Image-to-image translation
6Isola et al. Image-to-Image Translation with Conditional Adversarial Nets, CVPRโ17

Maximum likelihood
Assume that all generative models maximise the likelihood of the training data
โ ๐ฅ: inputโ ๐๐๐๐ก๐ : probability density function
of input samplesโ ๐๐๐๐๐๐: estimate probability
function, parameterised by ๐
7

Taxonomy of generative methods
8

Generative adversarial networks
10
generator ๐บ(โ ; ๐๐บ)
(counterfeiter)
noise
real samples ยฃdiscriminator ๐ท(โ ; ๐๐ท)(police) 0
1
real
fake
๐บ(๐ง; ๐๐บ)
๐ฅ
๐ง โข ๐ท tries to make ๐ท(๐ฅ) near 1 and ๐ท(๐บ ๐ง) near 0
โข ๐บ tries to make ๐ท(๐บ ๐ง) near 1

Minimax game
๐ ๐๐บ , ๐๐ท =1
2๐ผ๐ฅ~๐๐๐๐ก๐๐๐๐๐ท ๐ฅ; ๐๐ท +
1
2๐ผ๐ง~๐๐ง log 1 โ ๐ท ๐บ ๐ง; ๐๐บ
โ min๐๐บ
m๐๐ฅ๐๐ท
V ๐๐บ , ๐๐ท
โ ๐ท wishes to maximise V(๐๐บ , ๐๐ท) and controls ๐๐ท
โ ๐บ wishes to minimise V(๐๐บ , ๐๐ท) and controls ๐๐บ
โ Solution to optimization at local minimum
โ Game of two players with a solution at Nash equilibrium
11

Non-saturating game
๐ฝ๐ท = โ1
2๐ผ๐ฅ~๐๐๐๐ก๐๐๐๐๐ท ๐ฅ; ๐๐ท โ
1
2๐ผ๐ง~๐๐ง log 1 โ ๐ท ๐บ ๐ง;๐๐บ
๐ฝ๐บ =1
2๐ผ๐ง~๐๐ง log 1 โ ๐ท ๐บ ๐ง;๐๐บ
โ Problem: when ๐ท successfully rejects generator samples, generatorโs gradient vanishes
โ Solution:
๐ฝ๐บ = โ1
2๐ผ๐ง~๐๐ง log ๐ท ๐บ ๐ง; ๐๐บ
12

Training GANs
13
generator ๐บ(โ ; ๐๐บ)
noise
real samples ยฃdiscriminator ๐ท(โ ; ๐๐ท)
๐บ(๐ง; ๐๐บ)
๐ฅ
๐ง
๐๐ฝ๐ท
๐๐ท
๐๐ฝ๐บ
๐๐ท
๐๐ฝ๐บ
๐๐ท
๐๐ท
๐๐บ ๐ฝ๐บ = โ1
2๐ผ๐ง~๐๐ง log ๐ท ๐บ ๐ง; ๐๐บ
๐๐ฝ๐ท
๐๐ท
๐๐ท
๐๐๐ท
๐๐ฝ๐บ
๐๐ท
๐๐ท
๐๐บ
๐๐บ
๐๐๐บ
๐๐ฝ๐บ
๐๐ท
๐ฝ๐ท
๐ฝ๐บ
๐ฝ๐ท = โ1
2๐ผ๐ฅ~๐๐๐๐ก๐๐๐๐๐ท ๐ฅ; ๐๐ท โ
1
2๐ผ๐ง~๐๐ง log 1โ ๐ท ๐บ ๐ง; ๐๐บ

Transpose convolution
Stride=1
Review: Transposed convolution (deconv)
Convolution
Stride=1
14Dumoulin and Vision (2016), A guide to convolution arithmetic for deep learning, arXiv

Transpose convolution
Stride=2
Review: Transposed convolution (deconv)
Convolution
Stride=2
15Dumoulin and Vision (2016), A guide to convolution arithmetic for deep learning, arXiv

DCGAN (generator) architecture
โ Deconv weights are learned (unlike Zeiler & Fergus, see lecture 12)โ Deconvs are batch normalizedโ No fully connected layerโ Adam optimiser
16Radford et al, (2015). Unsupervised representation learning with deep convolutional generative adversarial networks.

DCGAN for LSUN bedrooms
High quality images on restricted domain
17Radford et al (2015). Unsupervised representation learning with deep convolutional generative adversarial networks.

Vector arithmetic on face samples
Semantically meaningful latent space
18Radford et al (2015). Unsupervised representation learning with deep convolutional generative adversarial networks.

Problems with counting and global structure
19Salimans et al, S. (2016). Improved Techniques for Training GANs. NeurIPS.

Mode collapse
- Another failure mode is for the generator to collapse to a single mode- If the generator learns to render only one realistic object, this can be
enough to fool the discriminator
20Salimans et al, S. (2016). Improved Techniques for Training GANs. NeurIPS.

Measuring GAN performance
Ask humans to distinguish between generated data and real dataโ Subjective, requires training to spot flaws
Automating the evaluation (Inception score):1. Image quality: images should contain meaningful objects (few dominant objects)
- Feed images to Inception Net to obtain conditional label distribution ๐ ๐ฆ ๐ฅ- For each generated image, entropy over classes ฯ๐ฆ ๐ ๐ฆ ๐ฅ ๐๐๐ ๐ ๐ฆ ๐ฅ should be low
2. Diversity: the model should generate varied images (balanced over classes)- Entropy over generated images ๐ ๐ฆ ๐ฅ = ๐บ ๐ง ๐๐ง should be high
โ Combining two requirements (โhow different is the score distribution for a generated image from the overall class balance?โ)
๐ธ๐ฅ๐พ๐ฟ(๐(๐ฆ|๐ฅ)||๐(๐ฆ))
21Salimans et al, S. (2016). Improved Techniques for Training GANs. NeurIPS.

Class-conditional GANs
โ Add class information in latent code ๐งโ It is not unsupervised anymore
22Mirza and Osindero (2014). Conditional Generative Adversarial Nets. arXiv.
generator ๐บ(โ ; ๐๐บ)
noise
0
1
0
One-hot class label

Spectral normalization
โ GAN training can be unstableโ Culprit: Gradient updates for G are
unboundedโ Observation: First layer weights of G
are ill-behaved when the training is unstable
โ Solution: Apply spectral norm
โ Spectral norm is the square root of the maximum eigenvalue of ๐๐๐
โ ๐ ๐ = ๐๐๐ฅ๐โ 2
โ 2โ ๐/๐(๐)
23Miyato et al. (2018). Spectral Normalization for GANs. ICLR.
Baseline

Scaling up GANs
Brock et al show thatโ bigger batch sizesโ more number of filter channels
(~50% more)โ larger dataset (292 million
images with 8.5k images, 512 TPU cores!)
improves state-of-the-art around 35% in Inception Score
24Brock et al. (2019). Large Scale GAN Training for High Fidelity Natural Image Synthesis. ICLR.

2014 to 2019
25Brock et al. (2019).
Goodfellow et al. (2014).

Summary
โข Generative models
โข Training GANs
โข DCGAN Architecture
โข (Open) challenges
โข Improvements
26

Reading material
Recommendedโ Goodfellow et al, (2014). Generative adversarial nets. NeurIPS. โ Longer version Goodfellow, (2016). NIPS 2016 Tutorial: Generative Adversarial Networks.
Extraโ Radford et al, S. (2015). Unsupervised representation learning with deep convolutional
generative adversarial networks. โ Salimans et al, S. (2016). Improved Techniques for Training GANs. NeurIPS.โ Miyato et al. (2018). Spectral Normalization for GANs. ICLR.โ Brock et al. (2019). Large Scale GAN Training for High Fidelity Natural Image Synthesis. ICLR.
27