Data Science and Machine Learning Internship ...
- 0k Enrolled Learners
- Live Class
Generative Adversarial Networks or GANs are a generative modeling approach using Deep Learning to train the model in a clever manner to generate data by using the sub-model approach. In this article, we will try to understand “What Are GANs” in detail. The following topics are covered in this article:
Generative models are nothing but those models that use an Unsupervised Learning approach. In a generative model, there are samples in the data i.e input variables X, but it lacks the output variable Y. We use only the input variables to train the generative model and it recognizes patterns from the input variables to generate an output that is unknown and based on the training data only.
In Supervised Learning, we are more aligned towards creating predictive models from the input variables, this type of modeling is known as discriminative modeling. In a classification problem, the model has to discriminate as to which class the example belongs to. On the other hand, unsupervised models are used to create or generate new examples in the input distribution.
To define generative models in layman’s terms we can say, generative models, are able to generate new examples from the sample that are not only similar to other examples but are indistinguishable as well.
The most common example of a generative model is a Naive Bayes Classifier which is more often used as a discriminative model. Other examples of generative models include Gaussian Mixture Model and a rather modern example that is General Adversarial Networks. Let us try to understand What Are GANs?
Generative Adversarial Networks or GANs are a deep-learning-based generative model that is used for Unsupervised Learning. It is basically a system where two competing Neural Networks compete with each other to create or generate variations in the data.
It was first described in a paper in 2014 by Ian Goodfellow and a standardized and much stable model theory was proposed by Alec Radford in 2016 which is known as DCGAN (Deep Convolutional General Adversarial Networks). Most of the GANs today in existence use DCGAN architecture.
To understand how GANs work, let’s break it down.
In GANs, there is a Generator network that takes a sample and generates a sample of data, and after this, the Discriminator network decides whether the data is generated or taken from the real sample using a binary Classification problem with the help of a sigmoid function that gives the output in the range 0 to 1.
The generative model analyzes the distribution of the data in such a way that after the training phase, the probability of the discriminator making a mistake maximizes. And the Discriminator, on the other hand, is based on a model that will estimate the probability that the sample is coming from the real data and not the generator.
The whole process can be formalized in a mathematical formula given below.
In the above formula:
G = Generator
D = Discriminator
Pdata(x) = Distribution of real data
Pdata(z) = Distributor of generator
x = sample from real data
z = sample from generator
D(x) = Discriminator Network
Now comes the training part for a GAN, which can be further divided into 2 parts which are done sequentially.
Train the discriminator and freeze the generator, which means the training set for the generator is turned as False and the network will only do the forward pass and no back-propagation will be applied.
Basically the discriminator is trained with the real data and checks if it can predict them correctly, and the same with the fake data to identify them as fake.
Train the generator and freeze the discriminator. In this phase, we get the results from the first phase and can use them to make better from the previous state to try and fool the discriminator better.
Steps For Training
The concept of GANs is rather fascinating but there are a lot of setbacks that can cause a lot of hindrance in its path. Some of the major challenges faced by GANs are:
The following are a few applications of GANs.
Prediction Of Next Frame In A Video
The prediction of future events in a video frame is made possible with the help of GANs. DVD-GAN or Dual Video Discriminator GAN can generate 256×256 videos of notable fidelity up to 48 frames in length. This can be used for various purposes including surveillance in which we can determine the activities in a frame that gets distorted due to other factors like rain, dust, smoke, etc.
Text to Image Generation
Object-driven attentive GAN(obj-GAN), performs the text-to-image synthesis in two steps. Generating the semantic layout is the initial step and then generating the image by synthesizing the image by using a de-convolutional image generator is the final step.
This could be used intensively to generate images by understanding the captions, layouts and refine details by synthesizing the words. There is another study about the storyGANs that can synthesize the whole storyboards from mere paragraphs.
Enhancing The Resolution of an Image
Super-resolution generative adversarial network or SRGAN is a GAN that can generate the super-resolution images from low-resolution images with finer details and better quality.
The applications can be immense, imagine a higher quality image with finer details generated from a low-resolution image. The amount of help it would produce to identify details in low-resolution images can be used for wider purposes including surveillance, documentation, security, detecting patterns, etc.
Image To Image Translation
Pix2Pix GAN is a model designed for general purpose image-image-translation.
Interactive Image Generation
GANs can be used to generate interactive images as well, Computer Science and artificial intelligence laboratory(CSAIL) has developed a GAN that can generate 3-D models with realistic lighting and reflections enabled by the shape and texture editing.
More recently, researchers have come up with a model that can synthesize a reenacted face animated by a person’s movement while preserving the appearance of the face at the same time.
This brings us to the end of this article where we have learned ‘What Are GANs”. I hope you are clear with all that has been shared with you in this tutorial.
If you found this article on “What Are GANs” relevant, check out the Edureka Certification Training for Machine Learning Using Python, a trusted online learning company with a network of more than 250,000 satisfied learners spread across the globe.
We are here to help you with every step on your journey and come up with a curriculum that is designed for students and professionals who want to be a Python developer. The course is designed to give you a head start into Python programming and train you for both core and advanced Python concepts along with various Python frameworks like Django.
If you come across any questions, feel free to ask all your questions in the comments section of “What Are GANs” and our team will be glad to answer.
|Python Certification Training Course|
Class Starts on 28th May,2022
28th MaySAT&SUN (Weekend Batch)
|Python Certification Training Course|
Class Starts on 18th June,2022
18th JuneSAT&SUN (Weekend Batch)