fx e f v x G
v x
v x
2 cos ) , , , (
2
2
2
2
2
1
+
=
With
sin cos
sin cos
x v v
v x x
=
+ =
where 0 is the orientation oI sinusoid, f its Irequency and
x
(respectivelv
v
) the standard deviation oI the gaussian
according to x (respectively v) axis.
Gabor Iilters allow to isolate the contours oI an image at
a direction perpendicular to 0. In case oI handwritten
documents, we apply a set oI Iour gabor Iilters,
corresponding to orientations 0, 45, 90 and 135. The
parameters f and are tuned so as to enhance the text lines,
localizing the high Irequencies. These two parameters
inIluence the results oI the oriented contours segmentation.
Figure 2 Application of a set of four gabor filters with
respective masks
The standard deviation oI the gaussian is chosen to be
inIerior to 1/3 oI the radius oI the mask r in order to
respect the dynamics oI the Gabor Iunction while the
echeloned Irequency is linked to by the Iormula:
3
16 r
f
e
=
where
20
2
* f f
e
=
choosing f : 2, 4, 8 et 16.
The application oI a set oI gabor Iilters is shown in
Iigure 2. One can notice that the resulting contours are not
very precise in localization. Hence to reduce the contour
thickness, we suppress all non-maximal Gabor responses,
keeping only the maximal points amplitudes |5|.
Figure 3 Directional contour map in the vertical (0),
oblique (45and 135) and horizontal (90) directions
Finally, we superimpose the Iour binary maps obtained.
In cases where the same pixel is simultaneously detected by
more than one Iilter, we consider the direction in which the
pixel was most reactive. This results in a contour
directional map as illustrated in Iigure 3.
This study allows the construction oI a direction rose, a
diagram Iiguring the relative proportions between the
directional components oI an object, and is independent oI
the scale oI observation (Iigure 4). During the construction
oI our direction rose, each pixel votes with a normalized
weight proportional to its value on the respective Gabor
map. Hence, the pixels more reactive in a particular
direction have more weight as compared to the less
reactive ones. We keep this direction rose as a Iour
dimensional Ieature vector, representing the writing style oI
its author provided that the observed sample is suIIiciently
representative oI the writing style. Based on these vectors,
a k-means clustering is carried on the training set,
comparing two writings by Euclidean distance in the Iour
dimensional representation space. An important choice in
the k-means algorithm is the number oI clusters to retain.
We have carried out an exhaustive study by calculating the
classiIication error on the training set Ior diIIerent values
oI k. It is estimated by computing the mahanalobis distance
oI the direction rose oI each image in the training set to
each oI the classes; classiIication error being the number oI
images wrongly classiIied. The value oI k which reduces
the classiIication error on the training set to minimum is
thus chosen (k2 Ior our system) allowing us to divide the
reIerence base into two disjoint sets according to the
writing style.
Figure 4 Direction rose for the vector [16.2, 27.0, 24.3,
32.4]
2.1.2. Extraction of local Features
Once similar writings have been grouped together, we
proceed to the study oI local details in a handwriting. We
have shown that within a handwritten text, there exist
redundant patterns which could be exploited by a writer
identiIication system.
To extract these Iorms, the handwritten text is divided
into a large number oI small windows oI size nxn. This size
should be large enough to contain ample inIormation about
the style oI the author and small enough to ensure a good
identiIication perIormance |12|. The simplest method
could be the division oI the entire image regularly Irom leIt
to right and top to bottom and eliminating the windows
which do not contain any part oI text. This not only gives a
large number oI sub-images (containing text pixels), but
the windows are also not well positioned over the text,
dividing some strokes into diIIerent sub-images. Recently,
we proposed a more adaptive approach |13| where a
component-by-component division oI text is carried out.
For each connected component in the text, the vertical
origin is Iixed and a window is displaced Irom leIt to right
to Iind the Iirst text (black) pixel.
Figure 5 Window Positioning (a) Start of ink trace, (b)
Choice of next side with exiting trace, (c) Initial
position of the next window, (d) Sliding the window
with respect to trace
Problems occurring with these methods oI segmenting
the image are linked to the lack oI invariance oI the line
position within the local window. In the present
communication, we present a new division technique more
adapted to the ink trace. Starting with a connected
component we Iind its skeleton and place the Iirst window
on one extremity oI the skeleton. For each window, we
deIine Iour Ilags namely: East, West, North and South, the
respective Ilag being set iI the skeleton exits Irom that
particular side. II the skeleton exits Irom the E (or W), we
place the next window towards the right (respectively leIt)
oI the current window (on the original component), and
displace it in the vertical direction (up and down) to Iind its
best position. On the other hand, iI the skeleton exists Irom
the N (or S), we place the next window on top (respectively
bottom) oI the current window and move it horizontally
(leIt or right) so that it is well placed over the text. The
method has been illustrated in Iigure 5. In cases where the
skeleton exists Irom more than one side, we treat each oI
the branches separately. The window positioning algorithm
is applied to each oI the components in the image thus
resulting in a division oI handwriting into small sub-
images, shown Ior the word headlines` in Iigure 6. A
comparison oI the regular division (84 windows), the
W
N
E
S
Y Adjust
O
O
O x Skeleton
exiting
Irom east
(a) (b)
(c) (d)
E
X Fixed
method presented in |13| (67 windows), and the proposed
method (59 windows) has been illustrated. The new
method not only reduces the number oI useIul windows but
also improves the window positioning with respect to the
text pixels.
Figure 6 Division of the word headlines (a) Regular
Division, (b) Sliding windows horizontally, (c)
Following the ink trace
Regarding the window size n, we carry out an exhaustive
study with sizes oI 11x11, 13x13, 15x15 and 17x17 and
Iinally Iix it to 13x13 Ior our system. The eIIect oI window
size on identiIication perIormance has been analyzed in
detail in |13|.
Once the text has been divided into sub-images, we
proceed to their clustering. The objective is that the sub-
images which are morphologically similar are grouped in
same classes. We have employed a sequential clustering
algorithm that does not need to know a priori the number
oI clusters to retain. Two sub-images are compared by the
Iollowing correlation similarity measure |1|.
2 / 1
00 10 01 11 00 01 10 11
01 10 00 11
)| )( )( )( |(
) , (
n n n n n n n n
n n n n
Y X S
+ + + +
=
With n
if
being the number oI pixels Ior which the two
sub-images X and Y have values i and f respectively, at the
corresponding pixel positions. The clusters obtained on a
sample image have been illustrated in Iigure 7.
Once the sub-images have been clustered, we sort the
classes and keep only those having suIIicient number oI
elements. The term suIIicient however is relative, so we
pick the top most important M classes which allow to cover
85 oI text pixels in the image.
For each class, we calculate its probability oI occurrence
P(C
i
) and also its covariance matrix:
T
i i i i i
X X Cov ) )( ( =
With X
i
being the matrix whose columns are the
elements (each sub-image represented as a n
2
x1 column
vector) oI class i and n
i
being the arithmetic mean oI class
i. Thus, we construct a vector Ior each class and represent
the document by the set oI these vectors.
} , ), (
i i i i
Cov C P F =
)} ( , C card i F D
i
r
=
Figure 7 Clusters obtained on a document image
2.2. Identification
In the identiIication phase, given a handwriting sample
oI an unknown writer, the objective is to identiIy its writer
among the writers in the reIerence base. The Iirst step
towards identiIication is the recognition oI the writing style
oI the questioned document T. The set oI Iour gabor Iilters
is applied to the image, its direction rose is constructed and
the writing class is identiIied using mahanalobis distance:
( ) ) ) ( ( ) ) ( ( min arg ) (
1
i
T
i
i
rose T rose rose T rose T Class =
where rose(T) represents the vector oI the direction rose
oI document T,
i
rose the mean and L the covariance
matrix oI class i. Hence, we extract a subset S oI the
reIerence base R, having the same writing style as that oI T.
We then proceed to the extraction oI local Ieatures Irom
the test document. We start with the division oI text into
sub-images, Iollowed by their clustering, thus representing
the writing by a set oI classes as discussed in the previous
sections. For each class, we select one sub-image, the one
which is the best representative oI its group. In each class,
(c)
(b)
(a)
we calculate the similarity measure oI each element with all
the other elements oI the same class. The element which is
closest to all the others is chosen as class representative.
Thus we have a representation oI writing by a set oI
patterns which are speciIic to a writer:
} f
r
x T =
Figure 8 Identification model
The identiIication oI writer is carried out employing the
Bayesian classiIier; the similarity between a test document
T represented as T
r
and a reIerence document D
represented by D
r
being Iormulated as:
=
=
) (
1
)) ( (
) (
1
) , (
r
i
T card
f
f
i
D C
r
x C P Max
T card
D T SIM
That is: Ior each f x in T
r
, the objective is to Iind the
class i oI document D that maximizes the probability oI
pattern f x belonging to class C
i
. ) ( f
i
x C P is estimated
by the expression:
) ( log ) ( ) (
2
1
log
2
1
1
i i i
T
i i
C P X Cov X Cov +
size window the nxn; d
matrix) (dxd i class oI matrix covariance
vector) (dx1 i class oI mean
x pattern the ng representi Vector
j
=
=
=
=
i
i
Cov
X
where
A complete derivation oI the above expression could be
Iound in |13|. We calculate the similarity between
document T and all the documents in the subset S and
identiIy the writer oI the questioned document as:
))) , ( ( max ( ) (
i
S D
D T SIM Arg Writer T Writer
i
=
With : R S
3. Experimental Results
To evaluate our system, we have randomly chosen a set
oI 100 writers Irom the IAM database |7|, with one image
oI each used in training and one in testing. Each image
contains on the average, 8-10 lines oI text.
Figure 9 Classification rates
For the Iirst phase, we have achieved a classiIication rate
oI 98 (k 2). We remark that there is a signiIicant
decrease in the classiIication rate iI we divide the reIerence
base into more than two classes (k~2); see Iigure 9. Thus
Ior the rest oI our evaluations we Iix k to 2. In the second
phase, we search the writer oI the questioned document
within the speciIic writing class and achieve and overall
identiIication rate oI 92. The 8 error is the cumulative
error oI the two steps oI classiIication and identiIication.
A comparative study oI the results obtained with and
without pre-classiIication oI writings revealed that using
phase 1 not only improves the identiIication rate but also
reduces the number oI comparisons to be made in phase 2
which could be very useIul once dealing with larger data
sets. Although one would have liked a higher value oI k,
but even with k2, the results show an improvement
against k1 (no clustering). We also compare the method
oI division oI text (into sub-images) proposed in the
present paper to the one we presented in |13|. It is
observed that the new method achieves signiIicantly
improved identiIication results, as summarized in Iigure 10.
In our Iuture series oI evaluations, we plan to enlarge the
experiments and the data set and perIorm a comparative
evaluation with the other methods in the literature.
82%
84%
86%
88%
90%
92%
94%
96%
98%
Top1 Top2 Top3 Top4
I
d
e
n
t
i
f
i
c
a
t
i
o
n
R
a
t
e
Without Phase1,Text Division by Proposed method
With Phase1 (k=2),Text Division by Proposed Method
With Phase1 (k=2),Text Division by Earlier Method
[13]
Figure 10 Comparison of Identification Rates
4. Conclusion
We have presented an eIIective method Ior writer
identiIication in handwritten documents. The method is
based on identiIying the writing style oI an author and then
extracting the Iorms that a writer would use Irequently as
he draws the characters. The realized identiIication rates
are very promising and validate the arguments put Iorward
in this paper. However, the presented text should be long
enough (at least 5-6 lines) so that it well represents the
writing style and allows the exploitation oI the idea oI
redundant patterns in a writing. In addition, changing the
window size n during the phase oI handwriting division,
this method could be applied to non-Latin languages like
Asian or Arabic scripts. The system could be made more
robust by automatically adjusting the window size
depending upon the writing details. Moreover, the system
can be extended beyond identiIication to perIorm the
veriIication oI the author as well.
References
|1| A. BenseIia, T. Paquet and L. Heutte, 'A writer
identiIication and veriIication system, Pattern Recognition
Letters,vol 26, issue 13, 2080-2092,2005.
|2| V. Bouletreau, N. Vincent, R. Sabourin, H. Emptoz,
"Handwriting and signature: one or two personality
identiIiers?", In Proc.oI Fourteenth International
ConIerence on Pattern Recognition, Los Alamitos, CA,
vol.2, 1998, pp. 1758-1760.
|3| M. Bulacu, L. Schomaker, and L. Vuurpijl, 'Writer
identiIication using edge-based directional Ieatures, In
Proc. oI 7th International ConIerence on Document
Analysis and Recognition, volume II, Edinburgh, Scotland,
3-6 August 2003, pp. 937941.
|4| M. Bulacu and L. Schomaker, 'Combining Multiple
Features Ior Text-Independent Writer IdentiIication and
VeriIication, In Proc. OI the 10th International Workshop
on Frontiers in Handwriting Recognition, La Baule, France,
2006.
|5| D. Gaceb, V. Eglin, and S. Bres. Handwriting similarities as
Ieatures Ior the characterization oI writer`s style invariants
and image compression. In International ConIerence on
Image Analysis and Recognition (ICIAR), volume 2, pages
776-789, 2006.
|6| A Imdad, S Bres, V Eglin, H. Emptoz and R.M. Carlos Joel,
'Writer IdentiIication using Steered Hermite Features and
SVM, In Proc. oI the 9th Int'l conIerence on Document
Analysis and Recognition (ICDAR 2007), Curitiba, Brazil,
September 2007.
|7| U. Marti and H. Bunke, 'A Iull English sentence database
Ior oII-line handwriting recognition, In Proc. oI 5th
International ConIerence on Document Analysis and
Recognition, Bangalore, India, 1999, pp. 705-708.
|8| A. Nosary, L. Heutte, T. Paquet, Y. Lecourtier, "DeIining
writer's invariants to adapt the recognition task", In Proc. oI
5th International ConIerence on Document Analysis and
Recognition, Bangalore, India, 1999, pp. 765-768.
|9| R. Pareti and N. Vincent, 'Global Method based on Pattern
Occurrences Ior Writer IdentiIication, In Proc. oI the 10th
International Workshop on Frontiers in Handwriting
Recognition, La Baule, France, 2006.
|10| H.E.S. Said, T.N Tan, K.D. Baker, 'Personal IdentiIication
Based on Handwriting, Pattern Recognition, vol. 33, 2000,
pp. 149-160.
|11| L. Schomaker, L. And M. Bulacu, 'Automatic Writer
IdentiIication Using Connected-Component Contours and
Edge-Based Features oI Uppercase Western Script, In
IEEE Transactions oI Pattern Analysis and Machine
Intelligence,vol 26, no. 6, pp. 787-798, 2004.
|12| A. Seropian and N. Vincent, "Writers Authentication and
Fractal Compression," iwIhr, p. 434, Eighth International
Workshop on Frontiers in Handwriting Recognition
(IWFHR'02), 2002.
|13| I. Siddiqi and N. Vincent, 'Writer IdentiIication in
Handwritten Documents, In Proc. oI the 9th
Int'l conIerence on Document Analysis and Recognition
(ICDAR 2007), Curitiba, Brazil, September 2007.
|14| S. Srihari, S. Cha, H. Arora, and S. Lee, 'Individuality oI
handwriting, J. oI Forensic Sciences, 47(4):1.17, July
2002.