Published in


Convolutional Generative Adversarial Network: “EyeGaze” Image Generator

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.

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.


The Mindboard Data Science Team explores cutting-edge technologies in innovative ways to provide original solutions, including the Masala.AI product line. Masala provides media content rating services such as vRate, a browser extension that detects and blocks mature content with custom sensitivity settings. The vRate browser extension is available for download via the Chrome Web Store. Check out www.masala.ai for more info.



Case Studies, Insights, and Discussions of our Modernization Efforts

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