GAN Studio

July 2018
HTMLCSSJavaScriptAI

A web application for training and generating images with GANs (generative adversarial networks), which was a popular method for image-based generative AI from its development in 2014, until diffusion kind of took over around 2020. Given DALL-E and Stable Diffusion, this technique is now mostly obsolete but it was fun while it lasted.

This was my major project for software design and development in high school in 2018. So the disclaimer is that I probably don't agree with many of the decisions anymore.

At the time this was probably the largest programming project I had completed.

Tutorial/demo video that was submitted with the project.

Technology

All I had was a hammer, so the entire project was written from scratch using vanilla JavaScript.

The UI was drawn from rectangle/text primitives and powered by click events on a HTML Canvas. The GAN was written from scratch down to the individual looping over neurons to sum their activations (no parallelism 🥲).

Many mediocre layers of abstraction.

The source code can be found on Github.

Application

Application embedded below if you want to try it yourself, although I won't make any guarantees about the experience.

You can draw the data manually (not recommended). Otherwise the MNIST training data for each digit can be found on GitHub.