A neural network from scratch in Python

Unistroke program

A few days ago I watched the “godfather of AI” and Nobel Prize winner Geoffrey Hinton explain to Jon Stewart how neural networks work.

A few years ago I made a neural network for recognizing symbols that are hand drawn by the user with a single stroke of the mouse, to get familiar with the math of backpropagation. I helped myself with the book Make your own neural network by Tariq Rashid. The user drawn curve is reduced to points, which form vectors. These are then fed to the neural network for training.

Install the required numpy package:

pip install numpy

Launch it with:

python gui.py

How to use

  1. Make a training set. You can:
    • Draw your own symbols and label them
    • Or/And load the included sample training set of 1000 symbols from the file digits_0-9.csv
  2. Click the button Train and wait for the training to complete
  3. Swich the mode to Recognition
  4. Draw the symbols you want to recognize

Unistroke on GitHub

Full video of installation and usage: