PERFORMANCE COMPARISON OF ONLINE HANDWRIING RECOGNIION SYSEM FOR ASSAMESE LANGUAGE BASED ON HMM AND SVM MODELLING Deepoy Das, Rtuparna Dev, SRM Prasanna, Subhankar Ghosh, Krshna Nak Department of EEE, II Guwahat, Assam {deepoy2002@gmal.com, rtuparna.sarma5@gmal.com, prasanna@tg.ernet.n, ghoshsubhankar@gmal.com, krshnanak.35@gmal.com} ABSRAC hs work emphasses on the development of Assamese onlne character recognton system usng HMM and SVM and performs a recognton performance analyss for both models. Recognton models usng HK (HMM oolkt) and LIBSVM (SVM oolkt) are generated by tranng 181 dfferent Assamese Stokes. Stroke and Akshara level testng are performed separately. In stroke level testng, the confuson patterns of the test strokes from HMM and SVM classfers are compared. In Akshara level testng, a GUI (provded by CDAC-Pune) whch s ntegrated wth the bnares of HK/LIBSVM and language rules (stores the set of vald strokes whch makes a character) are used, manual testng s done wth natve wrters to test the Akshara level performance for both models. Expermental results show that the SVM classfer outperforms the HMM classfer. KEYWORDS Support Vector Machnes, Hdden Markov Models, Handwrtng Recognton, Assamese, LIBSVM, HK 1. INRODUCION Of the varous handwrtng recognton systems avalable, there exsts two basc handwrtng recognton domans dstngushed prmarly by nature of the nput sgnal-onlne and offlne. In offlne system the dgtsed nformaton s n the statc form whereas n the onlne system, nformaton s acqured durng producton of the handwrtng usng equpments such as ablet PC whch captures the traectory of the wrtng tool. he nformaton captured undergoes some fltraton, pre-processng and normalsaton process after whch the handwrtng s segmented nto basc unts whch are usually a character or part of a character. Fnally each segment s classfed and labelled. In our system, we examne the effectveness of usng Hdden Markov Models (HMM) and Support Vector Machnes (SVM) for modellng the classfer. HMM has been used for Bangla [2], elugu [3], aml [4], Malayalam [5] and n prevous works for Assamese [6] [7]. Support vector machnes (SVMs) have also been used n [8] for elegu and Devnagr scrpts whle [9] compares the performance between systems developed usng HMM and SVM for elegu scrpt. he classfers are bult ndvdually usng HMM and SVM and the recognton accuraces of both the systems are analysed for comparson. In our work, the two coordnate trace Nataraan Meghanathan et al. (Eds) : ICCSEA, SPPR, VLSI, WMoA, SCAI, CNSA, WeS - 2014 pp. 87 95, 2014. CS & I-CSCP 2014 DOI : 10.5121/cst.2014.4717
88 Computer Scence & Informaton echnology (CS & I) between one pen down to pen up s taken as the basc unt and s termed as stroke and a set of 181 characters have been classfed as vald stroke after detaled analyss of the handwrtng of the Assamese language. 1.1 Assamese language and Assamese character database he Assamese language s an Indo Aryan language and s used n the North Eastern part of Inda. Sanskrt s the mother language of Assamese and though t has ts own scrpt, ts phonetc character set and behavour s derved from Sanskrt. It currently has a total of 11 vowels, about 41 consonants, 10 numerals and a number of conuncts, vowel modfers, consonant modfers and other symbols. he vowels, consonants and numerals are prevously defned n the language. However to obtan a set of vald conuncts, the Assamese scrpt has been thoroughly scrutnsed as the frequency of usng conuncts s not well defned n the scrpt. Eventually the Assamese scrpt of 241 aksharas s formed consstng of 11 vowels, 41 consonants, 147 conuncts, 10 numerals, 10 vowel modfers, 2 consonant modfers and 20 addtonal symbols after analysng the commonly used conuncts obtaned by scannng the pages of Hemkosh Dctonary wrtten by Hem Chandra Barua and comparng t wth a lst of 147 conuncts prepared by the Resource Centre for Indan Language echnology Solutons (RCILS), Indan Insttute of echnology, Guwahat. hese are then sent for data collecton. he lst of 241 symbols s depcted n fgure 1. Fgure 1: Assamese Aksharas he data s collected wth a HP ablet PC wth a samplng rate of 120 Hz and the captured nformaton contans values of horzontal & vertcal coordnates along wth wrter nformaton. Fnally consderng wrter feedback as well, a fnal lst of 147 Assamese symbols s created consstng of 11 vowels, 41 consonants, 55 conuncts, 10 numerals, 23 specal symbols and 5 characters whose shape change on addton of modfers. 1.2 Characters of Assamese handwrtng For classfcaton and labellng, the handwrtng data s segmented nto basc components called strokes whch are generally a whole character or part of the character. In our work, the coordnate trace between one pen down to pen up s taken as the basc component or stroke. However as Assamese handwrtng s a case of cursve handwrtng, several components may be merged or even broken down by nfrequent wrters. hus data groupng s done n three ways
Computer Scence & Informaton echnology (CS & I) 89 namely strokes, substrokes and suprastrokes. he strokes consst of a typcal basc component of aksharas agreed naturally by maorty of non-cursve wrters. he substrokes contaned components are formed by mergng several components or strokes. Agan f the nfrequent wrters break the components of the stroke nto more than one component then spltted components form the suprastrokes. A lst s prepared combnng all the above strokes of dfferent data groups and we have a fnal lst of 203 dstnct strokes n Assamese handwrtng. he fnal strokes lst s depcted below n Fgure 2. Fgure 2 Isolated Assamese strokes 2. CHARACER RECOGNIION SYSEM he schematc block dagram of Assamese Onlne Stroke Recognton system usng HMM & SVM Modellng s shown below n Fgure 4. 2.1 Database he Assamese data set conssts of a set of 203 solated strokes or basc components as shown n Fgure 2. A set of 147 Assamese Aksharas have been fnalsed to acqure the stroke data requred to desgn a robust stroke recognser. he Akshara examples have been collected from 100 users n two sessons n an HP ablet PC usng an open source tool developed by HP wth a samplng rate of 120 Hz. From each of the Akshara sample, the basc component or stroke s extracted from one pen down to pen up whch results n about 1000 examples for each stroke of whch 50 % are used for tranng and 50 % for testng. Durng data collecton no lmtaton or restrcton s enforced on the style of wrtng and hence, we have a large varaton among the samples of a gven stroke.
90 Computer Scence & Informaton echnology (CS & I) 2.2 Annotaton Fgure 3: Assamese Onlne Stroke Recognton System Usng HMM & SVM Modellng Annotaton refers to the labellng of collected database n order to arrange them nto groups of analogous patterns whch n the mleu of our work are the strokes, substrokes and suprastrokes of Assamese language. he classfers are then traned wth these patterns whch are then used for recognton purpose. he desred outcome after annotaton s a database completely labelled at the sentence, word, character and stroke labels. he annotated data s analysed to fnalse the set of strokes, substrokes and suprastrokes and fnally only those patterns or strokes are retaned whch are used by more than 5 % users. 2.3 Pre-processng and Feature Extracton he pre-processng stage conssts of sze normalzaton, smoothng, nterpolaton of mssng ponts, removal of duplcate ponts and resamplng of the captured coordnates [10]. 2.3.1 Sze Normalsaton he sze of each ndvdual data sample s normalsed by scalng the pattern both horzontally and vertcally [11] 2.3.2 Smoothng Smoothng excludes the nose captured durng the data collecton process and performed usng a movng average flter of sze three. Each pattern s smoothed both n horzontal and vertcal drectons dscretely [12] 2.3.3 Removal of duplcate ponts Duplcate ponts do not contan any nformaton and only cause data redundancy and hence these ponts are removed before feature extracton [12]
2.3.4 Resamplng Computer Scence & Informaton echnology (CS & I) 91 Resamplng elmnates the dspartes n the data due to the wrtng speed of the wrters. It s performed by lnear nterpolaton of mssng ponts whch results n a sequence of equdstant ponts [12] 2.4 Feature Extracton he pre-processed horzontal & vertcal coordnates and ther frst and second dervatves can be used as features for the modellng of the stroke classfer. he frst dervatve gves the change and the second dervatve gves the change of change n horzontal and vertcal coordnates. he frst dervatve s calculated to observe the change n the traectory at current pont. he second dervatve s calculated n order to examne the change of change n traectory at current pont. A wndow sze of two s consdered n both the cases. he method of extractng feature vectors s dentcal for both the classfcaton models used n our work. 2.5 Classfcaton Models he effcency of HMM and SVM are studed for developng the stroke classfers. 2.5.1 HMM Modellng and testng HMM models a doubly stochastc process, one observable and the other hdden [14]. In our work, the sequence of feature vectors from the onlne handwrtng s the vsble stochastc process and the underlyng hand movement s the later. In the present work,for modellng each stroke, one left to rght, contnuous densty HMM s developed. he left to rght structure s used supposng dstnctve drectons of handwrtng movements [15]. After collected database s annotated at stroke level, sx dmensonal features are extracted from the pre-processed coordnates. 203 strokes are fnalsed durng scrpt analyss of the Assamese language and hence 203 HMM models are bult for each of the 203 strokes. All the test examples correspondng to each stroke class are tested aganst all the stroke models and f msclassfcaton arses due to resemblance n pattern shape between two strokes those stroke classes are merged. Hence the fnal stroke classfer s developed wth 181 stroke classes. he HMM models are traned usng 7 states and 20 mxtures and HMM oolkt (HK) s used for tranng and testng. A. HMM ranng he feature vectors descrbed n the prevous secton are used for tranng the HMM whch comprses of a set of states and the alteratons lnked wth t and are traned usng Baum-Welch re-estmaton or expectaton maxmzaton (EM) approach [14]. In ths procedure an ntal model s taken and mproved model parameters are re-estmated usng the gven set of feature vectors. he most recent model s the ntal model for the next teraton and agan re-estmaton s done usng the same set of feature vectors. hs procedure s recurrng untl model parameters become statc and the model of the last reteraton s stored as the model for the gven class [12]. he process s repeated for all stroke classes. B. HMM estng Durng testng the class nformaton for the examples that are unknown to the traned model are found out. he lkelhood probablty of the gven test example aganst each of the traned HMM models are determned and the model wth the hghest lkelhood s theorsed as the class. he process s repeated for all the testng examples and the class nformaton s noted [12], [15].
92 Computer Scence & Informaton echnology (CS & I) 2.5.2 SVM Modellng Smlar to HMMs, f gven a set of tranng samples, SVMs wll attempt to buld a model. Each tranng data nstance s marked as belongng to one of two categores. he SVM wll attempt to separate the data nstances nto those two categores wth a p-1 dmensonal hyperplane, where p s the sze of each data nstance. hs model can then be used on a new data nstance to predct whch category t would fall onto. he maxmum margn hyperplane can be represented as [17] Vector x s a test case and ( x( ) y( x) = b + α y K ), x y s the class value of the tranng example x (). In the equaton, the parameters of the hyper plane are b andα.b s a real constant, and α are non-negatve real constants. he functon K ( x( ), ) s a kernel functon and SVMs are powerful n the sense that one can substtute dfferent kernel functons. he four basc kernel functons are [18] 1. Lnear: K ( x, x ) = x x d 2. Polynomal: K ( x, x ) = ( γx x + r ), γ > 0 3. Radal(RBF): K ( x, x ) = e 2 ( γ x x ) 4. Sgmod: K ( x, x ) = ( γ x x r ) + he classfer can be constructed as follows: [19] w ϕ( x( )) + b 1, f y = 1 w ϕ ( x( )) + b 1, f y = 1 [ w ( x( )) + b] 1 y ϕ, = 1, Κ Κ, N, γ > 0 Where ϕ ( ) s a nonlnear functon that maps the gven nputs nto some hgher dmensonal space. In case we cannot fnd the separatng hyperplane n ths space, we ntroduce addtonal varables: ξ, Where = 1,..., N. After ths, we wll attempt to solve ths mnmzaton problem: N 1 mn J ( w, ξ ) = w w + c ξ y w ϕ( x( )) + b 1 ξ ξ 0, = 1, Κ, N w, b, ξ 2 = 1 s.t. [ ] he soluton to the above model wll be the optmal separatng hyperplane. A. SVM ranng and estng We use the LIBSVM defaults radal bass kernel for mappng a gven set of nput vectors nto a hgher dmensonal space. he pre-processng step nvolves extracton of four dmensonal feature vectors namely the horzontal & vertcal coordnates and ther frst dervatves. he second dervatves are not used as they have been found to gve reduced recognton accuracy. As SVM works wth fxed szed vectors, we choose 60 equdstance handwrtten ponts, whch span the whole handwrtten curvature (choose more ponts n hgh curvatures).
Computer Scence & Informaton echnology (CS & I) 93 3. GRAPHICAL USER INERFACE (GUI) he GUI of the testng tool has been developed by Centre for Development of Advanced Computng Graphcs and Intellgence based Scrpt echnology Group (CDAC), Pune, Inda and s provded wth API Calls. A Partcular API call was used to get certan servce out of the GUI. We have ntegrated the GUI wth our HMM and SVM tranng models separately one at a tme, along wth vald set of language rules (stored n text fle) usng a DLL. Fgure 4: Block Dagram of Akshara Recognton wth GUI and DLL. Akshara 1 recognzed wth stroke 2, 3 and 61. When a stroke s wrtten on the GUI, the parameters of API provde the basc data lke 2- dmensonal coordnate traces of the stroke. he dynamc lnked lbrary when provded wth raw handwrtten trace, t ntates pre-processng for refnement of the 2-dmensonal trace and then performs classfcaton tasks wth the ntegrated HMM testng model and outputs the set of labels of recognzed stroke. he set of strokes are then checked wth language rules to verfy whether there exst a vald Akshara for the respectve strokes. If yes, then output the vald Akshara n GUI text box. 4. COMPARISON RESULS BEWEEN HMM AND SVM CHARACER RECOGNIION SYSEM Durng testng, log lkelhood values are obtaned from HMM classfer whle SVM classfer gves probablty estmates as output. he output from both the stroke recognzers are then compared usng two approaches. In the frst approach, the confuson matrx s obtaned from both the HMM classfer and SVM classfer and the confuson patterns are analysed. he confuson matrx for the frst 10 classes out of the 181 classes obtaned usng HMM s shown n Fgure 6 and the confuson matrx for SVM classfer s shown n Fgure 7. In the second approach, users are allowed to wrte the stroke patterns n the testng tool obtaned by ntegratng the GUI provded by CDAC, Pune once wth the HMM classfer and once wth the SVM classfer and accuracy of both the classfers are studed manually. he developed stroke classfer gves average recognton accuracy of about 94 % n case of HMM and 96 % n case of SVM. he akshara level average performance s 84.67 % n case of HMM and 86.23 % n case of SVM
94 Computer Scence & Informaton echnology (CS & I) Fgure 5: confuson percentage matrx for the frst 10 strokes usng HMM classfer Fgure 6: confuson percentage matrx for the frst 10 strokes usng SVM classfer 5. CONCLUSION We have observed that the feature vector namely the coordnate trace, frst dervate and second dervatve works perfectly wth HMM based system, however the recognton accuracy reduces sgnfcantly when the second dervate s used as a feature n SVM based system. herefore n SVM based system only the coordnate trace and frst dervate s used as a feature. In HMM based system the recognton accuracy reduces f second dervate s not used n the feature set. he SVM based system outperforms HMM based system by 2% n stroke accuracy and 1.56% n akshara case. he performance s almost smlar. he performance mght mprove f we consder a larger set of database than currently used n SVM case. REFERENCES [1] N. Arca and F.. Yarman-Vural, An Overvew of Character Recognton Focused on off-lne Handwrtng, IEEE rans. Systems, Man, Cybernetcs Part C: Applcatons and Revews, vol. 31, no. 2, pp. 216-233, May 2001 [2] S. K. Paru, K. Gun, U. Bhattacharya, and B. B. Chaudhur, Onlne Bangla Handwrtten Character Recognton usng HMM, n Proc. 19th Int. Conf. on Pattern Recognton (ICIP),, pp. 1-4, ampa FL, 2008 [3] V. J. Babu, L. Prasanth, R. R. Prasanth, R. R. Sharma, G. V. P. Rao and A. Bharath, HMM-based onlne handwrtng recognton system for telugu symbols, n Proc. 9th Int. Conf. on Document Analyss and Recognton (ICDAR), Curtaba, Brazl, 2007, pp. 63-67 [4] K. Shashkran, K. S. Prasad, R. Kunwar, A. G. Ramakrshnan, Comparson of HMM and SDW for aml handwrtten character recognton. n Proc. Int. Conf. on Sgnal Processng and Communcatons,, pp. 1-4, IISc Bangalore, Inda, 2010 [5] A. Arora and A. M. Namboodr, A Hybrd Model for Recognton of Onlne Handwrtng n Indan Scrpts, n Proc. of Int. Conf. on Fronters n handwrtng Recognton, pp. 433-438, Kolkata, 2010
Computer Scence & Informaton echnology (CS & I) 95 [6] G. S. Reddy, P. Sharma, S. R. M. Prasanna, C. Mahanta and L. N. Sharma, Combned Onlne and Offlne Assamese Handwrtten Numeral Recognzer, n Proc. of 18th Natonal Conference on Communcatons, pp. 1 5, 2011 [7] G. S. Reddy, B. Sarma, R. K. Nak, S. R. M. Prasanna and C. Mahanta, Assamese Onlne Handwrtten Dgt Recognton System usng Hdden Markov Models, accepted at the Workshop on Document Analyss & Recognton, 2012 [9] A. Jayaraman, C. Chandra Sekhar and V. S. Chakravarthy, Modular Approach to Recognton of Strokes n elegu Scrpt, n Proc. Of 9th Internatonal Conference on Document Analyss and Recognton, pp. 501-505, 2007 [10] V. J. Babu, L. Prasanth, R. R. Prasanth, R. R. Sharma, G. V. P. Rao and A. Bharath, HMM-based onlne hanwrtng recognton system for telugu symbols, n Proc. Of 9th Int. Conf. on Document Analyss and Recognton Brazl, 2007, pp. 63-67. [11] X. L and D. Y. Yeung, Onlne handwrtten alphanumerc character recognton usng domnant ponts n strokes, Pattern Recognton, vol. 30, no. 1, pp. 31-44, 1997. [12] S.R.M Prasanna, Rtuparna Dev, Deepoy Das, Subhankar Ghosh, Krshna Nak, Onlne Stroke and Akshara Recognton GUI n Assamese Language Usng Hdden Markov Model Internatonal Journal of Scentfc and Research Publcaton, ISSN 2250-3153 [13] http://htk.eng.cam.ac.uk/ [14] L. R. Rabner, A tutoral on Hdden Markov Models and selected applcatons n speech recognton, Proc. Of IEEE, vol. 79, no. 2, pp. 257-286, 1989. [15] G. Sva Reddy, Bandta Sharma, R.Krshna Nak, S.R.M Prasanna, Chtralekha Mahanta, Assamese Onlne Handwrtten dgt recognton system usng Hdden Markov Models n Proc Of the workshop on Document Analyss and Recognton, pp. 108-113, DAR 12. [16] Nello Crstann and John Shawe-aylor, An Introducton o Support Vector Machnes And Other Kernel-Based Learnng Methodsǁ, Cambrdge Unversty Press, 2000. [17] K. Km, Fnancal me Seres Forecastng Usng Support Vector Machnes, Elsever, March 2003 [18] C. Hsu, C. Chang, C. Ln, A Practcal Gude to Support Vector Classfcaton, Natonal awan Unversty, 2003 [19] Z. Hua, Y. Wang, X. Xu, B. Zhang, L. Lang, Predctng Corporate Fnancal Dstress Based on Integraton of Support Vector Machne and Logstc Regresson, Expert Systems wth Applcatons, 2007