Segmentation and Recognition of Handwritten Numeric Chains

,


INTRODUCTION
Handwritten numerical string recognition has been a topic of intensive research in recent years due to its large number of potential applications.The recognition of numerical strings differs from that of isolated digits because it requires the segmentation of a string into separate entities representing individuals digits.It is also deferent from the problem of recognizing handwritten words form a dictionary in the sense that almost no contextual information is available.Segmentation of numerical strings is generally a difficult task because individual numerals in a string can overlap or touch each other, or a numeral can be broken into several parts.Strategies for handwritten numerical string recognition can be divided into segmentation-then-recognition [1,2] and segmentationbased recognition [3,4] .In the first approach, the segmentation module provides a single sequence hypothesis where each sub-sequence should contain an isolated character, which is submitted to the recognizer.Very often, contextual information is used in the segmentation process to improve the robustness of the system.The second strategy is based on a probabilistic assumption where the final decision must express the best segmentation-recognition score of the input image.Usually, the system yields a list of hypotheses from the segmentation module and each hypothesis is then evaluated by the recognition.Finally, the list is postprocessed taking into account the contextual information.Although this approach gives a better reliability than the previous one, the main drawback lies in the computational effort needed to compare all the hypotheses generated.Moreover, the recognition module has to discriminate various configurations such as fragments, isolated characters and connected characters.In this strategy, segmentation can be explicit when based on cut rules [5,6] or implicit when each pixel column is a potential cut location [7,8] .A good review about segmentation can be found in [9].Indeed, handwritten numerical string recognition is present in almost every application involving handwriting recognition, for instance, postal address [10,11] , cheque processing and form reading [3,7] .Such applications have been very popular in handwriting recognition research, due to the possibility to reduce considerably the manual effort involved in these tasks.

A PROPOSED SYSTEM FOR HANDWRITTEN
NUMERIC CHAINS RECOGNITION Handwritten isolated digits recognition: In the setting of the handwritten writing recognition, we proposed an off line system for the recognition of the isolated handwritten digits (shown in the figure 1), this system is divided in three phases: • Acquisition and preprocessing.
Fig. 1: General Schema of our handwritten isolated digits recognition system Acquisition: Before analyzing the different processing steps, let's recall that we are especially interested at the off line processing.For our case, the acquisition is done with a numeric scanner of resolution 300 dpi with 8 bits/pixels, the used samples are all possible classes of the handwritten digits (0,1,2,3,4,5,6,7,8,9) with variable sizes and variable thickness, and with 100 samples for every class.Let's note that the characters images of our database are formed only by two gray levels: the black for the object and the white for the bottom.The figure 2 shows some samples of the used database.Preprocessing: The preprocessing operations are classical operations in image processing, their objective is to clean and prepare the image for the other steps of the OCR system.The preprocessing attempts to eliminate some variability related to the writing process and that are not very significant under the point of view of the recognition, such as the variability due to the writing environment, writing style, acquisition and digitizing of image.For our case, we used the following preprocessing operations: Filtering and inversion of the gray levels This operation consists in eliminating the noises in the binary image due to different reasons (bad Acquisition conditions, bad writing conditions, the writer's mood.. etc.), in our case, some digits are marked by the noise of type "peppers and salt", the application of the filter median on the digit image permitted us to eliminate easily this type of noise.Let's note that for reasons of calculation we reversed the gray levels of the digit image (black for the bottom and white for the object).The figure 3 shows us the filtering and inversion operation of the gray levels of some handwritten digits.Normalization of the digit image Knowing that the digits images have variable sizes, this operation consists at normalizing the image size at 64 * 64 pixels (see figure 4).Fig. 3: Filtering and inversion of the gray levels of some handwritten digits.

Fig. 4: Normalization of some handwritten digits
Features extraction Features extraction is an important step in achieving good performance of OCR systems.
However, the other steps also need to be optimized to obtain the best possible performance, and these steps are not independent.The choice of features extraction method limits or dictates the nature and output of the preprocessing step and the decision to use gray-scale versus binary image, filled representation or contour, thinned skeletons versus full-stroke images depends on the nature of the features to be extracted.Features extraction has been a topic of intensive research and we can find a large number of features extraction methods in the literature, but the real problem for a given application, is not only to find different features extraction methods but which features extraction method is the best?.This question led us to characterize the available features extraction methods, so that the most promising methods could be sorted out.In this study, we are especially interested in the binary image of the digits, and the methods used to extract the discrimination features are the following: The distribution sequence: While dividing the digit image at a determined number of zones, the distribution sequence characterizes a number of the object pixels in relation to the total pixels number in a given zone.For our application, the digit image is divided in 64 zones (see figure 5), and the values of the distribution sequence are defined by: With: i x : is the ith value of the distribution sequence.
N i : is a number of the object pixels in the ith zone.N: is a total pixels number in the ith zone.Barr-features The Barr features have been used with success in several works [12 , 13] , they are calculated on the binary digits images.Firstly, four images parameters are generated, and every image parameter corresponds to one of the following directions: east (e), North (n), Northeast (ne), Northwest (nw).Every image parameter has a whole value representing the Barr length in the direction in question.The features are calculated from the images parameters using zones that overlap to assure a certain degree of smoothing.Fifteen rectangular zones are arranged in five lines with three zones for every line; every zone is of size [(h/3)*(w/2)] where h and w are respectively the height and the width of the image.The high corners on the left of the zones are at the positions {(r0, c0): r0=0, h/6, 2h/6, 3h/6, 4h/6 and c0=0, w/4, 2w/4}.The values in every zone of the parameters images are added and the sums are normalized, and the dimension of the features vector is 15* 4=60.If we suppose With N is a normalization factor chosen experimentally.The figure 6 shows the images parameters of the digits three and eight and their Barr features.Fig. 6: The images parameters of the digits three and eight and their Barr features.
The centred moments of the different projections In this case, the discrimination parameters are the centered moments extract from the follow projections (see Figure 7): The vertical projection: for a given column, the value of the projection is equal to the number of object pixels in this column.The horizontal projection: for a given line, the value of the projection is equal to the number of object pixels in this line.The diagonals projections: for a given diagonal, the value of the projection is equal to the number of object pixels according the direction in question.
While the centred moments of the projection are given by the following formulas: x : is the mean value of the projection in question.

• ) ( i x p
: is the probability of l 'element i x in projection sequence.
• M: is projection sequence size.
For our application, we chose the first six moments for every projection.The centred moments of the different profiles By definition, the image profile in a given direction is the set of the object pixels seen while standing in this direction.From this point of view, we can define the following profiles (see Figure 8):

•
Low profile: it is the set of the object pixels seen while standing below the image of the number • High profile: it is the set of the object pixels seen while standing over the image of the number • Left profile: it is the set of the object pixels seen while standing on the left of the image of the number • Right profile: it is the set of the object pixels seen while standing on the right of the image of the number While the centred moments of the different profiles are calculated by formulas: 3, 4 and 5.For our application, we chose the first six moments for every profile.Used features vector It is the features vector used to characterize the digit image, and with which, we will nourish the recognition module.For every digit image, this vector is constituted by 64 parameters of the distribution sequence, 60 parameters obtained by the Barr features method, the 24 centred moments of the different projections and the 24 centred moments of the different profiles.

Digit recognition
The handwritten digits recognition is a problem for which a recognition model must necessarily take in account an important number of variabilities, dice at the time, the recognition techniques based on the neural networks can bring certain suppleness for the construction of such models.For our system, we opted for an MLP (Multi-Layers Perceptron) which is the most widely studied and used neural network classier.Moreover, MLPs are efficient tools for learning large databases.The used MLP in our work is trained with the back propagation with momentum training algorithm.The transfer function employed is the familiar sigmoid function.

The input data
The database consists of 1000 binary images.These images represent all classes possible of the handwritten digits (0,1,2,3,4,5,6,7,8,9) with variable sizes and variable thickness, and with 100 samples for every class.This database is divided to two sets, 70℅ for training the neural network and 30 ℅ for testing it.

Neural network parameters
The input layer nodes number is equal to the size of the used features vector (N_IL=172), the output layer nodes number is equal to the classes number to recognize (N_OL=10), for the hidden layers, we used a single hidden layer with 87 nodes fixed by groping (N_HL=87).The initial connection weights are in the range [-1, 1].

The training process
For training the neural network, back propagation with momentum training method is followed.This method was selected because of its simplicity and because it has been previously used on a number of pattern recognition problems.The method works on the principle of gradient descent.The algorithm uses two parameters which are experimentally set, the learning rate  η and momentum µ .These parameters allow the algorithm to converge more easily if they are properly set by the experimenter.For our case, we have opted for the following values: η =0.35 and µ =0.9.During the learning phase the neural network learns by example and the connection weights are updated in an iterative manner.The training process for the network is stopped only when the sum of squared error falls below 0.001.

Handwritten numeric chains recognition
In this part, we tried to widen our system not only to the recognition of the isolated handwritten digits, but also to the recognition of the handwritten numeric chains constituted of a variable number of digits.The questions that arise are how to exploit the realized system and what are the steps of processing that we must add to attain this objective.In this setting, we proposed an improved version of the previous system, but before the presentation of the new system, let's note that we are not interested at this moment at the segmentation problems; this last will be treated in our next work.
Used database the used database, is constituted of 1000 handwritten numeric chain of different lengths and different writers.Let's recall that the used numeric chains are the chains whose numbers are well separated (absence of overlap and ligatures between the numbers and absence of broken numbers).Preprocessing The new system and after presentation of the handwritten numeric chain, start with cleaning it by applying an operation of filtering.in our case, some numeric chains are marked by the noise of type "peppers and salt", the application of the filter median on the chain permitted us to eliminate easily this type of noise.Let's note that for reasons of calculation we reversed the gray levels of the numeric chain image (black for the bottom and white for the object).The Figure 9 shows us the filtering and inversion operation of the gray levels of some handwritten numeric chains.Fig. 9: Filtering and inversion of the gray levels of some handwritten numeric chains.

Segmentation of the numeric chain
The vertical projection for a given image is the number of the object pixels in every column of the image; it is obtained by the following expression: With: ) ( j V : is the value of j order of the projection sequence. ) , ( j i IM : The value of the pixel whose coordinates are i and j in the image of the numeric chain.n: is the number of the lines of the numeric chain image.The segmentation of the numeric chain in digits is achieved by exploiting the transition black/white (or white/black) when we sweep for the last line the image columns of the vertical projection.(Figure 10).Fig. 10: The vertical projections of some handwritten numeric chains Numeric chain recognition Every obtained digit by segmentation is presented separately to the entry of the system achieved in the first part (recognition system of the isolated handwritten digits) and will undergo the following processing: normalization, features extraction and finally the recognition.Finally and after the presentation of all segments, the system displays the result of the recognition of the presented handwritten numeric chain.A detailed schema of the developed system is given by the Figure 11.

RESULTS
Firstly, the neural network performances are measured on the entire isolated digits database (training or learning set and testing set).During this phase, we present the digit image to recognize to the system entry, and we collect at the exit its affectation to one of the possible classes.The results can be: 1. Recognized digit: the system arrives to associate one and only one prototype to the digit to recognize 2. Ambiguous digit: the system proposes several Prototypes to the digit to recognize 3. Rejected digit: the system doesn't take any decision of classification 4. Non recognized digit: the system arrives to take a decision for the presented digit, but it is not the good decision.
The results and the different rates are regrouped in the table 1: Secondly, we measured the performances of the global achieved system (system of recognition of the handwritten chains numeric), while presenting to its entry the numeric handwritten chains.The results are displayed at the exit of system.The obtained recognition rate for the database used attain 91.30%

DISCUTION
The obtained results are very encouraging; however we foresee the following evolution possibilities: To consider other classification methods 3. To use of the algorithms capable to control the ambiguity, reject and non recognizer rates by adjusting the reject and ambiguity rates by use of suitable doorsteps 4. To use of other features extraction methods 5. Use of the post-processing techniques to improve the system performances 6.To improve our system by Taking in account the segmentation problems and especially the problem of the digits overlap in the numeric chain.

CONCLUSION
The recognition of the handwritten numeric chains is a problem for which a model of recognition must necessarily take in account an important number of variabilities and constraints due at the variation of the digit shape of the same class (variation of the writing styles, use of different writing instruments, variation of writing of a writer to another.. etc) and to the problems of the chain segmentation at isolated digits (problem of overlap for example).In our work, we presented an off line system for the recognition of the handwritten numeric chains.This work is divided in two big parts: 1.The realization of a system of isolated digits recognition: in this case the study is based mainly on the evaluation of neural network performances, trained with the gradient back propagation algorithm.Used parameters to form the input vector of the neural network are extracted on the binary images of the digits by several methods: distribution sequence, Barr features and centred moments of different projections and profiles.2. The extension of our system for the reading of the handwritten numeric chains (constituted of a variable number of digits) by using the vertical projection to segment the numeric chain at the isolated digits and every digit will be presented separately to the entry of the system achieved in the first part (recognition system of the isolated handwritten digits).

Fig. 2 :
Fig. 2: Some samples of the used database.

Fig. 5 :
Fig. 5: The digits three and eight and their distribution sequences parameters associated at a shape in entry and Zi (i=1,2… .15) is an rectangular zone of size [(h/3)*(w/2)] with the top corner on the left is ( 0 0 ,c r ), the value ik P of the parameter associated to the Zi zone for the image parameter k f (k=1,2,3,4) is given like follows:

Fig. 7 :
Fig. 7: The digits three and eight and their different projections.

Fig. 8 :
Fig. 8: The digits three and eight and their different profiles

Fig. 11 :
Fig. 11: Detailed schema of the developed system

Table 1 :
Results and different rates With: R-R: Recognizer rateA-R: Ambiguity rate.J-R: Reject rate.NR-R: Non recognizer rate