For working professionals
For fresh graduates
More
Deep Learning Tutorial: A Comp…
Every morning, scrolling through social media notifications is as routine as brushing my teeth. Like many, I’m also guilty of touching up my photos before sharing them—smoothing wrinkles and enhancing colors have become essential for online sharing.
But have you ever stopped to wonder how these editing tools work?
It all comes down to something called generative adversarial networks, or GANs for short. These clever algorithms are the backbone of many image-editing applications, allowing users to alter their photos with ease.
Thousands of companies worldwide leverage GANs for a wide range of applications. So, let's take a closer look at how the GAN algorithm functions.
The Generative Adversarial Network (GAN) is an unsupervised deep learning architecture where two neural networks compete to generate realistic new data from a given training dataset. One network, called the generator, creates new data samples from the input data and modifies them to be as authentic as possible.
Meanwhile, the other network, known as the discriminator, attempts to distinguish between the generated data and real data from the original dataset. This adversarial setup leads to the continual improvement of the generator's ability to produce convincing fake data, as it learns to generate samples that are increasingly difficult for the discriminator to differentiate from real ones.
The training process continues until the discriminator can no longer accurately determine whether the generated data is real or fake, resulting in the generation of high-quality synthetic data.
GAN architecture comprises two parts - the generator and the discriminator. In simple words, the generator acts like a thief and generates fake samples based on original data. Whereas, the discriminator acts as the police whose role is to identify the abnormalities in the generated sample and classify it as fake or real.
This component is a part of the GAN structure which learns to create fake data on receiving feedback from the discriminator. The generator learns to make the discriminator characterize its output as real.
Compared to discriminator training, GAN AI generator training needs tighter integration among the two components. The generator takes random noise as input and transforms it into a meaningful output.
A discriminator in a GAN neural network acts as a classifier. It attempts to distinguish between the fake data generated from the real data.
The training data of the discriminator comes from two sources:
The two neural networks of GAN train in an adversarial manner. One network tries to generate new data, and the other tries to predict if the output is fake or real.
A simplistic overview of the entire computing process is as follows:
The generator tries to maximize the mistake probability by the discriminator, however, the discriminator tries to minimize the error probability.
During training, both the generator and discriminator neural networks evolve and confront each other constantly until an equilibrium state is reached. In this state, the discriminator will no longer be able to recognize synthesized data. At this point, the GAN machine learning model training is over.
Several forms of GANs can be used for various tasks. Here are some of the most important types:
Images are generated and classified using the neural networks as simple multi-layer perceptrons. The generator captures data distribution, while the discriminator assesses the likelihood of input data belonging to a specific class.
Let’s say, you want to generate the image of a cat. The conditions that you provide can have a label describing the image content, like cat images with the label ‘cat’. Conditioning helps the generator produce data that meets specific conditions.
The generator in this network uses transported convolutions to upscale data distribution, whereas the discriminator uses convolutional layers for classifying data. It also introduces architectural guidelines that make training more stable.
This is a fun neural network to experiment with. If I want to alter an image, I can train this algorithm to do so. Do you want to change the background of your image and add a scenic backdrop? This algorithm will help you do that.
The primary goal of this network is to increase the resolution of an image. However, the image quality and details are maintained, when enhancing the image resolution.
This type of GAN network addresses the challenge of generating high-resolution images by dividing the problem into stages. It employs a hierarchical approach, with several discriminators and generations working at different image resolutions.
The process starts by generating a low-resolution image which improves in quality with progressive GAN stages.
GANs have many applications in today's world. Here are some uses of generative adversarial networks:
Modern GAN can mask medical images, employee images, or street-view images rendering them useless for the attacker.
Generative models can be used for data augmentation to generate synthetic data having all the attributes of real-world data.
For example, GAN can be trained to generate images of the surface below the ground. For this, it needs to understand the correlation between the underground structures and the surface data. By studying the available sub-surface images, GAN creates new ones using terrain maps.
These neural networks have several advantages. Some of these benefits have been listed below:
Even though there are many benefits of GANs, there are some disadvantages to it. These limitations have been listed below:
Natural language processing (NLP) is a subset of artificial intelligence that understands, generates, and manipulates human language. There are many applications for it such as text summarization, chatbots, machine translation, sentiment analysis, etc.
But how is GAN used in NLP?
It is used for performing tasks such as paraphrasing, text generation, data augmentation, and style transfer.
Applying GAN in NLP poses challenges. The generator struggles to provide smooth gradients for the discriminator's evaluation, and the discriminator can't offer meaningful feedback for the generator's improvement. To address this, various techniques have emerged, such as using discrete latent variables, reinforcement learning, or leveraging pre-trained language models.
AI is the future of computing, altering the way we live and think. Generative adversarial networks (GANs) form a powerful paradigm in the field of machine learning. This deep learning model can generate new synthetic data from scratch of information.
However, there are not many people who have a proper understanding of this new technology. If you want to make a career in this field, check out the certified courses offered by upGrad. Their courses are designed by industry experts and can help you not only get a firm grasp of AI concepts but will upskill you enough to get lucrative job offers.
It is a machine learning (ML) model comprising two neural networks - the generator and the discriminator.
GANs are used for creating new data instances resembling the training data. The generator produces fake instances and the discriminator distinguishes between the real and fake data.
Both CNN and GAN are deep learning neural architectures. CNNs are mainly used for recognition and classification. Whereas, GANs are generative models generating new examples from a giant training set.
Generative adversarial networks are used for generating videos and images, enhancing data, transferring styles, and the like are just some examples of GAN.
The two major components of GANs are the generator and the discriminator.
GANs are used for generating diverse data samples, that are helpful for training machine learning models.
GAN is a unsupervised deep learning algorithm.
GAN comprises of a sequential model with batch normalization. Tanh, convolutional, linear, reshaping and unsampling layers.
GAN is used for performing various NLP tasks like paraphrasing, text generation, data augmentation, and style transfer.
A key limitation is GANs is when the generator produces a limited range of samples.
Author
Talk to our experts. We are available 7 days a week, 9 AM to 12 AM (midnight)
Indian Nationals
1800 210 2020
Foreign Nationals
+918045604032
1.The above statistics depend on various factors and individual results may vary. Past performance is no guarantee of future results.
2.The student assumes full responsibility for all expenses associated with visas, travel, & related costs. upGrad does not provide any a.