/WGAN

Primary LanguagePython

WGAN

This program was written with PyTorch and uses a GAN with a Wasserstein loss function to try to recover image data that has had some type of data loss function applied to it (erased pixels, lowered resolution, or added noise). During training, the function causing data loss is applied to the output of the GAN generator and the discriminator must discern between such output and real images with data loss. This setup induces the generator to learn the underlying true data distribution of the images to best imitate real images with data loss subject to the data loss function being applied to its output. The model training is done with the MNIST dataset using image batches and an Adam optimizer.

Training on MNIST images

MNIST images:

wgan 5 1

 

Output images from the generator:

wgan 5 2

Training to recover pixel-erased image data

Pixel-erased MNIST images:

wgan 9 1

 

Images after applying pixel erasing to the generator output:

wgan 9 2

 

Images directly from the generator output without any data loss function applied:

wgan 11 2

Training to recover low-resolved image data

Low-resolved MNIST images:

wgan 13 1

 

Images after applying low-resolving to the generator output:

wgan 13 2

 

Images directly from the generator output without any data loss function applied:

wgan 15 2

Training to recover Gaussian noised image data

Noised MNIST images:

wgan 17 1

 

Images after adding Gaussian noise to the generator output:

wgan 17 2

 

Images directly from the generator output without any data loss function applied:

wgan 19 2