Handwritten Number Recognition Using Image Processing and Neural Network Technique


A handwritten number recognition system was developed by using image processing and neural network technique. The detail is described as below.

Image Processing Technique
Before the computer can recognize handwritten number, a set of handwritten number images needed to be provided to computer to teach her about what does the image mean. The chain codes approach is used to extract out the image feature information based on their shape .

The below are the steps used to obtain the chain codes of an image.
  • Grayscaling
  • Thresholding - Histogram information are used to obtain the best threshold value automatically
  • Scalling - If code word resampling technique are used. This technique can reduce the noises contain in the chain codes
  • Thinning - Also known as skeleton. Remove redundant line information
  • Chain coding - Convert shape information into a set of numerical number.
Neural network Technique
Neural Network is like the human brain model. The image information which has been converted into a set of numerical number, will be feeded into the neural network. Neural Network will be trained. The Neural Network will be continuous improved based on its learning experience.

Image Searching
After a well trained Neural Network has been constructed, any test image will be processed using the above mentioned image processing technique. A set of numerical number will be obtained and feeded into the Neural Network. The output of the Neural Network is the result of the recognition.

How to search for an image

  1. Download the numberrecognition-1.0.zip from the Download section.
  2. Extract the numberrecognition-1.0.zip to any location of your computer local disk (For example, C:\Program Files\ in Windows) by using archive tool (In Windows, you may use WinZip. In Linux, you may use the tar command. In Macintosh, Stuffit expander will expand the archive automatically)
  3. You will see a new folder named numberrecognition-1.0 is created. (For example, C:\Program Files\numberrecognition-1.0 in Windows)
  4. In Windows, double click the numberrecognition.jar in bin folder. (For example, C:\Program Files\numberrecognition-1.0\bin\numberrecognition.jar in Windows) In Linux, you may use the command java -jar numberrecognition.jar
  5. You will see the following screen. 
  6. Click on Project->Open..., a file chooser dialog box will be pop up. Go to the location where you extract the archive file and choose pure_images_loading_with_tokens.xml. (For example, C:\Program Files\numberrecognition-1.0\pure_images_loading_with_tokens.xml) A collection of training images will be loaded into the application's Image Tree. 
  7. Click on Neural Network tab, click on Set default button, followed by Train button. Please note that our intention is to make the error graph very near to 0.0. If you can't get the result, try to re-train the neural network by increasing the number of input neurons (60 for example) or the number of hidden neurons (50 for example). 
  8. Click on Image Recognition tab, write a number within the Drawing Area, click Recognize button. Please note that your handwritten number should be similar to the training image found in the Image Tree. 

Highlighted features in handwritten number recognition demo
  • Save project configuration in XML format.
  • Save trained Neural Network
  • Drag n Drop support in the image tree
  • Multithreading in image processing, neural network training and image recognition
  • Able to recognition any objects other than number which used shape as their main identity
  • Use code word re-sampling to reduce the noises in the code word
  • Support Auto Threshold so that the whole training and recognition process is fully automated. User needed not to try-n-error to get the best threshold value

I would like to have handwritten number recognition feature in my own application, do you have any library.

Yes. We have made that for you :) A neural network, which is trained with 10000 handwritten digit images from http://yann.lecun.com/exdb/mnist/ train image database, is shipped together with this library as default neural network model.
By performing benchmarking on 8920 handwritten digit images from http://yann.lecun.com/exdb/mnist/ test image database. With the default neural network model shipped together with libnumrecognition, the highest recognition rate is 97.87% and the lowest recognition rate is 90.92%.


Click here for handwritten number recognition library binary and source code
Click here for handwritten number recognition library user manual
Click here for handwritten number recognition library documentation
Click here for handwritten number recognition demo binary and source code
Click here for handwritten number recognition applet demo (Java Runtime Environment 6 is required)

System Requirement

The following platform which is installed with Java 6 Runtime Environment, SE v1.6.0 or above will be supported. It can be downloaded from http://www.java.com/en/download/manual.jsp

Number Recognition had been tested in Windows XP and no bugs have been discovered so far at the time being written.

Number Recognition had been tested in Ubuntu 6.06 and no bugs have been discovered so far at the time being written.

Macintosh (Apple Mac OS X and Apple Mac OS 9 & earlier)
Number Recognition had been tested in Mac OS X (10.3.5) and no bugs have been discovered so far at the time being written. Thanks to Ard Jonker for performing the testing.

Solaris(TM)SPARC(TM) (32-bit)
Not tested.


Special thanks to Shuwn Yuan for her support during my time in Penang, Malaysia.

Jens Langner <Jens.Langner@light-speed.de> <http://www.jens-langner.de/> - For his GUI codebase.

Wayne Rasband <http://rsb.info.nih.gov/ij/> - For his image processing library

Paolo Marrone and the Joone team <http://www.joone.org> - For their neural network library

Created by on 26 February 2007