TD 2 : GAN & Diffusion
MSO 3.4 Apprentissage Automatique
Thomas DESGREYS
To compute all the trainings and evaluations, I had to use both Google Colab and Kaggle (in parallel because of the slowness) because they offer free GPU use. That's why on the final notebook BE2_GAN_and_Diffusion.ipynb, some cells or not correctly run.
Part 1: DC-GAN
The aim of this part is to generate written numbers thanks to a Deep Convolutional Generative Adversarial Networks.
For this purpose, we implement a generator and a discriminator : the generator is trained to generate fake numbers from noise, in order to lure the discriminator and the discriminator is trained to differentiate true numbers from fakes.
We can see on the loss curves that the accuracy of the discriminator is quite constant as the generator get better so its hard for it to get better. The generator loss is decreasing. The variation of the losses is unstable as the two models are in competition.
We observe at the end of the training (5 epochs) that the generated images are really close to real written numbers. However, we note that the generator doesn't create specific numbers but "something" that looks like a number.
Part 2: Conditional GAN (cGAN)
In this part we aim at to generating facades from a template image.
For this purpose, we use a UNET architecture for the generator and a patch GAN for the discriminator.
We can see the same unstable behavior as for the DC-GAN. The GAN is getting better on average so that's satisfying.
Comparison of the model for 100 and 200 epochs
With the training data, we observe that the model use its memory to recreate quite the same facades. The model with 200 epochs generates less blurry images.
With the validation data, the model is creating more original images. Its sticks to the template to create realistic images with still a lot of artefacts. The images are quite fare from the original but that's normal given the sole information of the template. The model with 200 epochs show a bit more details but also mor noise so we can't conclude its better.