Moment invariant-based features for Jawi character recognition

ABSTRACT

The recognition of Jawi characters is important because Jawi characters were widely used in the Southeast Asian countries for 600 years [3]. The Jawi characters were used for writing Malay language, and can be found on many tombstones, currency, royal decrees, books, and so on. Furthermore, almost 15,000 manuscripts are written in Jawi with various contents, namely, tales, theology, and poems that can be found in museums all over the world in, for instance, England, the Netherlands, Malaysia, Indonesia, and many other countries. The ancient manuscripts not only hold a record of the history and culture of Southeast Asian countries, but also contain medical prescriptions, military strategies, navigation techniques, and other useful knowledge [4].
Research in the digital image and computer vision field has yielded optical character recognition (OCR) for Chinese [5], Arabic [6], [7], Indian [8], and Latin characters [9], but no OCR system has yet been presented for Jawi characters. An OCR application framework requires four steps, namely: (1) preprocessing [10], [11], [12]; (2) segmentation; (3) feature extraction [13], [14]; and (4) pattern classiffiication [15]. At present, few algorithms for Jawi character recognition exist and these recognition algorithms have only been tested on a limited number of Jawi characters. For instance, they have been tested only on the isolated characters [16]. In recent years, character recognition of Arabic variants, such as Farsi and Urdu, has gained attention. However, less attention has been paid to Jawi characters compared with Urdu and Farsi. Thus, the development of a Jawi character recognition algorithm with a complete dataset is indeed required so the ancient Jawi manuscripts can be utilized in easier ways. Table 2 shows the details of the accuracy levels of character recognition methods using pattern classifiers. The method proposed by Razak that used Hamming classification achieved the highest accuracy levels, with 97% recognition rate, but it was not robust to scaling operations [17]. The methods in Table 2 need a training process. In common, the number of training characters is proportional to the recognition accuracy; the greater the number of training characters, the higher the recognition accuracy is. Moreover, another problem of a pattern classifier established using local optima solutions, such as neural networks, is that it may decrease the accuracy level [18]. On the other hand, methods such as Support Vector Machine 1713 (SVM) and Hidden Markov Models (HMM) that are based on global optimum solutions, require longer time and more memory to execute the program. The Adaboost algorithm fails due to noise. In Adaboost, there are two points of weakness: the learning process and classification process [19]. After all, the result of each pattern classifier is influenced by the feature selection [20]. The method proposed by Heryanto et al. was able to reach 95.67% recognition rate, but the testing process reached an accuracy of 73.59% [21]. Machine learning algorithms such as Artificial Neural Network (ANN) and SVM have been used to classify a pattern, and widely applied in character recognition [24]. It is used to perform the classification or recognition in a phase known as the training phase. The training method categorizes the extracted features into several classes of similar patterns. The ANN has been used since the 1980s, and at the end of 1990s SVM was introduced as new and better classification method [25]. The drawback of machine learning is the method requires experimentation method to model the training phase [26]. SVM as part of machine learning method shows more superior performance in character recognition system than other methods such as ANN and K-nearest Neighbor (KNN) [27]. However, the SVM processes information as a holistic pattern and fails in training local pattern. Furthermore, SVM consumes more storage and requires more complex computation than other learning algorithms such as ANN and HMM. Another disadvantage of SVM is the requirement to determine the kernel methods.
In this article, we propose a novel technique for Jawi character recognition system, and we refer it to as the Tree Root (TR) Algorithm. The algorithm does not use complex mathematical computation, but performs simple classification process and requires less storage memory. It does not require training process; it saves feature template for recognizing process. The method was tested with a dataset of Jawi handwriting with the complete character set: 36 isolated, 27 initial-form, 27 end-form, and 35 middle-form characters. The following section discusses the proposed method. In section three, we discuss the experimental process of the proposed algorithm. Section four presents and discusses the results, and finally, the conclusion is presented in section five.

PROPOSED METHOD
In digital image processing and computer vision, the moment invariant is mostly used for describing object characteristics. There are two types of feature extractions based on moment invariants: contour-based or shape-based moment invariants [28] and region-based moment invariants [29]. Moment invariants are very useful for extracting object features with unique characteristics regardless of location, size, and orientation. Hu proposed seven invariant moments, known as Geometric Moment Invariants (GMI) that are invariant toward translation, rotation, scaling, and mirroring as follows [30].  (1), we developed the tree root (TR) algorithm. In the algorithm, denotes the ℎ moment, with = {1,2,3,4,5,6,7} and refers to a group of characters with the ℎ moment and moment value . For example, the character group of first moment with = 1 is denoted as 11 . The TR algorithm is explained as follows. , if is unique, then save the moment value and and the character is unique and recognized. Otherwise, = + 1. 6. Check value, if = 7, the character in this group is unrecognizable. Otherwise, return to step 4.

RESEARCH METHOD
In this section, we present the research method for testing the TR algorithm. The experiment was conducted in three stages: (1) data collection and template production; (2) feature extraction process; and (3) testing.

Data collection and template production
The Jawi characters were collected according to the following steps: (1) write the characters on the paper; (2) scan the paper and save the character image; (3) crop the character part in the image, by positioning the cropped part in the middle of the image; and (4) normalize the images into 160×140 pixels. The Jawi character template was prepared in two forms: binary and thin. Examples of binary template Jawi characters are shown in in Figure 1, while examples of thin template Jawi characters are shown in Figure 2.

Feature extraction process
In the feature extraction process, (1) was used to calculate all moment values of the character images. The moment values were stored and used as feature in recognition process. Based on these values, the TR algorithm recognizes the characters. The moment values of the character were classified using the proposed method.

Testing
The TR algorithm was tested on sets of rotated and scaled characters, to find out whether the algorithm can recognize the rotated and scaled Jawi characters. The characters were rotated 90o and 180o to the right and scaled by scale factors of 2 and 0.5. Fourteen characters were chosen, and each character was chosen to represent each shape group of the Jawi alphabet. We used seven characters from the binary template: isolated jim, end-form ha, middle-form ya, initial ga, initial ng, isolated pa, and end-form pa, and seven characters from thin template, consisting of isolated alif, isolated kaf, middle-form haa, middle-form ya, end-form ra, middle-form ha, and end-form va.
Furthermore, The SVM and Euclidean distance (ED) as classifier were applied to compare the performance of the proposed method. We applied the SVM classifier and ED to the moment values  (1), and then compared the results with that of the proposed method. In data training for SVM and ED, we used features of 125 characters for each binary and thin template. In testing stages, we used both rotated and scaled characters. In SVM training, we used one against all strategy for classifying each class of character. After training, we tested the classified class using the testing characters. The ED value was computed between the features, i.e., the moment values of binary or thin template of training and testing character. The ED value was sorted, and the smallest ED value indicated the recognized character.

RESULTS AND ANALYSIS
The TR algorithm classified the Jawi characters into seven groups. The first group consisted of one, i.e., the first moment value. In this case, the character is represented by one, i.e., the first moment values. The second group consisted of two, i.e., the first and the second moment values. In this case, the character is represented by two, i.e., the first and the second moments. Similar rules are applied to the remaining groups. Within the same group, each character is differentiated by a unique value of its highest moment. Figure 3a shows the percentage recognition rate in each "moment group" of binary template characters. Based on the results, there was one character that can be represented by two moment, i.e., 0.8%. Five characters were represented by three moments, or 4%. The characters that can be recognized by four moments were 15 characters or 12%. There were 21 characters recognizable by five moments, or 16.8%. Furthermore, recognizable characters by six and seven moments were 32 characters (25.6%) and 39 characters (31.2%), respectively. From a total of 125 characters, there were twelve characters that cannot be recognized as unique characters. The percentage of unrecognizable characters using Hu's moment invariant features is 9.6%. Figure 3b shows the recognition rate of thin template characters. There were two characters that can be represented by two moments or 1.6%. The percentage of recognizable characters based on three moments was 4.8% or 6 characters from the total of 125 characters. Up to 14 characters or 11.2% and 30 characters or 24% can be recognized by four and five moments, respectively. Furthermore, the recognized character with six moments was 27 characters or 21.6%, as the recognition rate with seven moments was 30 characters (24%). Sixteen characters were not recognizable as unique characters, which is 12.8% of the total of 125 characters.

Recognition results of binary template characters
(a) (b) Figure 3. Percentage of recognition in each "moment group" of: (a) binary template characters, (b) thin template characters Tables 3 and Table 4 show the test results with binary and thin characters, including rotated and scaled characters. Seven characters were chosen as the testing character, and shown in 'input character' column. Each character was rotated by 90 o and 180 o and was scaled by two scaling factor: 0.5 and 2. The unrecognized characters of binary template as shown in Table 3 are Jim initial-form (rotated 180 o ), Ha end-form (rotated 180 o ), P end-form (rotated 90 o ), G initial-form (0.5 factor scaled), and Ng initial-form (0.5 factor scaled). Table 3 shows that the proposed method can recognize eleven rotated and twelve scaled characters from total 28 characters.

Testing with rotated and scaled characters
As shown in Table 3, character Jim in initial form has different moment value for each scaled factor; the character ‫جـ‬ with scaled factor of 0.5 has the moments 1, 4, 12, 10, 21, . . ., while the character ‫جـ‬ with scaled factor of 2 has the moments 1, 4, 12, 10, 22, . . .. However, because the moment value of each scaled character matches the saved feature, that was the first four moments, 1, 4, 12, 10, the character was recognized.
In addition, Table 4 shows that Kaf isolated-form, Haa middle-form, R end-form, Ya middle-form, Ha end-form, V end-form, and alif isolated-form are the unrecognized characters of thin template. Table 4 presents nine rotated and eight scaled characters form 28 characters succeed to be recognized. These results suggest that the TR algorithm is robust to rotation and scaling operations, as will be discussed in the following.  Table 4, character ‫ـيـ‬ (Ya middle-form) was rotated by 90•, and has the moment value 1,5,21,20,23,42, and character ‫ـيـ‬ was rotated by 180• has the moment value 1,5,21,20,23,41, thus both characters are recognized as ‫,ـيـ‬ because the feature are 1, 5, 21, 20. The different moment value at the fifth to seventh moment is ignored, because it was not saved. The proposed method resulted in better recognition rate on binary template than thin template. Most characters in binary template become unique at the sixth and seventh moments while most characters in thin template become unique in the fifth, the sixth, and the seventh moments. Table 3 and 4 demonstrates that the TR algorithm can recognize the rotated and scaled characters, although these characters have the difference moment values at the latest moments. The features contain not all moment value combinations, but only the unique ones.

Comparison with other classification methods
In this subsection, we present comparison result of the proposed method with other benchmarking classification methods. Some of the benchmarking pattern classifiers are support vector machine (SVM) and Euclidean Distance (ED). Table 5 shows the results of recognition using SVM classifier and ED. The SVM classifier used 125 characters in data training phase. By using binary template, SVM failed to recognize the Jawi character. None of testing character was recognized, thus, the recognition accuracy of binary template was 0%. By using thin template, SVM recognized three characters, thus, the recognition accuracy was 10.71%. The SVM had better performance on thin characters than binary characters. On the other hand, the proposed method had better recognition rate on binary characters than thin characters.
ED achieved better result than SVM classifier but less than the proposed method. By using binary template, ED recognized eleven characters, thus, the recognition accuracy was 39.29%. On thin template, ED had less accurate than binary template by recognizing 4 characters or 14.29%. Training phase is not required by the proposed and ED method, instead both methods directly recognize the characters by matching the features, i.e., the moment values of each character. SVM classifier has lower recognition accuracy. Comparing to the proposed method and ED that did not require more dataset to perform training process, SVM failed in recognizing Jawi character with only one dataset. This lower performance was caused by the lack of data training for SVM classifier. In machine learning method, the used of less training data would decrease the method's performance. On the other hand, the proposed method was not affected by the number of training data because it did not need training stages, and use the features directly in recognition process.

CONCLUSION
In this article, we have presented a novel feature extraction and recognition technique for Jawi characters based on moment invariant features, which is called the Tree Root (TR) algorithm. This algorithm assigned each character a unique combination of Hu's moment values. The TR algorithm was applied to two character templates, binary and thin, each consisting of 125 Jawi characters. In the binary template, the TR can recognize 90.4% of the characters, while in the thin template it can recognize 87.2% of the characters. The results showed that the TR algorithm successfully recognized rotated and scaled characters. The proposed method achieved higher recognition rate, compared with SVM classifier and ED using the same testing character.