concept gan in category deep learning

appears as: GANs
Deep Learning for Vision Systems

This is an excerpt from Manning's book Deep Learning for Vision Systems.

I kept this to the end because, although the earlier examples are truly impressive CV applications of AI, but this is where I see the real magic is happening. The magic of creation. In 2014, Ian Goodfellow, invented a new deep learning model that can imagine new things called GANs (Generative Adversarial Models). The name can make it sound a little intimidating, but I promise you that it is not. It is an evolved CNN architecture which is considered a major advancement in deep learning. So, when you understand CNNs, GANs will make a lot more sense to you.

GANs, are sophisticated deep learning models that are able to generate stunningly accurate synthesized images of objects, people, and places among other things. If you give them a new set of images, they can make entirely new images that are realistic and have never been seen before. For example, StackGANs is one of the GAN architecture variations that can take a textual description of an object then generate a high resolution image of the object matching that description. This is not just running an image search on a database. These photos are never seen before and totally imaginary.

Figure 1.11

GANs is one of the most promising advancements in machine learning over the past few years. Research into GANs is very new and the results are already overwhelmingly promising. Most of the applications of GANs so have have been for images. But it makes you wonder, if machines are given the power of imagination to create pictures, what else can they create? Can your favorite movies, music, and maybe even books be created by computers in the future? The ability to synthesize one data type (text) to another (image) will eventually allow us to create all sorts of entertainment with just detailed text descriptions.

Generative Adversarial Networks (GANs) are a new type of neural architectures introduced by Ian Goodfellow and other researchers at the University of Montreal, including Yoshua Bengio, in June 2014, in their paper “Generative Adversarial Nets” in 2014. GANs have been called “the most interesting idea in the last 10 years in ML” by Yann LeCun, Facebook’s AI research director. The excitement is well justified. The most notable features of GANs are their capacity to create hyperrealistic images, videos, music, and text. For example, none of the faces in Figure 8.1 (right) belong to a real human; they are all fake. Same thing for the handwritten digits in the left  image in the same figure. This shows GAN’s ability to learn the features from the training images and imagine its own new images using these patterns learned.

Figure 8.11: The process flow to train GANs.
Deep Learning with JavaScript: Neural networks in TensorFlow.js

This is an excerpt from Manning's book Deep Learning with JavaScript: Neural networks in TensorFlow.js.

Table 1.1. Examples of tasks in which accuracy improved significantly thanks to deep-learning techniques since the beginning of the deep-learning revolution around 2012. This list is by no means comprehensive. The pace of progress will undoubtedly continue in the coming months and years. (view table figure)

Machine-learning task

Representative deep-learning technology

Where we use TensorFlow.js to perform a similar task in this book

Categorizing the content of images Deep convolutional neural networks (convnets) such as ResNet[a] and Inception[b] reduced the error rate in the ImageNet classification task from ~25% in 2011 to below 5% in 2017.[c] Training convnets for MNIST (chapter 4); MobileNet inference and transfer learning (chapter 5)
Localizing objects and images Variants of deep convnets[d] reduced localization error from 0.33 in 2012 to 0.06 in 2017. YOLO in TensorFlow.js (section 5.2)
Translating one natural language to another Google’s neural machine translation (GNMT) reduced translation error by ~60% compared to the best traditional machine-translation techniques.[e] Long Short-Term Memory (LSTM)-based sequence-to-sequence models with attention mechanisms (chapter 9)
Recognizing large-vocabulary, continuous speech An LSTM-based encoder-attention-decoder architecture achieves a lower word-error rate than the best non-deep-learning speech recognition system.[f] Attention-based LSTM small-vocabulary continuous speech recognition (chapter 9)
Generating realistic-looking images Generative adversarial networks (GANs) are now capable of generating realistic-looking images based on training data (see https://github.com/junyanz/CycleGAN). Generating images using variational autoencoders (VAEs) and GANs (chapter 9)
Generating music Recurrent neural networks (RNNs) and VAEs are helping create music scores and novel instrument sounds (see https://magenta.tensorflow.org/demos). Training LSTMs to generate text (chapter 9)
Learning to play games Deep learning combined with reinforcement learning (RL) lets machines learn to play simple Atari games using raw pixels as the only input.[g] Combining deep learning and Monte Carlo tree search, Alpha-Zero reached a super-human level of Go purely through self-play.[h] Using RL to solve the cart-pole control problem and a snake video game (chapter 11)
Diagnosing diseases using medical images Deep convnets were able to achieve specificity and sensitivity comparable to trained human ophthalmologists in diagnosing diabetic retinopathy based on images of patients’ retinas.[i] Transfer learning using a pretrained MobileNet image model (chapter 5).
  • Randomness is good for inducing robustness. Because GAN training may result in a dynamic equilibrium, GANs are prone to getting stuck in all sorts of ways. Introducing randomness during training helps prevent this. We introduce randomness in two ways: by using dropout in the discriminator and by using a “soft one” value (0.95) for the realness labels for the discriminator.
  • Sparse gradients (gradients in which many values are zero) can hinder GAN training. In other types of deep learning, sparsity is often a desirable property, but not so in GANs. Two things can cause sparsity in gradients: the max pooling operation and relu activations. Instead of max pooling, strided convolutions are recommended for downsampling, which is exactly what’s shown in the generator-creating code in listing 10.10. Instead of the usual relu activation, it’s recommended to use the leakyReLU activation, of which the negative part has a small negative value, instead of strictly zero. This is also shown in listing 10.10.
  • 10.3. Image generation with GANs

    Since Ian Goodfellow and his colleagues introduced GANs in 2014,[16] the technique has seen rapid growth in interest and sophistication. Today, GANs have become a powerful tool for generating images and other modalities of data. They are capable of outputting high-resolution images that in some cases are indistinguishable from real ones to human eyes. See the human face images generated by NVIDIA’s StyleGANs in figure 10.9.[17] If not for the occasional artifact spots on the face and the unnatural-looking scenes in the background, it would be virtually impossible for a human viewer to tell these generated images apart from real ones.