HYBRID OFF-LINE OCR FOR ISOLATED HANDWRITTEN GREEK CHARACTERS G. amvakas,2, B. Gatos, I. ratkaks, N. Stamatopoulos,2, A. Ronots 2, S.J. erantons Computatonal Intellgence Laboratory Insttute of Informatcs and Telecommuncatons Natonal Center for Scentfc Research Demokrtos GR-53 Aga araskev, Athens, Greece http://www.t.demokrtos.gr/cl {gbam, bgat, pratka, nstam, sper}@t.demokrtos.gr 2 Department of Informatcs and Telecommuncatons Unversty of Athens, Greece ABSTRACT In ths paper, we present an off-lne OCR methodology for solated handwrtten Greek characters manly based on a robust hybrd feature extracton scheme. Frst, mage pre-processng s performed n order to normalze the character mages as well as to correct character slant. At the next step, two types of features are combned n a hybrd fashon. The frst one dvdes the character mage nto a set of zones and calculates the densty of the character pxels n each zone. In the second type of features, the area that s formed from the projectons of the upper and lower as well as of the left and rght character profles s calculated. For the classfcaton step Support ectors Machnes (SM are used. The performance of the proposed methodology s demonstrated after testng wth the CIL database (handwrtten Greek character database, whch was created from dfferent wrters. KEY WORDS Handwrtten OCR, Hybrd Features, Handwrtten Character Database. Introducton Optcal character recognton (OCR s one of the most successful applcatons of automatc pattern recognton. The OCR stems attempt to facltate the every-day use of computers n the transformaton of large amount of documents, ether prnted or handwrtten, nto electronc form for further processng. Nowada, the recognton of prnted solated characters s performed wth hgh accuracy. However, the recognton of handwrtten characters stll remans an open search problem. In general, character recognton procedure conssts of two steps: (a feature extracton where each character s represented as a feature vector and (b classfcaton of the vectors nto a number of classes []. To develop hgh n at these two ponts. To get the outer profles, for each y value, the outermost x values of each contour half s selected. To get the nner profles, for each y value, the nnermost x values are selected. Horzontal profles can accuracy handwrtten character recognton stems, researchers have taken great efforts searchng for effcent feature representaton and classfers wth good generalzaton ablty. Selecton of a feature extracton method s probable the sngle most mportant factor n achevng hgh recognton performance [2]. Due to the nature of handwrtng wth ts hgh degree of varablty and mprecson, obtanng these features s a dffcult task. A feature extracton algorthm must be robust enough that for a varety of nstances of the same symbol, smlar feature sets are generated, thereby makng the subsequent classfcaton task less dffcult [3]. In the lterature, feature extracton methods have been based on two types of features: statstcal and structural [4]. Representaton of a character mage by statstcal dstrbuton takes care of style varatons to some extent. Ths method s used for reducng the dmenson of the feature set provdng hgh speed and low complexty [5]. On the other hand, characters can be represented by structural features wth hgh tolerance to dstortons and style varatons. The most common statstcal features used for character representaton are: (a zonng, where the character s dvded nto several zones and features are extracted from the denstes n each zone, (b projectons, where the twodmensonal mage (2-D s represented as onedmensonal sgnal (-D [6] and (c crossngs and dstances [5]. For example, contour drecton features measure the drecton of the contour of the character [7], whch are generated by dvdng the mage array nto rectangular and dagonal zones and computng hstograms of chan codes n these zones. In [2], a feature extracton method whch s based on horzontal and vertcal profles of the contour of the characters s presented. Frst the horzontal projecton s computed locatng the uppermost and lowermost pxels of the contour. The contour s splt be extracted n a smlar fashon, startng by dvdng the contour n upper and lower halves. These features, although ndependent to nose and deformaton, depend on rotaton. Another example s presented n [8], where 554-46 97
two sets of features are extracted usng crossngs and dstances. The frst one conssts of the number of transtons from background to foreground pxels along vertcal and horzontal lnes through the character mage and the second one calculates the dstances of the frst mage pxel detected from the upper and lower boundares, of the mage, along vertcal lnes and from the left and rght boundares along horzontal lnes. Structural features are based on topologcal and geometrcal propertes of the character, such as maxma and mnma, cusps above and below a threshold, cross ponts, branch ponts, strokes and ther drectons, nflecton between two ponts, horzontal curves at top or bottom, etc. One of the most popular technques for structural feature extracton s codng whch s obtaned by mappng the strokes of a character nto o 2-D parameter space, whch s made up the codes. Another method for structural feature representaton s representaton by graphs. The character s frst parttoned nto a set of topologcal prmtves, such as strokes, loops, cross ponts etc. and, these prmtves are represented usng attrbuted or relatonal graphs [5].There are two knds of mage representaton by graphs. The frst knd uses the coordnates of the character shape [9]. The second one s an abstract representaton wth nodes correspondng to the strokes and edges correspondng to the relatonshps between the strokes []. For the recognton of handwrtten Greek characters the only etng approach s based on structural features []. A 28-dmenson vector s extracted consstng of hstograms and profles. The well known horzontal and vertcal hstograms are used n combnaton wth the radal hstogram, out-n radal and n-out radal profles. Assume that each character s normalzed to a 32x32 matrx. Consder that the value of the element n the m-th row and the n-th column of the character matrx s gven by a functon f: f ( mn, = a ( mn where a mn takes bnary values (.e., for whte pxels and for black pxels. The horzontal hstogram of the H h character matrx s the sum of black pxels n each row (.e., 32 features: H ( (, h m = f m n (2 n Smlarly, the vertcal hstogram H v of the character matrx s the sum of black pxels n each column (.e., 32 features: H ( (, v n = f m n (3 m The radal hstogram s defned as the sum of foreground pxels on a radus that starts from the center of the mage and ends up at the border. The radal hstogram values are calculated wth a step of 5 degrees (.e., 72 features: 6 Hr ( φ = f( 6 sn φ, 6 + cos φ (4 = φ = 5* k, k [,72 The value of the out-n radal profle s defned as the poston of the frst foreground pxel found on the radus that starts from the perphery and goes to the center of the character mage formng an angle φ wth the horzontal a. The out-n radal profle values are calculated wth a step of 5 degrees (.e., 72 features: I I : f( 6 sn φ, 6 + cos φ o ( φ = = 6 (5 & f ( 6 sn φ, 6 cos φ Ι +Ι φ = 5* k, k [,72 Smlarly, the value of the n-out profle s defned as the poston of the frst foreground pxel found on the radus that starts from center of the character mage and goes to the perphery formng an angle φ wth the vertcal a. The n-out radal profle values are calculated wth a step of 5 degrees (.e., 72 features: J J : f( 6 sn φ, 6 + cos φ o ( φ = (6 = 6 & f( 6 Jsn φ, 6 Jcos φ + φ = 5* k, k [,72 Thus, a 28-dmenson vector s extracted for each character, as presented n Fg. : (a (b (c (d (e (f Fg. : a Character Matr b Horzontal Hstogram, c ertcal Hstogram d Radal Hstogram, e Radal out-n rofle, f Radal n-out rofle. In ths paper, we present a hybrd statstcal feature extracton method for solated handwrtten Greek characters, whch s based on a combnaton of features extracted from dvdng the character mage nto zones and the projectons of the upper, lower, left and rght profles. The expermental results ndcate the 98
effectveness of our approach. We manly compare our method wth the only etng method for recognzng handwrtten Greek characters, whch s descrbed n []. The remanng of the paper s organzed as follows. In Secton 2 our approach s presented whle expermental results are dscussed n Secton 3. Fnally, conclusons are drawn n Secton 4. 2. roposed Method 2.. re-processng Before the feature extracton algorthm takes place, we frst normalze all bnary character mages to a ΝxN matrx. After normalzaton, slope correcton s performed, whch s based on [2]. The domnant slope of the character s found from the slope corrected character whch gves the mnmum entropy of a vertcal projecton hstogram. The vertcal hstogram projecton s calculated for a range of slope correcton angles, α, where the angle s gven n ± θ. A slope correcton range of θ=6 ο appears to cover all wrtng styles. The slope of the character α m, s found from: α = mn H (7 m H = N = a ± θ log where N s the number of the columns n the vertcal projecton hstogram and s the probablty of a foreground pxel appearng n column. The character s then corrected by α m usng (see Fg. 2: (8 x = x y tan( a m (9 y = y ( (a (b Fg. 2: Feature extracton of a character mage based on zones. (a The normalzed character mage, (b Features based on zones. Darker squares ndcate hgher densty of character pxels. we calculate the densty of the character pxels (see Fg. 2. Let Z H and Z be the total number of zones formed n both horzontal and vertcal drecton. Then, features based on zones f z (, = Z H Z - are calculated as follows: where, x ( y ( e e z f ( = m( ( ( ( x ( = ( ZH ZH Z max, max xe( = ( ZH + Z H H ZH ymax ( =, ymax ( = ( ZH Z + ZH Z In case of features based on character (upper/lower profle projectons, the character mage s dvded nto two sectons separated by the horzontal lne y = y t (see Eq. 2: x ym( y (2 yt = m( x y x 2.2. Feature Extracton In our approach we employ two types of features. The frst one dvdes the character mage nto a set of zones and calculates the densty of the character pxels n each zone. In the second type of features, the area that s formed from the projectons of the upper and lower as well as of the left and rght character profles s calculated. Let m( be the character mage array havng s for foreground and s for background pxels, x max and y max be the wdth and the heght of the character mage. In the case of features based on zones, the mage s dvded nto horzontal and vertcal zones. For each zone, (a (b (c Fg. 3: Feature extracton of a character mage based on upper and lower character profle projectons. (a The normalzed character mage. (b Upper and lower character profles. (c The extracted features. Darker squares ndcate hgher densty of zone pxels. Upper/lower profles (Eq. 3, 4 are computed by consderng, for each mage column, the dstance between the horzontal lne y t and the closest pxel to the upper/lower boundary of the character mage (see Fg. 3. where y where y yup ( x = yt y, (3 yt yt, f m( = = y :( m( = & y = mn(y, y [,yt ],else ylo ( x = y yt, (4 ymax yt, f m( = = yt y:( m( = &y = max(, y [y t,y max ],else 99
Let be the total number of blocks formed n each produced zone (upper, lower. For each block, we calculate the area of the upper/lower character profles denoted as n the followng: xe ( up _ ar ( = yup( x ( f ( R le _ ar ( = xle( ( f ( R r _ ar ( = xr( ( f where, (5 ymax, ymax y x ( s( = ( R y e( = ( R + e R R f lo _ ar ( = ylo( x R R (6 ( and =.. R -. Fg. 4 llustrates the features extracted where, from a character mage usng projectons of character profles. xmax ( = (, xmax xe( = ( + The overall calculaton of the proposed feature vector s and =.. -. Fg. 3 llustrates the features extracted gven n Eq. 22. The correspondng feature vector length from a character mage usng projectons of character equals to Z H Z +2 + 2R. profles. x ( y e e( z f ( = mx (,, =... ZHZ In case of features based on character (left/rght profle ( ( projectons, the character mage s dvded nto two xe ( Z HZv f up_ ar( = y up( x, = ZHZ... ZHZ + sectons separated by the vertcal lne x = x t (see Eq. 7 ( Z HZ xe ( Z HZ + (22 m( x f( = f lo_ ar( = y lo( x, = ZHZ + +... + ZHZ + 2 x y xt = ( Z HZ + v m( (7 x y ( Z HZ + 2v R f le_ ar( = x le(, = ZHZ + 2 +... + ZHZ + 2 + R ( Z HZ + 2v ( Z HZ + 2 + R R f r_ ar( = = = + + + + + + x r(, ZHZ 2 R... ZHZ 2 2R ( Z HZ + 2 + R 3. Expermental Results (2 (2 (a (b (c Fg. 4: Feature extracton of a character mage based on left and rght character profle projectons. (a The normalzed character mage. (b Left and rght character profles; (c The extracted features. Darker squares ndcate hgher densty of zone pxels. Left/rght character profles (Eq. 8,9 are computed by consderng, for each mage column, the dstance between the vertcal lne x t and the closest character pxel to the left/rght boundary of the character mage (see Fg. 4 : where x x ( = x x, le t (8 xt xt, f m( = = x :( m( = & x = mn(x, x [,xt ], else x ( = x x, r t (9 xmax xt, f m( = where x = xt x:( m( = & x = max(x, x [xt,x max ],else Let R be the total number of blocks formed n each produced zone (left, rght. For each block, we calculate the area of left/rght character profles denoted as n the followng: For our experments, we have used the CIL Greek characters database. Ths database was created by handlng a number of forms (see Fg. 5 below that nclude 56 Greek characters. Intally, wrters are requested to fll these forms and afterwards, a scanner converts them to dgtal bnary mages. The last stage deals wth character extracton: Frstly, t detects lne and column ntersectons of each form and thus, approxmates the coordnates of cells. However, very slght nclnaton of forms, due to scannng, may cause serously erroneous cell detecton. Then, n order to avod ths, each cell s coordnates are re-defned, by scannng cell upwards and downwards untl border lnes are found. Lastly, characters are detected wthn cells and are sorted wthn the CIL database. Every wrter flled 5 forms, resultng n a data base of 28, solated and labeled characters. Each class represents a character and conssts of 5 varatons of ths character (56x5=28,. After the sze normalzaton step some characters such as the upper-case Ο and the lower-case o, are consdered to be the same. So, for havng meanngful results we merged these two classes nto one, by randomly selectng 5 characters from both classes. Ths was done to a total of par of classes. Table shows whch classes are merged. Ths concluded n havng 46 classes wth 5 patterns n each class and the database now has 46x5=23, characters 2
features based on zones and features based on character profle projectons led to the feature extracton model (Eq. 22 that uses a total of sxty-fve (65 features. In the partcular bnary classfcaton problem classfcaton step was performed usng two well-known classfcaton algorthms, Eucldean Mnmum Dstance Classfer (EMDC [3] and Support ector Machnes (SM [4]. Formally, the support vector machnes (SM requre the soluton of an optmzaton problem, gven a tranng set of nstance-label pars (x, y, =,, m, where n x R and y {, } m. The optmzaton problem s defned as follows: mn ω, b, ξ T ωω+ C 2 T subject to y( ω φ( x + b ξ ξ m ξ = (23 Fg. 5: Sample of the forms used for the CIL Greek Characters Data Base. Moreover, /5 of each class was used for testng and the 4/5 for tranng. So the used database was splt nto a tranng set of 8,4 characters (4x46=8,4 and a testng set of 4,6 characters (x46= 4,6. Table : Merged Classes Upper-case Lower-case Ε ε 2 Θ θ 3 Κ κ 4 Ο ο 5 Π π 6 Ρ ρ 7 Τ τ 8 Φ φ 9 Χ χ Ψ ψ As t has already been descrbed n Sectons 2 we have used a sze normalzaton step followed by a slope correcton step before feature extracton. Durng the normalzaton step, the sze of the normalzed character mages used s x max =6 and y max =6. In the case of features based on zones, the character mage s dvded nto fve (Z H =5 horzontal and fve (Z =5 vertcal zones formng a total of twenty-fve (25 blocks wth sze 2x2 (see Fg. 2. Therefore, the total number of features s 25. In the case of features based on character (upper/lower profle projectons we keep the same sze of the normalzed mage, whle the mage s dvded nto ten ( vertcal zones ( = (see Fg. 3. Consequently, the total number of features equals to twenty (2. Smlarly, the normalzed mage dvded nto ten ( horzontal zones (R = (see Fg. 4. Therefore, the total number of features equals to twenty (2. Combnaton of Regardng the classfcaton step, SM was used n conjuncton wth the Radal Bass Functon (RBF kernel, a popular, general-purpose t powerful kernel, denoted as: 2 K( x, x exp( γ x x (24 j j Furthermore, a grd search was performed n order to fnd the optmal values for both the varance parameter (γ of the RBF kernel and the cost parameter (C of SM (see Eq. 23. Table 2 depcts the recognton rates (% for the proposed hybrd method, the sngle feature methods and the method descrbed n [] whch s the only method reported n the lterature for the recognton of Greek handwrtten characters. These recognton rates acheved after combnng slope correcton wth ether sngle features of both feature extracton schemes. We can draw several conclusons. Frst, as t can been easly seen the best performance, for both classfers, s acheved n the case of usng an addtve fuson resulted after the combnaton of slope correcton precedng the hybrd feature extracton scheme. Moreover, our approach seems to have better results although the total number of features used (65 s smaller than the one n [] (28. Fnally, the SM acheved consderably hgher recognton rates than the EMDC. 4. Concluson Ths paper proposes an off-lne OCR stem for solated handwrtten Greek characters that s based on an addtve fuson resulted after a novel combnaton of two dfferent modes of character mage normalzaton (sze normalzaton and slope correcton and robust hybrd feature extracton. 2
We compared the proposed approach wth the method descrbed n [], whch s the only work n recognzng Greek handwrtten characters. Our approach acheved hgher rates of recognton. Our future research wll focus on explotng new features as well as fuson methods to further mprove the current performance. Acknowledgements Ths research s carred out wthn the framework of the Greek Mnstry of Research funded R&D project OLYTIMO [5] whch ams to process and provde access to the content of valuable hstorcal books and handwrtten manuscrpts. References [] S. Brtto, R. Sabourn, F. Bortolozz, C. Y. Suen, Foreground and Backround Informaton n an HMM- Based Method for Recognton of Isolated Characters and Numeral Strngs, 9th Internatonal Workshop on Fronters n Handwrtng Recognton (IWFHR-9, October 26-29, 24, Kokubunj, Tokyo, Japan, pp 37-376. [2] O. D. Trer, A. K. Jan, T.Taxt, Features Extracton Methods for Character Recognton A Survey, attern Recognton, 29(4 : 64-662, 996. [3] J. A. Ftzgerald, F. Geselbrechtnger, and T. Kechad, Applcaton of Fuzzy Logc to Onlne Recognton of Handwrtten Symbols, 9th Internatonal Workshop on Fronters n Handwrtng Recognton (IWFHR 9, Tokyo, Japan, pp. 395-4, October 26-29, 24. [4].K. Covndan, A.. Shvaprasad, Character Recognton A Revew, attern Recognton, 23(7, 99, pp. 67-683. [5] N. Arca and F. Yarman-ural, An Overvew of Character Recognton Focused on Off-lne Handwrtng, Table 2: Expermental Results re-processng Features Number of Classfer Recognton Slope Correcton Method n Hybrd features EMDC SM Rate (% [] Zones rojectons 28 8.65% 28 8.56% 25 82.67% 4 77.23% 65 83.2% 25 84.3% 4 79.6% 65 85.8% 28 87.52% 28 88.62% 25 86.76% 4 87.6% 65 92.34% 25 87.74% 4 88.4% 65 92.9% IEEE Transactons on Stems, Man, and Cybernetcs, art C: Applcatons and Revews, 3(2, 2, pp. 26-233. [6] Y. Tao, Y. Y. Tang, The feature extracton of Chnese character based on contour nformaton, n roc. 5thInt. Conf. Document Anal. Reognt., Bangalore, Inda, 999, pp. 637 64. [7] K. M. Mohuddn and J. Mao, A Comprehensve Study of Dfferent Classfers for Handprnted Character Recognton. attern Recognton, ractce I, pp. 437-448, 994. [8] J. H. Km, K. K. Km, C. Y. Suen, Hybrd Schemes Of Homogeneous and Heterogeneous Classfers for Cursve Word Recognton, 7 th Internatonal Workshop on Fronters n Handwrtng Recognton, September -3 2, Amsterdam, ISBN 9-76942--3, Njmegen: Internatonal Unpen Foundaton, pp 433-442s. [9] H. Cheng, W. H. Hsu, M. C. Kuo, Recognton of handprnted Chnese characters va stroke relaxaton, attern Recognton, 26(4, pp 579 593, 993. [] W. Lu, Y. Ren, C. Y. Suen, Herarchcal attrbuted graph representaton and recognton of handwrtten Chnese characters, attern Recognton, 24(7 pp. 67 632, 99. [] E. Kavalleratou, N. Fotaks, G Kokknaks, Handwrtten Character Recognton Based on Structural Characterstcs, cpr, p. 339, 6 th Internatonal Conference on attern Recognton (ICR'2 - olume 3, 22. [2] R. Buse, Z.Q. Lu, and T. Caell, A Structural and Relatonal Approach to Handwrtten Word Recognton, IEEE Trans. Stems, Man, and Cybernetcs, art B, 27(5, pp. 847-86, Oct. 997. [3] Theodords, S., and Koutroumbas, K., attern Recognton,(Academc ress, 997. [4] Cortes C., and apnk,., Support-vector network, Machne Learnng, vol. 2, pp. 273-297, 997. [5] OLYTIMO project, http://t.demokrtos.gr/cl/olytmo, 26. 22