← All projects 2021

Arabic Handwritten Numeral Generation

A conditional GAN that synthesises handwritten Arabic digits from scratch, filling a gap MNIST never covered and cutting the cost of dataset collection and labelling.

  • Python
  • Deep Learning
  • GANs
  • WGAN-GP
  • Computer Vision
  • Google Colab

The most-used dataset in machine learning, MNIST, only covers Western Arabic numerals (0 to 9 as written in the Latin world). The Eastern Arabic numerals used across much of the Arabic-speaking world are barely represented, and I couldn’t find a single model that generated both. So I built one.

What it does

A generative model that learns what handwritten digits should look like and creates brand-new ones from scratch. Practically, this is a way to grow a dataset without the expense of manual collection and labelling, useful anywhere training data is scarce.

How it works

  • Trained a Wasserstein GAN with Gradient Penalty (WGAN-GP) for stable adversarial training.
  • Watched the network progress from pure noise, to rough shapes, to convincing handwritten digits over the course of training.
  • Added a digit-morphing mode that smoothly interpolates one number into another in the model’s latent space.

Take it for a spin

The full notebook runs in the browser, no setup required. Source and a one-click Google Colab are linked above.