MNIST Digit Recognizer


Draw a digit between 0 and 9 above and then click classify. A neural network will predict your digit in the blue square above. Your image is 784 pixels (= 28 rows by 28 columns with black=1 and white=0). Those 784 features get fed into a 3 layer neural network; Input:784 - AvgPool:196 - Dense:100 - Softmax:10. The net has 20,600 learned weights hardcoded into this JavaScript webpage. It achieves 98.5% accuracy on the famous MNIST 10k test set and was coded and trained in C. The net is explained here. The best nets are convolutional neural networks and they can achieve 99.8% accuracy. An example coded in Python with Keras and TensorFlow is here.

Additionally this page allows you to download your hand drawn images. Your images get added to your history showing above to the right. Click 'download' to receive a CSV of digits with or without labels. You can import that CSV into your neural network software for training or testing. The format of the CSV is the same as Kaggle's. Each row is a digit with 784 pixels representing a 28x28 image (rows first). If you download with labels, then each row begins with the label. Assign true labels by clicking images in your history above and then clicking the correct keyboard key number.

Each image is cropped before classification and before adding to history. If you don't want images cropped, hit the shift key to expose two new buttons. Then hit the button that says, 'Crop Off'. To clear the entire history, simply reload the webpage. To remove one image from history, click it, then click delete.

You can visually watch a neural network learn here.