Comparison of Smoothing Techniques and Recognition ... - IEEE Xplore

2 downloads 0 Views 935KB Size Report
August 01-02, 2014, Dr. Virendra Swarup Group of Institutions, Unnao, India. 978-1-4799-6393-5/14/$31.00 ©2014 IEEE. Comparison of Smoothing Techniques ...
IEEE International Conference on Advances in Engineering & Technology Research (ICAETR - 2014), August 01-02, 2014, Dr. Virendra Swarup Group of Institutions, Unnao, India

Comparison of Smoothing Techniques and Recognition Methods for Online Kannada Character Recognition System Shwetha D.

Mrs. Ramya S.

Department of Electronics and Communication Manipal Institute of Technology (MIT) Manipal, India [email protected]

Department of Electronics and Communication Manipal Institute of Technology (MIT) Manipal, India [email protected]

Abstract—This paper aimed at working on Online Recognition of Handwritten Kannada Characters. The recognition was done for the Top, Middle and Bottom strokes of Kannada characters. Genius MousePen i608X was used to collect the handwritten character samples to build the database. Handwritten character samples were collected for each character from a particular target-group which includes people who are native to Kannada language and belong to different age groups. These samples were semi-automatically validated, pre-processed and features were extracted. Segmentation of characters was done to divide the strokes into top stroke, middle stroke and bottom stroke. These segmented strokes were individually processed. The pre-processing techniques used in the project include removal of duplicated points, smoothing, interpolating missing points, resampling of points and size normalization. Smoothing techniques was compared for Gaussian and Moving Average Smoothing. Dominant point, writing direction and the curvature features were also extracted. In addition to this, recognition was carried out by KNN and SVM pattern recognition methods and a second level of verification rules was incorporated, yielding a maximum recognition rate of 92.5% for KNN and 94.35% for SVM. Keywords— Handwritten Kannada Characters; Character Recognition; Smoothing Algorithms; KNN; SVM

I. INTRODUCTION Computers and mobiles have become an important part of our lives. With the rapid development in technology, keyboards are being replaced by touch pads. Both the physical and touch keypads require a minimum amount of space on the display device which is used to display the keypad, which otherwise could have been used for displaying valuable data. As a solution to this problem, keypads can be replaced by handwriting recognition systems. The recognition can be done online or offline based on the type of input sample. In offline recognition system, pre-handwritten text on paper is scanned, converted into a two dimensional image and fed into the

computer for recognition. Whereas online recognition takes handwritten input in real time using digitizers or tablet PC. Plenty of researches are going in offline and online character recognition and even many commercial systems are available in the market for different languages. Even then when compared to Chinese, Japanese, Roman and Arabic characters the work done on Indian regional languages is less. Popular South Indian languages are Kannada, Tamil, Telugu and Malayalam. Our present work is on online Kannada handwritten character recognition. The first reported work on Kannada OHR is by S.R. Kunte et al. [1] in the year 2000 using wavelet features and neural network as classifier, with a recognition accuracy of 95%. Later in 2010 Rituraj Kunwar et al. [2] used statistical dynamic space warping (SDSW) classifier reporting accuracies of 88% at the Akshara level and 80% at the word level. Mahadeva Prasad et al. [3] used Principal Component Analysis (PCA) reported an average recognition accuracy of 96.9%. Venkatesh and Ramakrishnan [4] achieved an average accuracy of 92.6% by using Dynamic Text Wrapping (DTW) and Principal Component Analysis (PCA). Rakesh Rampalli and Ramakrishnan [5] did the fusion of online and offline strategies and obtained 92.3%. Keerthi Prasad et al. [6] did the online Kannada character recognition for hand held devices using PCA and DTW with an accuracy of upto 88% for PCA and 64% for DTW. Vishwaas M. et al. [7] obtained an accuracy of 94.4% by the combination of Direction based Stroke Density principle (DSD) and Kohonen Neural Network (KNN). In the work presented here two smoothing algorithms namely, Gaussian and Moving Average Smoothing were analyzed. Dominant points, writing direction and curvature features were used and the recognition accuracy was compared for KNN and SVM classifiers. II. DATA COLLECTION The standardized database for online Kannada handwritten characters is not available. Therefore we created our own database using Genius MousePen i608X. All the users were native to the Kannada language and belong to different age

978-1-4799-6393-5/14/$31.00 ©2014 IEEE

IEEE International Conference on Advances in Engineering & Technology Research (ICAETR - 2014), August 01-02, 2014, Dr. Virendra Swarup Group of Institutions, Unnao, India groups. The XY coordinates of characters written on the tablet PC and the entered user credentials are saved into a text file. The user credentials were saved in XML format. The database includes varying size and tilted characters as well. Validation of the database is done in order to ensure that the character samples collected from the users are valid. The validation of characters is based on the number of valid strokes used to represent each character. The validation process is semiautomatic. III. SEGMENTATION On observing the character combinations, three regions, namely, middle, top and the bottom are noticed. There exists a vertical overlap among these three regions. In Kannada script characters are having same set of top, bottom and right auxiliary strokes which when combined with middle stroke gives different characters. By combining such strokes, number of classes can be reduced which will reduce the computational complexity and cost of the system. The order of writing a character covering these regions is middle, top, middle region vowel modifiers and then the bottom. Each region may have single or multiple strokes [3]. We have divided the character into three stroke groups as shown in the Fig. 1. They are:  Top stroke comprising of stroke that occupy the top region of character.  Middle stroke comprising of strokes that occupy middle region of character.  Bottom stroke having the bottom region strokes such as conjuncts and vowel modifiers

IV. PREPROCESSING Incomplete, noisy and inconsistent data is often collected from the user. This raw data has to be pre-processed before it can be applied to the system. The pre-processing steps used in present work are Removal of Duplicated Points, Smoothing, Interpolating Missing Points, Re-sampling of Points and Size Normalization. A. Removal of Duplicate Points Duplicate Points occur during the writing process as the tablet is extremely sensitive to movement of the pen. These points are removed from the captured ink as they are redundant points and do not carry any information. They also increase the processing time considerably. B. Smoothing The erratic pen movement causes jitter in handwriting and this produces noise in the stroke. This type of noise is removed by Smoothing of Strokes. We have compared recognition result for two smoothing techniques namely Gaussian Smoothing and Moving Average Smoothing. 1) Gaussian Smoothing: Smoothing is obtained by convolving the Gaussian window with input data. The coefficients of a Gaussian window are computed from (1). (1) where, and α is inversely proportional to the standard deviation of a Gaussian random variable. The relation with the standard deviation, σ, of a Gaussian probability density function is given by (2). σ = N/2α

(2)

The default value of α is 2.5. Let f be a signal and w be a filter or kernel given by (1). The convolution of f and w denoted by f∗w is the function of discreet time, n, and is given by (3) and (4). Fig. 1. An example of a character showing different stroke groups.

(3)

The segmentation is done in two simple steps:  As stated earlier, the middle stroke is the first stroke written in a character. So the first stroke is put into the middle stroke group.  The Y coordinate of the next stroke is compared with the middle stroke. If the maximum value of Y coordinate of the next incoming stroke is greater than or equal to the maximum value of Y coordinate of the middle stroke, then that stroke is put into top stroke group; else it is put into the bottom stroke group. This step is repeated until all the strokes of a character are taken into consideration.

(4) 2) Moving Average Smoothing: The response of the Moving Average smoothing given by difference equation (5).

(5) where, ys(i) is the smoothed value for the ith data point and S is the span.

978-1-4799-6393-5/14/$31.00 ©2014 IEEE

IEEE International Conference on Advances in Engineering & Technology Research (ICAETR - 2014), August 01-02, 2014, Dr. Virendra Swarup Group of Institutions, Unnao, India C. Curve Fitting The input handwritten character can miss some points due to the fast handwriting speed of the user. These missing points may create difficulty for the proper recognition of the character and hence are interpolated using curve fitting. Curve fitting was done inorder to avoid the undesired points getting inserted by resampling. D. Resampling Resampling is a process of fixing the number of points used to represent a character in a way that the original character can be obtained back from those fixed number of points. By trial and error method each stroke was resampled to 60 points. E. Normalization Let ai, given by (6), and bi, given by (7), be the normalized X and Y coordinates. Then they are calculated as, ai = (xi – xmin) / (xmax – xmin) (6) bi = (yi – ymin) / (ymax – ymin) (7) where, xmin, ymin and xmax, ymax denote the minimum and maximum horizontal and vertical coordinate value.

B. Coordinates of Dominant Points Dominant points of character P are the points whose slope values of qi change remarkably. A point pi of P can be named as dominant point, if the two conditions given by (11) and (12) are both satisfied. (qi+1 – qi + 8) % 8 ≥ CT (11) (qi – qi+1 + 8) % 8 ≥ CT (12) where, CT is curvature threshold and 2 ≤ i ≤ 59 and % is modulo operator. CT is the curvature threshold for selecting any point as dominant point [8]. It can take any value from the set {0,…..,4}. By default, first and last points of P are considered as dominant points. Fig. 3 shows an example character with CT= 0,1,2. It can be seen that there is no change in the input character when CT is equal to 0; the character is completely distorted when CT is equal to 2. CT equal to 1 gives a better representation of the input character and was thus used in our work. To make feature size equal, the dominant points obtained for each character sample is resampled to new value. By trial and error Middle stroke is resampled to 18 points, top stroke to 10 points and bottom stroke to 16 points.

V. FEATURE EXTRACTION A. Quantized Slope To get quantized slope feature from pre-processed points, first the slope angle of the segment between two consecutive points has to be found. Let P be the preprocessed character with 60 points given by (8). P = {pi} (8) where, pi = {xi,yi} and i =1,2,……….,60. Then the slope angle of the segment between two consecutive points is calculated as given in (9). θi = tan-1 [(yi+1 – yi) / (xi+1 – xi)] (9) The slope angle obtained is quantized uniformly into 8 levels to make this feature invariant to noise [8] as shown in Fig. 2.

Fig. 3. a) Character with Dominant Points; b) Character with CT = 0; c) Character with CT = 1 and d) Character with CT=2

C. Writing direction The local writing direction at a point (x(t),y(t)) is described using the cosine and sine [9] expressed by (13) and (14) respectively. cosα(t) = Δx(t) / Δs(t) (13) sinα(t) = Δy(t) / Δs(t) (14) where, 𝞓s(t), 𝞓x(t) and 𝞓y(t) are defined by (15), (16) and (17) respectively.

Fig. 2. Quantizing the slope values.

Let Q be the set of quantized slope values corresponding to given P. Then, Q can be expressed by (10). Q = {qi} (10) where, i =1,2,……..,60 and qi∈{0,……….,7}. The feature dimension is 60.

Δs(t) =(Δx2(t) + Δy2(t))1/2 Δx(t) = x(t-1) – x(t+1) Δy(t) = y(t-1) – y(t+1)

(15) (16) (17)

D. Curvature The curvature at a point (x(t), y(t)) is given by the cosine and sine angles defined by the sequence of points (x(t − 2), y(t − 2)), (x(t), y(t)), (x(t + 2), y(t + 2)). It can be obtained from writing direction [12] using (18) and (19).

978-1-4799-6393-5/14/$31.00 ©2014 IEEE

IEEE International Conference on Advances in Engineering & Technology Research (ICAETR - 2014), August 01-02, 2014, Dr. Virendra Swarup Group of Institutions, Unnao, India cosβ(t) = cosα(t-1) cosα(t+1) + sinα(t-1) sinα(t+1) (18) sinβ(t) = cosα(t-1) sinα(t+1) - sinα(t-1) cosα(t+1) (19) VI. CHARACTER RECOGNITION The online character recognition strategy employed in the present work is as depicted in Fig. 4. The recognition process involves training and testing phases. 30% of the characters in the database are used for training the classifiers and the remaining 70% of the characters are tested. We have compared the recognition results with two classifiers namely, K-Nearest Neighbor (KNN) and Support Vector Machine (SVM) with Gaussian and Moving Average Smoothing algorithms. Performance of KNN is compared using three distance metrics namely Cosine, Euclidean and City block distance. And the performance of SVM is compared using three kernel functions namely Linear, Polynomial and RBF. Training and testing of top, middle and bottom stroke groups is done individually. In the training phase the recognition result from each stroke group is combined to obtain the recognized character. Second level of verification is done during the process of combining the strokes where based on top and bottom strokes, validation rules are applied which increased recognition rates by 0.52%.

Euclidean City block

90.71 92.07

90.32 92.50

Similarly recognition rates for SVM classifier with three kernel functions namely, Linear, Polynomial and RBF kernels along with Gaussian and Moving Average Smoothing techniques is listed in Table II. On referring to Table II, Gaussian Smoothing with linear and polynomial kernels was better than the Moving Average Smoothing. But Moving Average Smoothing with RBF kernel gave better recognition accuracy of 94.35%. TABLE II.

RECOGNITION RATE FOR SVM

Recognition Rate for SVM (%) Kernel Functions

Gaussian Smoothing

Moving Average Smoothing

Linear Polynomial RBF

88.37 93.83 93.93

86.07 93.44 94.35

The performance of the recognition system is good with KNN and SVM classifiers for both Gaussian and Moving Average Smoothing algorithms. But Gaussian smoothing requires convolution, which consumes more memory and also has speed limitations. This fact makes Moving Average Smoothing better than Gaussian Smoothing. Also, the recognition rate obtained is more for Moving Average Smoothing as shown in Table I and Table II. The maximum performance given by KNN classifier is 92.5% whereas using SVM it is 94.35%. This shows that SVM classifier is better than KNN for the Online Handwritten Kannada Character recognition. Fig. 5 shows the comparison chart for KNN and SVM classifiers.

Fig. 4. Online Kannada Character Recognition System

VII. EXPERIMENTAL RESULTS The character recognition rate was compared for KNN and SVM classifiers. The recognition rate for KNN classifier using three distance metrics namely, Cosine, Euclidean and City block distance along with Gaussian and Moving Average Smoothing techniques is given in Table I. On referring to the Table I, Gaussian Smoothing with Cosine and Euclidian distance metrics gave better accuracy than the Moving Average Smoothing. But when Moving Average Smoothing was performed with City block distance metric gave even better recognition accuracy of 92.5%. TABLE I.

RECOGNITION RATE FOR KNN

Recognition Rate for KNN (%) Distance Metrics

Gaussian Smoothing

Moving Average Smoothing

Cosine

90.45

90.23

Fig. 5. Comparison of Recognition Rates of KNN and SVM

VIII. CONCLUSION AND FUTURE WORK Database for the Online Handwritten Kannada Characters was created which includes tilted as well as varying size character samples. Characters were segmented into top, middle and bottom strokes and stroke labels were assigned. Pre-processing methods such as Removal of Duplicated Points, Smoothing, Interpolating Missing Points, Re-sampling of Points and Size Normalization were used. Smoothing results compared for Gaussian and Moving Average algorithms. Dominant points were extracted and resampled.

978-1-4799-6393-5/14/$31.00 ©2014 IEEE

IEEE International Conference on Advances in Engineering & Technology Research (ICAETR - 2014), August 01-02, 2014, Dr. Virendra Swarup Group of Institutions, Unnao, India Writing direction and curvature features were also extracted from resampled dominant points. These features were given to KNN and SVM classifiers. The recognition rate was compared for three distance metrics viz. Cosine, Euclidian and City Block for KNN and three kernel functions viz. Linear, Polynomial and RBF for SVM. After recognition a second level of verification rules was applied. City Block distance metric with Moving Average Smoothing gave better performance compared to cosine and Euclidean for KNN and the maximum accuracy attainable from the system using KNN is 92.5%. In case of SVM, the performance with RBF kernel was better compared to linear and polynomial kernels and the maximum accuracy of the system is 94.35%. This may be due to the variation in writing styles across individuals, misclassification among stroke groups which is mainly due to similarity between the shapes of the stroke groups.

[7]

[8]

[9]

Vishwaas M, Arjun M M, and Dinesh R, "Handwritten Kannada CharacterRecognition based onKohonen Neural Network ," IEEE, pp. 91–97, 2012. N. Joshi, G. Sita, a. G. Ramakrishnan, and S. Madhvanath, "Comparison of Elastic Matching Algorithms for Online Tamil Handwritten Character Recognition," in Ninth International Workshop on Frontiers in Handwriting Recognition, pp. 444–449. S. Jaeger, S. Manke, J. Reichert, and A. Waibel, "Online handwriting recognition : the NPen ++ recognizer," International Journal on Document Analysis ans Recognition, pp. 169–180, October 2001.

It can be concluded that the Character Recognition System for the Online Handwritten Kannada Characters is designed, implemented and tested. SVM classifier is better compared to KNN classifier. The performance of the system with KNN and SVM with Moving Average Smoothing is 92.5% and 94.35% respectively. The recognition can be improved by applying second level of classifiers and also incorporating pre-processing methods for slant correction. This may reduce the effect of writing style variation and contribute in boosting the recognition rate. The current system can be further improved upon for recognition of words too. ACKNOWLEDGMENT We would like to express our deepest appreciation to the HOD, the professors and the staff members of the E&C Department of Manipal Institute of Technology, Manipal for their support. We are also grateful to our family and all our friends for their love, help and encouragement. REFERENCES [1]

[2]

[3]

[4]

[5]

[6]

S. R. Kunte and S. Samuel, "Wavelet features based online recognition of handwritten kannada characters," Jl Visualiza- tion Society of Japan, pp. 417-420, 2000. R. Kunwar, P. Mohan, K. Shashikiran, and A. G. Ramakrishnan, "Unrestricted Kannada Online Handwritten Akshara Recognition using SDTW," IEEE, 2010. M. M. Prasad, M. Sukumar, and a. G. Ramakrishnan, "Divide and conquer technique in online handwritten Kannada character recognition," in International Workshop on Multilingual OCR - MOCR ’09, 2009. N. Venkatesh and A. G. Ramakrishnan, "Choice of classifiers in hierarchical recognition of online handwritten Kannada and Tamil aksharas". Rakesh Rampalli and A. G. Ramakrishnan, "Fusion of Complementary Online and Offline Strategies for Recognition of Handwritten Kannada Characters," J.UCS Journal of Universal Computer Science, vol. 17, no. 1, pp. 81-93, 2011. K. P. G, N. R. Chanukotimath I. Khan, and F. Khan, "On-line Handwritten Character Recognition System for Kannada using Principal Component Analysis Approach," IEEE, pp. 675–678, 2012.

978-1-4799-6393-5/14/$31.00 ©2014 IEEE