Off-Line Handwritten Character Recognition of ... - IEEE Xplore

3 downloads 0 Views 329KB Size Report
Off-Line Handwritten Character Recognition of Devnagari Script. U. Pal. 1. , N. Sharma. 1. , T. Wakabayashi. 2 and F. Kimura. 2. 1. Computer Vision and Pattern ...
Off-Line Handwritten Character Recognition of Devnagari Script

1

U. Pal1, N. Sharma1, T. Wakabayashi2 and F. Kimura2 Computer Vision and Pattern Recognition Unit, Indian Statistical Institute, Kolkata-108, India Email: [email protected] 2 Graduate School of Engineering, Mie University, 1577 Kurimamachiya-cho, Tsu, Japan Email: {waka,kimura}@hi.info.mie-u.ac.jp

Abstract In this paper we present a system towards the recognition of off-line handwritten characters of Devnagari, the most popular script in India. The features used for recognition purpose are mainly based on directional information obtained from the arc tangent of the gradient. To get the feature, at first, a 2× 2 mean filtering is applied 4 times on the gray level image and a non-linear size normalization is done on the image. The normalized image is then segmented to 49 x 49 blocks and a Roberts filter is applied to obtain gradient image. Next, the arc tangent of the gradient (direction of gradient) is initially quantized into 32 directions and the strength of the gradient is accumulated with each of the quantized direction. Finally, the blocks and the directions are down sampled using Gaussian filter to get 392 dimensional feature vector. A modified quadratic classifier is applied on these features for recognition. We used 36172 handwritten data for testing our system and obtained 94.24% accuracy using 5-fold cross-validation scheme.

1. Introduction Recognition of handwritten characters has been a popular research area for many years because of its various application potentials. Some of its potential application areas are Postal automation, Bank cheque processing, automatic data entry, etc. There are many pieces of work towards handwritten recognition of Roman, Japanese, Chinese and Arabic scripts, and various approaches have been proposed by the researchers towards handwritten character recognition [1-3]. There are many scripts and languages in India and not much research has been done for the recognition of handwritten Indian characters. In

this paper, we propose a system towards the recognition of off-line handwritten Devnagari characters. Many pieces of work have been done towards the recognition of Indian printed characters [4-8] and at present OCR systems are commercially available for some of the printed Indian scripts. Towards off-line handwritten recognition of Indian characters only a few attempts have been made. Among off-line handwritten work on Indian scripts, maximum research has been done for Bangla. Systems are available for off-line Bangla handwritten numerals and characters [9]. Also some systems have been developed for unconstrained Bangla handwritten word recognition for Indian postal automation [10]. First research report on handwritten Devnagari characters was published in 1977 [11] and not much research work is done after that. Some research work are available towards Devnagari numeral recognition [12-14] but to the best of our knowledge there are only two reports on Devnagari off-line handwritten character recognition [15,16] after the year 1977. One work is due to Kumer & Singh [15] and they proposed Zernike moments based approach for Devnagari character recognition. The other work on Devnagari character recognition is proposed by us [16] and 64 dimensional chain code features have been used in that work. In this paper a quadratic classifier based scheme is proposed for off-line Devnagari handwritten character recognition. The features used for recognition purpose are mainly based on directional information obtained from the gradient. To get the feature, at first, mean filtering is applied on the image and a non-linear size normalization is done on the resultant image obtained after mean filtering. The normalized image is then segmented to 49 x 49 blocks. A Roberts filter is then applied to obtain gradient image. Next, the arc tangent of the gradient (direction of gradient) is initially quantized into 32 directions and the strength of the gradient is

Ninth International Conference on Document Analysis and Recognition (ICDAR 2007) 0-7695-2822-8/07 $25.00 © 2007

accumulated with each of the quantized direction. Finally, these directions are down sampled using Gaussian filter to get 8 directions from 32 directions. Also 49 x 49 blocks are down sampled using Gaussian filter into 7 x 7 blocks. As a result, we get 7 x 7 x 8 = 392 dimensional feature vector and this feature is fed to the quadratic classifier for recognition. Rest of the paper is organized as follows. In Section 2 we discuss about Devnagari language, its character set and data collection for the experiment. Feature extraction procedure is presented in Section 3. Section 4 details the classifier used for the recognition. The experimental results are discussed in Section 5. Finally, conclusion on the paper is given in Section 6.

2. Devnagari language and data collection Devnagari is the most popular script in India and the most popular Indian language Hindi is written in Devnagari script. Nepali, Sanskrit and Marathi are also written in Devnagari script. Moreover, Hindi is the national language of India and the third most popular language in the world [4]. Thus, the work on Devnagari script is very useful for the country. The alphabet of modern Hindi consists of 14 vowels and 33 consonants (www.omniglot.com/writing/hindi.htm). These characters may be called basic characters. Writing style in Devnagari script is from left to right. The concept of upper/lower case is absent in Devnagari script. In Devnagari script a vowel following a consonant takes a modified shape. Depending on the vowel, its modified shape is placed at the left, right (or both) or bottom of the consonant. These modified shapes are called modified characters. A consonant or vowel following a consonant sometimes takes a compound orthographic shape, which we call as compound character [4]. Compound characters can be combinations of two consonants as well as a consonant and a vowel. Compounding of three or four characters also exists in the script. In this paper we considered 47 basic characters and the character set considered in this paper is shown in Fig.1.

(a)

The complexity of a handwritten character recognition system increases mainly because of various writing styles of different individuals. Most of the errors in such system arise because of the confusion among the similar shaped characters. In Devnagari there are many similar shaped characters. Examples of some groups of similar shaped characters are shown in Fig.2. To get an idea of similar shape of printed as well as handwritten characters, we provide here the samples of both printed (see Fig.2(a)) and their handwritten (see Fig.2(b)) characters. There are some structural differences between two samples of a group in the printed characters but such difference in the corresponding handwritten samples is very less. From the Fig.2(b) it can be seen that shapes of two or more characters of a group is very similar due to handwritten style of different individuals and such shape similarity makes the recognition system more complex and increases the error rate of the system.

(a)

(b) Fig.2. Examples of some similar shaped Devnagari characters. (a) printed samples (b) corresponding handwritten samples of (a). Data collection for the present work has been done from different individuals of various professions. We have collected 36172 data samples for the experiment of the proposed work. We used a flatbed scanner for digitization. Digitized images are in gray tone with 300 dpi and stored as TIF Format.

3. Feature extraction Here we used 392 dimensional feature vector for our experiment and to obtain 392 dimensional features the following steps are applied.

(b) Fig.1. Printed samples of Devnagari characters considered in this experiment (a) Vowels (b) Consonants.

Step 1: Compute the bounding box of the input graylevel image. To get bounding box information we use the binary version of the input gray image and we use Otsu method [17] for the purpose. The gray image portion

Ninth International Conference on Document Analysis and Recognition (ICDAR 2007) 0-7695-2822-8/07 $25.00 © 2007

obtained within the bounding box is used for further processing. Step 2: Apply 2 × 2 mean filtering 4 times on this gray image. Step 3: A non-linear size normalization of the image is done [18]. Here the image is normalized into 148 x 148 pixels and this size is decided from the experiment. Step 4: Apply again a 3 × 3 mean filtering 2 times on this normalized gray image. Step 5: Normalized image is then segmented into 49 x 49 blocks. Step 6: Apply Roberts filter on the image to obtain gradient image. The arc tangent of the gradient (direction of gradient) is quantized into 32 directions and the strength of the gradient is accumulated with each of the quantized direction. By strength of Gradient ( f ( x, y ) ) we mean f ( x, y) = (∆u )2 + (∆v )2 , and by direction of gradient ( θ ( x, y )) we mean

θ ( x , y ) = tan −1

∆v , ∆u

where, ∆u = g ( x + 1, y + 1) − g ( x, y ) ,and ∆v = g(x +1, y) − g(x, y +1) , and g ( x, y ) is a gray scale at (x, y) point. Step 7: Histograms of the values of 32 quantized directions are computed in the 49 x 49 blocks. A smoothing filter [1 4 6 4 1] is used to get 16 directions from 32 directions. On this resultant image, another smoothing filter [1 2 1] is used to get 8 directions from 16 directions. Further more, we use a 31 x 31 twodimensional Gaussian-like filter (See Fig.3) to get smoothed 7 x 7 blocks from 49 x 49 blocks (shown in Fig.4). Thus, we get 7×7×8 = 392 dimensional feature vector. 0.014 0.012 0.01

0.014

Fig.4. Illustration of getting 7 x 7 blocks from 49 x 49 blocks.

4. Character classifier Recognition of characters in quadratic classifier [19] is carried out by using the following discriminant function: g ( X ) = ( N + N 0 + n − 1) ln[ 1 + k



∑ i =1

λi N λi + 0 σ N

1 N 0σ

{ Φ Ti ( X − M )} 2 ]] + 2

2

[ X −M

2

k

N0 2 σ ) N

∑ ln ( λ i =1

i

+

where X is the feature vector of an input character; M is a mean vector of samples;

ΦTi is the ith eigen vector of the

sample covariance matrix; λi is the ith eigen value of the sample covariance matrix; k is the number of eigen values considered here; n is the feature size; σ2 is the initial estimation of a variance; N is the number of learning samples; and No is a confidence constant for σ and N0 is considered as 3N/7 from the experiment. We do not use all the eigen values and their respective eigen vectors for the classification. Here, we sort the eigen values in descending order and take first 120 (k=120) eigen values and their respective eigen vectors for classification.

0.008

0.012

0.006

0.01

0.004

0.008

0.002 0

0.00

6

0.00

4 0.00 2 0

Fig.3. Example 31 x 31 two-dimensional Gaussian-like filter used for smoothing.

5. Result and discussion Data used for the present work were collected from different individuals. We considered 36172 samples of Devnagari basic characters (vowels as well as consonants) for the experiment of the proposed work. We have used 5-fold cross validation scheme for recognition result computation. Here database is divided into 5 subsets and testing is done on each subset using the rest four subsets for learning. The recognition rates for all the test subsets are averaged to calculate recognition accuracy.

Ninth International Conference on Document Analysis and Recognition (ICDAR 2007) 0-7695-2822-8/07 $25.00 © 2007

Table 3. Rejection versus error rate obtained from the classifier

5.1 Global recognition results From experiment we noted that the overall recognition accuracy of the proposed scheme using 392 dimensional features was 94.24% when zero percent rejection was considered. 97.89% accuracy was obtained when we considered first two top choices of the recognition result. The detail recognition results obtained from different top choices are given in Table 1. We also noted the accuracy of individual Devnagari characters. Maximum accuracy (98.58%) was achieved for the Devnagari characters . The next highest accuracy (97.95%) was achieved for the character . Accuracies of some of the Devnagari characters for which we got higher recognition rates are shown in Table 2. From the experiment we also noted that the character got the lowest recognition accuracy (only 84.02%). This lower accuracy was due to the shape similarity of the character

with the character

.

Table 1. Recognition results based on different choices from top (without any rejection)

Top choices

% of Accuracy

1 2 3 4 5

94.24% 97.89% 98.77% 99.11% 99.33%

Rejection (%)

Error (%)

0.00 2.50 5.50 8.50 11.50 14.50 25.03

5.76 4.40 3.90 2.30 1.70 1.24 0.50

5.3 Confusing pair computation We also noticed some confusing pairs of Devnagari characters and their error rates are shown in Table 4. The characters and confused the most, and their confusion rate is 0.37%. The next most confusing pair is and , and they confuse 0.32% cases. From the experiment we noted that mainly similar shaped characters confused by the system at higher rate. Table 4. Main confusing pairs of Devnagari characters Confusion rate Confusing character pairs

(Computed from overall samples)

0.37% Table 2. Individual accuracy of some Devnagari characters

0.32% 0.20%

Character Accuracy Character Accuracy 98.58%

97.95%

97.94%

97.82%

97.82%

97.48%

97.20%

97.20%

5.2 Rejection versus error rate computation We also computed the rejection versus error rate of the classifier and the results are presented in Table 3. We noted that 2.30% error occurred in our proposed scheme when rejection rate was 8.50% and only 0.50% error occurred when rejection rate was 25.03%. Rejection criteria of the proposed system is decided mainly based on the difference of 1st and 2nd value of the discriminant function g(X).

0.17% 0.15% 5.4 Results on poor/noisy image Since we use statistical classifier and our feature detection technique scheme is not very sensitive to noise, our scheme shows correct results even if the samples are poor in quality. To get an idea of such samples, some poor images where we obtained correct results from our system are shown in Fig.5.

Ninth International Conference on Document Analysis and Recognition (ICDAR 2007) 0-7695-2822-8/07 $25.00 © 2007

Fig.5. Examples of some poor samples.

5.5 Erroneous results

References

To get the idea about the samples where our system generates erroneous results, we provide some such samples in Table 5. Actual handwritten input samples are shown in the first row of this table and the printed samples of their recognized class are shown in the respective columns of the second row of the table. Since the shape of these handwritten samples and the shape of the corresponding recognized character class is very similar, we may think that these handwritten samples are recognized correctly. Unfortunately they are all missrecognized. Actual class of each of the handwritten samples, shown in the first row of this table, is shown in respective columns of the third row of the table in printed form.

[1] R. Plamondon and S. N. Srihari, “On-Line and off-line handwritten recognition: A comprehensive survey”, IEEE Trans on PAMI, Vol.22, pp.62-84, 2000. [2] Z.Chin and H. Yan, “A handwritten character recognition using self-organizing maps and fuzzy rules”, Pattern Recognition, Vol.22, pp. 923-937, 2000. [3] K.Kim and S.Y. Bang, “A handwritten character classification using tolerant Rough set”, IEEE Trans. on PAMI, Vol.22, pp.923-937, 2000. [4] U. Pal and B.B. Chaudhuri, “Indian script character recognition: A Survey”, Pattern Recognition, Vol. 37, pp. 1887-1899, 2004. [5] B. B. Chaudhuri and U. Pal, “A complete printed Bangla OCR system”, Pattern Recognition, Vol. 31, pp. 531-549, 1998. [6] K. G. Aparna, A. G. Ramakrishnan, “A Complete Tamil Optical Character Recognition System”, In Proc. 5th Intl workshop on DAS, pp. 53-57, 2002. [7] A. Negi, C Bhagvati, B. Krishna, “An OCR System for Telugu”, In Proc. 6th ICDAR, pp.1110-1114, 2001. [8] V. Bansal and R. M. K. Sinha, “A complete OCR for printed Hindi text in Devnagari script”, In Proc. 6th ICDAR, pp. 800-804, 2001. [9] K. Roy, U. Pal and F. Kimura, “Recognition of Handwritten Bangla Characters”, In Proc. 2nd International Conference on Machine Intelligence, pp.480-485, 2005. [10] U. Pal, K. Roy and F. Kimura, "A Lexicon Driven Method for Unconstrained Bangla Handwritten Word Recognition", In Proc.10th IWFHR, pp.601-606, 2006. [11] I. K. Sethi and B. Chatterjee, “Machine Recognition of constrained Hand-printed Devnagari”, Pattern Recognition, Vol. 9, pp. 69-75, 1977. [12] M. Hanmandlu and O.V. Ramana Murthy, “Fuzzy Model Based Recognition of Handwritten Hindi Numerals”, In Proc. Intl. Conf. on Cognition and Recognition, pp. 490-496, 2005. [13] R. Bajaj, L. Dey, and S. Chaudhury, “Devnagari numeral recognition by combining decision of multiple connectionist classifiers”, Sadhana, Vol.27, pp.-59-72, 2002. [14] U. Bhattacharya, S. K .Parui, B. Shaw, K. Bhattacharya, “Neural combination of ANN and HMM for handwritten Devnagari Numeral Recognition”, In Proc. 10th IWFHR, pp.613-618, 2006. [15] S. Kumar and C. Singh, “A Study of Zernike Moments and its use in Devnagari Handwritten Character Recognition”, In Proc. Intl. Conf. on Cognition and Recognition, pp. 514520, 2005. [16] N. Sharma, U. Pal, F. Kimura and S. Pal, “Recognition of Offline Handwritten Devnagari Characters using Quadratic Classifier”, In Proc. Indian Conference on Computer Vision Graphics and Image Processing, pp- 805-816, 2006. [17] N. Otsu, “A Threshold selection method from grey level histogram”, IEEE Trans on SMC, Vol.9, pp.62-66, 1979. [18] T. Wakabayashi, S. Tsuruoka, F. Kimura and Y. Miyake, “Increasing the Feature size in handwritten Numeral Recognition to improve accuracy”, System and Computers in Japan, Vol.26, pp.35-44, 1995. [19] F. Kimura, K. Takashina, S. Tsuruoka and Y. Miyake, “Modified quadratic discriminant function and the application to Chinese character recognition”, IEEE Trans. on PAMI, Vol. 9, pp.149-153, 1987.

Table 5. Erroneous samples Actual Samples (Handwritten) Recognized as (Printed sample) Actual Class (Printed sample)

5.6 Comparison of results To the best of our knowledge there exist only two recent pieces of work on off-line handwritten Devnagari characters. Kumar and Singh [15] used Zernike moments for Devnagari handwritten characters and obtained 80% accuracy from 200 data. The other work is done by us [16] where we used 64 dimensional feature vector and the features are obtained from the directional chain code information of the contour points of the characters. We obtained 80.36% accuracy from 11270 handwritten Devnagari character data. From this present method we obtained 94.24% accuracy from 36172 Devnagari data. Please note that 11270 samples used in [16] are included in this present database.

6. Conclusion India is a multi-lingual and multi-script country comprising of eleven different scripts and not much work has been done towards off-line handwriting recognition of Indian scripts. In this paper we present a quadratic classifier-based system towards the recognition of off-line Devnagari handwritten characters. We tested our proposed system on 36172 samples and obtained 94.24% recognition accuracy. We hope this work will be helpful to the researchers for the work towards other Indian script characters.

Ninth International Conference on Document Analysis and Recognition (ICDAR 2007) 0-7695-2822-8/07 $25.00 © 2007