Skip to main content

GAN on Computer Synthetic Face Images with WandB

How will a basic GAN preform on Computer Generated Images? How will the can we optimize basic parameters of a GAN?
Created on February 14|Last edited on February 28

What is a GAN?

GANs are a type of Neural Networks that make generate new images based on a dataset. GANs consist of two neural networks -- a Generator and a Discriminator. The Generator makes an image the Discriminator determines if an image is generated. The end goal of GANs are to generate an image that the Discriminator cannot tell is generated.
Courtesy of OpenAI's DALL-E

Code Source

I used the code from PyTorch's DCGAN Tutorial as a baseline GAN.

Dataset Introduction

I am training on a subset of DigiFace1M, a dataset of synthetic face images used for face recognition training. Only the first 3750 images were used in training (72 images for 50 individuals), in order to not exponentially increase training time.


WandB Code Saving helped out here as I was parsing the datasets
💡

Initial Run

Hyperparameters
  • Image Size: 64
  • Latent Vector Size: 100 (Size of the Generator's Input)
  • Feature Map Size: 64


/

Sweep on Hyperparameters

I decided to sweep over Latent Space, Feature Maps, and Image Size in order to see the effects of it on the GAN's performance.
This was incredibly fast saving versus doing it myself!
Before WandB: Folders with Pkl , Image/Dataset Files, Copies of Code, Naming Schemes
With WandB: wandb.sweep()
💡



Weave panels are very helpful in understanding the effects of each variable in the sweep.
💡








Best Runs based on D_losses, G_losses, and my own discretion.



Easy logging using wandb.log() and worrying about formatting the graphs later. Saves time in preparing the model and moves it to after training.
💡


GIF of progression of hopeful-sweep-7 (Courtesy of Scott Condron)


Future Exploration

  • Effects of different layers on the Image Creation process
  • Comparing the performance of different GAN architecture
  • Making my own layer!

Uses of Weights and Biases in the project

  • Sweeps (with Multiple Agents)
  • Reports
  • Image Logging
  • Used an existing Artifact to make a GIF
  • Weave