Digit Recognition

A tool to recognize hand-drawn (single) digits. The hand-drawn digits are fed to a neural network that tries to classify the digits. The neural network is trained on the MNIST dataset. Note that the network is still pretty sensitive to how the input looks. Results may therefore not always be very accurate. Tip: drawing digits works great on a touch screen interface (e.g. iPad).
  • Draw a digit...
Neural Network. The neural network is a 3-layer network (300 + 100 hidden units). The hyperbolic tangent is used as activation function. The input is a 28x28 vector representation of the pixels in the image containing the digit. The network was trained on the MNIST dataset, with a training set of 60.000 samples and a test set of 10.000 samples. For training resilient backpropagation is used. After 63 training iterations, the network converged to a Mean Squared Error (MSE) of 0.0396 on the training set. The MSE for the test is 0.0470, with 93,4% of the test set classified correctly. A graph of the MSE as it develops during the 63 epochs is displayed below.

MSE Graph

Image Processing. The images drawn by a user need to be converted to the format that is used to train the neural network with. In the MNIST dataset digits are normalized to 20x20 pixels (preserving aspect ratio). The 20x20 box is then centered according to the center of mass of the pixels in a 28x28 image. The same process is applied to the hand-drawn images of the user.