Examples‎ > ‎

Handwritten digits recognition

The Nunn Library sample applications include handwriting recognition demo application, which is an excellent prototype problem for neural networks learning.
The following runnable examples are provided:
  • mnist_test application lets you evaluate multiple net configurations on MNIST
  • ocr_test provides a GUI to write digits that can recognize by using MNIST trained nets
The test is performed by using the MNIST data set, which contains 60K + 10K scanned images of handwritten digits with their correct classificationsThe images are greyscale and 28 by 28 pixels in size.
  • The first part of 60,000 images were used as training data.
  • The second part of 10,000 images were used as test data.
  • The test data was taken from a different set of people than the original training data.
  • The training input is treated as a 28×28=784-dimensional vector.
  • Each entry in the vector represents the grey value for a single pixel in the image.
  • The corresponding desired output is a 10-dimensional vector.
You may obtain other info about MNIST at link http://yann.lecun.com/exdb/mnist/

mnist_test - Usage:

  [--training_files_path|-p <path>]
  [--save|-s <net_description_file_name>]
  [--load|-l <net_description_file_name>]
  [--learning_rate|-r <rate>]
  [--epoch_cnt|-e <count>]
  [[--hidden_layer|-hl <size> [--hidden_layer|--hl <size] ... ]

--version or -v
  shows the program version
--help or -h
  generates just this 'Usage' text
--training_files_path or -p
  specify training/test files set path
--save or -s
  save net data to file
--load or -l
  load net data from file
--skip_training or -n
  skip net training
--learning_rate or -r
  set learning rate (default 0.10)
--epoch_cnt or -e
  set epoch count (defualt 10)
--hidden_layer or -hl
  set hidden layer size (n. of neurons, default 100)

Example, running mnist_test with max epoch count 60, learing rate 0.40, one hidden layer of 135 neurons and saving net status on nn_135hl_040lr.net file:
# mnist_test -e 60 -r 0.40 -hl 135 -s nn_135hl_040lr.net

NN hidden neurons L1 : 135
Net Learning rate : 0.4
Training labels : train-labels.idx1-ubyte
Training images : train-images.idx3-ubyte
Test labels file: t10k-labels.idx1-ubyte
Test images file: t10k-images.idx3-ubyte
Learning epoch 1 of 60
Completed 100%
Error rate : 6.65%
Success rate : 93.35%
BER : 6.65%
Epoch BER : 1
Learning epoch 2 of 60
Completed 22.8%


This is an interactive demo which uses MNIST trained neural network created by using Nunn Library.
nunn status files (.net) have been created by mnist_test application.

YouTube Video