Since deep learning took off in 2012, some people think no new idea has been more interesting or promising than Generative Adversarial Network (GAN), introduced by Ian Goodfellow in 2014 in the paper, Generative Adversarial Networks (https://arxiv.org/abs/1406.2661). In fact, Yann LeCun, the Facebook AI research director and one of the pioneering deep learning researchers, referred to GAN and adversarial training as “the most interesting idea in the last 10 years in machine learning.” Because of this, how can we not cover it here, to understand why GAN is so exciting and how to build GAN models and run them on iOS and Android?
In this chapter, we'll first give an overview of what a GAN is, how it works, and why it has such great potential. Then we'll go through two GAN models: one basic GAN model that can be used to generate human-like handwritten digits, the other more advanced GAN model that can enhance low-resolution images to high-resolution ones. We'll show you how to build and train such models in Python and TensorFlow and how to prepare the models for mobile deployment. Then we'll present iOS and Android apps, with the complete source code, that use the models to generate handwritten digits and enhance images. By the end of the chapter, you should be ready to further explore all kinds of GAN-based models out there or start building your own ones and understand how to run them in your mobile apps.
In summary, we'll cover the following topics in this chapter:
- GAN – what and why
- Building and training GAN models with TensorFlow
- Using the GAN models in iOS
- Using the GAN models in Android