In this code pattern, look at a simple JSON representation of defining a Generative Adversarial Network (GAN) model, and implementing a Deep Convolutional GAN (DCGAN) model to generate fashion images without writing a single line of code.
Deep learning models used to perform classification tasks are upper bounded by the number of images available in the training data. Data augmentation is often used to synthetically generate more data, which looks similar to the original data. Generative Adversarial Networks are state-of-the-art models that are used to generate synthetic, realistic images.
Fashion MNIST is a 10-class classification data set that is a drop-in replacement for the MNIST digit classification data set. Many deep learning models are trained for performing classification on the Fashion MNIST data set. The performance of these classifiers could be improved if the training data set could be augmented with more images. A Deep Convolutional GAN (DCGAN) model is a GAN for generating high-quality fashion MNIST images.
This is an open source project bundled with the following tools that you can use to design and implement custom GAN models:
- Specify the architecture of a GAN model by using a simple JSON structure, without the need for writing a single line of code
- Customize all of the parameters of different GAN components through the JSON structure
- Train the designed GAN model on any custom data (such as a fashion data set) to start generating new images
- The user creates a JSON config file that defines the architecture choices of the GAN model to be trained.
- The user sends the JSON config file through a REST API call to a Python-Flask server in IBM Cloud.
- The Flask API decodes the JSON config file in real time and creates a GAN model definition.
- The Flask API then converts the GAN model definition into an error-free PyTorch code.
- The GAN model in PyTorch is then trained using the given input fashion image data set.
- The trained model generates new fashion images that are not in the input data set but look similar to them.
- The newly generated images can be collected from the Python runtime in IBM Cloud.
Find the detailed steps for this pattern in the README file. The steps show you how to:
- Create an account with IBM Cloud.
- Install the IBM Cloud CLI.
- Log in to your IBM Cloud account using CLI.
- Set up the IBM Cloud Target Org and Space.
- Clone the GitHub repository.
- Create a GAN configuration file.
- Edit the manifest file and ProcFile.
- Push the app to a new Python runtime in IBM Cloud.
Smruthi Raj Mohan