Introduction

Nowadays, we are being influenced a lot by computers and almost all the important processing is being done electronically. Keeping in mind today’s demand, it becomes important that the transfer of data between human beings and computers should be simple and fast. Document analysis and recognition plays a major role in data transfer between human beings and computers. Optical character recognition (OCR) is the most essential part of a document analysis system. OCR has two streams: offline OCR and online OCR. In online handwriting recognition, data is captured during the writing process with the help of a special pen and an electronic surface whereas offline documents are scanned images of prewritten text, generally, on a sheet of paper. Offline handwritten character recognition, usually abbreviated as Offline HCR, is the process of converting handwritten text into machine processable format. Research work has been continued in this field since the late 1960s, throughout the world. It is still an active area of research as the problem involved is complex in nature. Till now, no solution has been offered that solves the problem correctly and efficiently as far as Indian scripts are concerned. Though many researchers have worked to recognize the characters of Indian scripts but the problem of interchanging data between human beings and computing machines is still a challenging one. Most of the published work on Indian scripts recognition deals with printed documents and a few articles deal with handwritten character recognition problem. Handwriting recognition provides a methodology for improving the interface between the user and the computer as it enables computers to read and process handwritten documents. Offline handwriting recognition is significantly different from online handwriting recognition, because here, stroke information is not available [1, 2]. Research in offline handwritten character recognition is popular owing to its practical usage such as recognition of text in bank cheques, recognition of prescription by doctors, automatic pin code reading of postal mails etc. There are four major stages in handwritten character recognition problem: digitization, pre-processing, feature extraction and classification. The block diagram of handwritten character recognition system is given in Fig. 1. Before feature extraction phase, we have performed digitization and pre-processing activities on character image. Digitization is the process of converting paper based handwritten Gurmukhi character into electronic form. The electronic conversion is accomplished by using a procedure whereby a character image is scanned and an electronic representation of the original image of character, in the form of a TIFF image, is produced. Digitization produces the digital image which is fed to the pre-processing phase. In this phase, the gray level character image is normalized into a window of size 100 × 100 using nearest neighborhood interpolation (NNI) algorithm. After normalization, we produce bitmap image of the normalized image. Now, the bitmap image is transformed into a thinned image using parallel thinning algorithm proposed by Zhang and Suen [3]. Feature extraction is an important component of a character recognition engine. The main aim of feature extraction phase is to detect various features of digitized character image, which maximized the recognition accuracy. The extracted features should be able to assign a unique classification score to a character. Classification is the decision making stage of an Offline HCR system. This stage makes use of the features extracted in previous stage for deciding the class membership. Two classifiers, namely, k-NN and SVM have been considered for recognition purpose. As such, a well-defined feature extraction algorithm makes the classification process more effective and efficient. For recognition of patterns appearing in each such image, we have proposed two feature extraction techniques, namely, parabola curve fitting based features and power curve fitting based features.

Fig. 1
figure 1

Block diagram of offline handwritten character recognition system

Researchers have used different types of features for character recognition and consequently different feature extraction methods have surfaced for representation of characters, such as zoning, diagonal, directional, transition, intersection and open end points, gradient and chain code features etc. Hanmandlu et al. [4] have reported zoning features for handwritten Hindi numerals. They have divided the input image into 24 zones in their work and compute the vector distance for each pixel position in the grid from the bottom left corner and normalize these distances to [0, 1] in order to obtain the features. Kumar et al. [5] have achieved 94.29 % accuracy for offline handwritten Gurmukhi character recognition with intersection and open end points as features and SVM with polynomial kernel as the classifier. Sharma and Jhajj [6] have proposed the zoning feature extraction technique for extracting features of the characters in Gurmukhi script. Sethi and Chatterjee [7] have presented a Devanagari hand-printed numeral recognition system. Bansal and Sinha [8] have proposed a technique for complete Devanagri script recognition. Sharma et al. [9] have proposed a directional chain code features based quadratic classifier and obtained 80.36 % accuracy for handwritten Devanagari characters. Pardeep et al. [10] have used diagonal feature extraction technique for handwritten character recognition system. Rajput and Mali [11] have reported chain code features for Marathi handwritten numeral recognition and they achieved 98.15 % recognition accuracy. Rodriguez and Perronnin [12] have reported gradient histogram features for word spotting in handwritten documents. Basu et al. [13] have proposed a hierarchical approach for handwritten Bangla characters recognition. Garain et al. [14] have achieved an accuracy of 96.30 % for Bangla handwritten character recognition. Roy et al. [15] have proposed a system for automatically sorting of the postal documents. They have employed a two-stage Multi-Layer Perceptron (MLP) based classifier to recognize Bangla and Arabic numerals. Sharma et al. [16] have developed an online handwritten Gurmukhi script recognition system. Kumar et al. [17] have presented a good review on handwritten Indian scripts recognition systems. Ashok and Rajan [18] have presented a handwritten character recognition system using RBF network. Pal et al. [19] dealt with recognition of offline handwritten Bangla compound characters using MQDF. Roy et al. [20] have proposed a scheme for lexicon-driven bi-lingual (Bangla and English) city names recognition for Indian postal automation. Kumar [21] has brought in an artificial intelligence based technique for machine recognition of handwritten Devanagari script. Pal et al. [22] have put forth an offline handwritten Oriya script recognition system. Pal et al. [23] have assimilated a comparative study of handwritten Devanagari character recognition. Bhattacharya et al. [24] have proposed a scheme for Bangla character recognition. They have achieved a recognition accuracy of 94.7 % and 92.1 % for training and testing, respectively. Lehal and Singh [25] have developed a complete recognition system for printed Gurmukhi script, where connected components are initially segmented using thinning based approach. Jindal et al. [26] have provided a complete recognition system for recognition of degraded printed Gurmukhi script documents. These works have motivated authors to propose two efficient feature extraction techniques, namely, parabola curve fitting based features and power curve fitting based features for offline handwritten Gurmukhi character recognition.

Gurmukhi Script and Data Collection

Gurmukhi script is the script used for writing the Punjabi language. The word Gurmukhi has been derived from the Punjabi term “Guramukhi”, which means “from the mouth of the Guru”. Gurmukhi script is the tenth most widely used script in the world [27]. Gurmukhi script has three vowel bearers, thirty-two consonants, six additional consonants, nine vowel modifiers, three auxiliary signs and three half characters. Writing style of Gurmukhi script is from top to bottom and left to right. In Gurmukhi script, there is no case sensitivity. The character set of the basic 35 akhars of the Gurmukhi script is given in Fig. 2. In Gurmukhi script, most of the characters have a horizontal line at the upper part called headline and characters are connected with each other through this line.

Fig. 2
figure 2

Gurmukhi script character set

For the present work, we have collected samples of isolated handwritten Gurmukhi characters from one hundred different writers. These writers were requested to write each Gurmukhi character.

Proposed Feature Extraction Techniques

We propose two feature extraction techniques, namely, parabola curve fitting based features and power curve fitting based features, in this work. First time, we have used these features for character recognition task. These techniques have been compared with other recently proposed feature extraction techniques, namely, zoning, diagonal, directional, transition, intersection and open end points, gradient and chain code features. Two classifiers, namely, k-NN and SVM have been considered in order to perform these comparisons. The system first prepares a skeleton of the character as shown in Fig. 3a and b so that meaningful feature information about the character can be extracted.

Fig. 3
figure 3

a Digitized image of Gurmukhi character () b thinned image of Gurmukhi character ()

Parabola Curve Fitting Based Features

The thinned image of a character is divided into n (=100) zones. A parabola is then fitted to the series of ON pixels (foreground pixels) in each zone using the least square method. A parabola \( y = a + bx + cx^{2} \) is uniquely defined by three parameters: a, b and c. For each zone, a parabola is fitted using least square method. Values of a, b and c are calculated using Least Square Method. Parabola curve fitting based feature set elements corresponding to Gurmukhi character ( ) as shown in Fig. 4, are given in Table 1.

Fig. 4
figure 4

Parabola curve fitting based feature extraction

Table 1 Parabola curve fitting based feature values for the Gurmukhi character () shown in Fig. 4
$$ \begin{aligned} &y = a + bx + cx^{2} \\& \sum y = \, na + b\sum x + \sum {x^{2} } \\& \sum {xy} \; = \;{\text{a}}\sum {x + b} \sum {x^{2} + c} \sum {x^{3} } \\& \sum {x^{2} y} = a\sum {x^{2} } + b\sum {x^{3} } + c\sum {x^{4} } \\ \end{aligned} $$

As such, this will give 3n features for a given bitmap.

The steps that have been used to extract these features are given below.

Step I: Divide the thinned image into n (=100) number of equal sized zones.

Step II: For each zone, fit a parabola using the least square method and calculate the values of a, b and c (Fig. 4).

Step III: Corresponding to the zones that do not have a foreground pixel, set the values of a, b and c to zero.

Step IV: Normalize the feature values in the scale [0, 1].

Power Curve Fitting Based Features

The thinned image of a character is again divided into n (= 100) zones. A power curve is fitted to the series of ON pixels (foreground pixels) in every zone using the least square method. A power curve of the form \( y = ax^{b} \) is uniquely defined by two parameters: a and b. For each zone, a power curve is fitted using least square method. Parabola curve fitting based feature set elements corresponding to Gurmukhi character ( ) as shown in Fig. 4, are given in Table 2. Thus the values of a and b are calculated as follows:

Table 2 Power curve fitting based feature values for a Gurmukhi character () as shown in Fig. 4
$$ \begin{aligned} &y = ax^{b} \\ &\log y = \log \;a + b\;\log x \\&{\text{Put }}\log \, y = \, Y, \, \log \, a \, = \, a \, \& \, \log \, x \, = \, X \\& {\text{So}}, \, Y \, = \, a \, + \, b \, X \\& \sum Y \; = \, na \, + \, b\sum X \\&\sum {XY} \; = \, A\sum X + b\sum {X^{2} } \\ \end{aligned} $$

These parameters will give 2n features for a given bitmap.

The steps that have been used to extract these features are given below.

Step I: Divide the thinned image into n (= 100) number of equal sized zones.

Step II: In each zone, fit a power curve using the least square method and calculate the values of a and b.

Step III: Corresponding to the zones that do not have a foreground pixel, set the value of a and b as zero.

Step IV: Normalize the feature values in the scale [0, 1].

Results and Discussion

Two classifiers, namely, k-NN and SVM have been used in this work in order to compare the proposed feature extraction techniques with other recently proposed feature extraction techniques. Each technique has been tested with 3,500 images of handwritten Gurmukhi characters. We have also analyzed the performance of other recently proposed feature extraction techniques, namely, zoning, diagonal, directional, transition, intersection and open end points, gradient and chain code features. A performance analysis has also been carried out in order to find the best feature set for a given offline handwritten Gurmukhi character. We have divided the data set using partitioning strategies as depicted in Table 3. These strategies are considered to establish how the classifiers behave for different training data.

Table 3 Partitioning strategies of training and testing data

Performance Analysis Based on k-NN Classifier

We have done experiments using k-NN classifier for the value of k = 1, 3, 5, 7. From these experiments we have achieved best accuracy for the value of k = 5. In this sub-section, results of performance analysis of partitioning strategies (a, b,…, k) based on the 5-NN classifier are presented (Table 4). It has been noted that the power curve fitting based on features with 5-NN classifier achieved maximum recognition accuracy of 98.10 % when we use strategy h.

Table 4 Recognition accuracy based on k-NN classifier for various feature extraction techniques

Performance Analysis Based on SVM with Linear Kernel Classifier

In this sub-section, results of performance analysis of partitioning strategies (a, b,…, k) based on SVM with linear kernel classifier are presented (Table 5). One can see that power curve fitting based features enable us to achieve a recognition accuracy of 97.14 % when we use strategy k and SVM with linear kernel.

Table 5 Recognition accuracy based on SVM with linear kernel classifier for various feature extraction techniques

Performance Analysis Based on SVM with Polynomial Kernel Classifier

In this sub-section, results of performance analysis of partitioning strategies (a, b,…, k) based on SVM with polynomial kernel classifier are presented (Table 6). It has been observed that the power curve fitting based features make this possible to achieve a recognition accuracy of 94.29 % when we use strategy k and SVM with polynomial kernel.

Table 6 Recognition accuracy based on SVM with polynomial kernel classifier for various feature extraction techniques

Performance Analysis Based on SVM with RBF Kernel Classifier

In this sub-section, results of performance analysis of partitioning strategies (a, b,…, k) based on SVM with RBF kernel classifier are illustrated (Table 7). It has been seen that power curve fitting based features and SVM with RBF kernel achieved maximum recognition accuracy of 94.29 % when we use strategy k.

Table 7 Recognition accuracy based on SVM with RBF kernel classifier for various feature extraction techniques

Performance Analysis Based on 5-Fold Cross Validation Technique for Various Features and Classifiers

In this sub-section, we have presented experimental results based on 5-fold cross validation technique. In general, k-fold cross validation divides, complete data set of each category into k equal subsets. Then one subset is taken as testing data and remaining k−1 subsets are taken as training data. By cross validation each sample of training data is also predicted and it gives the percentage of correctly recognized testing dataset. The system achieves a recognition accuracy of 90.06, 83.98, 83.79 and 81.53 % using k-NN, SVM with linear kernel, SVM with polynomial kernel and SVM with RBF kernel classifiers, respectively, when power curve fitting based features are used with 5-fold cross validation technique in the classification process (Table 8).

Table 8 Recognition accuracy based on 5-fold cross validation technique for various features and classifiers

As given in Table 8, a maximum recognition accuracy of 84.17 % with parabola curve fitting based features and k-NN classifier could be achieved. For this case, confusion matrix for the Gurmukhi characters is given in Table 9. Also, power curve fitting based features and k-NN classifier, could achieve a maximum recognition accuracy of 90.06 %. The confusion matrix for this case is given in Table 10.

Table 9 Confusion matrix based upon parabola curve fitting features and k-NN classifier
Table 10 Confusion matrix based upon power curve fitting features and k-NN classifier

Conclusion

In this work, we have proposed efficient feature extraction techniques for offline handwritten Gurmukhi character recognition. The classifiers that have been employed in this work are k-NN and SVM with three flavors, i.e., SVM with linear kernel, SVM with polynomial kernel and SVM with RBF kernel. The system achieves a recognition accuracy of 97.14, 94.29 and 94.29 % using SVM with linear kernel, SVM with polynomial kernel and SVM with RBF kernel classifiers, respectively, when power curve fitting based features are used as input to the classification process. In this case, 99 % data was taken in training and 1 % data was considered in testing (Strategy k). It has also been seen that the results achieved using parabola curve fitting based features are also better than recently proposed feature extraction techniques. Maximum recognition accuracy of 95.62 % could be achieved when parabola curve fitting based features were used with k-NN classifier and Strategy h. When we use SVM classifier with parabola curve fitting based features, maximum recognition accuracy of 94.29 % could be achieved. In this case, 99 % data was taken in training and 1 % data was considered in testing (Strategy k). In this work, the highest recognition accuracy of 98.09 % could be achieved when power curve fitting based features were used with k-NN classifier. In this case, 85 % data was taken in training and 15 % data was considered in testing (strategy h). Using 5-fold cross validation technique and power curve fitting based features, we have achieved a recognition accuracy of 90.06, 83.98, 83.79 and 81.53 % using k-NN, SVM with linear kernel, SVM with polynomial kernel and SVM with RBF kernel classifiers, respectively. As such, the results obtained using the power curve fitting based features are promising. This technique can further be explored by combining with other techniques for achieving higher recognition accuracy.