Blog post 3: Understanding content



I chose the paper Generative Adversarial Networks[1] from Ian Goodfellow, which I am going to review what the main points are and how it works.

Intorduction

Generative Adversarial Networks, or GANs for short, are an approach to generative modeling using deep learning methods. Generative modeling is an unsupervised learning task in machine learning that involves automatically discovering and learning the regularities or patterns in input data in such a way that the model can be used to generate or output new examples that plausibly could have been drawn from the original dataset.[1,2,3,4]


How does it work?

GANs consists of two networks, a Generator G(x), and a Discriminator D(x). They both play an adversarial game where the generator tries to fool the discriminator by generating data similar to those in the training set. The Discriminator tries not to be fooled by identifying fake data from real data. They both work simultaneously to learn and train complex data like audio, video or image files.[2,3]

The generator model generates images from random noise(z) and then learns how to generate realistic images. Random noise which is input is sampled using uniform or normal distribution and then it is fed into the generator which generates an image. The generator output which are fake images and the real images from the training set is fed into the discriminator that learns how to differentiate fake images from real images. The output D(x) is the probability that the input is real. If the input is real, D(x) would be 1 and if it is generated, D(x) should be 0.The Discriminator and Generator play a two-player minimax game with the value function V(G, D). So, Minimax Objective function is:

Fig 1: Optimization function of a GAN, image from source[1]




D() gives us the probability that the given sample is from training data X. The Generator, wants to minimize log(1-D(G(z)) i.e. when the value of D(G(z)) is high then D will assume that G(z) is nothing but X and this makes 1-D(G(z)) very low. For the Discriminator, we want to maximize D(X) and (1-D(G(z))). So the optimal state of D will be P(x)=0.5. However, we want to train the generator G such that it will produce the results for the discriminator D so that D won’t be able to distinguish between z and X. Here, the Discriminator tries to maximize the objective which is V while the Generator tries to minimize it, due to this minimizing/maximizing the goal is to get the minimax term. They both learn together by alternating gradient descent.[2,3]

The iteration of gradient descent will be performed on D using real and generated images by fixing G. Then D will be fix and train G for another single iteration to fool a fixed D. The goal is to optimize the minimax function by iterating both G and D in alternating steps until G produces good quality images and the discriminator won’t be able to differentiate between real and fake images. Below is the pseudo-code which shows how GANs are trained: [1,2,3]

Fig2: Pseudo-code on how GANs are trained, image from source[1]


Sources

[1] Ian J. Goodfellow. Generative Adversarial Networks.https://arxiv.org/abs/1406.2661. Accessed: 2021-04-23

[2]Google Developers. Introduction | Generative Adversarial Networks | Google Developers build intelligent systems.https://developers.google.com/machine-learning/gan. Accessed: 2021-04-23.

[3]Medium. 2021. GANs — A brief introduction to Generative Adversarial Networks. https://medium.com/analytics-vidhya/gans-a-brief-introduction-to-generative-adversarial-networks-06216c7200e#:~:text=GANs%20consists%20of%20two%20networks,those%20in%20the%20training%20set.&text=They%20both%20work%20simultaneously%20to,audio%2C%20video%20or%20image%20files. Accessed: 2021-04-23.

[4]Brownlee, J., 2021. A Gentle Introduction to Generative Adversarial Networks (GANs).  Machine Learning Mastery. https://machinelearningmastery.com/what-are-generative-adversarial-networks-gans/ Accessed: 2021-04-23..

 




Comments

  1. Dear Antonio,

    Thanks for the summary of GANs and to have given the reader an overview of the concept. You were able to capture the main concept and transfer it to the reader very smoothly.

    It would be nice to get more elaboration on how the gradient descent part and how optimization is performed and specifically, how "a fixed D" is chosen when training G. I wonder if one uses the optimized value of D from the gradient descent.

    Keep up with the good work!

    Best,
    Mohsen

    ReplyDelete
  2. Dear Antonio, I am a fan (if not the biggest fan :D) of GANs and I really enjoyed reading your post. All that there is to know for getting good insights about GANs is mentioned in your review. A great thing about your post is that you provided some great references for those who are interested. In short, I can say you have successfully managed to write about a very exciting paper and topic and kept me motivated to read further. Great job! All the best. Kiavash

    ReplyDelete
  3. Dear Antonio

    Thank you for the great review of the paper. I found it a really interesting topic and you explained the main points so well. Your review has the potential to interest the people who are not familiar with the concept of GAN. I am definitely going to read this paper and find out more about these networks.

    All the best,
    Afrooz

    ReplyDelete

Post a Comment

Popular posts from this blog

Scientific review