Combining Contour Based Orientation and Curvature Features for ...

Report 4 Downloads 49 Views
Combining Contour Based Orientation and Curvature Features for Writer Recognition Imran Siddiqi, Nicole Vincent Laboratoire CRIP5 –SIP, Paris Descartes University, 45 Rue des Saint Pères, 75006 France {imran.siddiqi, nicole.vincent}@mi.parisdescartes.fr

Abstract. This paper presents an effective method for writer recognition in handwritten documents. We have introduced a set of features that are extracted from two different representations of the contours of handwritten images. These features mainly capture the orientation and curvature information at different levels of observation, first from the chain code sequence of the contours and then from a set of polygons approximating these contours. Two writings are then compared by computing the distances between their respective features. The system trained and tested on a data set of 650 writers exhibited promising results on writer identification and verification. Keywords: Writer Recognition, Freeman Chain Code, Polygonization.

1 Introduction Among the expressive behaviors of human, handwriting carries the richest information to gain insight into the physical, mental, and emotional states of the writer. Each written movement or stroke reveals a specific personality trait, the neuromuscular movement tendencies being correlated with specific observable personality features [2]. This explains the stability in the writing style of an individual and the variability between the writings of different writers, making it possible to identify the author for which one has already seen a written text. This automatic writer recognition serves as a valuable solution for the document examiners, paleographers and forensic experts. In the context of handwriting recognition, identifying the author of a given sample allows adaptation of the system to the type of writer [10]. Writer recognition comprises the tasks of writer identification and verification. Writer Identification involves finding the author of a query document given a reference base with documents of known writers. Writer verification on the other hand determines whether two samples have been written by the same person or not. The techniques proposed for writer recognition are traditionally classified into textdependent [15,17] and text-independent methods, which can make use of global [5,11] or local [4,6] features. Combining the global and local features is also known to improve the writer recognition performance [7,13,15]. Lately, the methods that compare a set of patterns (a writer specific or a universal code book) to a questioned writing have shown promising results as well [4,13]. These methods however rely on

a segmentation of handwriting and defining an optimal segmentation remains a problem. In this paper, we present a system for offline writer recognition using a set of simple contour based features extracted by changing the scale of observation as well as the level of detail in the writing. We first compute a set of features from the chain code sequence representing the contours, at a global as well as at a local level. We then extract another set of features from the line segments estimating the contours of handwritten text. Finally we perform a comparative evaluation of the different types of features and explore their various combinations. The method has been detailed in the following sections where we present the features, the recognition and the results.

2 Feature Extraction For feature extraction, we have chosen to work on the contours of the text images as they eliminate the writing instrument dependency while preserving the writing style and the writer-dependent variations between character shapes. We start with the gray scale input image, binarize it using the Otsu’s global thresholding algorithm and extract the contours of the handwritten text. We then represent the contours in two ways: by a sequence of Freeman chain codes and by a set of polygons obtained by applying a polygonization algorithm to the contours. We then proceed to the extraction of features (a set of distributions) that capture the orientation and curvature information of writing; the two most important visual aspects that enable humans instinctively discriminate between two writings. These features have been discussed in the sections to follow where we first discuss the chain code based features and then we present how we have modeled some loss of details keeping only a general and simple view of the writing that is enough to characterize its writer. 2.1

Chain Code Based Features

Chain codes have shown effective performance for shape registration [1] and object recognition [3] and since the handwritten characters issued by a particular writer have a specific shape, chain code based features are likely to perform well on tasks like writer recognition. We therefore compute a set of features from the chain code sequence of the text contours first at a global level and then from the stroke fragments within small observation windows. 2.1.1

Global Features

At the global level, in order to capture the orientation information, we start with the well-known histogram of all the chain codes/slopes (slope density function f1) of the contours where the bins of the histogram represent the percentage contributions of the eight principal directions. In addition, we also find the histograms of the first (and second) order differential chain codes that are computed by subtracting each element of the chain code from the previous one and taking the result modulo connectivity (8

in our case). These histograms (f2 and f3) represent the distribution of the angles between successive text pixels (f2) and the variations of these angles (f3) as the stroke progresses. The distributions of chain codes and their differentials give a crude idea about the writing shapes but they might not be very effective in capturing the fine details in writing; we thus propose to count not only the occurrences of the individual chain code directions but also the chain code pairs, in a histogram f4, illustrated for two writings in figure 1. The bin (i,j) of the (8x8) histogram represents the percentage contribution of the pair i,j in the chain code sequence of the contours. Employing the same principle, we also compute the (8x8x8) histogram of chain code triplets f5. It is important to precise that all the 64 possible pairs and 512 possible triplets cannot exist while tracing the contours and we can have a total of 44 pairs and 236 triplets.

Fig. 1. Two writings and their respective distributions of chain code pairs

Finally, for the purpose of comparison, we use an estimate of curvature computed from the histograms of contour chain code, presented in [3] for object recognition. A correlation measure between the distribution of directions on both sides (forward and backward) of a contour pixel pc is used to approximate the curvature at pc and it is the distribution of these estimates which is used to characterize an author (f6). 2.1.2

Local Features

The features f1 – f6, although computed locally, capture the global aspects of writing thus the relative stroke information is lost. We therefore chose to carry out an analysis of small stroke fragments as well. Employing an adaptive window positioning algorithm [13], we divide the writing into a large number of small square windows, the window size being fixed empirically to 13x13. Within each window, we find the percentage contribution of each of the eight directions (chain codes), the percentages being quantized into ten percentiles. These contributions are counted in a histogram (f7): the bin (i,j) is incremented by one if the direction i is represented in the jth percentile. Figure 2 shows the windows positioned over an image and the contribution of one of the windows to the histogram where the three direction codes present in the window lead to three contributions to the histogram. The process is carried out for all the windows and the distribution is finally normalized. This distribution (f7) thus, can be considered as a window-based local variant of f1. Using

the same idea, we also compute f2 and f3 locally, represented by the distributions f8 and f9 respectively. These distributions have been discussed in detail in [14]. Segment Length:42 Pixels

Dir

Pixels

Percentage

Percentile

Bin

5

4

9

1

5,1

6

2

5

1

6,1

7

36

86

9

7,9

42

100

Fig. 2. Windows positioned over the chain-coded image and the contribution of one of the windows to the distribution f7 These chain code based features compute the orientation and curvature information of writing, however, these estimates are computed from raw pixels and it would be interesting to carry out a similar analysis at a different observation level. We therefore propose to estimate the contours by a set of polygons and then proceed to feature extraction (a set of global features) which not only corresponds to a distant scale of observation but the computed features are also more robust to noise distortions. 2.2

Polygon Based Features

These features are aimed at keeping only the significant characteristics of writing discarding the minute details. Employing the sequential polygonization algorithm presented in [16], we carry out an estimation of the contours by a set of line segments. The algorithm requires a user defined parameter T that controls the accuracy of approximation. Larger values of T create longer segments at the cost of character shape degradation and vice versa. Figure 3 shows the polygon estimation of the contours of a handwritten word for different values of T. For our system, we have used a value of T equal to 2, chosen empirically on a validation set. We then extract a set of features from these line segments.

T=1 T=2 Fig. 3. Polygonization at different values of T

T=3

T=5

We first compute the slope of each of the line segments and employ their distribution (f10) for characterizing the writer. Each line is identified as belonging to one of the bins (classes) illustrated in figure 4. These bins are chosen in such a way that the lines having nearly the same orientations as the principal directions (vertical, horizontal etc) fall in their respective classes. For example, all the segments in the range -12° to 12° are classified as (nearly) horizontal and so on.

Not only the number of slopes in a particular direction is important but their corresponding lengths as well, so in order to complement the distribution f10, we also compute a length-weighted distribution of slopes (f11), where for each segment at slope i, the bin i in f11 is incremented by the length of the segment. The distribution is finally normalized by the total length of segments in the image. 2

8 6 7 1 4 3

2 5

Bin 1 2

Class Horizontal (H) Vertical (V)

3

Left Diagonal (LD)

4

LD Inclined towards Horizontal (LDH)

5

LD Inclined towards vertical (LDV)

6

Right Diagonal (RD)

7

RD Inclined towards Horizontal (RDH)

8

RD Inclined towards Vertical (RDV)

Fig. 4. Division of slopes (-90° to 90°) into bins and the corresponding segment classes

We next estimate the curvature by computing the angle between two connected segments and use the distribution of these angles as our next feature (f12). The angle bins are divided in a similar fashion as for the slopes. Similarly, in order to take into account the lengths of the segments forming a particular angle, a length weighted version of f12, f13 is also computed. Finally, irrespective of the orientation, it would be interesting to analyze the distribution of the lengths of segments in a writing. Generally, smooth strokes will lead to longer and fewer segments while shaky stokes will result in many small segments, thus the straight segment lengths could be useful in distinguishing the writings of different authors. We therefore use the distribution of these lengths (f14) as a writer specific feature, the number and partitioning of bins being determined by analyzing the distribution of lengths in writings of the validation set. We thus extract a set of fourteen (normalized) distributions to represent a document image. The distributions for which the number of bins is not discussed explicitly have been partitioned empirically on the validation set. Table 1 summarizes the proposed features with the dimensionalities of each. Table 1. Dimensionalities of the proposed features

Feature Dim

f1 8

f2 7

f3 8

f4 44

f5 236

f6 11

f7 80

f8 70

f9 80

f10 8

f11 8

f12 8

f13 8

f14 10

3 Writer Recognition The dissimilarity between two writing samples is defined by computing a distance between their respective features. We tested a number of distance measures including: Euclidean, 2, Bhattacharyya and Hamming distance, 2 distance reading the best

results in our evaluations. Writer Identification is performed by computing the distance between the query image Q and all the images in the data set, the writer of Q being identified as the writer of the document that reports the minimum distance. For writer verification, the Receiver Operating Characteristic (ROC) curves are computed by varying the acceptance threshold, verification performance being quantified by the Equal Error Rate (EER). The identification and verification results have been presented in the following section.

4 Experimental Results For the experimental study of our system, we have chosen the IAM [8] data set which contains samples of unconstrained handwritten text from 650 different writers. This data set contains a variable number of handwritten images per writer with 350 writers having contributed only one page. In order to fit in all the 650 writers in our experiments, we keep only the first two images for the writers having more than two pages and split the image roughly in half for writers who contributed a single page thus ensuring two images per writer, one used in training while the other in testing. We carried out an extensive series of experiments evaluating the performance of individual features and their various combinations. We will report only a sub-set of results presented for the three types of features and their combinations in figure 5. It can be observed that the combined performance of each type of features is more or less the same with the combination of polygon based features performing slightly better (82.3% against 81.5% & 81.1%). Combining two types of features boosts the identification rates to around 84-85% which rises to 89% when using all the features. Similarly for writer verification we achieve an equal error rate of as low as 2.5%. Table 2. Comparison of writer identification methods Writers Marti et al. (2001) Bensefia et al. (2004) Schlapbach and Bunke (2006) Bulacu and Schomaker (2007) Our method

[9] [4] [12] [7]

20 150 100 650 150 650

Samples/ writer 5 2 5/4 2 2 2

Performance 90.7% 86% 98.46% 89% 94% 89% / 86.5%

We finally present a comparative overview of the results of recent studies on writer identification task on the IAM data set (Table 2). Although identification rates of as high as 98% have been reported, they are based on a smaller number of writers. Bulacu and Schomaker [7] currently hold the best results reading 89% on 650 writers and we have achieved the same identification rate with the proposed features. It is however, important to precise that we distinguish the training and test sets while in [7] the authors have used a leave-one-out approach on the entire data set. Thus, in order to present a true comparison we also carried out a similar experimentation and achieved an identification rate of 86.5%. We hope to improve the performance of the system by optimizing the selection of the proposed features.

100%

90%

90%

Identification Rate

Identification Rate

100%

80% 70% 60%

f1,f2,f3

50% 40%

f1,f2,f3,f6 f1,f4,f5

30%

All

80% 70% 60%

f7

50% 40%

f8 f9

30%

A ll

20%

20% 1

2

3

4

5

6

7

8

9

1

10

2

3

a) Chain Code (CC) Features (Global)

6

7

8

9

10

b) CC Based Local Features (Window Based) 100%

100% 90%

70% 60% 50%

f14

40%

f10,f11 f12,f13

96%

Identification Rate

80%

30%

All

92% CC & Pol

88%

Pol & Local CC & Local

84%

All Features

20%

80% 1

2

3

4

5

6

7

8

9

10

1

2

3

4

H it lis t S ize

10

96%

8

7

8

9

10

All Features CC & Local CC & Poly

92%

Hitlist:1 Hitlist:10

FRR(%)

6

88%

80%

4 2

0

2

4

6

8

10

FAR(%)

N um be r o f Writ e rs

e) Identification rate as function of number of writers

Local & Poly

0

50 15 0 25 0 35 0 45 0 55 0 65 0

10

6

d) Combining three types of features

100%

84%

5

H it lis t Size

c) Polygon Based Features

Identification Rate

5

H it lis t S ize

H it lis t S ize

Identification Rate

4

f) Writer Verification Performance (ROC Curves)

Fig. 5. Writer Identification and Verification Results

5 Conclusion We have presented an effective method for writer recognition that relies on extracting a set of features from the contours of text images. These features are simple to compute and are very effective, realizing promising results on writer recognition. We have shown that recognition rates can be improved by modeling a vision with fewer details (polygonized version of writing) than the original digitized image. In our future research, we intend to extract and compare these features separately for different parts of words (baseline, ascenders & descenders). We also plan to employ a more sophisticated feature selection mechanism (like genetic algorithms etc). These additions are likely to enhance the recognition performance of the system.

References 1. Ahmad, M. B., Park, J.,Min, H.C., Shim, Y.:Shape registration based on modified chain codes. In: Advanced Parallel Processing Technologies, 600-607, (2003) 2. Baggett, B.:Handwriting Analysis 101-The Basic Traits. Empressé Publishing, (2004) 3. Bandera, A., Urdiales, C., Arrebola, F., Sandoval, F.:2D object recognition based on curvature functions obtained from local histograms of the contour chain code. Pattern Recognition Letters, Vol 20, pp.49-55, (1999) 4. Bensefia, A., Paquet, T., Heutte, L. : A writer identification and verification system, Pattern Recognition Letters, Vol 26, pp. 2080-2092, (2005) 5. Bouletreau, V., Vincent, N., Sabourin, R., Emptoz, H. : Handwriting and signature:one or two personality identifiers? In: Proc.of 14th ICPR, 1758-1760, (1998) 6. Bulacu, M., Schomaker, L., Vuurpijl, L. : Writer identification using edge-based directional features. In: Proc. of 7th ICDAR, 937–94 1, (2003) 7. Bulacu, M., Schomaker, L. : Text-Independent Writer Identification and Verification Using Textural and Allographic Features. IEEE Transactions on PAMI, pp. 701-717, (2007) 8. Marti, U., Bunke, H. : A full English sentence database for off-line handwriting recognition. In: Proc. of 5th ICDAR, pp. 705-708, (1999) 9. Marti, U., Messerli, R., Bunke, H. :Writer Identification Using Text Line Based Features. In: Proc. of 6th Int’l Conference on Document Analysis and Recognition, p. 0101, (2001) 10. Nosary, A., Heutte, L., Paquet, T., Lecourtier, Y. :Defining writer's invariants to adapt the recognition task. In: Proc. of 5th ICDAR, 765-768, (1999) 11. Said, H.E.S., Tan, T.N., Baker, K.D. :Personal Identification Based on Handwriting. Pattern Recognition, vol. 33, 149-160, (2000) 12. Schlapbach, A., Bunke, H. :Off-line Writer Identification Using Gaussian Mixture Models. In: Proc. of 18th Int. Conf. on Pattern Recognition, 992–995, (2006) 13. Siddiqi, I., Vincent, N. :Combining Global and Local Features for Writer Identification. In: Proc of 11th Int'l Conference on Frontiers in Handwriting Recognition, (2008) 14. Siddiqi, I., Vincent, N.:A Set of Chain Code Based Features for Writer Recognition. In: Proc. of 10th Int’l Conference on Document Analysis and Recognition, (2009) 15. Srihari, S., Cha, S., Arora, H., Lee, S. :Individuality of handwriting. J. of Forensic Sciences, 47(4):1.17, (2002) 16. Wall, K., Danielsson P.:A fast sequential method for polygonal approximation of digitized curves. Computer Vision, Graphics and Image Processing, vol.28, pp.220-227, (1984) 17. Zois, E.N., Anastassopoulos, V.:Morphological waveform coding for writer identification. Pattern Recognition, 33 (3), 385–398, (2000)