0% found this document useful (0 votes)
30 views4 pages

Recognition of Handwritten Digits Using Machine Learning Techniques IJERTV6IS050456 PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views4 pages

Recognition of Handwritten Digits Using Machine Learning Techniques IJERTV6IS050456 PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Published by : International Journal of Engineering Research & Technology (IJERT)

http://www.ijert.org ISSN: 2278-0181


Vol. 6 Issue 05, May - 2017

Recognition of Handwritten Digits using


Machine
Learning Techniques
Shobhit Srivastava#1, Sanjana Kalani#2,Umme Hani#3, Sayak Chakraborty#4
Department of Computer Science and Engineering
Dayananda Sagar College of Engineering
Bangalore,Karnataka,India
III. IMAGE PREPROCESSING
The size of the image used is this project is 25 by 25
Abstract—This paper illustrates the application of object
character recognition (OCR) using template matching and pixels. The steps used in pre-processing the image is
machine learning techniques to solve the problem of represented in Fig 1.
handwritten character recognition. In this paper we perform
the recognition task using Template Matching, Support
Vector Machine (SVM), and Feed Forward Neural Network.
Template matching is an image processing technique to
break the image into smaller parts and then match to a
template image. Here we use a Multi Class SVM classifier
and Neural Network to classify the image. We use the dataset
to train the classifier followed by feature extraction and
finally applying the classifiers to recognize the digits.

Keyword — Support Vector Machine, Template Matching,


Neural Networks, Feature Extraction

I. INTRODUCTION
Handwritten image recognition is probably one of the
most interesting and challenging applications in the field
of pattern recognition. Handwritten recognition is divided
into two types of techniques: on-line and off-line. Off-line
techniques include reading the character using an image
capture device, such as a camera. while the technique
which is being dealt here is Off-line which means to
convert a handwritten image into a machine readable
form. Fig. 1. Steps of Pre-Processing

The major factor behind choosing this particular Finally the image is resized to 25 by 25 pixels. The
application is its numerous applications such as Automatic images used for testing consists of more than one digits
Number Plate Recognition, assisting blind and visually which needs to be separated into individual digits before
impaired people,automatic check processing for banks, applying the pre-processing steps.
and to process huge number of documents in industries
like healthcare, legal, education, and finance the focus if
the work described in this paper is on handwritten digits.
The paper will further be covering data collection, image IV. FEATURE EXTRACTION
preprocessing, feature extraction, and finally Blob Analysis: Blob or Binary Large Object is a large
classification. image which needs to be managed, and consists of binary
II. DATA ACQUISITION data. In this project we used images that consists of a
sequence of digits. The image is then converted into a
The data used in this project is a set of handwritten
binary image using the bwlabel function in matlab, where
digits from 1 to 10. The data has been divided into two
the image is processed according to the connected
categories which form the training set and the test set.
components concept.
Sets of data were collected which are the phone numbers,
zip-codes, and address plates for testing purpose. Connected Components: The concept is based on
grouping similar pixels according to pixel connectivity.

IJERTV6IS050456 www.ijert.org 711


(This work is licensed under a Creative Commons Attribution 4.0 International License.)
Published by : International Journal of Engineering Research & Technology (IJERT)
http://www.ijert.org ISSN: 2278-0181
Vol. 6 Issue 05, May - 2017

The connected components have similar levels of pixel binary class classification, that is one against all other
intensity, and after grouping, each pixel is labelled classes which builds one SVM per class. Here the
according to the component it belongs to. K-connected technique used is oneagainst-one which builds one SVM
components (here K=8), algorithm is used in this work. for each pair of classes. This method constructs n(n-1)/2
classifiers where each one is trained on data from two
The process of classification is performed using classes. For training data from ith and jth classes we use the
template matching, SVM and Neural Network approach. following binary classification ,
V. TEMPLATE MATCHING
Template Matching is a computer vision technique
which is used to recognize the elements in the image by
matching it with a predefined template. The process is
elaborated in the flow diagram in Fig. 2.

Fig. 4. Equation For Svm

If sign suggests that x is in the ith class, then


th
the votes for the i class is incremented by one. Otherwise,
the votes for the jth class are increamented by one. Then,
we predict x is in the class with the largest number of
votes. The voting approach described above is also called
the “Max Wins” strategy. In case that two classes have
identical number of voteswe simply select the one with the
smaller index (this might not be a good strategy but is
adopted for simplicity). Practically we solve the dual of
problem described in Fig. 4 where the number of variables
is same as the number of data points in the two classes.
Fig.2. Flow Diagram For Template Matching Technique Hence, if on average each class has (l/n)th of the data
points, we have to solve n(n-1)/2 quadratic programming
Image Correlation: The main goal of this technique is to problems where each of them has about 2/n variables.
find similarity between images of equal dimensions. The
technique used to perform this task is Cross-Correlation,
and it is defined to be the sum of pairwise multiplications
VII. NEURAL NETWORK
of corresponding pixel values. The major disadvantage of
The approach discussed here is known as Artifical
this technique is that brightening of the image will
Neural Network(ANN). ANN is a model in machine
increase the cross-correlation with another image even if
learning which consists of a large number of artificial
the pixel values of the second image are not similar, as
neurons connected to each other. The structure of neural
shown in Fig. 3.
network resembles axons in the human brain. The
motivation behind choosing this type of architecture is to
build an intelligent model with functionality similar to that
of a human brain. The structure of a neural network
comprises of the Input, Hidden, and the Output layeras
shown in Fig. 5.

Fig.3. Cross-Correlation Depending On Brightness Of The Image

VI. SUPPORT VECTOR MACHINE


Support Vector Machine (SVM) is one of the most
popular classification algorithms used in the field of
machine learning. SVM was initially built to perform

IJERTV6IS050456 www.ijert.org 712


(This work is licensed under a Creative Commons Attribution 4.0 International License.)
Published by : International Journal of Engineering Research & Technology (IJERT)
http://www.ijert.org ISSN: 2278-0181
Vol. 6 Issue 05, May - 2017

Fig. 6 Output From Template Matching Algorithm

Fig.5 Structure Of Neural Network

Multilayer Perceptron (MLP): A MLP is a feed forward


ANN which maps the input data to the corresponding
output. It consists of a several layer of nodes, with each Support Vector Machine
layer is connected to the following layer through a set of The results from the SVM algorithm are the numbers
directed edges. Each neuron in the network is assigned an containedin the input image The accuracy obtained on the
activation function which maps the weighted input to the training data set was 76.7%.
output.
Below are the ROC and Confusion Matrix for SVM.
The MLP network is trained using the Backpropagation
algorithm.
Backpropagation Algorithm: Below are the equation
which explains the backpropagation algorithm.

Phase 1: Compute the error in output layer δL: The


components of δL are given by δLj=∂C/∂aLjσ′*(zLj). The
term ∂C/∂aLj is the rate of change of the cost function
with respect to the output activation function.
Phase 2: Compute the error δl in terms of the error in the
next layer, δl+1:
Fig. 7 Confusion Matrix
δl=((wl+1)Tδl+1) σ′(zl)
Suppose we know the error δl+1 at the l+1th layer. When
we apply the transpose weight matrix, (wl+1)T, we can
think of this as moving the error backwards through the
network, giving us a measure of the error at the output of
the lth layer. We then take the Hadamard product σ′(zl).
This moves the error backward through the activation
function in layer l, giving us the error δl in the weighted
input to layer l.

Combining phase 1 and phase 2 we can compute error δl


for any layer.
VIII. RESULT ANALYSIS
Template Matching Fig. 8 Roc Curve

IJERTV6IS050456 www.ijert.org 713


(This work is licensed under a Creative Commons Attribution 4.0 International License.)
Published by : International Journal of Engineering Research & Technology (IJERT)
http://www.ijert.org ISSN: 2278-0181
Vol. 6 Issue 05, May - 2017

Neural Network
The input is explained in the following GUI.
IX. CONCLUSION
In this project we used Template Matching, Support
Vector Machine, and Artificial Neural Network for digit
recognition. It turned out that all the three methods were
very promising but Neural Networks was very challenging
to apply and yielded very good results, followed by SVM
and Template Matching. Due to time constraints our
project was restricted to digits, and for future work it will
be interesting to investigate characters and more advanced
applications could involve facial or handwriting
recognition.
X. ACKNOWLEDGEMENT
We are very thankful to our professors and specially to our
guide Dr. Selvam Venkatesan for his significant help in
Fig. 9 Neural Network Gui completing this project.

Below are the confusion matrix and training performance


for the neural network.
XI. REFERENCES
[1] F. Bastien, P. Lamblin, R. Pascanu, J.
Bergstra, I. J.
Goodfellow,A. Bergeron, N. Bouchard, and Y. Bengio.Theano: new
featuresand speed improvements. Deep Learning and Unsupervised
Feature Learning NIPS 2012 Workshop, 2012
[2] Qiao Tan, Yuanlin Wen , Chenyue Meng Learning of Visualization
of Object Recognition Features and Image Reconstruction
[3] Žiga Zadnik, Handwritten character Recognition: Training a
Simple
NN for classification using MATLAB)
[4] J.Pradeep, E.Srinivasan, and S.Himavathi, Diagonal Based Feature
Extraction For Handwritten Character Recognition System Using
Neural Network
[5] O. Matan, J. Bromley, C. J. Burges, J. S. Denker, L. D. Jackel, Y.
LeCun, E. P. Pednault, W. D. Satterfield, C. E. Stenard, T. J.
Thompson, Reading Handwritten Digits: A Zip Code Recognition Sy
[6] C-L. Liu and K. Marukawa, “Normalization Ensemble for
Fig. 10 Confusion Matrix For Neural Networks Handwritten Character Recog nition”, The Ninth International
Workshop on Frontiers in Handwriting Recognition (IWFHR 9),
Tokyo, Japan, pp. 69-74, 2004
[7] https://www.elen.ucl.ac.be/Proceedings/esann/esannpdf/es1999-461
[8] Vanderbrug, G.J, Rosenfeld, ―Two -Stage Template Matching,‖
IEEE Transactions on Computers,
Vol. 60, Issue 11, 1977
[9] P. Weinzaepfel, H. Jegou, and P. Perez. Reconstructing an image
from its local descriptors. In Computer Vision and Pattern
Recognition,2011, pages 337 – 344. IEEE.
[10] D. M. Zeiler and R. Fergus. Visualizing and understanding
convolutional networks. In Computer Vision and Pattern
Recognition,2013.
[11] M. Zeiler and R. Fergus. Visualizing and understanding
convolutional networks. In arXiv:1311.2901 , 2013.
[12] M. D. Zeiler and R. Fergus. Visualizing and understanding
convolutional networks. In Computer Visio

Fig. 11 Training Performance For Neural Networks

IJERTV6IS050456 www.ijert.org 714


(This work is licensed under a Creative Commons Attribution 4.0 International License.)

You might also like