A Comprehensive Guide to Generative Adversarial Networks (GANs)

栏目: IT技术 · 发布时间: 5年前

内容简介:This is the main component of the GAN. Here a generative network makes an attempt to learn the trends of the distribution and generate data belonging to this distribution.So how do we do this? Well it depends. In case of our example, for generating dog ima

This is the main component of the GAN. Here a generative network makes an attempt to learn the trends of the distribution and generate data belonging to this distribution.

So how do we do this? Well it depends. In case of our example, for generating dog images, our noise will undergo some De-Convolution Layers and finally, the output will be an image, hoping to be a dog’s. The generated image will be classified as real or fake by the discriminator. The generator will be penalized with more loss if the generated image is far from ‘being real’ and the loss will decrease as it makes progress in fooling the discriminator.

This is the basic idea behind a generator network. The architecture may differ with the use case. There are GAN architectures that are conditional i.e. there is some notion of a condition for generating data alongside the noise. Such additions may alter the architecture a bit, but the fundamental idea of the adversaries stand.

We now move on to the collective training of the generator and the discriminator.

Combined Training of the Generator and Discriminator as ‘The GAN’

So, GANs are great! But combined training of the generator and discriminator poses a problem for convergence. Let’s see how the GAN is trained.

The generator should be isolated from the discriminator and vice versa while training. In short, first the discriminator is trained for several epochs then the generator, and this sequence continues back and forth. This ensures that the training is in the right direction. Otherwise, training both at the same time would be like hitting a moving target and would possess higher chances of failure.

If you can’t train a classifier to tell the difference between real and generated data even for the initial random generator output, you can’t get the GAN training started.

Google Developer Blog

Moreover, as the generator gets better at fooling the discriminator, as a corollary, the discriminator’s accuracy decreases. There comes a point where the discriminator reaches accuracy 0.5 which suggests that the discriminator has started predicting randomly i.e. on a coin toss (which it is obviously not supposed to do). This does not help the generator training in any way and may deteriorate its performance instead.

Hence, convergence in GANs is not stable and is a major issue.

Training Loss

The GANs paper defines the training loss as:

Minimax Loss via Google Developer Blog

This is the Minimax loss, the discriminator tries to maximize it and the generator tries to minimize log(1 – D(G(z))) as it cannot touch log(D(x)).

However, the paper also suggests modifying this loss for the generator to maximize log(D(G(z))).

A Few Use Cases (to get you thinking)

  • Vanilla GANs (the ones described in the GAN paper ) can be used to augment data for training in case of imbalanced or less data.
  • Deep Convolutional Generative Adversarial Networks or DCGAN are vanilla GANs with Convolutional Layers for image generation
  • The pix2pix model can be used to take a wireframe of a structure as an input and generate the complete structure as output. Other applications include coloring black-white images.
  • CycleGAN is used to transform images from one domain to another without any paired training samples
  • DeepFake Generation and Detection is one of the latest research topics in GANs which essentially generates edited or tampered images that look realistic to the naked eye. This can be easily done manually with the help of photo/video editing softwares and hence, is vulnerable to misuse. DeepFake detection can be derived as a corollary to generation.

I will try to cover the implementation of some of these GANs in future articles. So stay tuned!

Conclusion

The main takeaway from this article is the concept of adversarial training evaluation of a generative model. This gives rise to many branches for researchers to come up with similar evaluators for better model performance.

We have also seen the idea of generative and discriminative modeling, and how they differ from each other.

We studied how GANs work and the idea behind it. We’ve had a pragmatic approach overall; we addressed the training aspect of the GANs and the issues that arise while actually training the network.

Finally, we had a word on some well-known flavors of GANs.

References:

Original paper: https://arxiv.org/abs/1406.2661

For more on the mathematical transformational aspect of GANs, refer:


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

网站转换率优化之道

网站转换率优化之道

[美] Khalid Saleh、[美] Ayat Shukairy / 顾 毅 / 人民邮电出版社 / 2012-4 / 45.00元

内容简介: 怎样才能将访问者转化为顾客? 本书提供了一些切实可行的建议,比如如何说服访问者作出购买决定,如何避免用户因信息过量或导航繁琐而离开网站等。不论你是在设计或营销大型电子商务网站,还是在管理中小型在线业务,都可以从本书学会怎样使用市场营销原则、设计方法、可用性原则和分析数据来持续提升网站的转换率。 作者帮助过众多公司吸引在线顾客,有着丰富的实战经验,在书中细致讨论了从访问......一起来看看 《网站转换率优化之道》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试