SUMMER TRAINING Free Tutorials  Go To Your University  Placement Preparation 
Project Based Best Summer Training Courses in Jaipur
Investing in yourself is easy. Udemy online courses now from INR 455
0 like 0 dislike
in Artificial Intelligence(AI) & Machine Learning by Goeduhub's Expert (3.1k points)
edited by
What is Generative Adversarial  Networks (GANs) and how does GANs works. A beginner's complete guide to Generative Adversarial  Networks (GANs). GANs is a class of machine learning which is capable of generating realistic images, art, videos etc. GANs are composed of two neural networks called Generator and Discriminator. Here we explained, What is need of GANs and various applications of GANs in real life.

1 Answer

0 like 0 dislike
by Goeduhub's Expert (3.1k points)
edited by
Best answer

Generative adversarial networks were first introduced in 2014 by Ian J. Goodfellow and other researchers in the paper. (Click here to see the paper).

Generative adversarial networks or GANs usage generative modeling. 

What is generative modeling: 

In generative modeling we create new data from original data by learning the input data, meaning generative models learn the pattern and features of input data in such a way that it produces new data that looks like the same as input data. 

We can say that generative modeling is unsupervised learning, which says that a model patterns and regularities in data itself.

For example, gans can create a realistic image of a human face by learning human face images, even though the faces don't belong to any real person. 

Why gans are getting so much attention nowadays?

Let's see some applications of gans to understand its role in practical life.

  1. Generating realistic photos of human faces. 
  2. To generate human faces with age. (Faceaging)
  3. Photos to cartoon.
  4. Text to image translation and vice versa.4
  5. art generation
  6. Music generation 
  7. Video generation and using different features in videos and many more...

As you can see gans can produce high quality and colorful art, images, paintings and more ...that only can do by humans till now, makes gans popular.

Now let's take look at the working mechanism of gans. 

A generative adversarial network consists of two models one is the generative model and the other is the discriminator. The generative model is represented by G and the Discriminator is represented by D. 

The generator is used to learn input data to produce new data imitate input data.

The Discriminator is used to discriminate between generated data and input data.

 In simple terms, the discriminator works as a classifier that classifies the generated data (fake data generated by generator) and input data (real data).

These two networks are trained simultaneously which means the Generator and Discriminator compete with each other using a min-max game (an equation of loss function). 

min-max game is an optimization strategy in which two networks try to minimize their loss function. 

D&G Loss function

In the above equation, we are trying to minimize the loss function for the generator so that it can produce fake images that look real and maximizing the loss function for the discriminator so that it can not distinguish between real and fake. 

In the above equation, theta_g is the loss function for the generator and theta_d is the loss function for the discriminator.

x- input data (Noise) 

z- generated data from the generator

Flow Diagram for working mechanism of Discriminator and Generator 

gan flow chart

We can say that generator is trying to fool the discriminator while the discriminator is trying to not get fooled by the generator. At first, the generator produces not very realistic images and the discriminator is also naive, with time both models improved and, at some point generator succeeded in fooling the discriminator. At this point, the discriminator is not able to distinguish between real and fake. 

Project - Generate Images with DCGANs(Deep Convolutional Generative Adversarial Networks) with Keras

Our Mentors(For AI-ML)

Sharda Godara Chaudhary

Mrs. Sharda Godara Chaudhary

An alumna of MNIT-Jaipur and ACCENTURE, Pune


Ms. Nisha

An alumna of IIT-BHU

Related questions


About Us | Contact Us || Terms & Conditions | Privacy Policy || Youtube Channel || Telegram Channel © Social::   |  |