Handwritten Chinese character recognition using fuzzy image alignment

The task of handwritten Chinese character recognition is one of the most challenging areas of human handwriting classification. The main reason for this is related to the writing system itself which encompasses thousands of characters, coupled with high levels of diversity in personal writing styles and attributes. Much of the existing work for both online and off-line handwritten Chinese character recognition has focused on methods which employ feature extraction and segmentation steps. The preprocessed data from these steps form the basis for the subsequent classification and recognition phases. This paper proposes an approach for handwritten Chinese character recognition and classification using only an image alignment technique and does not require the aforementioned steps. Rather than extracting features from the image, which often means building models from very large training data, the proposed method instead uses the mean image transformations as a basis for model building. The use of an image-only model means that no subjective tuning of the feature extraction is required. In addition by employing a fuzzy-entropy-based metric, the work also entails improved ability to model different types of uncertainty. The classifier is a simple distance-based nearest neighbour classification system based on template matching. The approach is applied to a publicly available real-world database of handwritten Chinese characters and demonstrates that it can achieve high classification accuracy and is robust in the presence of noise.


Introduction
Handwritten Chinese character recognition (HCCR) has been the topic of much interest, in both research circles and also for practical applications.However, the task of HCCR where the domain is non-constrained (in which the uncertainty is not limited to particular training examples of handwritten characters) is still a problem that poses significant challenges (Du et al. 2014).This is mainly due to the high levels of diversity of both handwriting styles and large character sets.These two aspects make the task of recognition and classification for handwritten Chinese characters much more complex than that of languages which are based upon the Roman or Latin alphabet writing systems (Hildebrandt et al. 1993;Suganthan and Yan 1998).
Chinese characters are used for daily communication by more than 25 % of the world's population, mainly in Asia.In basic terms, there are three main character sets: traditional Chinese characters, simplified Chinese characters, and Japanese Kanji.Indeed, literacy in written Chinese requires a knowledge of thousands of characters, many of which have their own unique shape and structure, but certain distinct characters may actually be visually very similar.In particular, Chinese characters are based on stroke structures and a great many groups of characters are constructed and share the same components.Such characters are easily confused even by humans.The most common Chinese character structures can be divided into five different categories: (1) characters which have a single structure, (2) characters which have a left and right structure, (3) characters which have an upper and a lower structure, (4) characters which have a 'surrounded by ' structure, and (5) characters which have a framework structure (Zhang et al. 2009).Given this level of complexity, differences in writing styles (regular, fluent, and cursive) (Liu et al. 2004), and personal attributes of handwriting, it is easy to appreciate the complexity of the task at hand.
In most existing approaches to HCCR, a series of steps aimed at extracting features or feature information from images is performed (Du et al. 2014;Liu et al. 2004).In addition, such approaches typically also rely on very large training datasets (in the order of thousands of training examples) (Liu et al. 2004;Shao et al. 2014), resulting in models of considerable size and complexity.In this paper, an alternative approach is presented which does not require any feature extraction step.Instead, it relies upon an image alignment technique to bring various examples of characters into correspondence.This means that the resulting classification models are entirely data driven, and overly complex feature extraction steps are avoided.
In addition, metrics based upon fuzzy-entropy are employed to assess the degree of image alignment, offering much flexibility in capturing of the relations between image characteristics, and the ability to model both probabilistic and possibilistic uncertainty.
The image alignment process adopted here is termed congealing (Miller et al. 2000).It is a group-wise image alignment approach for a set of images and is not constrained to subjectively defined 'good' training examples.This approach allows the consideration of a set of images (or more generally, a set of arrays) and translates them with respect to a continuous set of given transformations to make the images more 'similar', according to a particular measure of assessment.
The remaining sections of this paper are organised as follows.Section 2 outlines the existing state-of-the-art work in HCCR and summarises the theoretical basis and concepts of image congealing.Section 3 presents the modified fuzzy image congealing algorithm.Section 4 describes the novel handwritten Chinese character recognition approach using fuzzy image congealing.Section 5 reports on the experiments carried out for fuzzy image congealing for handwritten Chinese characters and shows recognition results.Finally Sect.6, concludes the paper and briefly discusses future work and possible extensions.

Related work
This section includes two parts: the background work relating to HCCR, and that of image congealing.

Handwritten Chinese character recognition
The recognition and classification of handwritten Chinese characters pose a significant challenge for automated methods (Du et al. 2014;Liu et al. 2004;Shao et al. 2014).Indeed the sheer number of characters, intricate complexity of such characters, and variations in writing styles mean that the task can be difficult even for humans (Tai 1992;Plamondon and Srihari 2000).
In mainland China, there are typically two character sets: simplified containing 3755 characters, and traditional containing 6763 characters.These have been formally recognised as an international standard, and the first set is a subset of the second (Tai 1992).However, in Taiwan there are 5401 traditional characters and these are defined in a single standard set.In both the traditional and simplified Chinese sets, around 5000 characters are regularly used.Japan on the other hand has 2965 Kanji characters (many of which are similar to Chinese characters), which are once again formalised in an international standard.There is also a second nonoverlapping set of 3390 Kanji characters.
Chinese characters are ideographs and are composed primarily of a series of straight lines or multiple-line strokes.Quite a few characters contain fairly independent substructures or components, known as radicals.However, very different characters can share common radical components, for example, the character (bei) and character (fen) share the same radical in the bottom half of the character, whilst the character (wang) differs only from the character (yu) only by the short stroke in the right-hand corner.Other examples include the following three characters (bian), (bian) and (bian).They can only can be distinguished from one another by their middle part.This property can pose a problem in recognition, often leading to confusion between distinct characters, particularly where feature extraction/recognition/classification maps similar features in different characters to the same decision.Handwriting further obscures the recognisability of such characters.This makes the task very challenging and has prompted much work in the area (Hildebrandt et al. 1993;Suganthan and Yan 1998).
The task of HCCR has attracted much interest and a number of different methods have been proposed for tackling this problem.Generally, a typical HCCR system implements a pre-processing, segmentation step initially to establish character patterns (Liu et al. 2004), followed by feature extraction to assess the structure type and representation.Since the structure may be represented differently, a variety of recognition approaches can be utilised to classify a given handwritten Chinese character to a particular class.
In the existing literature, almost all of such approaches rely on a certain form of feature extraction and underlying representation (Liu et al. 2004), with various approaches adopted for Chinese characters in this regard (Hildebrandt et al. 1993;Liu and Kim 2001;Umeda 1996).Basically, the approaches can be divided into two different types: those based upon the examining the structural characteristics of the characters (Okamoto and Yamamoto 1999) and those based upon the statistical features of the handwritten characters (Tai 1992).The former focuses upon writing stroke analysis, while statistical methods tend to focus upon features extracted from the shape information.The extraction of features and its subprocesses has a direct impact upon the recognition performance as those features extracted must offer a form of unified representation to build models in the steps that follow (classification/recognition/etc.).
To obtain reliable recognition performance, a divide-andconquer classification approach is common amongst HCCR approaches.This is usually implemented using so-called 'rough classification' and 'fine classification' to decide which types of character structure the approach is dealing with Kato et al. (1999), Umeda (1996).Most existing techniques are variations on this theme of general approaches, although more specific methods (Du et al. 2014;Suganthan and Yan 1998;Wong Wong and Chan 1999) are often used for the recognition and classification step.

Image congealing
The goal of image congealing is to align or reduce the variation within a set of images.Such a technique is simple and relies on iteratively transforming all of the images by a small amount so that they are better aligned with respect to each other (Miller et al. 2000).As a result, all of the training images (and later testing images) can be brought into correspondence.To achieve this aim, a metric or objective function is employed.By optimising the objective function, the images are aligned with respect to a set of allowable transformations.There are two important concepts in this process: (a) the pixel-stack entropy and (b) the transformation matrices.
Given a 'stack', I, of n images of size m pixels, a single pixel value in this stack is denoted Each image, I ∈ I, is independently transformed by an affine transformation U. The transformation for the jth image is denoted U j and the transformed pixel stack is denoted x i .
The image congealing algorithm seeks to iteratively minimise the entropy across the stack of images by transforming each image by a small amount with respect to a set of possible affine transforms.The transform that gives rise to the greatest decrease in entropy is discovered via a hill-climbing approach.At each iteration of the algorithm, the goal is to where is the probability of the kth element of the multinomial distribution in x j i .This process corresponds to minimising the total joint entropy of pixels across the stack of images and can be reformulated simply as where H (D i ) is the entropy across the distribution field of probabilities for the ith pixel (Learned-Miller 2006).The minimisation can be performed by finding the transformation matrix U, for each image, that maximises the log-likelihood of the image with respect to the distribution of pixels across the stack.
The transformation for the jth image, as denoted by U j is composed of component transforms: x-translation (t x ), ytranslation (t y ), rotation (θ ), x-scale (s x ), y-scale (s y ), xshear (h x ), and y-shear (h y ).The affine transformation matrix U j can then be built such that After each iteration the scale of all the transforms, U 1 , . . ., U n , are readjusted by the same amount so that the mean log-determinant of the transforms is 0; that is, the set of all transforms has zero-mean.The rationale for this step is to prevent the algorithm from succumbing to a situation where all of the images are shrunk to a point where they are no longer representative, as a result of an ever decreasing value of entropy.
Once the congealing algorithm has converged, or has reached a predefined number of iterations, the congealed versions of the input images can be revealed by multiplying the original images by their associated transformation matrix.

Fuzzy-entropy-based image congealing
Image congealing has been employed for a variety of different tasks and has been the subject of a number of different modifications (Cox et al. 2009;Learned-Miller et al. 2005;Learned-Miller 2006).An extension to the image congealing approach that uses fuzzy-entropy (FE) as an objective function is described in Mac Parthalain and Strange ( 2013) and uses a definition of FE that is derived from the work in Hu et al. (2006) and Kosko (1986).Several different definitions for FE have been proposed (Al-Sharhan et al. 2001), but this work utilises an approach based on similarity relations, which is described below.

Similarity relation-based fuzzy-entropy
As the name suggests this definition of fuzzy-entropy is based on fuzzy-similarity relations.As such it collapses to classical information entropy (Shannon 1951), when the similarities between objects (image pixels in this case) are crisp.This ensures that the approach subsumes the original Boolean algorithm as well as offering the ability to model fuzzy uncertainty.Also, by adopting such an approach, no additional subjective thresholding information or 'fuzziness' parameter is required; only the information contained within the data is utilised.Formally, for a non-empty finite set X , R is a binary relation defined on X, denoted by a relation matrix M(R): where r jk ∈ [0, 1] is the (similarity) relation value of x j i and x k i in a particular pixel stack x i .Note that a crisp equivalence relation will generate a crisp partition of the universe, whereas a fuzzy equivalence relation induces a fuzzy partition which subsumes the crisp condition as a specific case.This property is important as it ensures that when all relations are crisp that the resulting partition is also crisp.In other words, crisp or discrete object values (non real-valued) will result in a crisp/discrete similarity matrix, populated only by absolute similarity values of 0 or 1.
For a finite set U, A is a fuzzy or real-valued attribute set, which generates a fuzzy equivalence relation R on U. Given a fuzzy-similarity relation matrix M(R), as previously defined, the fuzzy equivalence class generated by [x j i ] where i ∈ [1, . . .m] and j ∈ [1, . . .n] R can be defined by: Note that Eq. ( 3) is a conventional short-hand representation of a discrete fuzzy set, indicating that the membership value of the ith element of the jth image is r ji where i ∈ [1, . . .m] and j ∈ [1, . . .n].A number of different similarity relations can be used to induce such a matrix, but three that are particularly useful for this work and defined in Eqs. ( 7), (8), and ( 9).The cardinality of [x The uncertainty measure of the information embedded in the data or fuzzy-entropy of the fuzzy equivalence relation is then defined as: where This definition of fuzzy-entropy directly offers a fuzzy information metric that may be used for the image congealing problem.Recall the concept of 'image stack' introduced earlier.By taking all of the pixel grey-level values across the stack, a metric based upon the classical entropy is used as an assessment of alignment.By modifying this metric, the fuzzy-entropy metric is now employed in its place.
The first step in formulating the FE metric is to induce a fuzzy-similarity relation matrix.This is also achieved using the pixel grey-level values in this particular case, although there are other image characteristics that can be used (Learned-Miller 2006).The similarity relation matrix is essentially a symmetric matrix which allows the comparison of all of the objects to each other.The matrix can be constructed by employing a fuzzy-similarity relation to determine the pairwise similarity of objects.
Let R P be the fuzzy-similarity relation induced by a pixel P: μ R a (x, y) is the degree to which objects (image pixels in the 'stack') x and y are similar for the indexed pixel a.As mentioned previously this may be defined in many ways, thus allowing much flexibility in how the matrix is constructed.The fuzzy-similarity relations defined in ( 7), ( 8) and ( 9) are typical of those that may be used.

Fuzzy-entropy for image congealing
What image congealing seeks to do is to iteratively minimise the fuzzy-entropy E across all of the stacks of pixels for the whole of each image.This is done by transforming it with respect to a set of possible affine transforms.The aggregated measurement is essentially the summation of the fuzzy entropies amongst all m pixel stacks: where x i is the transformed pixel stack as defined previously.
One possible way of doing this can be described as follows.
Firstly, a transformation matrix is generated for each image in the training set.Following that each of the parameters related to the transforms are changed iteratively.The fuzzy-entropy metric is then used to assess whether the parameter modification has resulted in a decrease in the entropy.If that is the case, the transformation is retained and the matrix is modified in that direction accordingly.If, however, it results in an increase in entropy, then the transformation is reversed and the next transform is applied.The congealing process will stop when the fuzzy-entropy value no longer continues to fall or the maximum number of iterations is reached.

Fuzzy image congealing for handwritten Chinese character recognition
In this section, the novel approach for handwritten Chinese character recognition using fuzzy image congealing is described.The fuzzy image congealing process is employed not only in the training phase to construct character models, but also when a test character is presented for classification.
The approach is illustrated in Figs. 2 and 3.
During the training phase, it is desirable to be able to bring all of the instances of each particular character into correspondence.This is done by aligning each character to all of the other training instances of the same class; that is, a set of training character images are aligned using the fuzzyentropy-based congealing algorithm for that particular class.This process is then repeated for all training classes, which results in image models for each handwritten character.Both the training and application of such models are described below followed by an algorithmic complexity analysis

Model building
Compared with the feature extraction-based techniques (Liu et al. 2004) or other techniques such as those in Liu and Kim Fig. 2 Fuzzy congealing-based HCCR (2001) and Suganthan and Yan (1998) for building classification models, the mean character image method employed here is much more straightforward and does not require any subjective judgement or decision with respect to the images under consideration.Moreover, since the character instances of a particular class have been aligned to be more similar to each other, once the alignment has taken place, a 'mean image' can be calculated from all of the congealed images.Such a mean image is, therefore, a wholly data-driven model.
For the model building step, mean images of each congealing iteration are collected for use as matched templates.Such mean images from different iterations rather than a single mean image obtained at the end of training congealing process are necessary because by aligning all of the images and then using the final mean image output, much of the variation that is useful for classifying test images can be retained.This is due to the fact that the alignment process when used to generate only a single mean image tends to result in a regularisation of all of the transformations and, therefore, removes any useful variation.

Recognition
The recognition sub-system can be seen in Fig. 3.As mentioned previously, a further fuzzy image congealing process is carried out when a new character is presented for classification.
The reason this new congealing step is performed during the recognition phase is that in general the test image will not initially be in correspondence with the training images.Since the same character written by different people can have quite different characteristics (size, shape, style and so on) it is necessary to align it so that it can be consistently classified.Once this has been completed, the similarity between the congealed images can be computed.Note that since the training images are already in correspondence with each other, only a small number of congealing iterations are required to bring the test image into correspondence with these.
To calculate the similarity between a test character and the classification models, a series of steps are necessary.These steps are shown in Fig. 3.During the congealing process for the training phase, k mean images are saved for each character after every iteration.Then, the test image is congealed with the mean image models of a particular character.Finally, a nearest neighbour classifier using a Euclidean distance metric is used to classify the test image (though other distance metrics may also be used for this purpose): where || • || represents the absolute distance.This process is then repeated for each model character, respectively.The model with the smallest distance to the test character is then used for classification.

Complexity
The complexity of the original congealing algorithm based upon information entropy (Shannon 1951) is linear with respect to the number of parameters (related to the number of image transformations).It is clear that the incremental update involved happens for m − 1 images and the update to each image is performed in constant time with respect to the (constant) number of parameters or transforms.This can be summarised as O(n − 1 × m × t) where n, m, and t relate to the number of images, pixels, and transforms, respectively.
Unfortunately, as noted previously, the fuzzy-entropy metric requires the additional n × n calculation for the similarity relation per pixel stack, over all image pixels.This results in added complexity of O(n−1×(m−1) 2 ×t), meaning that the approach is quadratic with respect to the number of pixels.The additional overhead means that the fuzzy-entropy-based classifier system proposed here may not perform as quickly as the techniques based upon feature extraction methods or indeed the version that is based upon traditional information entropy.Initial thoughts on addressing this issue are discussed briefly in the conclusion.

Experimental evaluation
This section details the experiments conducted and the results obtained for the novel HCCR approach using fuzzy-entropy congealing algorithm.The handwritten Chinese characters used in a series of experiments are drawn from the HCL2000 dataset (Zhang et al. 2009).

Data and experimental setup
The HCL2000 dataset (Zhang et al. 2009) is a large-scale offline database which contains 3755 frequently used simplified Chinese characters handwritten by 1000 different subjects.The 3755 characters are formalised as the Chinese National Standard GB2312-80.Each character image is 64 × 64 pixels and is binary in format, although congealed models contain grey values in the range [0,255].
A large number of characters are commonly used in Chinese writing systems.Moreover, there are several types of structure for Chinese characters.For the experimentation detailed here, 80 different characters (or character classes as each character may be written in a variety of forms) are used.These are representative of the aforementioned types of structure and are selected from the list of most commonly Table 1 Chinese character data used characters in modern Chinese.A selection of these can be seen in Table 1.
For the training and model construction phase, 20 different handwritten Chinese character instances of the same class are randomly chosen from the dataset to perform image alignment using fuzzy-entropy-based congealing.The fuzzysimilarity relation which was used for training is that shown in Eq. ( 8), where a is defined as a particular pixel stack.For each character model built, the total number of iterations was set to a value of 15.After the fuzzy congealing step has been completed, it results in 15 'mean' images for each character of the training data.
For the recognition process, 15 mean character training images of a particular class are then congealed with the test image.The testing data consisted of 50 characters (5 instances of each class) which were randomly selected from the same dataset.Note that the number of congealing iterations in this second alignment process is only 3 since most of the 15 training images are mean samples of the training alignment process.
Whilst carrying out the testing phase, a more strict similarity relation is used (Eq.7).The reason for doing so ensures that the classification has more harsh boundaries and that only very similar images can be classified into the correct class.For the fuzzy-similarity relation Eq. ( 7) is used.
To test the robustness of the approach, in the presence of noise, a separate series of experiments was also carried out.Ten character classes of three test samples per character (30 test characters in total) had Gaussian white noise artificially added to the images.The characters used for this are: (de), (zhong), (guo), (an), (wo), (ming), (tong), (bu), (da).The classification accuracies are then compared for different variational intensities of noise.

Results
Since the generation of mean images is a key step in the proposed approach, and plays an important role as the classification template for the recognition process, examples of training samples for 3 characters: (1) (2) (tuan), (3) (yin), before and after fuzzy-entropy-based

Classification accuracy
Although a simple nearest neighbour classifier is employed for this work, it proves quite effective as the 90.50 % average classification accuracy (weighted by the number of instances of each class) shown in Table 2 demonstrates.This is con-  2014;Liu et al. 2004).Indeed, the framework and single structure characters, prove easiest to classify with a rate of 100 %.The upper and lower and surrounded-by characters are a little more challenging, however, with accuracies of 85 and 83.33 %, respectively.Most of the confusion in the classification and recognition phase relating to the individual characters of these two types of structure happens between characters which are very similar to one another.This indicates that additional effort needs to be focused on the removal or at least the significant reduction of such confusion in future work.
An excerpt from the full confusion matrix for those characters which are most problematic for the approach is shown in Table 3.It can be seen that (guo) is most often confused with the characters (tuan), (yin) and (tong).This misclassification can be explained by the similarity of these characters in terms of their structure types.The same is true for the character (fen), which is confused with (bei).Indeed there seems to be a level of symmetry between these two characters in terms of confusion but again the structures are similar.Rather less intuitive is the confusion between the character (ban) and (bei) as these are drawn from different structures (left-right and upper and lower, respectively).An in-depth investigation into this remains an important further research.
As can be seen in Table 3, those characters which belong to the same character structure are easily confused and can be classified incorrectly.For example, the character (guo), (tong), (tuan) and (yin) belong to the 'Surroundedby' type structure, since the character (guo) looks similar to the other 3 characters.The classification accuracy of the characters of the 'Surrounded-by' type structure is indeed the lowest in Table 2 and once again emphasises the challenge facing HCCR systems.

Robustness
A subset of the original data is used for this series of experiments as mentioned previously.To illustrate the effects of noise, an example of the character (de) is shown in Fig. 6 with different intensities of artificially added noise.Despite an initial fall in accuracy, it is encouraging to note that even with extreme levels of added noise, the classification accuracy remains stable, as shown in Fig. 7.This robustness may stem from the use of mean image templates as the action of transforming all images until they are aligned in some ways mitigates this.

Conclusion
This paper has proposed an image-only model for performing handwritten Chinese character recognition.The motivation for such an approach stems from the desire to employ a purely data-driven approach, and therefore avoid any associated As such it also helps to avoid generating large and complex models which require enormous amounts of training data.Since handwritten Chinese characters are much more complex than those of Latin/Roman writing systems, such a step is important in ensuring robust and accurate classification whilst simultaneously avoiding the overhead in dealing with large numbers of data samples.
Although the approach detailed in this paper offers important advantages over existing methods, there are a number of areas which require further attention.The complexity of the approach (due to the computation of fuzzy-similarity relations) needs to be addressed.To tackle this, more computationally efficient ways of calculating the fuzzy-entropy for the image stack may prove useful.The definition of fuzzyentropy used here is based on similarity relations, but an alternative distance-based interpretation could also be implemented.Also, it would be interesting to investigate all current similarity measures to discover if there is a particular definition which may offer similar performance but with reduced computation.Another aspect of the approach which would benefit from further attention is the classification phase.Currently classification is carried out using a simple but effective template matching nearest neighbour approach.However, the density of the transforms may provide more useful information as noted in Miller et al. (2000).
Whilst the application of the proposed approach here is limited to handwritten Chinese characters, it could equally be applicable for other types of imaging (e.g.medical imaging Chen et al. 2014, remote sensing Li et al. 2014, and planetary imaging Shang and Barnes 2013 etc.).Indeed, there is no reason why it could not also be adapted for the handwriting of other writing systems such as Bangla, Thai script, Arabic or others.

Fig. 1
Fig. 1 Image congealing-a set of pixels drawn from the same location in the set of n images

Fig. 5
Fig. 5 Mean images of handwritten Chinese characters before and after fuzzy image congealing: left-hand images are the mean images prior to alignment and right-hand images are the mean images after congealing

Fig. 7
Fig. 7 Classification accuracy in terms of different levels of noise

Table 2
Classification accuracies for types of Chinese characters

Table 3
Excerpt from confusion matrix for difficult cases Character (de) with increasing levels of added noise: a-g show the intensities 10-70, respectively