From the course: AI Workshop: Hands-on with GANs with Deep Convolutional Networks

A quick overview of GANs

Hi, and welcome to this AI Workshop: Hands-On with GANs, that is Generative Adversarial Networks, Using Deep Convolutional Networks. Now, I'll do a quick overview of how generative adversarial networks work, but I'll make an assumption here that you have some basic understanding of GANs. Now, generative adversarial networks belong to a class of machine learning models known as generative models. A generative model trains on a large corpus of data, and it learns the probability distribution and features of that data, and can use this information to generate new data instances that do not belong to the training set. These are entirely unique instances. These instances will be similar to the data the model was trained on. A generative adversarial network is one kind of generative model. The term adversarial comes from the fact that a GAN has two neural network components within it, and these two neural networks compete with one another to become better at what they do, more accurate in their predictions. The two networks are essentially playing a zero-sum game. When one improves, the other gets worse. The adversaries in a GAN have very specific names and very specific objectives. The first adversary is the generator responsible for generating instances. The second adversary is the discriminator responsible for classifying instances. Let's understand the generator first. The objective of a generator is to generate plausible realistic data, and this data is then fed in as negative samples to a discriminator. To start off, the samples that a generator creates is of poor quality. The discriminator is easily able to identify fake data from the generator versus the real data that it receives from a training dataset. As training progresses, the generator receives feedback from the discriminator and steadily improves the quality of the generated data till the generator is able to fool the discriminator. The discriminator will then find it hard to tell what data is generated and what data is real. The second adversary in a GAN is the discriminator, and the discriminator's objective is to distinguish the fake data generated by the generator from the real data instances that are also fed into the discriminator. If the discriminator is able to identify the generator's fake data, it penalizes the generator for generating implausible data, thus forcing the generator to improve. During the training process, as the generator improves, the discriminator's ability to distinguish real from fake steadily diminishes. During training, the generator will improve to such an extent till the discriminator is unable to tell fake and real data apart. Hopefully, you're already familiar with the basics of GANs from the previous AI Workshop: Hands-on with GANs Using Dense Neural Networks. In this workshop, we'll work with convolutional neural networks. Convolutional neural networks, or CNNs, are a neural network architecture that is primarily used for image recognition and processing tasks. The architecture of the layers in a CNN mimic the visual cortex of the brain, and how our eye and brain together perceive images. And this is why convolutional neural networks work very well with image data. The GAN that we'll build will essentially use the architecture of a convolutional neural network. This is going to be a deep convolutional GAN. You can think of the DCGAN as a class of CNNs that have certain architectural constraints, and can learn a hierarchy of representations from input images. When you use deep convolutional GANs to construct the generator and discriminator network, this can greatly improve the quality of generated images.

Contents