Convolutional Generative Adversarial Network: “EyeGaze” Image Generator

Eric Muccino
Jun 5, 2019 · 2 min read

A generative adversarial network (GAN) is a system composed of two neural networks: a generator and a discriminator. The discriminator takes a data instance as input, and classifies it as ‘Real’ or ‘Fake’ with respect to a training data set. The generator takes Gaussian noise and transforms it into a synthetic data sample with the goal of fooling the discriminator. The discriminator learns to classify samples as real or fake. The generator learns from errors in failed attempts at fooling the discriminator.

To test the capabilities of adversarial methods for generative models, we developed a simple GAN in Keras that uses convolutional neural network layers to generate and discriminate images of human eyes from the “EyeGaze” data set found on kaggle.com. Click here to access the kernel to view and run our code.

Results

Here is an example of an image found in the “EyeGaze” data set:

The following GIF shows images that our model generated from a single random seed over 105 training epochs.

Key takeaways from model development:

  • Batch normalization between layers was necessary for our model to convergence.
  • In order for batch normalization to behave properly, the discriminator needs to use separate batches for the real and fake data sets.
  • Setting the Adam optimization beta 1 hyperparameter to 0.5 produced better convergence than the default value of 0.9.
  • The generator needs to be trained more often and requires a significantly smaller learning rate compared to the discriminator since the discriminator has significantly less output complexity to learn.

We have shown that a very simple generative neural network can produce convincing results. Further improvements to the basic generative adversarial architecture would allow for powerful synthetic data generation for any data type including images, videos, time-series, natural language, and relational databases.

Mindboard

Case Studies, Insights, and Discussions of our…

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store