Off-line Recognition of Unconstrained Handwritten Numerals Using Fuzzy Hough Transform

A fuzzy system for handwritten numerals recognition using a fuzzy Hough transform technique is presented. The system is an off-line system since the data processed was written before the time of recognition. A data base of 480 patterns of unconstrained (free) handwritten numerals was used in the proposed system. Membership values are determined as fuzzy sets which are defined on the standard Hough transform vector. Manhattan distance measurement has been used to measure the similarity of an input feature vector to a number of numeral pattern classes. The overall recognition accuracy of the system for the ten numerals is 95%. 1.1-Introduction People usually write numbers in different shapes. Recognition of handwriting has many practical applications, including mail address and bank check reading. As in any pattern recognition problem, different Mohammed Z. Khedher& Ghayda A. Al-Talib and Shayma M. Al mashhadany 212 approaches to numerals recognition can be classified into two classes: the decision theoretic approach and the structural approach [1]. The decision theoretic approach includes many techniques, such as minimum distance classifier (which is used in this research), matching by correlation, optimum statistical classifier, and multilayer neural networks. In these approaches the recognition is based on the use of a decision function to separate different classes of patterns. These decision theoretic approaches ignore any structural relationship in a pattern's shape. Structural method, on the other hand, focuses on these inherent relationships and seek to describe certain pattern classes by a formal grammar. The syntactic approach is the most famous approach of the structural class [2]. The variability in handwriting is very large to be characterized by a finite set of rules. One way to deal with the variability in handwritten numerals is the use of fuzzy set theory. Fuzzy logic techniques have been used in both decision theoretic approach [3, 4], as well as structural approach [5]. For the recognition of numerals, a suitable feature vector has been extracted via the image matrix of each numeral. The feature vector should be governed by the following conditions [6]: 1Feature vectors of two different numerals should contain major differences between them so that the recognition technique can conclude these differences. 2Feature vectors of a special numeral written by different handwriting should be the same, as the recognition technique could not find a meaningful difference among them. There are many different methods to recognize Handwritten Numeral. Sadok and Alouani-1997 have used the concept of fuzzy logic in a syntactic method to recognize a handwritten numeral [1]. Harfi and Aghagolzadeh-2004 have used neural network to recognize the numerals over an asymmetrical segmentation pattern to obtain the feature vector[6]. AL-Taani-2005, has proposed a structural approach for recognizing on–line handwritten numerals. The slope is estimated and normalized for adjacent nodes. Based on the changing of signs of the slope values, the primitives are identified and extracted[7]. Jaehwa P. and venu G.-2000, described a method that uses an active heuristic function to determine the length of the feature vector as well as the feature themselves were used to classify an input pattern [8]. 1.2-Handwritten Indian Numerals description: In this paper, we consider the description of the numerals used in the eastern Arab countries usually called Indian Numerals. Before being Off-line Recognition of Unconstrained Handwritten Numerals Using... 213 processed by the program, the image is filtered and transformed to a binary image. A handwritten numeral will be characterized by a certain number of features. The characteristics of each feature as well as the way these features are connected together will make it possible to identify different shapes of the numeral. We use this terminology to characterize specific points on the outline and to label different types of lines, curves and loops. Those features are useful for handwritten numerals classification, and they are: • Big circles which exist on numerals like ٥ ، ٩ . • Slant lines in numerals like ٢ ، ٤ ، ٧ ، ٨ . • Horizontal lines in numerals like ٢ ، ٦ . • Vertical lines in numerals like ١ ، ٢ ، ٣ ، ٦ ، ٩ . • Dense circle in a numeral like ٠. • Curve in numeral like ٣. According to those features of the outline of numerals, the decision will be taken. 2. Methodology The central idea underlying the method used in the recognition of numerals in this paper is the following: A set of features (22 in the present implementation-see sections 2.1, 2.2) that can be computed from a pattern image. The bounding box (in Fig. 1) of a 48 pattern of the input image is divided into 48 images to be processed. (Figure 1) Bounding Box Hough Transform is a standard technique for detecting features as lines and curves in a given image [9]. For line detection, it uses a parameterization to map an arbitrary straight line in the image plane to a point in the parameter space. In polar coordinates, a straight line can be described via the equation ρ = X cos Ө +Y sin Ө 0<=Ө<180 ...(1) Mohammed Z. Khedher& Ghayda A. Al-Talib and Shayma M. Al mashhadany 214 Equation 1 describes a mapping of a point in the Cartesian coordinate X-Y plane to the sinusoidal curve in the polar coordinates ρ-Ө plane. Where ρ is its distance from the origin, and Ө is the angle of its normal with the X-axis [10]. 2.1 Line Extraction: Different line shapes in each numeral pattern are to be extracted and a number of fuzzy sets are defined to deal with the variation of styles and positions of line segments. All characteristics of the different lines in an image pattern were mapped in to the properties of these fuzzy sets [10]. Fuzzy set membership functions are listed in Table-1 for θ values in the first quadrant. Similar membership functions can be defined for θ values in the other quadrants. The fuzzy sets LL and SL of Table-1 extract length information of the different lines in a character pattern. HL, VL and TL represent their skew while NT, NB, NVC, NR, NL and NHC give the spatial distribution of these lines. By this technique, all characteristics of the different lines in an image pattern has been mapped into the properties of these fuzzy sets [10]. Table-1: Fuzzy set membership functions defined on Hough transform accumulator cells for line detection Off-line Recognition of Unconstrained Handwritten Numerals Using... 215 Table-1(Continue): Fuzzy set membership functions for line detection The core of the fuzzy sets TL, NT, NB, NVC, NR, NL, NHC represent crisp features. The core of the fuzzy sets HL and VL denote the strictly horizontal and strictly vertical lines, respectively, while the core of LL is a diagonal line. 2.2 Circle Extraction: Similar basic fuzzy sets are defined on the (a,b,c) accumulator cells for circle extraction using the transform c= (X-a)+(Y-b) ...(2) where (a and b) denote the center of a circle and c, its radius (see Table-2). From the fuzzy sets membership functions definitions, it is seen that a nonnull support of the fuzzy set implies the presence of the corresponding feature in a character pattern [10]. Mohammed Z. Khedher& Ghayda A. Al-Talib and Shayma M. Al mashhadany 216 Table 2: Fuzzy set membership functions defined on Hough transform accumulator cells for circle detection The advantage of using fuzzy set membership functions is that the search space is shortened and only the outputs of i high membership values are considered for the search. 2.3 Similarity Measurements: The recognition of the numerals requires estimation of Manhattan distance between the reference image to all other known images in the data base. Each pattern is represented by the feature vector Fi, i=1,2,3,...p. Then the Manhattan distance between Fj and other feature vectors is calculated by the absolute values of the distance between all the P pattern from i input pattern, where summation is done over all the feature elements subscripted by j [11]. Manhattan dis(fi, fj)= ∑ = k


1.1-Introduction
People usually write numbers in different shapes. Recognition of handwriting has many practical applications, including mail address and bank check reading. As in any pattern recognition problem, different approaches to numerals recognition can be classified into two classes: the decision theoretic approach and the structural approach [1]. The decision theoretic approach includes many techniques, such as minimum distance classifier (which is used in this research), matching by correlation, optimum statistical classifier, and multilayer neural networks. In these approaches the recognition is based on the use of a decision function to separate different classes of patterns. These decision theoretic approaches ignore any structural relationship in a pattern's shape. Structural method, on the other hand, focuses on these inherent relationships and seek to describe certain pattern classes by a formal grammar. The syntactic approach is the most famous approach of the structural class [2].
The variability in handwriting is very large to be characterized by a finite set of rules. One way to deal with the variability in handwritten numerals is the use of fuzzy set theory. Fuzzy logic techniques have been used in both decision theoretic approach [3,4], as well as structural approach [5].
For the recognition of numerals, a suitable feature vector has been extracted via the image matrix of each numeral. The feature vector should be governed by the following conditions [6]: 1-Feature vectors of two different numerals should contain major differences between them so that the recognition technique can conclude these differences. 2-Feature vectors of a special numeral written by different handwriting should be the same, as the recognition technique could not find a meaningful difference among them.
There are many different methods to recognize Handwritten Numeral. Sadok and Alouani-1997 have used the concept of fuzzy logic in a syntactic method to recognize a handwritten numeral [1]. Harfi and Aghagolzadeh-2004 have used neural network to recognize the numerals over an asymmetrical segmentation pattern to obtain the feature vector [6]. AL-Taani-2005, has proposed a structural approach for recognizing on-line handwritten numerals. The slope is estimated and normalized for adjacent nodes. Based on the changing of signs of the slope values, the primitives are identified and extracted [7]. Jaehwa P. and venu G.-2000, described a method that uses an active heuristic function to determine the length of the feature vector as well as the feature themselves were used to classify an input pattern [8].

1.2-Handwritten Indian Numerals description:
In this paper, we consider the description of the numerals used in the eastern Arab countries usually called Indian Numerals. Before being processed by the program, the image is filtered and transformed to a binary image.
A handwritten numeral will be characterized by a certain number of features. The characteristics of each feature as well as the way these features are connected together will make it possible to identify different shapes of the numeral. We use this terminology to characterize specific points on the outline and to label different types of lines, curves and loops. Those features are useful for handwritten numerals classification, and they are: • Big circles which exist on numerals like ،9 5 .
• Vertical lines in numerals like .
• Dense circle in a numeral like 0.
• Curve in numeral like 3. According to those features of the outline of numerals, the decision will be taken.

Methodology
The central idea underlying the method used in the recognition of numerals in this paper is the following: A set of features (22 in the present implementation-see sections 2.1, 2.2) that can be computed from a pattern image. The bounding box (in Fig. 1) of a 48 pattern of the input image is divided into 48 images to be processed.

(Figure 1) Bounding Box
Hough Transform is a standard technique for detecting features as lines and curves in a given image [9]. For line detection, it uses a parameterization to map an arbitrary straight line in the image plane to a point in the parameter space. In polar coordinates, a straight line can be described via the equation ρ = X cos Ө +Y sin Ө 0<=Ө<180 ...(1) Equation 1 describes a mapping of a point in the Cartesian coordinate X-Y plane to the sinusoidal curve in the polar coordinates ρ-Ө plane. Where ρ is its distance from the origin, and Ө is the angle of its normal with the X-axis [10].

Line Extraction:
Different line shapes in each numeral pattern are to be extracted and a number of fuzzy sets are defined to deal with the variation of styles and positions of line segments. All characteristics of the different lines in an image pattern were mapped in to the properties of these fuzzy sets [10].
Fuzzy set membership functions are listed in Table-1 for  values in the first quadrant. Similar membership functions can be defined for  values in the other quadrants.
The fuzzy sets LL and SL of Table-1 extract length information of the different lines in a character pattern. HL, VL and TL represent their skew while NT, NB, NVC, NR, NL and NHC give the spatial distribution of these lines. By this technique, all characteristics of the different lines in an image pattern has been mapped into the properties of these fuzzy sets [10].

Table-1(Continue): Fuzzy set membership functions for line detection
The core of the fuzzy sets TL, NT, NB, NVC, NR, NL, NHC represent crisp features. The core of the fuzzy sets HL and VL denote the strictly horizontal and strictly vertical lines, respectively, while the core of LL is a diagonal line.

Circle Extraction:
Similar basic fuzzy sets are defined on the (a,b,c) accumulator cells for circle extraction using the transform c= (X-a) 2 +(Y-b) 2 ...(2) where (a and b) denote the center of a circle and c, its radius (see Table-2). From the fuzzy sets membership functions definitions, it is seen that a nonnull support of the fuzzy set implies the presence of the corresponding feature in a character pattern [10].

Table 2: Fuzzy set membership functions defined on Hough transform accumulator cells for circle detection
The advantage of using fuzzy set membership functions is that the search space is shortened and only the outputs of i th high membership values are considered for the search.

Similarity Measurements:
The recognition of the numerals requires estimation of Manhattan distance between the reference image to all other known images in the data base. Each pattern is represented by the feature vector Fi, i=1,2,3,...p.
Then the Manhattan distance between Fj and other feature vectors is calculated by the absolute values of the distance between all the P pattern from i th input pattern, where summation is done over all the feature elements subscripted by j [11].
The effect of Manhattan distance on the recognition accuracy is based on the minimum value of this distance.

The Proposed System
The proposed method for recognizing the handwritten numerals is shown in Figure-2. The process can be divided into the following stages: 1-Splitting 2-Image centering 3-Digitization 4-Feature vector extraction 5-Symmetrical segmentation pattern 6-Recognition of numeral.

Splitting
The input image is entered to the system as a collection of 48 samples of each Arabic numeral (Figure 3-a,b), written by 48 different persons. In this stage, we get the size of the entered image and divide it into 7 columns and 7 rows in order to get 48 images each for a single writer.

Image centering
To recognize a hand-written numeral regardless of position and size, some sort of transformation has to be applied. Alternatively, the position and size of the original numeral can be adjusted to standard values, and then applying the classification to the adjusted image. This process of adjustment is called normalization.
The normalization process only trims the image to the area of the writing. From figure-4 the process first obtains the column and row summation of the image, which are the x and y profiles. The point with the maximum value of each profile is set as the center point. Next, from the center point, it searches left/up until a point in which its value is lower than a specified value (threshold value) and then sets it as the lower point of the profile. Again from the center point, it searches right/down for the higher point of the profile. The new rectangle is formed as (x_low, y_low, x_high, y_high).

Digitization
A heuristic rule generates a matrix of 1's and 0's for each image according to the gray level of image. Each black pixel is represented by a 1 and each white pixel by a 0 [12].

Feature Extraction
The main purpose of the feature extraction process is to reduce the number of inputs into the classifier while maintaining the important features or properties of the image. The more meaningful the features extracted are, the better this feature extractor is. Additionally, the features must satisfy other desirable requirements such as fast processing speed, low computational cost and low complexity of the feature extraction techniques. Thus, simpler and more powerful features cannot be easily found.
Once the input image is split into smaller units, these units are sent to a module which extracts features of the data, essential to the employed shape classification algorithm.
The actual features, however, are lines of different lengths, orientations, and circles of different sizes. The local feature vectors will produce same length vectors associated with each sample.

Symmetrical Segmentation Pattern
Elongated and skewed handwritten numerals can extensively affect the feature vector. Therefore a symmetrical segmentation pattern presentation is to be found.
With some modification to the current pattern of the numeral, a segmentation was done as in (Figure-6), and a 16-segment pattern was used and a counting of the enclosed pixels in every segment was performed.

(Figure-6) Symmetrical Segmentation Pattern
Then a ratio between the numbers of pixels in every segment to the whole number of pixels inscribed in the image has been found. This pattern in addition to a feature vector was used in the recognition step.

Recognition of Numerals
Now it is possible to recognize the numerals using two structures: The feature vector and the symmetrical pattern of every numeral.
Each numeral has different shapes which were captured by the set of primitives. Each numeral can be described by a specific array of features. Also each numeral has different symmetrical shapes. Both have been used to determine to which numeral the primitives collected belong. Figure-7 shows 48 sample of the handwritten numeral 7 as a database for this numeral with the output result of recognition from the system implemented.

Simulation Results
The proposed method was simulated to determine its performance for the numerals from 0-9. In the training procedure, 480 handwritten numerals from 48 different writers were used. The recognition rate of numerals is shown in Table-3. ( Figure-8) shows the results of processing of the numeral 5 as given by the program. The recognition accuracy for this numeral is 95.8 %.

Comparison to other Arabic numeral recognition systems
The present numeral recognition system is compared to other Indian character recognition systems.
An asymmetrical segmentation pattern is proposed to recognize a handwritten Persian / Arabic digit using neural network by Harifi and Aghagolzadeh [6]. The system gave a recognition rate of 97.6%.
Al-taani [7] recognizes on-line handwritten digits by a flexible technique which obtains about 95% accuracy rate. Jaehwa and Venu [8] used A*-Like search algorithm in an active recognition system to classify an input pattern. Jaehwa method yielded a recognition rate of 96%.
In his paper , Lee [13] used a simple multilayer cluster neural network in addition to a genetic algorithms to recognize unconstrained handwritten numerals. Lee method yielded a recognition of 97.1%.
Fray [14] used a binary decision trees for the recognition of handwritten numerals. It gave a recognition rate of 86.3% in the best case.
Unlike Cai and Liu [15], used the statistical and structural information for unconstrained handwritten numeral recognition. This approach uses state-duration adapted transition probability to improve the modeling of state-duration in HMMs. The recognition rate achieved was 95.5%.
Anil and Douglas [16] used deformable templates to recognition of handwritten digits. Classification using the minimum dissimilarity results in recognition rates up to 99.25%. The method in the present research uses structural features and fuzzy logic for classification. We can claim that the character recognition rate achieved for numerals is 92.2%, which is among the best reported.

Conclusions
An OCR system using fuzzy logic has been implemented for Indian numeral recognition from a large number of handwritten numerals. The proposed recognition system performs rotation and scalingin variant. Therefore, it achieves high flexibility for the hand writer to make sketches freely. The feature vector and the mapping vector, which characterizes the numeral is used as input to the recognition system. The output of the system is a decision about the foreign numerals. The advantage of fuzzy sets in Hough transform is that it does not reject any feature in the numeral pattern. Also, the output fuzzy sets enable the system to consider shapes which are suitable candidates for final selection from numerals database by using Manhattan distance as a similarity measurement.
By looking on the recognition results in Table-3, we can find that the minimum accuracy rate is for the numeral '1', the reason is the shapes of writing this number by persons. A vertical line is very rare on images of this number (see fig-9), so, other features may take higher probability in the recognition decision. Also, this numeral contains no circle in its shape, so all membership functions of the circle were rejected through the recognition step. On other hand, we found that the maximum accuracy rate was given to the numeral '9', since it contains a line and a circle (see fig-10), by this, all membership function sets for line and circle have been used in the recognition decision.