APPLICATION OF ZONAL AND CURVATURE FEATURES TO NUMERALS RECOGNITION

Purpose of the study: The purpose of this work is to present an offline Optical Character Recognition system to recognise handwritten English numerals to help automation of document reading. It helps to avoid tedious and time-consuming manual typing to key in important information in a computer system to preserve it for a longer time. Methodology: This work applies Curvature Features of English numeral images by encoding them in terms of distance and slope. The finer local details of images have been extracted by using Zonal features. The feature vectors obtained from the combination of these features have been fed to the KNN classifier. The whole work has been executed using the MatLab Image Processing toolbox. Main Findings: The system produces an average recognition rate of 96.67% with K=1 whereas, with K=3, the rate increased to 97% with corresponding errors of 3.33% and 3% respectively. Out of all the ten numerals, some numerals like ‘3’ and ‘8’ have shown respectively lower recognition rates. It is because of the similarity between their structures. Applications of this study: The proposed work is related to the recognition of English numerals. The model can be used widely for recognition of any pattern like signature verification, face recognition, character or word recognition in another language under Natural Language Processing, etc. Novelty/Originality of this study: The novelty of the work lies in the process of feature extraction. Curves present in the structure of a numeral sample have been encoded based on distance and slope thereby presenting Distance features and Slope features. Vertical Delta Distance Coding (VDDC) and Horizontal Delta Distance Coding (HDDC) encode a curve from vertical and horizontal directions to reveal concavity and convexity from different angles.


INTRODUCTION
Optical Character Recognition becomes more challenging due to the uniqueness of handwriting. Every writer has his/her own way of writing a character. Therefore, a successful OCR system should have enough rigidity to assimilate all those individual variations. Researchers adopt different approaches to extract features and classification. Dhande et al (2018) have presented a character recognition system for cursive English handwriting in a medical prescription to read the names of medicines. It uses a horizontal projection method for text-line segmentation and a vertical projection histogram method for word segmentation. Feature extraction has been done by means of a convex hull algorithm, whereas classification has been done with SVM. The system is reported to have an accuracy of 85%. Authors have put forward a study regarding the effect of depth of Convolutional Neural Network (CNN) architecture on recognition accuracy of handwritten Devanagari characters. It has been concluded that CNN-BLSTM hybrid architecture has dominated over state-of-the-art Devanagari character recognition (Chakraborty et al, 2018). Mathur et al.(2019) have proposed an integrated system of OCR and text-to-speech conversion to help visually impaired people to read a document. The system uses OCR and text-to-speech modules of mobile phones of the new generation. Authors have proposed local directional pattern and gradient directional pattern-based process for feature extraction followed by K-nearest neighbor (KNN) and support vector machine (SVM) classifiers to read Bangla numerals. It reports an accuracy of 95.62% on the benchmark dataset (CMATERDB 3.1.1) (Aziz et al 2018). Histogram of the oriented gradient has been used for feature selection of character image and SVM as a classifier to produce an accuracy of 98.05% on the CMATERDB dataset (Choudhury et al, 2018). A neural network-based character classification system has been put forward by Karungaru et al. (2013). Features have been derived from a star layered histogram. Centre of gravity (CoG) is determined from the contour of the character region and several lines at an equal distance are considered from CoG to the contour. The first point of intersection of the line with character gives rise to the first layer of the histogram and so on unless the line touches the boundary of the region containing the character. The system shows an overall accuracy of 97.1% on the MNIST database. Qacimy et al.(2014) have tried to improve the discriminatory ability of digit classification system by means of DCT upper left corner coefficients (225), DCT zig-zag coefficients (100), Block based DCT ULC coefficients (256), and Block based DCT zig-zag coefficients(160). Classification is done by means of SVM and obtained global accuracy on the MNIST dataset are 98.66%, 98.71%, 98.73%, and 98.76% respectively. Bhattacharya and Chaudhuri (2009) have proposed a multistage recognition system in the cascaded form to recognize mixed digits of Devanagari and Bangla under Indian script and English. Wavelet-based multiresolution representations and multilayer perceptron (MLP) are utilized for this purpose. They have presented two large databases for the above Indian scripts whereas, for English numerals, the MNIST database has been preferred. The system provides misclassification rates of 0.81% and 1.01% on training and test MNIST English samples respectively to

Feature Extraction by Zoning Method:
The whole image is divided into 25 zones by using the non-overlapping window of size 30×30. Features are extracted in two ways-First, the feature is extracted from each zone by finding the total number of white pixels of the zone and then dividing this number by the total number of pixels of the zone.
The second set of features is extracted as vector distance. The vector distance of each white pixel of a zone is calculated from the element at the bottom left corner of the same zone. All such distances are summed up and finally, the normalized vector distance is calculated by dividing the sum by the sum of all such distances for all pixels in the zone from the same reference.
To find the global feature, the same process is followed by taking the whole image as a single zone. Therefore, our final observation sequence contains 52 observations obtained by global and local feature extraction method, as shown below Distance Features (DF): Delta Distance Coding (DDC) is a differential approach towards coding a curve based on distance. In the differential approach of coding, the difference between magnitudes (pixel intensities in case of images) of two successive samples of a curve is considered that is absolutely lesser than either of the magnitudes. It reduces the complexity of the system. Delta Distance Coding (DDC) has been used to differentiate concavity from convexity while encoding the local curvature in a numeral sample. DDC has been applied both vertically and horizontally.

Vertical Delta Distance Coding (VDDC):
The pre-processed image of size 50×50 is divided into four equal sub-images each of size 25×25 to get local features. Twenty-five samples (a,b,c,d,...) of curves in each of the four sub-image spaces are considered and distance of the samples from reference level (pa, qb, rc, sd,…) is noted. The upper edge of the subimage is conventionally taken as a reference level. Delta Distance code for one sample is written based on the comparison between the current distance and that of the just previous sample.  The coding for the curve in Fig. 1(a) is '11022' whereas for that in Fig. 1(b), it is '22011'. Two different codes for concave and convex curves assure that VDDC can distinguish vertical concavity and convexity. Total feature elements out of this feature is equal to 25×4 = 100 Horizontal Delta Distance Coding (HDDC): Twenty-five samples are considered from each of four sub-images of size 25×25 corresponding to a sample image. The left edge is conventionally considered as reference level as shown in Fig.  2. The coding logic in HDDC is the same as that followed in VDDC. Slope Feature (SF): Slope Feature represents variations in slope. It is obvious from Fig. 3(a,b) that a concave curve with an opening along X-axis has a gradually increasing slope going along the curve in the direction of the arrow mark whereas a convex curve has decreasing slope moving down the curve. In the same way, a concave curve with an opening along Y-axis has a decreasing slope while a convex curve possesses an increasing slope concerning Y-axis. In the current paper, SF is extracted from the feature elements of VDDC and HDDC. Any two successive 1's in VDDC or HDDC reflects increasing (positive) local slope code '3'. On the other hand, two successive 2's in DF reflect decreasing (negative) local slope code '4'. For DF code '11022'and '22011', SF code will be '3004' and '4003'respectively.
(a) (b) Figure 3[a,b]: Slope change in curves with axis along X-axis The local slope of a curve will be coded as per the scheme shown in Figure 3. Therefore, Feature elements out of Slope

RESULTS/FINDINGS
The classifier used in this work is K-Nearest Neighbor having parameter K. It has been trained with all the feature vectors obtained in the above section. MNIST test data are classified by setting parameters 'K' equals 1 and 3. KNN classifier applies Euclidean distance metric to locate the nearest neighbor and Majority rule with nearest point tie-break for classification. Table 1 shows the individual rate of recognition of all the ten numerals. The system produces an average recognition rate of 96.67% with K=1 whereas, with K=3, the rate increased to 97%.  In order to compare the method and results of the current paper with those of existing work, the reference paper Babu et al. (2014) has been considered. They have classified Arabic numerals from the MNIST database with KNN classifier and derived features from the number of holes in an image, presence of water reservoirs, and fill-hole density. The system reports overall accuracy of 96.94%. Individual percent recognition rates of all the digits in the two systems have been tabulated in Table 2 and plotted in Fig. 5. For the current paper, the results with K=3 in Table 1 have been considered for comparison in Table 2.

CONCLUSION
In this paper, Zonal features in combination with Distance and Slope features have been utilized to recognize English numerals. KNN classifier produces an overall recognition accuracy of 97%. Table 2 shows the individual recognition accuracy of all the ten numerals. It is obvious that some numerals like '3' and '8' have shown respectively lower recognition rates. It is because of the similarity between their structures. Some demarcating features are required to avoid ambiguity in their recognition which will be done in future work. Such features will improve the individual as well as global recognition efficiency of the proposed system.

LIMITATION AND STUDY FORWARD
The similarities among the structures of different digits put a limit on individual and global accuracy. The features which can help their differentiation will be searched and implemented to boost the recognition rate. The system will be applied further to recognise the face of a person, signature verification and other pattern recognition works.