Deep convolutional generative adversarial networks (DCGANs) for generating fake faces with Tensorflow and Keras.
Final project for DD2424 Deep Learning in Data Science at KTH Royal Institute of Technology, Stockholm.
Note that this project is a fork of Cool GANs and Fake Celebrities that was a collaboration of the group:
The Large-scale CelebFaces Attributes (CelebA) Dataset is publicly available here.
The dcgan.ipynb
includes code to download and prepare the dataset, but it can also be done manually.
The implementation follows that of Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks.
The code is in dcgan.ipynb
.
Our experiments and results are discussed in the report and the presentation
The models are evaluated based on the generator and the discriminator losses, and the Fréchet Inception Distance (FID) metric proposed in GANs Trained by a Two Time-Scale Update Rule Converge to a Local Nash Equilibrium .
Due to the limit of accessibility to adequate hardware to training the DCGAN on the original faces dataset dimensions of 218 x 178, the models are trained on 32 x 32 and 64 x 64 images.
The implementation is first tested on the MNIST dataset, and then on the faces dataset.
Some samples of generated images are shown below.
All the generated MNIST images are of size 28 x 28. After 50 epochs:
Below are some results of generating 32 x 32 images. After 75 epochs:
The GIFs show the evolution of the generator. The evolution of the 32 x 32 generator (from another experiment than above):
Below are some results of generating 64 x 64 images. After 125 epochs:
The evolution of the 64 x 64 generator (from the same experiment as above):
Training logs are located at logs
and can be visualized with Tensorboard.
Some examples are shown below for a model trained on the 32 x 32 faces dataset.
GANs are cool, DCGANs are cooler.