Implementation of a Generative Adversarial Network (GAN) with a convolutional generator and discriminator. The provided model was effectively trained on a preprocessed LFW dataset (36x36, centered) on 1 GPU.
This personal project taught me a lot code-wise, and it opened my eyes to certain aspects of machine learning. I sincerely hope that those who will find time to read this README will find something interesting here themselves, or at least they can enjoy some peculiar images of my creation.
Even though this GAN works with low-resolution images, it is still incredible how well this model can extract semantic information from the dataset. Generated images are diverse and demonstrate complex properties including face symmetry, facial hair, occasionally glasses or even hats. Not to mention, the variety of facial expressions is just striking.
It was a revelation to me that GANs have a natural predisposition to providing diverse outputs. This is so because if a generator were to focus on creating images of a particular type, a discriminator would lower predictions for images of this type, punishing the generator's "dullness". That is why the generator's output space seems to resemble the training dataset.
Sooner or later, the discriminator might become overpowered by its generator. That means that fake images satisfy the discriminator's conditions better than real ones. Then, if the discriminator is too slow to retrain, it will start making progressively bad decisions. This situation might ultimately lead to the collapse of the model.
The discriminator may rank fake images higher than real ones, but that says little about their quality. The figures above demonstrate how the quality of the generator's output might degrade, as it happens during the GAN's collapse.
The importance of including batch normalization layers is hard to overstate. Working with random noise, they help immensely for the signal to travel throughout the net.
As a curiosity, I have included the most disturbing images obtained without implementing batch normalization.