A Deep Learning Approach For Optical Character
A Deep Learning Approach For Optical Character
Abstract— Handwritten Character Recognition is one of the very tough to achieve 100% accuracy as the accuracy is based
most challenging and demanding area of interest for researchers entirely on user handwriting styles. Many researches have
in domains of pattern recognition and image processing. Many
been carried out in this direction but achieving 100% accuracy
researchers have worked with recognition of characters of
different languages but there is comparatively less work carried is not possible.
for Devanagari Script. In past few years, however the work
carried out in this direction is increasing to a great extent. Optical Character Recognition (OCR) is a method which
Handwritten Devanagari Character Recognition is more takes an image as input scans it and transforms it to an
challenging in comparison to the recognition of the Roman editable form. There are various systems in the market which
characters. The complexity is mostly due to the presence of a scan printed data and some scan even handwritten data. But
header line known as shirorekha that connects the Devanagari
characters to form a word. The presence of this header line when it comes to the accuracy of the output most existing
makes the segmentation process of characters more difficult. software’s fail to provide enough accuracy as needed.
There is uniqueness to the handwriting styles of every individual
which adds to the complexity. In this paper, we propose The OCR systems which are present mostly make use of
development of Convolutional Neural Network (CNN) based machine learning techniques such as support vector machines
Optical Character Recognition system (OCR) for Handwritten (SVMs) and artificial neural networks (ANNs) for the
Devanagari Script which is observed to recognize the characters
accurately. recognition of characters. These classifier models used in the
OCR systems require that input images are down sampled to
Keywords— Convolutional Neural Networks, Deep Learning, reduce the complexity. This down sampling results in the loss
Devanagari Script, Handwritten character, Optical Character of some important information. SVM classifier for instance
Recognition. provide different recognition accuracy for characters with
different font styles.
I. INTRODUCTION
Therefore, in order to build an efficient OCR system which
can make use of data in the form of images we propose use of
Character recognition deals with recognizing the characters
convolutional neural networks in contrast with use of SVMs
accurately from a document. Character recognition is done
and ANNs. Convnets have proved to be very useful in high
either from printed documents or handwritten documents.
quality image and video recognition methods.
Character recognition is distinguished into two classes: on-line
character recognition and off-line character recognition. In
Convolutional Neural Network (CNN) are class of Deep
off-line recognition characters are optically captured by a
Neural Network which need smaller parameters and are easier
scanner and the writing is available as an image. In on-line
to train. By changing the number of hidden layers and
recognition the user writes directly on a pen-based input
trainable parameters in each layer of CNN their ability to
devices and curves and styles of writing are identified as
model input dataset can be varied. CNN have lesser trainable
written to recognize the character.
parameters in comparison to a fully connected feed-forward
network. CNNs have notion of local receptive field, weight
Handwritten character recognition is a technique to
replication and subsampling which allows us in having some
convert handwritten document into a text file which can be
amount of shift and distortion changes in data. A number of
edited. Handwritten character recognition is a very complex
convolutional and subsampling layers are present in CNNs for
task in contrast to printed character recognition as the
image processing.
characters are written in various styles and sizes. Every
individual has a unique way of writing. As a result it becomes
Authorized licensed use limited to: University College London. Downloaded on May 23,2020 at 18:14:50 UTC from IEEE Xplore. Restrictions apply.
2019 2nd International Conference on Intelligent Computing, Instrumentation and Control Technologies (ICICICT)
These layers are finally terminated by fully connected layer script which means that pronunciation of words are done as
where recodnition of data take place. Deep convolutional how they are written.
neural networks have a compact and cheaper mechanism as
opposed to standard feed forward network of same depth. But
a lot of processing and computation is required to train a
CNN, along with a large labelled dataset.
C. Form processing
HCR systems are used to read out the forms used to collect
public information. People reply in the space provided in the
forms. HCR systems are used to read what is written in blank
space.
D. Postcode recognition
HCR systems are used to read Handwritten postal address
and digits of postcode on letters.
Fig 3: Numerals in Devanagari Script
III. DEVANAGARI SCRIPT One of the unique feature of Devanagari script is the
presence of header line known as the “shirorekha”. This
A. Properties of Devanagari Script header line is present on top of every word and is used to
connect characters to form a word. The last letter of the word
is determined by the end of shirorekha. The presence of this
Devanagari script is used by languages like Hindi, Sanskrit,
shirorekha makes segmentation of characters more difficult
Sindhi Marathi, Nepali and Konkani. It is principal script of
for the recognition process. The writing fashion of the script is
India. Devanagari is a compound word with its subparts deva
from left to right direction and characters do not have
meaning “deity” and nagari meaning “city”
uppercase/lowercase.
Devanagari script has 36 consonants-“vyanjan” and 12
A Devanagari script is divided into three regions:
vowels-“swar” which are the basic characters. Besides these
basic characters there are also special symbols in the script
• Upper
known as “Matras”. These are known as the modifiers of the
• Middle
script and are placed above, below, left or right of a character.
• Lower
Also there are compound characters in the script which are
formed by combination of basic characters. It is a phonetic
Authorized licensed use limited to: University College London. Downloaded on May 23,2020 at 18:14:50 UTC from IEEE Xplore. Restrictions apply.
2019 2nd International Conference on Intelligent Computing, Instrumentation and Control Technologies (ICICICT)
The upper region is the portion above the headerline, the [1] presents an efficient OCR system with the use of
middle region covers the portion between headerline and convolutional neural networks. They recognize Sanskrit texts
baseline, the lower region is the segment below the baseline. written on olden documents which were poorly maintained
and downgraded. They showed that convolutional neural
networks are better than SVM and ANN for image
classification.
V. METHODOLOGY
Authorized licensed use limited to: University College London. Downloaded on May 23,2020 at 18:14:50 UTC from IEEE Xplore. Restrictions apply.
2019 2nd International Conference on Intelligent Computing, Instrumentation and Control Technologies (ICICICT)
Segmentation
Segmentation is differentiating object from the background.
For the grayscale image f(x,y), the segmented image s(x, y) is
obtained by binarization process as given below.
Inversion
When we write documents we usually write on a white paper
with a black/blue pen. But for character recognition we use
black pixels as background and white as foreground. Hence,
there is a need to invert the images.
i(x, y) = 1 - f(x, y) (2)
Universe of Discourse
It is the smallest area where the character is present, basically
the smallest rectangle surrounding the character. It removes
the extra unwanted pixels around the image.
Normalization
Normalizing refers to conversion of variable sized input
images to a predefined fixed size used for processing. In our
work we normalize the input images to a fixed size if 32x32
Fig 7: Handwritten Character pixels.
Preprocessing
Preprocessing is the initial stage in the handwritten character
recognition system. Preprocessing steps applied on the image Fig 11: Normalized image
are:-
Skeletonization
RGB to gray scale inversion A thin version of a character is known as skeleton of that
If the character is written in different color other than black character. Skeletonization is a process of converting the binary
we need to convert this image into a gray scale image. image into subsection of original image. While skeletonizing
This is done by taking weighted threshold of Red, Green and it is made sure that connectivity of the original image is
Blur component of a RGB image. preserved.
Noise Removal
Noise is removed from images with the help of filtering. In
our work we use non-linear median filtering.
Authorized licensed use limited to: University College London. Downloaded on May 23,2020 at 18:14:50 UTC from IEEE Xplore. Restrictions apply.
2019 2nd International Conference on Intelligent Computing, Instrumentation and Control Technologies (ICICICT)
Implementation Details
The project is implemented in Python. We used LeNet a
special type of CNN for the system. Convolutional neural
networks are implemented on keras. Tensorflow is used as
backend. Training is done on NVIDIA Geforce 940MX GPU.
VII. RESULTS
Convolutional neural networks are trained with labeled
dataset. We collected data samples of 15 characters from
different individuals. 1500 samples of each character were
used for training and 250 samples of each character were used
for testing. After the network was trained unknown characters
from word were given as input to the recognition system. The
accuracy obtained is shown below.
Authorized licensed use limited to: University College London. Downloaded on May 23,2020 at 18:14:50 UTC from IEEE Xplore. Restrictions apply.
2019 2nd International Conference on Intelligent Computing, Instrumentation and Control Technologies (ICICICT)
ACKNOWLEDGMENT and Artificial Neural Network” 2018 IEEE 3rd International Conference
on Computing, Communication and Security (ICCCS), Kathmandu
(Nepal).
I would like to take this as an opportunity to thank my [10] Abhishek Sutar, Naveen Menon, Priyanka Potdar, Priyanka Patil, Komal
Project Guide, Prof. Amit Patil, for giving me the opportunity Karande, Dr. Vijay Ghorpade “ Development of Intelligent Optical
Handwritten Character Recognition System for Devanagari Script” April
to work in the area of Character recognition and guided me. I
2016 International Research Journal of Engineering and Technology
would also like to thank my parents, sisters and friends who (IRJET) e-ISSN: 2395 -0056 Volume: 03 Issue: 04 | April-2016.
have constantly supported me throughout the duration of this [11] Krizhevsky, Alex, Ilya Sutskever, and Geoffrey E. Hinton. "Imagenet
project. classification with deep convolutional neural networks." In Advances in
neural information processing systems, pp. 1097-1105. 2012.
[12] Deepu Kumar, Divya Gupta “Review On Optical Character Recognition
for Off-line Devanagari Handwritten Characters & Challenges”
REFERENCES International Journal of Scientific Research in Computer Science,
Engineering and Information Technology © 2018 IJSRCSEIT | Volume
3 | Issue 3 | ISSN: 2456-3307.
[1] Meduri Avadesh and Navneet Goyal, “Optical Character Recognition [13] Ashutosh Aggarwal, Rajneesh Rani and Renu Dhir, “Handwritten
for Sanskrit using Convolution Neural Networks”, IEEE 2018 13th Devanagari Character Recognition Using Gradient Features”, Pattern
IAPR International Workshop on Document Analysis Systems. Recognition Volume 2, Issue 5, May 2012 ISSN: 2277 128X
[2] Bappaditya Chakraborty, Bikash Shaw, Jayanta Aich, Ujjwal International Journal of Advanced Research in Computer Science and
Bhattacharya and Swapan Kumar Parui “Does Deeper Network Lead to Software Engineering.
Better Accuracy: A Case Study on Handwritten Devanagari Characters” [14] Naveen Malik, Aashdeep Singh “Review of Character Recognition of
2018 13th IAPR International Workshop on Document Analysis Offline Handwritten Devanagari Script”. International Journal of
Systems. 2018 IEEE DOI 10.1109/DAS.2018.7. Computer Science and Mobile Computing, Vol.5 Issue.5, May- 2016, pg.
[3] Pahuni Saharan and Rupali Malhotra “Handwritten Devanagari 178-183
Character Recognition System Using Neural Network” Journal of [15] Yadav, Divakar, Sonia Sánchez-Cuadrado, and Jorge Morato. "Optical
Network Communications and Emerging Technologies (JNCET) character recognition for Hindi language using a neural-network
Volume 6, Issue 6, June (2016). approach." JIPS 9, no. 1 (2013): 117140.
[4] Kumar, Satish. "A study for handwritten Devanagari word recognition." [16] Pal, U., and B. B. Chaudhuri. "Indian script character recognition: a
Communication and Signal Processing (ICCSP), 2016 International survey." pattern Recognition 37, no. 9 (2004):1887-1899.
Conference on. IEEE, 2016. [17] Bansal, Veena, and R. M. K. Sinha. "Integrating knowledge sources in
[5] Jangid M, Srivastava S. Accuracy Enhancement of Devanagari Devanagari text recognition system." IEEE Transactions on Systems,
Character Recognition by Gray level Normalization. ACM.In Man, and Cybernetics-Part A: Systems and Humans 30, no. 4 (2000):
Proceedings of the 7th International Conference on Computing 500-505.
Communication and Networking Technologies 2016 Jul 6 (p. 25). [18] Rahiman, M. Abdul, and M. S. Rajasree. "A detailed study and analysis
[6] Sankaran, Naveen, and C. V. Jawahar. "Recognition of printed of ocr research in south indian scripts." In Advances in Recent
Devanagari text using BLSTM Neural Network." In Pattern Recognition Technologies in Communication and Computing, 2009. ARTCom’09.
(ICPR), 2012 21st International Conference on, pp. 322-325. IEEE, International Conference on, pp. 31-38. IEEE, 2009.
2012. [19] C. V. Jawahar, M. N. S. S. K. Pavan Kumar, S. S. Ravi Kiran. A
[7] Gaurav Jaiswal, “Handwritten Devanagari Character Recognition Model Bilingual OCR for Hindi-Telugu Documents and its Applications.
Using Neural Network” 2014 IJEDR | Volume 2, Issue 1 901-906. ICDAR 2003, 0-7695-1960-1/03 $17.00 © 2003 IEEE.
[8] Dinesh kumar, R., and J. Suganthi., "Sanskrit character recognition [20] Jayadevan, R., Satish R. Kolhe, Pradeep M. Patil, and Umapada Pal.
system using neural network."Indian Journal of Science and Technology, "Offline recognition of Devanagari script: A survey." IEEE Transactions
Vol 8(1), 65–69, January 2015. on Systems, Man, and Cybernetics, 41, no. 6 (2011)
[9] Sudan Prajapati , Shashidhar Ram Joshi , Aman Maharjan , Bikash
Balami “Evaluating Performance of Nepali Script OCR using Tesseract
Authorized licensed use limited to: University College London. Downloaded on May 23,2020 at 18:14:50 UTC from IEEE Xplore. Restrictions apply.