• No results found

Vol 7, No 6 (2017)

N/A
N/A
Protected

Academic year: 2020

Share "Vol 7, No 6 (2017)"

Copied!
6
0
0

Loading.... (view fulltext now)

Full text

(1)

Computer Science and Software Engineering

ISSN: 2277-128X (Volume-7, Issue-6)

2017

Segmentation Based Word Spotting Method for

Handwritten Documents

Thontadari C*, Prabhakar C.J.

Department of P.G Studies and Research in Computer Science, Kuvempu University, Shimogga, Karnataka, India

DOI:10.23956/ijarcsse/V7I6/0127

Abstract— In this paper, we present a segmentation based word spotting method for handwritten document images using Co-occurrence Histograms of Oriented Gradients (Co-HOG) descriptor. The drawback of Histogram of Oriented Gradients (HOG) is that HOG ignores spatial information of adjacent pixels where as the Co-HOG take into account spatial contextual information by capturing the co-occurrence of orientation pairs of neighbouring pixels. In order to construct Co-HOG descriptor for word spotting, we divide a word image into blocks and Co-HOG features are extracted from each block and finally concatenate them to form a feature descriptor. The proposed method is evaluated using precision and recall metrics through experimentation conducted on popular GW dataset and confirmed that our method outperforms for this dataset.

Keywords— Word spotting, Character Recognition, George Washington, Dynamic Time Warping, Hidden Markov Models

I. INTRODUCTION

Recently Document Image Analysis is become one of dynamic research field which draws an attention of researcher due to its complexity and growing requirement for accessing the content of digitized information. Optical Character Recognition (OCR) has been explored for a few decades with massive accomplishment which facilitates to automate human procedure. OCR techniques usually recognize words by processing fonts independently and works well with machine printed fonts against clean environment. Generally, big quantity of document images are accumulated in digital libraries, and processing of these documents with the help of OCR requires high computation rate due to difficulty involved in understanding the page layout of digitized documents, irregular writing manner, dull ink, stained paper and other adverse factors. In order to overcome these problems, researchers have proposed a method called word spotting. Word spotting method is a moderately new alternative for text recognition and retrieval in digitized printed and handwritten documents.

Handwritten word spotting is the pattern classification mission which consists of detecting given query word in handwritten document images. The word spotting in handwritten documents is not completely solved due to various challenges posed by handwritten documents. Hence, we focused on word spotting in handwritten documents rather than printed documents. Generally, a word spotting method consists of three main modules: pre-processing, feature extraction and feature matching. Among them, feature extraction is one of most important factors for achieving high retrieval performance, because of feature with strong discriminative information can be well classified even using with simplest classifier.

The literature investigation exposes that HOG descriptor is extensively used in numerous recognition applications because of its discriminative capability compared to other existing feature descriptors. The HOG descriptor is developed by Dalal [1] for pedestrian detection task with the use of Support Vector Machine (SVM) classifier. The HOG has been productively applied in various research fields such as word spotting method [2-3], face recognition [5-6], character recognition [7], text/non-text classification problem [8] and vehicle detection in traffic video [9].

Importantly, HOG considers orientation of only isolated pixels, whereas spatial information of adjacent pixels is ignored. In order to capture the orientation of adjacent pixels, Watanabe et al [12] have proposed Co-occurrence Histogram of Oriented Gradients (Co-HOG) descriptor. Instead of counting the occurrence of gradient orientation of a single pixel, gradient orientations of two or more adjacent neighbouring pixels are considered. For each pixel in an image block, the gradient orientations of the pixel pair formed by its neighbour and itself are examined. The Co-HOG descriptor is broadly used in object detection because of precisely representing the important uniqueness of an object structure, therefore CO-HOG descriptor is more applicable for real time applications such as detection of pedestrian [12], detection of human body parts [4], detection of objects in natural scene images [13], recognition of text in natural scene [15], recognition of characters in natural scenes [16], and recognition of characters in multilingual scene images [17].

(2)

II. RELATED WORK

Word spotting algorithms intend to reduce tedious and time overwhelming manual annotation applied to the pictorial representation of input documents words. The literature survey reveals that lot of techniques have been developed to spot the words in handwritten and printed documents. The prominent work by [18] exposed a strategy for image matching approach which is sufficient for certain applications and among which word spotting in handwritten documents is one of the important contribution. In [19] they have extended and proposed a novel approach for word spotting in handwritten document based on word profile features.

Word spotting algorithms for handwritten documents are broadly classified into two categories [19] such as pixel based and features based matching algorithms. In pixel based matching, similarity between the two images are measured on the pixel domain using various metrics such as Euclidean distance, XOR difference, Scott and Longuet-Higgins distance, Hausdroff distance or sum of the square differences. On the other hand, in feature based matching, images are compared with representative features extracted from the images. Similarity measures such as Dynamic Time Warping (DTW) and point correspondence are defined on the feature domain. The prominent learning algorithms for handwritten word spotting are Hidden Markov Models (HMM)[20] and Neural networks [21] which were used in a large extent of research for word spotting in handwritten documents.

In [10] have proposed Arabic and Latin script identification based on Histogram of Oriented Gradients feature descriptors. In [11] have proposed a unsupervised segmentation word spotting method based on grid of HOG descriptors, and a sliding-window approach is used to locate the document regions that are most similar to the query. A novel word spotting method for handwritten documents was described by [22] which is derived from the neural network based system. In [23], proposed contextual word model for keyword spotting in off-line Chinese handwritten documents, which measures the similarity between the query word and every candidate word in the document by combining a character classifier and the geometric context as well as linguistic context. A statistical script independent line based word spotting framework [24] for offline handwritten documents based on Hidden Markov Models. The candidate keywords are pruned in a two stage spotting framework using the character based and lexicon based background models. In [25] have proposed segmentation free word spotting method for historical document collections that follows the query by example paradigm. They used patch-based framework of bag-of-visual-words model powered by SIFT descriptors.

III. CO-OCCURRENCE HOG DESCRIPTOR (CO-HOG)

Co-HOG feature is robust against deformation and illumination variation because this is gradient based histogram feature descriptor. Co-HOG capture spatial information by counting frequency of co-occurrence of oriented gradients between pixel pairs at a given offset over an image. Thus relative locations are stored. The relative locations are reflected by the offset between two pixels. The combinations of neighbour gradient orientations can express shapes in detail.

We compute co-occurrence matrix K over an image I of size N × M at an offset x, y as follows:

𝐾𝑥,𝑦 𝑖, 𝑗 =

1 𝑖𝑓 𝐼 𝑝, 𝑞 = 𝑖 𝑎𝑛𝑑 𝐼 𝑝 + 𝑥, 𝑞 + 𝑦 = 𝑗

0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒, 𝑀

𝑞=1 𝑁

𝑝=1 (1)

where, Kx,y is a square matrix of dimension 8 × 8. Gradient orientation interval [0, 3600] is divided into N

bin = 8

orientations per 450. The maximum offset is set to 4 as in Figure 1(a), it will give rise to 31 co-occurrence matrices. For zero offset, co-occurrence matrix size is 1 × 8 (only eight effective values) because non-diagonal components are zero and the co-occurrence matrix size for other offsets is 8 × 8. One such co-occurrence matrix is shown in Fig. 1(b).

Fig 1: Extraction of Co-HOG features: (a) offset used in Co-HOG, (b) Co-occurrence matrix for the given offset

IV. OUR APPROACH

(3)

Therefore, we divide an image into blocks and extract Co-HOG features from each block. Then, extracted Co-HOG features are concatenate to form a feature descriptor of a word image. In the testing phase, the extracted Co-HOG feature descriptors of the training set is matched with feature descriptor of a query word image in order to retrieve word images similar to query image using a DTW matching technique.

A. Extraction of Co-HOG Descriptor

In order to extract Co-HOG features, for each scale, we divide an image into Blockh× Blockw non-overlapping blocks and co-occurrence matrices are computed for each block using Eq.1.

The Fig. 2(b) shows word image which is divided into non-overlapping blocks and corresponding co-occurrence matrices. Then, Co-HOG feature vector of the scale image is constructed by vectorizing and concatenating the co-occurrence matrices of all blocks. Finally, the components of all the co-co-occurrence matrices are concatenated to form Co-HOG descriptor which represents the word image. For example, when the word image is divided into 3 × 6 blocks, the dimension of Co-HOG feature vector is 34,704 i. e 8 × 8 × 30 + 8 × 3 × 6 .

Fig 2: Illustration of Co-HOG feature descriptor extraction process: (a) Sample word image (b) Word image divided in to 3x6 blocks and corresponding co-occurrence matrices of each block and (c) concatenated one after another to form a

Co-HOG feature vector

B. Word Image Matching

The literature survey and experimental based verification reveals that Dynamic Time Warping (DTW) (Rath, T.M. et al., 2007) matching algorithm yields highest accuracy for handwritten word spotting compared to other matching algorithms. Hence, for the word spotting task, we compare Co-HOG feature vectors of the training set with the Co-HOG feature vector of a query word image using a DTW matching algorithm to retrieve the word instances similar to the query word. Consider two word images X and Y of each dimension m. They are represented by vector X = (x1, … , xm) and

Y = (y1, … , ym). To determine the DTW distance between these two vectors, a matrix D of dimension m × m is built

where each element D i, j is the cost of matching the two vectors (x1, … , xm) and (y1, … , ym). Element D i, j in the

matrix is calculated in the following manner:

D i, j = min

D(i, j − 1) D(i − 1, j) D(i − 1, j − 1)

+ d(xi, yj (2)

where 1 < 𝑖 ≤ 𝑚 𝑎𝑛𝑑 1 < 𝑗 ≤ 𝑚.

In order to use DTW to match such feature vectors X and Y, we need to define a distance measure d for the local distance between two sequence samples, xi and yj. We used the Euclidean distance measure and it is defined as:

d(xi, yj) = mk=1(xi,k− yj,k)2 (3)

where, index k is used to access the elements from the vectors xi and yj.

V. EXPERIMENTAL RESULTS

(4)

evaluated based on popular metrics such as Precision (P), Recall (R) and f-measure. Precision gives the percentage of true positives as compared to the total number of word images retrieved by the approach. Recall gives the percentage of true positives as compared to the total number of true positives in the dataset and f-measure is the weighted harmonic mean of precision and recall, which can be used to calculate the accuracy of the approach

Precision P = TP

TP +FP (4)

Recall (R) = TP

TP +FN (5)

f − measure (f) = 2 P.R

P+R (6)

where, TP is the number of relevant word instances correctly retrieved, FP is the number of word images retrieved as other than query image and FN is the number of relevant word instances does not retrieve from the dataset.

We employed five-fold cross-validation method to validate our approach, each dataset is partitioned into five complementary subsets i.e. four subsets are used for training and remaining one subset is used as validation (test) set. The cross-validation process is repeated five times, with each subset used exactly once for validation. To estimate the overall evaluation results of our approach, we compute the mean Average Precision (mAP) and mean Precision-Recall (mPR) of the five validation results.

A. Pre-Processing

In preprocessing step, the handwritten document images are denoised and segmented into individual text lines, then words using the adjacent connected components technique. The sample results of denoised and segmented word images are shown in Fig. 3.

Fig 3: Sample results of denoised and segmented word images

B. Parameter Selection

One of the important factors to achieve the highest accuracy is an optimal number of blocks of an image. Hence, in order to find an optimal number of blocks, we conducted the experiments using GW dataset for a different number of blocks such as 1 × 2 2 blocks , 2 × 4 8 blocks , 3 × 6(18 blocks) and 4× 8 (32 blocks). The mean Average Precision (mAP) obtained on GW dataset using our approach for a different number blocks is presented in Table 1. It is observed that when the word image is divided into3 × 6 blocks(18 blocks), the accuracy of our approach is significantly better than for other number of blocks. Hence, in all the experiments, we divide the word image into 3 × 6 blocks(18 blocks)

and co-occurrence matrices are extracted from each block

Table 1. mean Average Precision (mAP) of our approach for different number of blocks

Number of Blocks mAP(%) For GW dataset

1 × 2 ( 2 blocks) 86.42 2 × 4 (8 blocks) 88.67 3 × 6 (18 blocks) 91.03 4 × 8 (32 blocks) 87.22

C. Experimental Results on GW dataset

The most important challenge for word spotting using this dataset is to deal with a small amount of training data, because this dataset consist of twenty pages. So, we have performed a five-fold cross validation for experimental evaluation. From GW database, we have taken manually labeled 1680 word instances of 28 classes of words from all the 20 pages of scanned handwritten documents. Each class of word may occur at least three times per document

(28 classes × 20 pages × 3 instances = 1680).

While performing five-fold cross validation, we partitioned dataset into five disjoint subsets and each subset consists of 336 word images (from each class of words we have taken 12 word images). In the training stage, 1344 word images are used and remaining 336 word images are used for testing. Hence, for every experiment, we have 336 word images as test samples, optimal number of blocks is 3 × 6 blocks and number of orientation bins is 8 bins. The cross-validation process is repeated five times, with each subset used exactly once for validation. It is noticed that, our approach yields highest accuracy (%) with mAP is 91.03, mPR is 87.83 and f-measure is 86.89.

(5)

Table 2. Some query words and their retrieval results for GW dataset.

In order to show the effectiveness of our approach, we compared results of our approach with results of existing methods such as word profile features based approach [26], HOG based approach by extracting local gradient histogram features through sliding window [2] and Fisher vector representation computed over SIFT descriptors from the word image [14]. We have conducted experiments using database described above. Table 3 shows the comparison results of our approach with existing methods. It is observed that, compared to existing methods, our approach yields highest accuracy with mAP is 91.03%.

Table 3. Results comparison of our approach with existing methods for GW dataset

Method Features Segment ation

mAP (%)

[26] Word profile Word 73.71

[2] HOG

descriptor Word 71.70

[14] SIFT

descriptors Word 85.63 Our

approach

Co-HOG

descriptors Word 91.03

Based on the experimental results obtained on GW dataset, we can conclude that our approach efficiently retrieves the handwritten words which are having non uniform illumination, suffering from the noise and written by different writers. The highest accuracy of our approach is due to the extraction of illumination and scale invariant Co-HOG features at multiple blocks of an image. Another factor for highest accuracy is a division of the word image into blocks which capture the local variations within the class. It is identified through evaluation of experimental results on GW dataset that our approach outperforms existing Word profile, HOG and SIFT based word spotting methods because Co-HOG is more robust, discriminating than HOG because it considers gradient orientations of two or more neighboring pixels.

VI. CONCLUSION

In this paper, we proposed a segmentation based word spotting method for handwritten document images using Co-occurrence Histograms of Oriented Gradients descriptors. Compared with HOG, the Co-HOG consider neighboring local spatial information. Co-HOG descriptor keeps robustness to illumination variation and invariance to local geometric transformation. The experimental results on publicly available GW dataset demonstrate that proposed Co-HOG descriptor achieves consistently excellent for word spotting in handwritten document images. The drawback of our approach for word spotting is its high dimensionality which has a negative impact on the computational cost when matching by DTW algorithm. However, it provides highest accuracy compared with existing methods.

REFERENCES

[1] Dalal, N., & Triggs, B. (2005, June). Histograms of oriented gradients for human detection. In Computer Vision and Pattern Recognition, IEEE Computer Society Conference on Vol. 1, 886-893.

[2] Rodrıguez, J. A., & Perronnin, F. (2008). Local gradient histogram features for word spotting in unconstrained handwritten documents. In International Conference on Frontiers in Handwriting Recognition, Canada, 7-12. [3] Terasawa, K., & Tanaka, Y. (2009). Slit style HOG feature for document image word spotting. In Document

Analysis and Recognition, 2009. ICDAR'09. 10th International Conference, 116-120.

(6)

[5] Deniz, O., Bueno, G., Salido, J., & De la Torre, F. (2011). Face recognition using histograms of oriented gradients. PR Letters,32(12),1598-1603.

[6] Shu, C., Ding, X., & Fang, C. (2011). Histogram of the oriented gradient for face recognition. Tsinghua Science & Technology, 16(2), 216-224.

[7] Newell, A. J., & Griffin, L. D. (2011). Multiscale histogram of oriented gradient descriptors for robust character recognition. In DAR, 1085-1089.

[8] Minetto, R., Thome, N., Cord, M., Leite, N. J., & Stolfi, J. (2013). T-HOG: An effective gradient-based descriptor for single line text regions. Pattern recognition, 46(3), 1078-1090.

[9] Arrospide, J., Salgado, L., & Marinas, J. (2013). HOG-like gradient-based descriptor for visual vehicle detection. In Intelligent Vehicles Symposium (IV), IEEE, 223-228.

[10] Saidani, A., Kacem Echi, A., & Belaid, A. (2015).Arabic/Latin and Machine-printed/Handwritten Word Discrimination using HOG-based Shape Descriptor. ELCVIA: 0001-23.

[11] Almazan, J., Gordo, A., Fornés, A., & Valveny, E. (2014). Segmentation-free word spotting with exemplar svms. PR, 47(12), 3967-3978.

[12] Watanabe, T., Ito, S., & Yokoi, K. (2009). Co-occurrence histograms of oriented gradients for pedestrian detection. In Advances in Image and Video Technology, Springer Heidelberg, 37-47.

[13] Ren, H., Heng, C. K., Zheng, W., Liang, L., & Chen, X. (2010). Fast object detection using boosted co-occurrence histograms of oriented gradients. In Image Processing, 17th IEEE International Conference, 2705-2708.

[14] Almazan, J., Gordo, A., Fornés, A., & Valveny, E. (2013). Handwritten word spotting with corrected attributes. In Proceedings of the IEEE International Conference on Computer Vision, 1017-1024.

[15] Tian, S., Lu, S., Su, B., & Tan, C. L. (2013). Scene text recognition using co-occurrence of histogram of oriented gradients. In DAR, 12th International Conference on 912-916.

[16] Su, B., Lu, S., Tian, S., Lim, J. H., & Tan, C. L. (2014). Character recognition in natural scenes using convolutional co-occurrence hog. In 22 International Conference on PR, 2926-2931.

[17] Tian, S., Bhattacharya, U., Lu, S., Su, B., Wang, Q., Wei, X., & Tan, C. L. (2015). Multilingual scene character recognition with co-occurrence of histogram of oriented gradients. Pattern Recognition, 51, 125-134.

[18] Manmatha, R., Han, C., & Riseman, E. M. (1996). Word spotting: A new approach to indexing handwriting. In Computer Vision and Pattern Recognition,Proceedings, IEEE Computer Society Conference, 631-637.

[19] Manmatha, R., & Rath, T. (2003). Indexing of handwritten historicaldocuments-recent progress. In Proceedings Symposium on Document Image Understanding Technology, 77-86.

[20] Fischer, A., Keller, A., Frinken, V., & Bunke, H. (2010). HMM-based word spotting in handwritten documents using subword models. In PR, International conference,3416-3419.

[21] Wollmer, M., Eyben, F., Keshet, J., Graves, A., Schuller, B., & Rigoll, G. (2009). Robust discriminative keyword spotting for emotionally colored spontaneous speech using bidirectional LSTM networks. In Acoustics, Speech and Signal Processing, 3949-3952.

[22] Frinken, V., Fischer, A., Manmatha, R., & Bunke, H. (2011). A novel word spotting method based on recurrent neural networks. PAMI,34(2), 211-224.

[23] Huang, L., Yin, F., Chen, Q. H., & Liu, C. L. (2013). Keyword spotting in unconstrained handwritten Chinese documents using contextual word model. Image and Vision Computing, 31(12), 958-968.

[24] Wshah, S., Kumar, G., & Govindaraju, V. (2014). Statistical script independent word spotting in offline handwritten documents. Pattern Recognition, 47(3), 1039-1050.

[25] Rusinol, M., Aldavert, D., Toledo, R., & Llados, J. (2015). Efficient segmentation-free keyword spotting in historical document collections. Pattern Recognition, 48(2), 545-555.

Figure

Fig 1: Extraction of Co-HOG features: (a) offset used in Co-HOG, (b) Co-occurrence matrix for the given offset
Fig 2: Illustration of Co-HOG feature descriptor extraction process: (a) Sample word image (b) Word image divided in to  3x6 blocks and corresponding co-occurrence matrices of each block and (c) concatenated one after another to form a Co-HOG feature vector
Fig 3: Sample results of denoised and segmented word images
Table 3.  Results comparison of our approach with existing methods for GW dataset

References

Related documents

Internationally well-known brand production companies as Coca Cola, Freiberger Pizza, Bahlsen Cookies, Melitta Kaffee, Campi- na dairy products, and Katjes Sweets, installed

In sciatic nerves harvested on day 16 post-immunization, DMF- preventative and DMF-therapeutic groups both displayed elevated local expression of M2 macrophages and reduced

In addition super 13%Cr modified martensitic stainless steel has excellent corrosion resistance alloy, good mechanical strength, good strength of retention in high

The free NH group of the thiazolidine moiety 23 is readily available for peptide coupling in both the carboxy and the ester derivatives of thiazolidine 15 and 23

(11), yielding an increasing weighted factor for the fourth joint shown in Fig. 7 illustrates the simulation results of the proposed WGPM method. To force joints back away

The aims of this study were to use OFT to determine the number and type of resources used in information seeking when medical students answer a clinical question, to describe

On the other hand, the limitations of this preliminary research was limited number of variables and should be discussed to improve more information about tourist experience in

Such a study will be of importance because of the alarming data of people, arising from our study, who do self-medication (81%); those that read the drug leaflets