Generative Adversarial Networks (GANs) — A Breakthrough in Deep Learning

Packt
3 min readSep 4, 2020

--

Sebastian Raschka, who has recently authored Python Machine Learning, Third Edition discusses the implementation of GANs for data analysis and how his book presents it.

GANs have evolved into one of the hottest and most widely used deep learning techniques. They are considered to be the most important breakthrough in deep learning, allowing computers to generate new data (such as new images).

The first GANs paper just came out two years before we started working on the second edition of our Python Machine Learning book. At that time, we were not sure whether GANs would stay an essential and relevant topic. But the scenario is completely different today — people use it for creating artwork and colourizing and improving the quality of photos. Even the video game modelling communities chose GANs to recreate textures of old video games in higher resolutions. Nowadays, various scientific research areas make use of GANs; for example, cosmologists use GANs for the generation of gravitational lensing effects for studying the effects of dark matter in the universe.

I think it goes without saying that an introduction to GANs was long overdue.

However, since its introduction, the original authors, as well as many other researchers, have proposed numerous improvements and various applications in different fields of engineering and science; for example, in computer vision, GANs are used for image-to-image translation (learning how to map an input image to an output image), image super-resolution (making a high-resolution image from a low-resolution version), image in painting (learning how to reconstruct the missing parts of an image), and many more applications. For instance, recent advances in GAN research have led to models that are able to generate new, high-resolution face images.

The overall objective of a GAN is to synthesize new data that has the same distribution as its training dataset. Therefore, GANs, in their original form, are considered to be in the unsupervised learning category of machine learning tasks, since no labelled data is required. It is worth noting, however, that extensions made to the original GAN can lie in both semi-supervised and supervised tasks.

In Python Machine Learning, Third Edition, I have first described the generative models in deep learning and their overall objective: synthesizing new data. I have then covered how GAN models use a generator network and a discriminator network, which compete with each other in an adversarial training setting to improve each other. We then understand the implementation of a simple GAN model using only fully connected layers for both the generator and the discriminator.

We also cover how GAN models can be improved. First, you will see a DCGAN, which uses deep convolutional networks for both the generator and the discriminator. Along the way, you will also learn about two new concepts: transposed convolution (for up sampling the spatial dimensionality of feature maps) and Batch Norm (for improving convergence during training).

You will further look at a WGAN, which uses the EM distance to measure the distance between the distributions of real and fake samples. Finally, we will talk about the WGAN with GP to maintain the 1-Lipschitz property instead of clipping the weights.

Summary

In this article, we explored how generative adversarial networks (GANs) can be applied in synthesizing new data samples.

If you like this piece and want to know more about GANs, please refer to this link and get your copy of Python Machine Learning, Third Edition.

--

--

Packt

We help developers build better software | Email customercare@packtpub.com for support | Twitter support 9-5 Mon-Fri