Source: Deep Learning on Medium
Deep Learning — Generative Adversarial Network(GAN’s)
GAN’s is a revolution in the field of deep learning .It has been introduced by the Ian Goodfellow and others in the paper titled “Generative Adversarial Networks” which is available at https://arxiv.org/abs/1406.2661 .GAN’s is one of the top discoveries in last decade in field deep learning .
Let’s try to understand what is GAN and How it works ?
In direction to understand GAN’s, we need to understand difference between Supervised and Unsupervised learning techniques and issues with them . Supervised learning are developed based on large quantities of “labeled” samples . The requirement for the supervised learning is large data-sets containing the explainable feature with respect to its labels. Example of a supervised image classifier would require a set of images with correct labels (e.g. cats , dogs , landscapes etc.)
Unsupervised learning are developed for data where we don’t have labeled with us. Since unsupervised learning algorithm don’t have this richness to learn from the labeled data. But they learn from mistakes and try not to make similar errors in the future.
The disadvantage of supervised learning is they need for large labeled data and developing the large number labeled samples which is costly and time consuming .While Unsupervised learners don’t have this disadvantage but accuracy is always concern for unsupervised learning .
So there is lot scope in unsupervised learning where labeling will not be required but can we improve the accuracy . So two algorithm or process that came up as GAN’s and RL’s(Reinforcement Learning ) by means of improving the accuracy of unsupervised learning from area of neural networks .
As in GAN’s works on generative models , these models can predict most likely outcome more accurately . Like predicting next word before we usually write in the search engine example (eg — google ).
So GAN’s are a class of algorithms used in the unsupervised learning environment. Generative Adversarial Networks consist of a two networks — generator and a discriminator neural network. As we are talking about generator and discriminator in one model it become adversarial in nature.
Adversarial Networks means neural networks who can compete with each other . Both networks compete with each other to achieve a zero-sum game. The neural networks are assigned different job role i.e. contesting with each other where one them will try o bluff others .So there are two neural networks in it –
- Generator — Neural Network one is called the Generator because it generates new data instances.
- Discriminator — Another neural network is called as Discriminator, which evaluates work for the first neural net (Generator ) for authenticity.
Now this is becoming more complex. We will try to understand how it works –
Suppose we are trying to classify the the image of different animal’s.
Now consider a Generator with the mission to fool Discriminator by using carefully crafted images that look almost simillar but not quite correct . This is done by picking a taking sample randomly from training set (latent space) and synthesizing a new image by randomly altering its features (by adding random noise). As an example, Generator can fetch the image of a any animal and can add an extra feature that can be any thing like extra leg ,eye or any feature to the image converting it to a false sample. The result is an image very similar to a normal cat with the exception of that feature.
In training, Discriminator is presented with a random mix of false images from training data as well as fake images generated by G. Its task is to identify correct and fake inputs. Based on the result , both machines try to fine-tune their parameters and become better in what they do. If Discriminator makes the right prediction, Generator updates its parameters in order to generate better fake samples to fool Discriminator. If Discriminator prediction is incorrect, it tries to learn from its mistake to avoid similar mistakes in the future. The reward for net Discriminator is the number of right predictions and the reward for G is the number D’s errors. This process continues until an equilibrium is established and D’s training is optimized.
In another way , GAN’s act like the two rival political parties of a country . Each party continuously attempts to improve on its weaknesses while trying to find and leverage vulnerabilities in their adversary to push their agenda. Over the time both parties become better operators.
Example — In recent times you must have heard or used the FaceApp application .FaceApp is an image processing app which mainly transform your image to your younger ,older form etc . They have used similar kind of algorithm to achieve this kind of results .