24th May 2019

Introduction to Generative Adversarial Network(GAN): Artificial Artist


Written By, Sanket Jagani



“Whether you want to uncover the secrets of the universe, or just want to pursue a career in the 21st century, basic computer programming skills is the key to it.” ~ Stephen Hawking

John Romero had his own say, describing Programmers to be the Artists in their field. Logic-based Artists are what he referred to them.

That said, allow me to take this opportunity and introduce you to the latest trend in the field of Deep Learning, Here, I present to you Generative Adversarial Network (GAN) – The Most Interesting Idea in last 10 years in the field of Machine Learning, as famously said by Yann LeCun.

Generative Adversarial Networks (GANs) are deep neural net architectures comprised of the two networks, fighting one against the other (thus The “Adversarial”).

Introduction to GAN


Let’s take an example to understand more in detail. Take a scenario, where you and your artist friend wants to get into the club but there are no passes available, so what will you do? Drop the idea and return back home! Obviously Not, Right? There’s is no way you can get a pass, so you and your friend decide to take an alternate route and fool the pass checker by mimicking the original pass.


Your artist friend gets some ideas by seeing the original pass and mimics it with a copy of your own. At the first attempt, when you come across the pass checker for verifying it, you expect to get through but luck’s not running in your favor and your attempt to fool him goes in vain. Your artist friend doesn’t give up and takes this as a feedback and comes up with a few more ideas to improve the copied pass (Here, assume you have endless time to get into the club) and you both try again to get into the club.


GAN introduction

What is a Generator?

A Generator is basically a Neural Network that generates some images and tries to fool the Discriminator. The Generative Model in ML tries to predict a feature from a certain label. In the example shared above, your artist friend who generates the fake pass for getting into the club can be referred to as a Generator.


What is Discriminator?

A Discriminator is like a verifier who verifies if the given image is from the training dataset or generated image. The Discriminative Model tries to predict the label from certain features. As per the verification performed, The Discriminator gives his feedback to the Generator. In the above example, the pass checker is like a Discriminator who checks, if the given pass is true or not.


But how?

One Neural Network called Generator generates some image and gives it to another Neural Network (like classifier), that authenticates if the generated image is from the Generator or the given dataset.

If the Discriminator finds a fake image, it gives an error to the generator with some feedback. On the basis of the feedback received from the discriminator, the generator will generate some new image and then again send it back to the discriminator for authentication. And this loop will continue until a given dataset and the generated image doesn’t differ.

Now let me give you an introduction to some of the cool and magical applications of GAN.

Applications of GAN


The main idea behind Conditional Generative Adversarial Network (CGAN) is that the generative and discriminative both should have conditional settings. As a result, the ideal model can learn a Multi-Modal Mapping from inputs to outputs by feeding it with different contextual information.



Stack GAN is used for generating a high-quality image from a given text description. If you train your model with birds labeled dataset and then give any text input, then Stack GAN gives a high-quality image from the given input description from the user.



Discover Cross-Domain Relations with Generative Adversarial Networks(Disco GANS) learns to discover relations between different domains, by using that relation GAN can style transfer from one to another domain.

DISCO GAN transfer your favorite purse style to your shoes, COOOOL. 🙂


Now you understand GAN artistic capabilities, there are a few more interesting applications such as

  • Black and White Image to Colour Image Translation
  • Style Transfer one image to another
  • Blur Image to Clear Image
  • Music Generation
  • Cartoon Character Generation
  • Image Generation

And many more applications where we can use GAN. Cool isn’t it?



From now onwards you can think of a computer as an artist. In this blog, I have explained what is GAN at a very basic level of understanding by describing some of its concepts and its applications.
So till this point, we have learned about the basics of GAN, how Generator and Discriminator work together & create some cool artificial artistic artwork based on a given input. I will explain in more detail depth from a beginner level in my upcoming blog. Wait for it 🙂

Written By,

Python Developer at Yudiz Solutions Pvt. Ltd