Deep convolutional generative adversarial network for FashionMNIST dataset with Keras and Keras-adversarial.
GAN creates adversarial setup for generator (i.e., convolutional neural network) to produce images with the objective to dupe discriminator (i.e., another convolutional neural network) while the latter trains to distinguish real images from generated ones.
I pursue the following goals:
- Testing the capacity of DCGAN to generate images.
- Making DCGAN implementation less cumbersome thanking to Keras library.
The Keras implementation in "gan_blob.ipynb" is similar to "GAN" though the latter is written with Tensorflow. To run "gan_blob.ipynb" you will need to install keras_adversarial from: keras-adversarial.
This notebook is not well annotated, please refer to "Annotated_DCGAN_.ipynb" for better understanding the code.
The output image at the end of the training is as at Fig 1.
As you can see he DCGAN suffers from so-called mode dropping: certain classes are rarely or not generated. As you can see our generated image does not contain any traces of shoes, for example.
I addresed this issues by adding batch normalization in discriminator's network. Batch Normalizations helps overcome the problem of different distribution for each layer's input within training phase. Please refer to "Annotated_DCGAN_.ipynb" for the full version of the notebook with necessary annotation to follow the code. The updated version produces images as: