File Information
File: 05-lr/acl_arc_1_sum/cleansed_text/xml_by_section/metho/98/p98-2152_metho.xml
Size: 25,505 bytes
Last Modified: 2025-10-06 14:14:59
<?xml version="1.0" standalone="yes"?> <Paper uid="P98-2152"> <Title>Japanese OCR Error Correction using Character Shape Similarity and Statistical Language Model</Title> <Section position="4" start_page="922" end_page="923" type="metho"> <SectionTitle> 2 OCR Model </SectionTitle> <Paragraph position="0"/> <Section position="1" start_page="922" end_page="922" type="sub_section"> <SectionTitle> 2.1 Noisy Channel Model </SectionTitle> <Paragraph position="0"> First, we formulate the spelling correction of OCR errors in the noisy channel paradigm. Let C represent the input string and X represent the OCR output string. Finding the most probable string C&quot; given the OCR output X amounts to maximizing the function P(XIC)P(C), = arg m~x P(C\[X) = arg mcax P(X\[C)P(C) (1) because Bayes' rule states that,</Paragraph> <Paragraph position="2"> P(C) is called the language model. It is computed from the training corpus. Let us call P(XIC ) the OCR model. It can be computed from the a priori likelihood estimates for individual characters,</Paragraph> <Paragraph position="4"> where n is the string length. P(xi\[ci) is called the characters confusion probability.</Paragraph> </Section> <Section position="2" start_page="922" end_page="922" type="sub_section"> <SectionTitle> 2.2 Zero-Frequency Problem </SectionTitle> <Paragraph position="0"> The character confusion probabilities are computed from the character confusion matrix, which is a set of the frequencies of the input-output character pairs of the OCR. The confusion matrix, however, is highly dependent on the character recognition method and the quality of the input image. It is a labor intensive task to make a confusion matrix, since Japanese has more than 3,000 characters. But the more serious problem is that the confusion matrix is too sparse to be used for statistical modeling.</Paragraph> <Paragraph position="1"> For example, suppose the word &quot;ItI~31E&quot; (environment) is incorrectly recognized as a non-word &quot;~ ~&quot;. The following is an excerpt of a confusion matrix, where the pair of a character and a number separated by a slash represents the output character and its frequency.</Paragraph> <Paragraph position="2"> input character ~: ~/1289 ~/1 {~/1 input character ~: ~/1282 ~/5 ~/1 ~/1 ~/I ~/1 ~/i Even if we collect more than one thousand recognition examples, there are no examples in which qll' is recognized as '~'. To compute the confusion probability P(~\[!II), we need a smoothing method. This is called the zero-frequency problem. Although it has been studied in many areas such as speech recognition, statistical language modeling and text compression, no previous work has examined on the smoothing of the character confusion probabilities. This is probably because the problem arises only when we consider OCR error correction of languages with large character sets.</Paragraph> <Paragraph position="3"> We propose a novel method to smooth the character confusion probabilities. First, we estimate the sum of the probabilities of novel events. We then distribute the probability mass to each novel event based on character similarity.</Paragraph> <Paragraph position="4"> We use a scheme, which we refer to as the Witten-Bell method (Witten and Bell, 1991), to estimate the sum of the probabilities for all novel events because it is simple and robust 1. Let C(ci,cj) be the frequency of events where ci and cj are the input and the output characters, respectively. Let ~(ci) be the sum of the probabilities of unseen output characters where the input character is ci. By using the Witten-Bell method, ~(ci) is estimated as,</Paragraph> <Paragraph position="6"> In the above example, '~' appears 1291(= 1289+1+ 1) times as input and there are three distinct characters in the output. Therefore, the probability of observing novel characters is 3/(1291 + 3) = 3/1294.</Paragraph> <Paragraph position="7"> One of the possible alternatives to the Witten-Bell method is the Good-Turing method (Good, 1953).</Paragraph> <Paragraph position="8"> But we didn't use the method since it assumes the distribution of the frequency of frequencies to be relatively smooth, which is not the case in the character confusion matrix.</Paragraph> </Section> <Section position="3" start_page="922" end_page="923" type="sub_section"> <SectionTitle> 2.3 Back-off Smoothing </SectionTitle> <Paragraph position="0"> Both the Witten-Bell and Good-Turing methods do not in themselves tell one how to share/~(ci) among 1In (Witten and Bell, 1991), the method is referred to as &quot;method C&quot; for estimating the escape probability in a text compression method, Prediction by Partial Matching (PPM).</Paragraph> <Paragraph position="1"> It estimates the probability of observing novel events to be r/(n + r), where n is the total number of events seen previously, and r is the number of symbols that are distinct. The probability of the event observed c times is c/(n + r).</Paragraph> <Paragraph position="2"> the distinct unseen events. The simplest strategy is to assume all unseen events are equally probable, but this is not reasonable because recognition errors are more likely to occur among characters with similar shapes. Therefore, we distributed the probability mass D(c~) based on character shape similarity computed from feature vectors.</Paragraph> <Paragraph position="3"> First, we made an appropriate number of character classes in which similar characters are gathered. This is done by clustering the feature vectors of each character; details are described in the next subsection. We then made a confusion matrix between the character classes from the character confusion matrix. Let C(class~, classj) be the frequency that the characters in classl are recognized as the characters in classj. It is computed as the sum of the elements in the character confusion matrix associated with the characters in class~ and classj.</Paragraph> <Paragraph position="5"> ci Eclass l ,cj C=class j By using the Witten-Bell method, we can estimate the class confusion probabilities between arbitrary classes. We then distribute the probability for unseen events in proportion to the class confusion probability,</Paragraph> <Paragraph position="7"> is a normalizing constant, and class(c{) is the function that returns the class of character c~.</Paragraph> <Paragraph position="8"> Numerical values for a's as well as the character class confusion probabilities can be precomputed. Therefore, the method is computationally efficient.</Paragraph> </Section> <Section position="4" start_page="923" end_page="923" type="sub_section"> <SectionTitle> 2.4 Character Clustering </SectionTitle> <Paragraph position="0"> In general, character recognition consists of feature extraction and classification. Feature extraction is applied to concentrate the information in the image into a few, highly selective features. Classification is accomplished by comparing the feature vector corresponding to the input character with the representatives of each character, using a distance metric. Therefore, if we cluster feature vectors of each character, the members of the resulting class are characters with similar shape, and so tend to cause confusion.</Paragraph> <Paragraph position="1"> The feature we used in the clustering experiment is PDC (Peripheral Direction Contributivity) (Hagita et al., 1983), which is one of the best features for Japanese character recognition 2. We clustered the feature vectors for 3021 Japanese characters into 128 classes by using the LBG algorithm (Linde et al., 1980), which is one of the most popular vector quantization methods.</Paragraph> <Paragraph position="2"> Let's go back to the previous example of estimating P(~I~)- After character clustering, '~' and '~' are clustered into class 29 and 119, respectively.</Paragraph> <Paragraph position="3"> times as input and there are 36 distinct classes in the output, where class 119 appeared 7 times,</Paragraph> <Paragraph position="5"> This class confusion probability and the normalizing constant ~(~) are used to compute P(~I~) using equation (7).</Paragraph> </Section> </Section> <Section position="5" start_page="923" end_page="924" type="metho"> <SectionTitle> 3 Language Model </SectionTitle> <Paragraph position="0"/> <Section position="1" start_page="923" end_page="924" type="sub_section"> <SectionTitle> 3.1 Word Segmentation Model </SectionTitle> <Paragraph position="0"> Let the input Japanese character sequence be C = clc2...cm, which can be segmented into word sequence W = wlw2...w,. We approximate P(C) in Equation (1) by the joint probability of word sequence P(W). P(W) is then approximated by the product of word bigram probabilities P(w~lwi_l).</Paragraph> <Paragraph position="2"> 2PDC features are formed by assigning stroke directions to pixels and selecting just pixels on the first, second, and third stroke encountered by the scan line. The marginal distribution of the four direction contributivity of such three pixels is then taken along 16 lines in eight different directions.</Paragraph> <Paragraph position="3"> Therefore, the dimension of the original PDC feature vector is 8&quot;3&quot;4&quot;16--1536. By using 2-stage feature selection, it can be reduced to 256, while still preserving the original recognition ability.</Paragraph> <Paragraph position="4"> Using the language model (9), the OCR error correction task can be defined as finding a word sequence r~d that maximizes the joint probability of word sequence given recognized character sequence P(WIX ). By using Bayes' rule, this amounts to maximizing the product of P(XIW ) and P(W).</Paragraph> <Paragraph position="5"> = arg mwax P(W\[X) = arg mwax P(X\[W)P(W) (10) The maximization search can be efficiently implemented by using the Viterbi-like dynamic programing procedure described in (Nagata, 1996). The algorithm starts from the beginning of the input sentence, and proceeds character by character. At each point in the sentence, it looks up the combination of the best partial word segmentation hypothesis ending there and all word hypotheses starting there. The word hypotheses proposed at each point include both exactly matched words and approximately matched words. All prefixes of the substring starting at the point are also proposed as unknown words if they are not in the dictionary.</Paragraph> </Section> <Section position="2" start_page="924" end_page="924" type="sub_section"> <SectionTitle> 3.2 Word Model for Unknown Words </SectionTitle> <Paragraph position="0"> We defined a statistical word model to assign a reasonable word probability to an arbitrary substring in the input sentence. The word model is formally defined as the joint probability of the character sequence wi = cl ... ck if it is an unknown word. We decompose it into the product of word length probability and word spelling probability,</Paragraph> <Paragraph position="2"> where k is the length of the character sequence and <UNK> represents unknown word.</Paragraph> <Paragraph position="3"> We assume that word length probability P(k) obeys a Poisson distribution whose parameter is the average word length A in the training corpus. This means that we regard word length as the interval between hidden word boundary markers, which are randomly placed with an average interval equal to the average word length.</Paragraph> <Paragraph position="5"> We approximate the spelling probability given word length P(cl...c~\[k) by the word-based character bigram model, regardless of word length.</Paragraph> <Paragraph position="7"> where &quot;#&quot; indicates the word boundary marker.</Paragraph> </Section> </Section> <Section position="6" start_page="924" end_page="925" type="metho"> <SectionTitle> 4 Approximate Word Matching </SectionTitle> <Paragraph position="0"> Since there are no delimiters between words in Japanese, we have to hypothesize all substrings in the input sentence as words, and retrieve their approximately matching words from the dictionary as correction candidates. The most likely correction candidate is selected by the word segmentation algorithm using the OCR model and the language model.</Paragraph> <Paragraph position="1"> For simplicity, we will present the method as if it were for an isolated word error correction.</Paragraph> <Paragraph position="2"> In English spelling correction, correction candidates are generated by the minimum edit distance technique (Wagner and Fischer, 1974). Edit distance is the minimum number of editing operations (insertions, deletions, and substitutions) required to transform one string into another. Since the target is OCR output, we can restrict the type of errors to substitutions only. Thus, the edit distance of two words becomes c/n, where c is the number of matched characters and n is the length of the misspelled (and the dictionary) word. Since the cost of computing the edit distance between a string and all dictionary words is expensive, we create an inverted index into the dictionary using character bigrams as the access keys (Angell et al., 1983).</Paragraph> <Paragraph position="3"> In Japanese OCR spelling correction, it is reasonable to generate correction candidates by edit distance for words longer than 2 characters since the number of correction candidates would be small.</Paragraph> <Paragraph position="4"> However, for two character words, edit distance is useless, because there are a large number of words with one edit distance. Since the average word length of Japanese is about two characters, this is a serious problem.</Paragraph> <Paragraph position="5"> We propose an approximate word matching method that uses character similarity. Let X be a non-word caused by OCR errors, and W be a correction candidate word. X would be corrected by W if the following relationship holds, P(X)P(XIX ) < P(W)P(XIW ) (14) The left hand side represents the probability that X is an unknown word and that it is correctly recognized. The right hand side represents the probability that W is incorrectly recognized as X. The larger the product of the word unigram probability P(W) and the word confusion probability P(XIW), the more likely word W is the correct word for X.</Paragraph> <Paragraph position="6"> Therefore, for two character words, we sort the list of all one edit distance words by P(W)P(X I W), and select the top-k words as the correction candidates.</Paragraph> <Paragraph position="7"> For example, if &quot;~&quot; is incorrectly recognized as &quot;~&quot;, there are at least 20 dictionary words whose edit distance is one.</Paragraph> <Paragraph position="8"> If we sort the list of one edit distance words by P(W), P(XIW), and P(W)P(X\[W), the correction candidates become as follows, sorted by P(W):</Paragraph> <Paragraph position="10"> Thus, by using P(W)P(XIW), we can make &quot;~ ~&quot; the most likely correction word. The approximate word matching method is so accurate that, in practice, it is sufficient to use only the top 5 candidates. This makes the program very efficient.</Paragraph> </Section> <Section position="7" start_page="925" end_page="3912" type="metho"> <SectionTitle> 5 Experiments </SectionTitle> <Paragraph position="0"/> <Section position="1" start_page="925" end_page="3912" type="sub_section"> <SectionTitle> 5.1 Training Data for the Language Model </SectionTitle> <Paragraph position="0"> We used the EDR Japanese Corpus Version 1.0 (EDR, 1991) to train the language model. It is a corpus of approximately 5.1 million words (208 thousand sentences). It contains a variety of Japanese sentences taken from newspapers, magazines, dictionaries, encyclopedias, textbooks, etc. It has a variety of annotations including word segmentation, pronunciation, and part of speech.</Paragraph> <Paragraph position="1"> In this experiment, we randomly selected 90% of the sentences in the EDR Corpus for training. The first column of Table 1 shows the number of sentences, words, and characters of the training set.</Paragraph> <Paragraph position="2"> There were 133281 distinct words in the training data. We discarded the words whose frequency was one, and made a dictionary of 65152 words. We then counted the vocabulary dependent word bigrams.</Paragraph> <Paragraph position="3"> That is, the words that were not in the dictionary were replaced with the unknown word symbol <UNK> before counting the bigrams. There were 758172 distinct word bigrams. We discarded the bigrams whose frequency was one, and the remaining 294668 bigrams were used in the word segmentation model.</Paragraph> <Paragraph position="4"> In the word model, we used 3167 character unigrams and 91198 character bigrams. All unigrams and bigrams whose frequencies were one were discarded. As for the average word length, instead of averaging all words in the corpus (=1.58), we averaged the words whose frequency was one (=4.76) in order to avoid the influence of highly frequent words.</Paragraph> </Section> <Section position="2" start_page="3912" end_page="3912" type="sub_section"> <SectionTitle> 5.2 Testl: Handwritten OCR </SectionTitle> <Paragraph position="0"> We designed two experiments to evaluate the performance of the OCR error corrector. The first experiment used simulated outputs of a handwriting OCR, while the second used real outputs of a printed character OCR.</Paragraph> <Paragraph position="1"> The first experiment was designed to test the OCR error corrector over a wide range of baseline recognition accuracies. The use of the OCR simulator was necessary because it is very difficult to obtain a large amount of test data with arbitrary accuracies.</Paragraph> <Paragraph position="2"> We selected 100 sentences from the remaining 10% of the EDR corpus for testing. The second column of Table 1 shows the number of sentences, words, and characters of the test set. By using an OCR simulator, we made four sets of character matrices whose first-rank recognition accuracies were 70%, 80%, 90%, and 95%. They contained at most 10 candidates for each character and their cumulative recognition accuracies were 90%, 95%, 98%, and 98%, respectively.</Paragraph> <Paragraph position="3"> For comparison, we implemented the OCR error correction method, which does not use character similarity information, presented in (Nagata, 1996). Instead of using character confusion matrix, he approximated it by the correct character distribution over the rank of the candidates 3. We refer to his method as the candidate rank method, and our method as the character similarity method.</Paragraph> <Paragraph position="4"> Figure 1 shows the recognition accuracies after error correction for various baseline OCR accuracies.</Paragraph> <Paragraph position="5"> The horizontal axis represents the accuracies of the baseline OCR, while the vertical axis represents the accuracies after error correction. The farther the point lies above the diagonal line, the more improvements are brought by the OCR error corrector.</Paragraph> <Paragraph position="6"> 3In (Nagata, 1996), it was assumed that the rank order distribution of the correct characters is a geometric distribution whose parameter is the accuracy of the first candidate. Let c/ be the i-th character in the input, xlj be the j-th candidate for ci in the output, and p be the probability that the first candidate is correct. The confusion probability P(xij Icl) is approximated as,</Paragraph> <Paragraph position="8"> acter recognition accuracy The character similarity method is significantly better than the candidate rank method for all base-line recognition accuracies examined. For example, when the baseline accuracy is 90%, the character similarity method achieved 97.4%, while the accuracy of the candidate rank method was 93.9% 4</Paragraph> </Section> <Section position="3" start_page="3912" end_page="3912" type="sub_section"> <SectionTitle> 5.3 Test2: Printed Character OCR </SectionTitle> <Paragraph position="0"> The second experiment was designed to test the OCR error corrector on unrestricted text and unknown OCR. In the first experiment, although the test sentences were open data, their statistical characteristics are expected to be similar to the training data because both of them were taken from the same corpus. Moreover, since the OCR simulator and the OCR error corrector used the same character confusion matrix, the input character matrices were closed data with respect to OCR.</Paragraph> <Paragraph position="1"> We selected 30 documents, each of which contained about 1000 characters. These documents had nothing to do with the EDR corpus. Ten of them were newspapers and the other 20 documents were a miscellaneous collection of novels, essays, patents, laws, scientific papers, etc.. Table 2 shows the breakdown of document type and image resolution. Newspapers were scanned at 300dpi and 400dpi, two of 4(Nagata, 1996) reported that, when the baseline accuracy is 90%, his method achieved 96.3%. The difference between 96.3% and 93.9% comes from the difference in the corpora. He tested the ATR corpus whose word perplexity is about 30, while we tested the EDR corpus whose perplexity is about 95. Here, perplexities are computed using word bigram model.</Paragraph> <Paragraph position="2"> them, scanned at 300dpi, were discarded because of low quality. Other miscellaneous documents were mainly scanned at 200dpi and 300dpi. Ten that used smaller fonts were also scanned at 400dpi.</Paragraph> <Paragraph position="3"> The printed character OCR used was a commercial product (RICOH Yomitori-Monogatari). It outputs at most 10 candidates for each character as well as a score ranging from 0 to 100 that represents the certainty of the first candidate. In fact, we know nothing about the algorithm and the training data of the OCR. At least, the training data should be different from ours since one is created for printed characters while the other was designed for hand-written characters.</Paragraph> <Paragraph position="4"> The 68 test document images contained 69102 input characters. After character recognition, there were 69305 output characters where 67639 (97.9%) characters were correct. There were 1422 (2.1%) replacement errors, 244 (0.4%) insertion errors and 41 By using the OCR error corrector, 575 characters were corrected, where 294 were right and 281 were wrong. The net improvement was only 13 characters. Figure 2 shows the recognition accuracies of each document image before and after error correc- null tion: 24 documents were improved, 30 documents got worse, and 14 documents were unchanged.</Paragraph> <Paragraph position="5"> Figure 2 indicates that the OCR error corrector improves the accuracy when the baseline recognition accuracy is less than 98%, while it worsens when the accuracy is more than 98%. This is mainly because of wrong corrections, where unknown words in the original text are replaced by more frequent words in the dictionary. Most unknown words are numbers, acronyms, and transliterated foreign words.</Paragraph> <Paragraph position="6"> Wrong correction can be avoided if the certainty of the character recognition (OCR score) is available.</Paragraph> <Paragraph position="7"> Table 3 shows the number of right and wrong corrections when correction is allowed only if the the OCR score is less than a certain threshold. The score of the printed character OCR ranges from 0 to 100, where 100 means it is pretty sure about the output. If we reject the corrections suggested by the error corrector when the OCR score is more than 80, the number of wrong corrections is reduced from 281 to 48, while that of right correction is reduced from 294 to 199. Thus, the number of net improvements increases from 13 to 151, which means a 10.6% (151/1422) reduction in replacement errors.</Paragraph> </Section> </Section> <Section position="8" start_page="3912" end_page="3912" type="metho"> <SectionTitle> 6 Discussion </SectionTitle> <Paragraph position="0"> Most previous works on Japanese OCR error correction considered only printed character OCRs and their target domain was limited. (Takao and Nishino, 1989) used part of speech bigram model and heuristic templates for unknown words. They achieved about 95% accuracy when the baseline accuracy was 91% for magazines and introductory textbooks of science and technology. (Ito and Maruyama, 1992) used part of speech bigram model and beam search in order to get multiple candidates in their interactive OCR corrector. They achieved 94.61% accuracy when the baseline accuracy was 87.46% for patents in electric engineering. We used word bigram model, a statistical word model for unknown words, and a statistical OCR model. We achieved 97.4% accuracy, when the baseline accuracy was 90% and the domain was not limited.</Paragraph> <Paragraph position="1"> It is very difficult to compare our results with the previous results because the experiment conditions are completely different. However, considering the fact that we did not restrict the target domain, our method arguably outperformed the previously published results, when the baseline accuracy is more then 90%. There is only one published work investigating the baseline accuracy much lower than 90% (Nagata, 1996). As we proved in the experiment, we outperformed his results significantly.</Paragraph> </Section> class="xml-element"></Paper>