GAN & cGAN tutorial.
Intro
GAN (for Generative Adversarial Network) is a type of machine learning model that consists of two neural networks : a discriminator and a generator. Basically, a generator generates fake data that the discriminator has to detect. While the discriminator learns how to "discriminate" between fake and real images, the generator tries to fool it into thinking the images are real. In this project, we use it to generate fake images based on real ones. cGAN (for Conditional Generative Adversarial Network) is a variation of GAN in which the generator conditioned on some input, such as a label or a class, to generate data that belongs to a specific category. In our case, it will be models of houses / buildings.
This project is part of MSO 3.4 Automatic learning. The goal of the project is to implement GANs in order to understand how they work, and is composed of two parts : the first one gives a simple example of Numbers generation with GAN, whereas the others gives us an example of cGAN, as an image to image translation model. The whole project is included in the Notebook in the main branch.
Steps of the project
- Generating handwritten digits using the MNIST dataset.
- Downloading the Dataset
- Initialize weights
- Define the generator and discriminator functions
- Set up the optimizer and the loss
- Train the model
- Plot results
- Generating Façade using CMP Facade Dataset (download it)
- Defining CGAN and U-net architecture
- Define the Generator with a built-up U-net architecture
- Define discriminator with conv-blocks.
- Set up optimizer and loss functions
- Train the model
- Plot results
Contact
This project has been written by Paul SERGENT. For any questions, don't hesitate to write to paul.sergent@ecl19.ec-lyon.fr