TD 2 : GAN & cGAN
MSO 3.4 Apprentissage Automatique
This project focuses on understanding and implementing Generative Adversarial Networks (GANs) and Conditional GANs (cGANs) for image generation and image-to-image translation tasks. Below is an overview of the project structure, including the tasks performed and the provided solutions.
Deep Convolutional GAN (DCGAN)
In this section, we explore the basics of GANs by implementing a DCGAN architecture to generate handwritten digits.
In this part, a tutorial for celebrity faces generation in applied to the handwritten digits. It gives a first introduction to GANs for a simple case.
Conditional GAN (cGAN)
In this section, we delve into cGANs, particularly focusing on image-to-image translation using a U-Net generator and a PatchGAN discriminator. The goal is to create images building facade images based on a mask of the facade.
U-Net architecture
The U-Net is a model based on several convolutional layers, that create an output image from an input one. It represents the generator The two main steps are:
- Define classes for U-Net architecture components.
- Create the U-Net model for image-to-image translation.
PatchGAN
The PatchGAN is the discriminator that will classify the images.
Loss functions
The loss function used in this project combines GAN loss and L1 norm loss to map both high and low-frequency features in the generated images.
Results
Comparative analysis of generated images between 1 epoch and 50 epochs shows significant improvement in image quality and resemblance to real images.
Conclusion
This project provides hands-on experience with GANs and cGANs, demonstrating their effectiveness in generating realistic images and performing image-to-image translation tasks. The pain point of the work carried out was mainly the computing time to train the model, which led to reducing the number of epochs and thus the performances of the model. To conclude, through practical implementation and analysis, learners gain insights into the complexities and nuances of deep structured learning.
Acknowledgments
The code and tutorials used in this project are primarily based on PyTorch documentation and research papers cited within the assignment.
Author
Oscar Chaufour
Feel free to expand on this readme with additional details or instructions as needed for your project documentation.