GAN & cGAN tutorial.
Getting started : better understanding of GAN/cGAN
Generative Adversarial Networks (GANs) have gained a lot of attention in recent years as a powerful tool in the field of machine learning. GANs are a type of artificial neural network that are capable of generating synthetic data that closely resembles real data. This is achieved by training two main components of the network, a generator and a discriminator, together in a "game-like" manner. The generator creates synthetic data, and the discriminator determines whether the data is real or fake. As the two components compete against each other, the generator improves over time and produces more realistic data.
This project focuses on understanding and exploring GANs, with a specific focus on image-to-image translation.
Image-to-image translation is the process of generating a new image that is based on an input image. For example, it can be used to convert a black-and-white image to a colored image or to convert a sketch to a realistic image.
Objective
This project was completed as part of the MSO_3_4 Apprentissage automatique practical work. The aim of the project was to provide a concrete implementation example of Generative Adversarial Networks (GANs) in order to gain a better understanding of how they work and how they can be used in machine learning applications.
The project is divided into two main parts, both of which are included in the same notebook. The first part provides an introduction to GANs, explaining their architecture and the basic principles behind their operation. The second part explores a specific type of GAN architecture(cGan) that is used for image-to-image translation.
Dataset
The MNIST Dataset is a large collection of handwritten digits that is frequently used for training image processing systems and testing machine learning algorithms. It is a popular dataset for researchers in the field.
The CMP Facade Dataset is a collection of 606 rectified images of facades from various sources that have been manually annotated. This dataset was created at the Center for Machine Perception and includes images from different cities and a variety of architectural styles.
Hands on example
In this section, we provide an introduction to DCGANs using an example. We use the MNIST dataset to train a GAN to generate new handwritten digits after showing it real digit images. DCGANs are similar to GANs but use convolutional and convolutional-transpose layers in both the generator and discriminator.
Results of the model
Training loss of the generator and descriminator
Results for 100 epochs :
Results for 200 epochs:
for more results, review the ipynb file.