Out of vocabulary queries for word graph-based keyword spotting
Abstract
[EN] In this master thesis several approaches are presented to support out of vocabulary queries in a Word Graph (WG)-based Keyword Spotting (KWS) application for handwritten text lines. Generally, KWS assigns a score that estimates how likely is that a given keyword is present in a certain line image. WGbased KWS offers very fast search times but assumes a closed vocabulary and assigns null scores to any word not included in such vocabulary. This work tries to provide to the WG-based KWS the flexibility of non-restricted searches and the speed achieved by the usage of WG.
Full text
UNIVERSITAT POLITÈCNICA DE VALÈNCIA DEPARTAMENT DE SISTEMES INFORMÀTICS I COMPUTACIÓ Out of Vocabulary Queries for Word Graph-based Keyword Spotting Joan Puigcerver i Pérez Directors: Dr. Enrique Vidal Ruiz Dr. Alejandro H. Toselli Rossi February 6, 2014
Gràcies, A la meva família, en especial als meus pares, per animar-me a perseguir allò que vull. A Anna que m’ha acompanyat, literalment, per mig món i ha tingut la paciència de suportar el meu estrés diari. A Moisés per la seva confiança i haver-me parlat d’aquesta temàtica per primera vegada. I, molt especialment, a Enrique i Alejandro que m’han introduït al món de la recerca, m’han guiat a través de tot aquest treball, amb substancioses aportacions i consells, i m’han donat llibertat per a interrompre’l, quan estava a l’altra banda de l’Atlàntic, i continuar-lo de nou a la meva tornada. PRHLT-DSIC-UPV iii
iv PRHLT-DSIC-UPV
Abstract This master thesis presents different approaches that aim to give a solution to the search of out of vocabulary queries in Keyword Spotting applications based on Word Graphs. Keyword Spotting refers to the problem of determining whether a given keyword is present in a collection of images. Typically, a score is computed for each keyword and line of each image, and pairs with a score surpassing a predetermined threshold are retrieved. This provides the user the ability to fine-tune the results of his/her searches. Keyword Spotting systems based on Word Graph provide very fast lookup speeds and accurate results, in comparison to other alternatives which operate at a character level. The improvement in the accuracy is achieved by using lexical information that can be extracted from many sources freely available, and not only the given training data in images and their transcripts. However, they suffer from the problem that a null score is assigned to any word that was not part of the training data (out of vocabulary keyword). Out of vocabulary words are an intrinsic problem of word-level language models and are present in many applications like Automatic Speech Recognition (ASR), Handwriting Text Recognition (HTR) and also in Keyword Spotting (KWS), which is studied here applied to handwritten line images. This work contributes to the KWS field with different alternatives that enable a reasonable estimation of out of vocabulary keyword scores in Word Graph-based systems, providing the versatility that characterlevel models offer (being able to spot any keyword), without giving up on the benefits of using language models and the speed that Word Graphs provide. Alternatives are presented at different abstraction levels, which go from very fast searches with moderate accuracy, to a very accurate approach at the expense of slower search speeds. v
Contents Table of Contents vii 1 Introduction 1 2 Handwriting Text Recognition 3 2.1 Pattern Recognition . . . . . . . . . . . . . . . . . . . . 3 2.2 Pattern Recognition for Handwriting Text Recognition . 5 2.3 Hidden Markov Models . . . . . . . . . . . . . . . . . . . 6 2.4 LanguageModels...................... 12 2.5 WordGraphs ........................ 14 3 Keyword Spotting 21 3.1 Keyword Spotting for Handwritten Text Images . . . . . 21 3.2 Fillerapproach ....................... 24 3.3 Word Graph approach . . . . . . . . . . . . . . . . . . . 27 3.3.1 Frame-level word posterior . . . . . . . . . . . . . 27 3.3.2 Fast computation of Frame-level Word Posteriors 28 4 Out of vocabulary Queries 31 4.1 Similarity measures among strings . . . . . . . . . . . . . 32 4.1.1 Levenshtein Edit Distance . . . . . . . . . . . . . 32 4.1.2 Stochastic Error Correcting Probability . . . . . . 33 4.2 Line-level smoothing . . . . . . . . . . . . . . . . . . . . 36 4.2.1 Levenshtein Distance-based smoothing . . . . . . 36 4.2.2 Stochastic Error Correcting-based smoothing . . . 36 4.3 Frame-level smoothing . . . . . . . . . . . . . . . . . . . 38 4.4 Filler-based scores . . . . . . . . . . . . . . . . . . . . . . 40 4.5 Combining scores with a Back-off heuristic . . . . . . . . 41 4.6 Computational issues . . . . . . . . . . . . . . . . . . . . 42 vii
Contents 5 Experiments 47 5.1 Corpora ........................... 47 5.1.1 Cristo Salvador . . . . . . . . . . . . . . . . . . . 47 5.1.2 IAM Database . . . . . . . . . . . . . . . . . . . 50 5.1.3 Query keywords selection . . . . . . . . . . . . . . 52 5.2 Assessment metrics . . . . . . . . . . . . . . . . . . . . . 53 5.2.1 Precision and Recall . . . . . . . . . . . . . . . . 53 5.2.2 Average Precision . . . . . . . . . . . . . . . . . . 55 5.2.3 Mean Average Precision . . . . . . . . . . . . . . 56 5.3 Description of the underlying HTR system . . . . . . . . 58 5.4 Baselineresults ....................... 59 5.5 Smoothing methods . . . . . . . . . . . . . . . . . . . . . 61 5.5.1 Line-level smoothing . . . . . . . . . . . . . . . . 63 5.5.2 Frame-level smoothing . . . . . . . . . . . . . . . 65 5.5.3 Back-off combination . . . . . . . . . . . . . . . . 67 5.5.4 Summary results . . . . . . . . . . . . . . . . . . 70 5.6 Posteriogram compression . . . . . . . . . . . . . . . . . 74 6 Conclusions 77 Bibliography 81 List of Figures 88 List of Tables 90 viii PRHLT-DSIC-UPV
Chapter 1 Introduction The usage of computers to preserve information from the passage of time and organize it to facilitate its access, has been one of their main applications since their very first days. Thanks to the evolution and improvement of technology, now we are able to store more digital information and access to it in a faster way and from almost everywhere around the world. However, for many centuries, handwriting has been the only way to preserve the human knowledge, besides oral communication. Precisely, storing information in books, manuscripts and other written forms, first handwritten and printed later, has been one of the main basis of all the human development around the world. Unfortunately, books have not always been successful in their task of preserving the human knowledge. One only needs to remember the dramatic incidents that devastated the old Library of Alexandria and caused the irreparable loss of thousands of ancient works. Handwriting Text Recognition (HTR) was developed, among other reasons, to preserve the information contained in handwritten documents using computers, a support which has proven to be more reliable than analog supports. And event more importantly, to allow an easier and faster access to that information (since information is only useful if it can be accessed). Despite all the progress achieved in the recent years by the HTR community, this field has still many problems and shortcomings, basically in terms of final accuracy of the transcribed text. These limitations affect the spreading of HTR and prevent it to be used for many useful applications. The dominant approach to the state-of-the-art HTR and its limitations will 1
Chapter 2. Handwriting Text Recognition 0.4 0.3 0.7 0.6 0.7 0.3 Figure 2.2: Illustration of a HMM modeling the character “t” of a handwritten text image where the text “text” is found. The boxed image regions are mapped to the state that emitted them. Formally, a continuous HMM is defined by the tuple (Q, q0, q|Q|−1, X, a, b). •Qis the finite set of states. In order to refer to a particular state qi∈Q, we will assume that Qis an enumerated set {q0, . . . , q|Q|−1}. •q0is the initial state, q0∈Q. •q|Q|−1is the final state, q|Q|−1∈Q. •Xis the real d-dimensional space of observation, X⊆Rd. •ais the state-transition probability distribution. In theory, a transition into a state qiat time t(i.e zt=qi), may depend upon all the previous sequence of states z1, . . . , zt−1. However, for sake of simplicity and computational tractability, usually the Markov assumption is taken, which assumes that ztis only conditionally dependent of zt−1, that is: 8PRHLT-DSIC-UPV
2.3. Hidden Markov Models P(zt|z1, . . . , zt−1) = P(zt|zt−1)(2.5) Additionally, it is also assumed that this distribution does not depend on the actual time when the transitions take place. This is know as the stationary assumption, and is formalized as: P(zt=qj|zt−1=qi) = P(zt+k=qj|zt+k−1=qi), k ≥0(2.6) Finally, for sake of the notation simplification and without any loss of generalization, it is assumed that q0is only visited in the first place, and q|Q|−1at the end. Thus, the actual sequence of visited states is assumed to be q0, z1, . . . , zT, q|Q|−1with zi∈Q. According to the previous restrictions, ais defined for each pair of states (qi, qj)∈Q− {q|Q|−1} × Q− {q0}as: a(qi, qj) = P(zt=qj|zt−1=qi)(2.7) As a probability mass function, amust guarantee that: X qj∈Q−{q0} a(qi, qj)=1,∀qi∈Q− {q|Q|−1}(2.8) •bis the emission probability distribution. First of all, for sake of simplification, the initial and final states, q0and q|Q|−1, are assumed not to emit any observation vector. Thus the sequence of observed states q0, z1, . . . , zT, q|Q|−1of T+ 2 elements, emits the observed sequence ~x1, . . . ,~xTof Telements. Additionally, an independence assumption is made for this conditional probability distribution. The observed feature vector ~xtat time tmay depend upon all previously visited states z1, . . . , ztand observed vectors ~x1, . . . , ~xt−1. The output independence assumption assumes that ~xtonly depends on the state at time t, that is, zt. p(~xt|z1, . . . , zt, ~x1, . . . , ~xt−1) = p(~xt|zt)(2.9) PRHLT-DSIC-UPV 9
Chapter 2. Handwriting Text Recognition Hence, bis defined for each pair (qi, ~x)∈Q− {q0, q|Q|−1} × Xas: b(qi, ~x) = p(~xt=~x|zt=qi)(2.10) As a probability distribution function, bmust guarantee: Z~x∈X b(qi, ~x)d~x = 1,∀qi∈Q− {q0, q|Q|−1}(2.11) In ASR and HTR applications, the emission distribution function is usually modeled as a Gaussian Mixture Model (GMM), which is a weighted sum of KGaussian distributions. b(qi, ~x) = K X k=1 λi,kbk(qi, ~x)(2.12) where, bk(qi, ~x) = 1 p(2π)d|Σi,k|exp −1 2(~x −~µi,k)0Σ−1 i,k (~x −~µi,k)(2.13) •µi,k is the mean vector of the component kof state qi. •Σi,k is the covariance matrix of the component kof state qi. •λi,k is the weight of the component kof state qi, and must satisfy: λi,k ≥0 K X k=1 λi,k = 1 Other distributions used in HTR or ASR applications are mixtures of Bernoulli distributions [18] or distributions estimated using Neural Networks [48, 10]. There are three main problems regarding the use of HMM for Pattern Recognition applications. 10 PRHLT-DSIC-UPV
2.3. Hidden Markov Models •Evaluation: To compute the probability of a sequence of observations x, given the model M, i.e. p(x|M). This is simply known as the emission probability of a sequence. A naive computation of this probability entails an exponential cost with the length of the sequences, since the probability that each sequence of states gives to xmust be summed up to obtain the total probability, that is: p(x|M) = X z∈QT p(x,z|M)(2.14) The previous can be efficiently computed by using two central algorithms for HMM, both based on Dynamic Programming: the forward and backward algorithms. Any of these two algorithms can be used to compute the emission probability of xand both have the same time and space computational costs. This reduces the computation of p(x|M)from a worst-case time complexity of O(T·|Q|T)to simply O(T·|Q|2), which can even be further reduced to O(T· |Q|), if certain topologies are assumed for the HMMs. •Decoding: An other central problem related to HMMs is to compute the most likely sequence of states ˆ zthat emitted a sequence of observations x, that is: ˆz= argmax z∈QT p(x,z|M)(2.15) Viterbi algorithm is used to compute the previous probability efficiently. It is very similar to the forward algorithm and has the same time complexity O(T· |Q|2), which can also be reduced to O(T· |Q|), under the same assumptions than forward and backward algorithms. Viterbi algorithm is the most used algorithm in HMM-based recognition systems, since it is the one used each time an input sequence xneeds to be recognized into some text sequence ˆ w. •Learning: The previous problems and algorithms assume that a HMM Mis given, but when a HTR or ASR task is considered, the only data available at the beginning is a training data set D, as PRHLT-DSIC-UPV 11
Chapter 2. Handwriting Text Recognition described in Section 2.2. The remaining problem is to optimize the transition and emission parameters of a HMM to optimize a certain criterion, based on the training data set D. The criterion used to optimize the HMMs parameters is the Maximum Likelihood, which maximizes the emission probability of the training data in D. Baum-Welch algorithm, a form of Expectation- Maximization (EM) algorithm, is used to improve iteratively the parameters of a HMM until no improvements are observed. The algorithm reaches a local optimum typically with very few iterations, and the cost of each iteration is O(N·T· |Q|2), which is also reduced to O(N·T· |Q|)under the same assumptions than the forward, backward and Viterbi algorithms. In HTR and ASR applications, it is usually necessary to use a concatenation of CHMMs to model a whole word, since character HMMs (or phoneme HMMs, in the case of ASR) are used to model a whole word, which is the basic input unit. In this case, the “embedded training Baum-Welch” algorithm is used, which reesti- mates the parameters of the composition of the C HMMs together. This algorithm allows to train the character models without any prior segmentation of the input sequences. The details of the previous algorithms are omitted from this thesis, since they are not required to understand the fundamental contributions of this work. More detailed information about HMMs can be found in [20, 28, 43]. 2.4 Language Models A Language Models (LM) is used to model the prior probability of a sequence of words in a certain language. LMs are used in a wide variety of natural language processing applications such as MT, ASR, HTR or text analysis. These models attempt to capture the properties of a given language and are able to predict the next word in a word sequence, given the previous words. For a sequence of lwords w=w1, w2, . . . , wl, the probability of such sequence Pr(w)can be decomposed by using the Bayes Rule, which gives the next equation: 12 PRHLT-DSIC-UPV
2.4. Language Models Pr(w) = Pr(w1, . . . , wl) = Pr(w1) l Y i=2 Pr(wi|w1, . . . , wi−1)(2.16) Usually, the estimation of the probability of arbitrary sequences becomes intractable since the length of these sequences is unrestricted and many of them are not observed during the training of the LM. For any sequence not seen during training, the model will assign a null probability to it. Observe that, if |V|is the number of words in a given vocabulary V, the number of different sentences that can be composed with lwords is |V|l. Thus, if one needs to accurately estimate the probability of sequences of length l, the number of training sequences grows exponentially with that length, which clearly becomes a problem when the length of the sequences is unrestricted, which is the case of HTR. In fact, this problem is one of the manifestations of the well-known curse of dimensionality phenomenon [3, 35], which is usually one of the main handicaps of many ML models. In order to face the curse of dimensionality in Language Models, ngram models are used. These models assume that only the n−1most recent words in a sequence are the ones that determine the probability distribution of the next word. That is, the probability of the word wi is only conditionally dependent of wi−n+1, . . . , wi−1, which is called the context of wi. Hence, Pr(w)is approximated by: Pr(w)≈Pr(w1) n−1 Y i=2 Pr(wi|w1, . . . , wi−1) l Y i=n Pr(wi|wi−n+1, . . . , wi−1) (2.17) The Maximum Likelihood estimation of the conditional probability Pr(w|v), given a set of sentences, is computed by: P(w|v) = C(vw) C(v)(2.18) where C(v)is the number of times that the sequence vhas appeared in any of the sentences in the training data set. PRHLT-DSIC-UPV 13
Chapter 2. Handwriting Text Recognition However, n-gram models are still sensible to the curse of dimensionality when a large context is considered, and thus, many of the sequences encountered on test data may be unseen during training, causing that P(w|v) = 0 in these cases. In aim to improve the estimation of such sequences, smoothing techniques are used to give some probability mass to these sequences. The two main smoothing methods are interpolation [20] and back-off [23]. In the experiments conducted in this work, the chosen smoothing method was the Kneser-Ney back-off, presented in [26], which is one of the most used techniques for n-grams smoothing. In the Kneser-Ney smoothing, a constant Dis discounted from the n-gram count. The main idea is to use a modified probability estimate for lower order ngrams. Specifically, the probability for a lower order n-gram is taken to be proportional to the number of unique words that precede it in the training data. Further details of the Kneser-Ney algorithm are omitted, since they are not relevant for the understanding of the central contributions of this work. Nevertheless, more details about this method and others can be found in [6]. Language Models and HMMs can be both interpreted as Stochastic Finite State Machines (SFSM), which provide an easy integration into a single SFSM. A version of the Viterbi algorithm, described on section 2.3, can be used on the top SFSM to obtain the best recognition hypothesis. Figure 2.3 shows an scheme of this integration. Additional details can be found in [44, 50, 51]. 2.5 Word Graphs Viterbi decoding algorithm described in section 2.3 can be adapted to provided multiple decoding hypotheses with their associated probability, instead of the single best hypothesis. Furthermore, as it will be explained further, these multiple hypotheses can be represented in form of a graph, that, when normalized appropriately provides certain features very useful for the task of general handwriting recognition and particularly, keyword spotting for handwritten image lines. A word graph (WG) is a labeled weighted directed acyclic graph (WDAG) whose edges are labeled with words and weighted with scores 14 PRHLT-DSIC-UPV
2.5. Word Graphs my this number house my thesis Language Model Lexical Model HMM Figure 2.3: A hierarchical FSM constructed by integrating Character HMMs, Lexical Models and LMs. derived from the HMM (likelihood) and N-gram (prior) probabilities computed during the line image decoding process. Formally, a word graph, G, is a tuple (Q, V, E, q1, F, τ, ω, ρ). •Qis a finite set of nodes. Given that word graphs are DAG, a topological order on the nodes may be assumed. Each node qis labeled with its corresponding index in this order: Q={1,2,...,|Q|}. •Vis a vocabulary, a non-empty set of words. •E⊂Q×Qis a finite set of edges connecting pairs of nodes in Q. Each edge is denoted by its starting and ending nodes: e= (i, j), i, j ∈Q, i < j. •qI∈Qis the initial node. For most cases, qI= 1. •F⊂Qis the set of final nodes. PRHLT-DSIC-UPV 15
Chapter 2. Handwriting Text Recognition •τ:Q→ {1, . . . , T}is a function that associates each node with the index of a vector from the input sequence. In handwritten images, that is the horizontal position in the image. Usually, τ(qI) = 1 and τ(q) = T, ∀q∈F. •ω:E→Vis a function associating each edge with a word from the vocabulary. Given the edge e= (i, j),ω(e)is a word hypothesis represented between the positions τ(i)and τ(j)of the input sequence. An alternative notation for ωwill sometimes be used to use pair of nodes Q×Qas the domain, instead of edges E. That is, ω(i, j) = ω(e), such that e= (i, j). •ρ:E→[0,1] is a probability function for each edge. The meaning of this probability depends on the normalization of the word graph, but ρ(e)typically refers to the probability of the hypothesis that ω(e)appears between the positions τ(i)and τ(j)of the decoded sequence. An alternative notation for ρwill sometimes be used to use pair of nodes Q×Qas the domain, instead of edges E. That is, ρ(i, j) = ρ(e), such that e= (i, j). As mentioned before, word graphs encode multiple word sequences hypotheses of an image line. A word sequence is represented by the words given by the ωfunction across a complete path in the word graph: a path from the initial node to any of the final nodes. More formally, given a path φ= (e1, e2, . . . , el), where ei∈E, e1= (1, j1), el= (il, jl)and jl∈F, the word sequence associated to this path is w=ω(e1)·ω(e2)· · · ω(el). As a matter of fact, each complete path in the word graph encodes a different alignment between a sequence hypothesis and different positions of the input sequence of feature vectors. In principle, since the same word sequence can be aligned in different ways to an input sequence, different paths on the word graph can actually represent the same word sequence, but with a different alignment to the input image. Word graphs can be restricted so that they contain only a single alignment for each word sequence (typically, the one with the highest likelihood), and thus, only a complete path exists for each sequence of words w. This class of word graphs are called unambiguous and from now on, we will assume that the considered word graphs are unambiguous in order to simplify the following expressions. The complete path encoding 16 PRHLT-DSIC-UPV
2.5. Word Graphs the sentence wwill be denoted by φwand the edges composing this path, will be denoted as e∈φw. The joint probability of a word sequence wand the input image x can be approximated using the scores on the edges of a word graph. p(w,x)≈Y e∈φw ρ(e)(2.19) A naive computation of the previous equation can be prohibitively expensive in terms of computation time, due to the large number of sequence hypotheses encoded in word graphs. However, it can be very efficiently computed using Dynamic Programming by means of a forward (α) and backward-like (β) functions. p(x)≈β(qI) = X q∈F α(q)(2.20) where: α(q) = (1q=qI P∀i∈Q:(i,n)∈Eα(i)ρ(i, n)q6=qI (2.21) β(q) = (1q∈F P∀j∈Q:(q,j)∈Eρ(n, j)β(j)n /∈F(2.22) Finally, the word sequence posterior probabilities P(w|x)can be approximately computed as: P(w|x) = p(w,x) p(x)(2.23) Usually, algorithms used for extracting the word graph introduce a parameter to specify the maximum input degree of each word graph node, which limits the amount of information retained in the word graph. Additionally, beam-search and other pruning techniques can be applied to accelerate the Viterbi search through the word graph. Figure 2.4 shows an example of a word graph for a text line image. The word graph represents a set of possible transcription hypotheses for the Spanish sentence “antiguos ciudadanos que en Castilla se llamaban”. PRHLT-DSIC-UPV 17
Chapter 3. Keyword Spotting equal to a certain confidence threshold Tare retrieved. The threshold T allows the user to control the precision-recall trade-off for each query. In the Information Retrieval field, precision basically measures the portion of retrieved lines that are relevant and recall measures the portion of relevant lines that are retrieved. For instance, suppose the user wants to find information about the H.M.S. Beagle from a collection of logbooks. It may look for the keyword “beagle” with a medium confidence threshold. The KWS system will then retrieve several lines: some of them relevant (“hits” or “true positives”), where the keyword “beagle” actually is present in the line, and some other will be misidentified lines, where the system spotted the “beagle” keyword but it does not actually appears (“false positives”). On the other hand, the system will probably miss also some lines where the keyword is written but a lower score is assigned (“false negatives”). By decreasing the confidence threshold T, the user will start getting some of the missing true lines where “beagle” is present but also other lines where the system thought that “beagle” was present (i.e. recall increases). Increasing the confidence threshold has the opposite effect: some “false positives” will be discarded, but it is also likely that some “hits” are lost, since their score is not high enough (i.e. precision increases). When T→ −∞, all lines are retrieved achieving the highest recall, but also, the lowest precision. When T→+∞, no line score exceeds the threshold and no results are retrieved for the query. More details about the precision and recall measures will be introduced in Section 5.2. For now, the important factor is that by providing the score S(x, v), the system is able to provide the user a tool for customization, which enables to personalize for each query the minimum degree of accuracy that the user expects. 3.2 Filler approach One of the most successful techniques to model the score S(x, v), for a given handwritten line image xand a given keyword v, is known as the Filler approach. It was first used in the field of Automatic Speech Recognition [30, 24, 25]. The approach uses character-HMMs to build a query-specific model Kvfor the keyword vand a filler or garbage model 24 PRHLT-DSIC-UPV
3.2. Filler approach F. It has been recently applied to handwritten KWS with considerable success [12, 13]. The filler HMM allows to recognize any sequence of characters. This is done using a composed HMM with an initial state linked to all the trained character HMMs in parallel and connecting each of them to a final state which has a loop-back to the initial state, in order to allow multiple strings with any arbitrary length to be decoded. The resulting HMM is depicted in Figure 3.1a. The keyword HMM, shown in Figure 3.1b, allows the recognition of the particular queried keyword. It is constructed by the concatenation of the character HMMs forming the keyword surrounded by the space HMM and embedding the filler HMM at the beginning and the end of the combined HMM. The initial state is linked to the filler and the first character HMM of the keyword and the edges to the final state come from the second filler HMM and the last character HMM of the keyword. This allows to recognize the query at any position of the line, no matter if the line is formed by multiple words or if it is formed only by the keyword. a · · · b sp (a) Filler HMM: F d sp sp o rw FILLER FILLER (b) Keyword HMM: Kv Figure 3.1: Compositions of HMMs used by the Filler approach. The states of the character HMMs usually use GMMs emission distributions, as explained in Section 2.3. PRHLT-DSIC-UPV 25
Chapter 3. Keyword Spotting In the spotting phase, a score SF(x, v)is computed as described in Equation (3.1), where p(x|Kv)is the probability of the whole image x given by the keyword HMM Kv,p(x|F)is the probability given by the filler HMM and Lvis the number of frames from the start to the end of the keyword v, according to the alignment given by Kv. SF(x, v):=log p(x|Kv)−log p(x|F) Lv (3.1) Intuitively, the probability given by the filler HMM will be greater than the one given by the keyword HMM, since the latter is a more restrictive modeling than the former. On the other hand, the probability computed by the keyword-specific model, Kv, will be greater on image lines that contain the modeled keyword than on image lines which contain other text, since the restrictions imposed in the keyword-specific model will dampen the probability given by the HMM. Thus, in the best case, the probability given by Kvwould be similar to the given by F, if the keyword is present in line x. If the keyword is not in the line image, p(x|Kv)will be typically much smaller than p(x|F). The difference of the logarithm of these two probabilities is used as the score, as shown in Equation (3.1). A formal justification of this score can be found in [13]. The main advantage of this model is that it does not require a word LM. This implies that any keyword can be spotted, even if that keyword was not part of the original training set. This provides the system with a huge versatility. However, LMs have been shown to be useful to boost the KWS accuracy and character LMs have been used together with the Filler approach [11]. Nevertheless, the main issue with the Filler-based approaches is that the lookup times are usually huge, since one Viterbi run has to be done for each keyword and for each line in the collection of documents. This yields in a O(|D| · |q| · γ)running time for a single query v, where |D| is the number of lines in the collection of documents, |q|is the number of characters of the query and γis a constant that depends on the total number of states in all character HMMs in Fand Kvand on the square of the number of character HMMs in F. 26 PRHLT-DSIC-UPV
3.3. Word Graph approach 3.3 Word Graph approach An alternative to diminish the computational cost of the search phase introduced by the Filler approach is the, so called, Word Graph approach. This approach uses the concept of word graphs introduced in Section 2.5. For each line in the collection, a word graph is computed and stored after the training phase. With the proper normalization, a score is obtained directly from the WG for each word in the training vocabulary. This score is stored during indexing. On the search phase, the only task to be done is to find in which WG the query keyword has a score that surpasses the confidence thresholds set by the user. The main publications presenting this method for handwritten KWS are [46, 47]. 3.3.1 Frame-level word posterior The first step to fully explain how this approach works is to introduce the word posterior probability at frame level, which accounts for the degree of uncertainty about a given keyword vbeing present in a specific horizontal position iwithin the line image, represented by the sequence of feature vectors x=~x1, ~x2, . . . ,~xn, where each vector ~xicorresponds to a frame of the image. This probability distribution can be marginalized considering all possible non-nested intervals containing the frame i, which gives Equation (3.2). P(v|x, i) = i X k=1 n X l=i P(v, k, l|x, i)(3.2) Applying Bayes rule to the previous result gives: P(v|x, i) = i X k=1 n X l=i P(k, l|x, i)P(v|x, k, l, i)(3.3) Finally, assuming that the probability P(k, l|x, i)is distributed uniformly among all [k, l]intervals containing i, and that P(v|x, k, l, i)is independent of i(since i∈[k, l]), gives the next equation: P(v|x, i)≈λ i X k=1 n X l=i P(v|x, k, l); λ=1 i·(n−i+ 1) (3.4) PRHLT-DSIC-UPV 27
Chapter 3. Keyword Spotting Observe that P(v|x, k, l)can be approximated by any state-of-the-art HTR engine, since it is the probability of the alignment of the word vto the image xwithin the frames [k, l]. Obviously, the better the accuracy of the HTR engine is, the better frame-level word posterior estimation is achieved. A naive computation of the previous equation, that could be done using a HTR engine for isolated words and all possible segmentation hypothesis of the image line, would entail a tremendous cost: at least Ω(|x|4). Nonetheless, this cost can be dramatically reduced if word graphs are used, as it will be explained in the next section. The previous equation could be used to address KWS in a naive way: Given a keyword vto be spotted, the frame-level word posterior probabilities P(v|x, i)can be computed to make the frame ia spotting candidate, that would be filtered according to the given threshold T. Nevertheless, the previous score gives a frame-level measure and lines have usually thousands of frames and such approach will be too finegraded, since hundreds of spots would be given for each line. Thus, we aim to give a line-level global measure, without considering the specific position of the queried keyword vwithin the line image. In order to fulfill this requirement, the confidence score S(x, v)is defined as: SG(x, v):= max 1≤i≤nP(v|x, i)(3.5) Similar scores to the one described in the previous equation have been proposed in the past as good heuristics to obtain word and sentence recognition confidence measures in Machine Translation [49], Automatic Speech Recognition [52, 41] and Handwriting Text Recognition [42]. Once the line-level score SG(x, v)is computed, lines with a score surpassing the threshold T, given by the user, are retrieved. 3.3.2 Fast computation of Frame-level Word Posteriors It was pointed in the previous section that a naive computation of Equation (3.4) results in a huge cost. Here we summarize the main ideas presented in [46] that allow a fast computation of the previous equation by using word graphs. 28 PRHLT-DSIC-UPV
3.3. Word Graph approach In Equation (3.4), the frame-level word posterior probability P(v|x, i) is approximated using the alignment probability of the word vbetween frames kand l, i.e. P(v|x, k, l). Observe that this probability distribution can be approximated from the word graphs, using the fact that each edge (q, q0)in the word graph has associated a start and end frames, corresponding to the values of the τfunction for nodes qand q0, as explained in Section 2.5. Using the fact that the sequence of character whas a single complete path in the word graph G, we can compute the edge posterior,ϕ(q, q0), efficiently using a the forward and backward algorithms: ϕ(q, q0) = X w:(q,q0)∈φw P(w|x) = α(q)·ρ(q, q0)·β(q0) β(qI)(3.6) Observe that this defines a new normalized weight for each edge in the word graph. This weight function has the following properties, as it has been proved in [46]: •Flow-preserving nodes: X q0∈Q ϕ(q0, q) = X q00 ∈Q ϕ(q, q00),∀q∈Q(3.7) •Edge-posteriors are frame-level conditional distributions: X (q,q0)∈E:τ(q)<i≤τ(q0) ϕ(q, q0) = 1,1≤i≤n(3.8) Given the previous normalization of the word graphs, then the framelevel word posterior probability P(v|x, i)can be approximated as: P(v|x, i)≈X (q,q0)∈E:ω(q,q0)=v,τ(q)<i≤τ(q0) ϕ(q, q0)(3.9) According to Equation (3.8), the previous Equation correctly defines a probability distribution with: Pv∈Σ∗P(v|x, i)=1. The computation of P(v|x, i)can be performed efficiently by sequentially visiting the WG edges and updating, for edge (q, q0)the value of PRHLT-DSIC-UPV 29
Chapter 3. Keyword Spotting P(v|x, i). Let be ω(q, q0) = v,τ(q) = i,τ(q0) = k, then the counter of frames i < j ≤kfor the keyword vare updated. When all edges have been visited, the absolute frequencies are normalized per frame. The computing time is then proportional to the number of edges and the average length of an edge, i.e. τ(q0)−τ(q). As the authors of the previous computation explain, this is, in fact, Θ(κ· |x|), where κis a relatively small constant that depends on the WG input degree. The cost of the following steps determine the overall cost of computing SG(x, v): •word graph generation and normalization, O(Γ · |x|). •word graph-based computation of the frame-level word posterior probabilities P(v|x, i),Θ(κ· |x|). •maximization step for the final calculation of SG(x, v),Θ(|x|). Given that, the final cost of SG(x, v)is O((Γ + κ)· |x|), where both Γand κdepend on the input degree of the word graph. This may become too expensive for large collections of documents and/or dense word graphs. Nevertheless, this cost is incurred only during the document collection processing needed to create the indexes. Once the indexes have been created, the lookup time is extremely fast. 30 PRHLT-DSIC-UPV
Chapter 4 Out of vocabulary Queries As mentioned in Section 3.3, one of the main benefits of using word graphs for KWS is that, by using contextual information, a better accuracy is achieved in front of the Filler model, which is a lexicon-agnostic approach. Word graphs assume that a vocabulary of words is given, which can be used to create an index that allows for fast searches. However, the use of word Language Models has a non-trivial implication: all words out of that vocabulary are not part of the modeled language, and thus, their prior probability is zero. The words which are not part of a Language Model are called out of vocabulary (OOV) words. For any query consisting in an OOV keyword, the word graph approach presented in the previous chapter will assign a null score to any line in the database. Only when the user sets the threshold to the minimum value, the system will report some line. Unfortunately, all lines will be reported in this scenario (since all of them have the same null score), which clearly limits the usability of the system for such queries, since it may be inadmissible to the user to review all the image lines, specially if he or she is working with a huge collection of documents. In further sections we will present different alternatives that try to give a reasonable score for every possible keyword, in aim to make the WG-based Keyword Spotting system more robust and flexible. Most approaches presented here are based in the same idea: When an OOV keyword is presented to the system to be spotted, its score will be based on the score of similar in-vocabulary keywords, indexed by the system. We will refer to this procedure as the score smoothing of an 31
Chapter 4. Out of vocabulary Queries OOV keyword. First, two alternative similarity measures are presented. The first one is the well-known Levenshtein edit distance. The second one, is a probability distribution based on Stochastic Error Correcting, that we call confusion probability. These alternative measures are presented in 4.1. Then, we propose different smoothing techniques at different stages of the spotting step. In Section 4.2, two line-level smoothing approaches will be presented that try to use the line-level score SG(x, v)computed for the indexed keywords using the word graph approach. Section 4.3 will present a method which is done at each frame by smoothing P(v|x, i)(see Section 3.3.1), using more available information than the previous methods, but requiring more computation. The last smoothing technique uses the line score SF(x, v), computed by the Filler model, to estimate the score of OOV keywords, given that this model is able to give a reasonable score for any keyword. Finally, an heuristic approach to combine the smoothed score for out of vocabulary queries and in-vocabulary queries will be presented (Section 4.5) and the different time and space requirements of the presented smoothing techniques will be commented in Section 4.6. 4.1 Similarity measures among strings 4.1.1 Levenshtein Edit Distance The Levenshtein edit distance is defined as the minimum number of insertion, deletion and substitution (edition) operations that are required to transform a string uinto v[29]. For instance, in order to transform the string “handwriting” into “handwritten”, at least, three of these edit operations are required: 1. Replace the second “i” by “t”: handwriting →handwrittng 2. Replace the second “n” by “e”: handwrittng →handwritteg 32 PRHLT-DSIC-UPV
4.1. Similarity measures among strings 3. Replace the last “g” by “n”: handwritteg →handwritten The Levenshtein distance is a well-known distance measure among strings which can be computed using the following recursive equation, for strings u=u1,m =u1, . . . , umand v=v1,n =v1, . . . , vn: d(u1,m, v1,n) = 0n=m= 0 n n > 0∧m= 0 m n = 0 ∧m > 0 min d(u1,m−1, v1,n)+1 d(u1,m, v1,n−1)+1 d(u1,m−1, v1,n−1) + δ(um, vn) n > 0∧m > 0 (4.1) where the δfunction is defined as: δ(a, b) = (1a6=b 0a=b(4.2) The previous equation a allows for an efficient implementation using dynamic programming with a time complexity of O(|u|·|v|). The problem that presents the use of the Levenshtein distance for the particular problem of KWS, is that it is blind to the morphological structure of the symbols that compose both string uand v. Thus, the Levenshtein distance between “hello” and “halo” is the same as “hello” and “hZlXo” (2 edit operations are required), but the latter transformation is very unlikely to happen in regular applications using natural English language. 4.1.2 Stochastic Error Correcting Probability In order to cope with the problem presented by the Levenshtein distance, we define an alternative similarity measure, based on the Stochastic Error Correcting approach [1]. The key idea is to compute a confusion probability P(u|v)which measures how likely is the HTR system to detect vinstead of u, where u∈Σ∗and v∈V, the vocabulary used for training. Following the ideas proposed by the previously cited paper, PRHLT-DSIC-UPV 33
Chapter 4. Out of vocabulary Queries cluded in the word graph of the given image line x: X u∈Σ∗ FS(u|x, i) = X u∈Σ∗X v∈VG(x) P(v|x, i)·P(u|v) maxu0∈Σ∗P(u0|v)β= X v∈VG(x) P(v|x, i) maxu0∈Σ∗P(u0|v)βX u∈Σ∗ P(u|v) = X v∈VG(x) P(v|x, i) maxu0∈Σ∗P(u0|v)β=Zx,i (4.22) Then, the posterior distribution ˜ P0(u|x, i)is defined as: ˜ P0(u|x, i) = 1 Zx,i ·FS(u|x, i)(4.23) Finally, this smoothed frame-level word posterior probability is used to compute the finale line score for image xand keyword u, as usual: ˜ S0 I(x, u):= max 1≤i≤|x| ˜ P0(u|x, i)(4.24) The parameter βis used to tune the length-correction heuristic. Observe that if β= 0, then Equation (4.23) reduces to Equation (4.13). 4.4 Filler-based scores Here we propose to take advantage of the capability of the Filler model to deal with out of vocabulary queries, and we propose a very simple smoothing approach based on using the line scores computed by the Filler model, SF(x, u)in order to estimate the score of such queries. Since the scores produced by the Filler model are usually in a logarithmic scale in the range (−∞,0], they are converted to the same range than the ones given by the word graph method using the following equation: S0 F(x, u) = exp(SF(x, u)) (4.25) 40 PRHLT-DSIC-UPV
4.5. Combining scores with a Back-off heuristic assuming that natural logarithms were used in the computation of SF(x, u). In fact, this approach is not an actual smoothing, since we are just using the Filler model to compute the scores of any event (in and out of vocabulary) and, thus, we are not taking advantage of the benefits that the WG-based KWS provides (lexicon-awareness and much faster time responses). However, in the following section, we will present a combination heuristic for taking advantage of the lexicon knowledge of word graphs for in-vocabulary keywords, and the capability of the Filler model to serve out of vocabulary queries. 4.5 Combining scores with a Back-off heuristic In previous sections, we have seen many approaches in order to smooth the score of out of vocabulary queries. The previous smoothing techniques are defined for any keyword u∈Σ∗, including the in-vocabulary keywords whose score is already well-modeled by the WG-based KWS approach. We observed that using directly the smoothed scores for any keyword, no matter if it is a in or out of vocabulary keyword, does not result in the best performance. For instance, the score assigned to relevant events by some of the presented methods (Sections 4.2.2, 4.3 and 4.4) have very different distributions depending on the length of the keyword, which affects the performance. We tried to provide an heuristic solution for this issue, as explained in the respective sections, however, the problem is not completely solved and better results can be achieved, if the scores given by the word graph and the presented smoothed scores are combined in a more elaborated way. During experimentation, we observed that the following heuristic works very well for combining in-vocabulary and out of vocabulary scores: S(x, u):=(SG(x, u)u∈VG(x) ˜ S(x, u)ηotherwise (4.26) PRHLT-DSIC-UPV 41
Chapter 4. Out of vocabulary Queries where η, that we call score scaling factor, is a parameter that controls the weight of the out of vocabulary scores. It is adjusted experimentally using a validation set, as usual. Additionally, ˜ S(x, v)can be any of the of the presented smoothing approaches: •Levenshtein Distance-based smoothing, ˜ SL(x, u), presented in Section 4.2.1. •Stochastic Error Correcting-based smoothing, ˜ SC(x, u)and ˜ S0 C(x, u), presented in Section 4.2.2. •Frame-level smoothing, ˜ SI(x, u)and ˜ S0 I(x, u), introduced in Section 4.3. •Filler-based smoothing, S0 F(x, u), presented in Section 4.4. This heuristic is similar to the back-off smoothing technique used in N-gram language models, where lower-order N-grams are used to estimate the probabilities of unseen events during training [23]. This similarity suggests that perhaps other combination techniques based on interpolation could also work well in this scenario. However, we have not explored this path. Finally, observe that the smoothed frame-level word posterior probability ˜ P(v|x, i), presented in Section 4.3, could also be combined (by means of back-off or interpolation) with the word posterior given by the word graph model (Section 3.3.1), instead of directly combining the scores at line-level. It remains to be explored also if this is a better alternative. 4.6 Computational issues Three different levels of smoothing have been presented in the previous sections, each of them entailing very different costs. While high-level smoothing techniques, proposed in Section 4.2, are relatively fast, lowlevel methods are much more slow, like the Filler-based score. Regarding the first level smoothing (line level), both presented approaches have the same time complexity. A naive implementation of the line-level smoothing methods would have a time complexity of O(|u| · 42 PRHLT-DSIC-UPV
4.6. Computational issues L· |V| · |D|), where |u|is the length of the query, L= maxv∈V|v|is the length of the longest indexed keyword, Vis the number of indexed keywords, and |D| is the number of indexed documents. Even if the information of frequent non-indexed keywords is cached, computing the distance or confusion probability between a new query u and all the indexed keywords would be prohibitive, for large data sets. However, different methods have been presented in the literature in order to reduce such operations based on common prefixes of the indexed keywords [5, 2], which dramatically reduce the time needed for computing these similarity measures. The frame-level smoothing presents an additional problem, which is that it adds an additional linear dependency on the number of frames of the indexed documents. Then, if F= maxx∈D |x|is the maximum length of the indexed image lines, a trivial implementation of this smoothing method would require about O(|u| · L· |V| · |D| · F)time steps. Of course, the same time reductions explained before could be used to reduce the cost of computing the confusion probability among the query and all indexed keywords. Moreover, the maximization operation stated in Equation (4.13) which results in the linear dependence of Fdoes not actually need to involve all frames of the line image, since for many of them, the frame-level word posterior will be identical. Observe that two frames that cut the same set of edges will have the same frame-level word posterior distribution. Since the set of cutting edges can only change when a new node is introduced in the word-graph, then the frame-level word posterior distribution will only change between two frames iand j, if and only if, a node qhas a time-stamp τ(q)in the range i<τ(q)< j. For instance, it can be easily seen in Figure 4.2a that any frame i between t1and t2fill have the same word posterior, i.e. P(antiguos|x, i) = 0.6and P(antiguas|x, i)=0.6, t1< i < t2. Figure 4.2b shows an example of a posteriorgram, where it is clearly shown that many columns of the histogram have exactly the same distribution, and thus, can be compressed into a single column in order to compute the maximization operation explained before. Even for dense word graphs, the number of frames required to perform the maximization operation is small: It typically decreases from 1000- 2000 frames, which is the typical length of the feature sequences, to 20-40 PRHLT-DSIC-UPV 43
Chapter 4. Out of vocabulary Queries (a) Example of a word graph. Frames between tiand ti+1 have the same posterior. (b) Example showing a posteriorgram distribution. Columns of the histogram with the same distribution can be compressed. Figure 4.2: Examples showing that the compression of posteriorgrams is possible. frames. This gives not only a huge speed-up in the lookup times, but also in the space requirements of this smoothing methods, since it needs to store not only the scores associated to each indexed keyword and image line, but the whole (compressed) posteriorgram of each line. Finally, Filler-based scores are the ones that require most time-expensive computations. For one million images, for instance, a single keyword query could require days or weeks of intensive computing. However, as 44 PRHLT-DSIC-UPV
4.6. Computational issues shown experimentally, using the back-off heuristic with this method, results in the best performance for out of vocabulary queries. PRHLT-DSIC-UPV 45
Chapter 5 Experiments 5.1 Corpora 5.1.1 Cristo Salvador The Cristo Salvador corpus (CS) is a XIX century Spanish manuscript provided by the the Biblioteca Valenciana Digital (BIVALDI)1. The manuscript contains handwritten text of a single writer and was scanned at 300dpi. The corpus suffers the typical degradation problems present in legacy documents [7], such as smear, significant background variations, drastic illumination changes, spots caused by the humidity, ink spots, etc. Moreover, this manuscript includes words with different sizes and style, underlined words, etc. All these degradation problems make the accurate recognition of this document difficult to achieve. The CS corpus is relatively small collection composed of 50 text page images in color. Figure 5.1 show some examples of the page images. Figure 5.2 contains a detailed view of a page image region. The page images were preprocessed and lines were automatically segmented as described in [38]. The results of this automatic processing were visually inspected and the segmentation errors were manually corrected, resulting in 1,172 text line images. The transcriptions of the corresponding lines contain 10,860 running words with a vocabulary of 3,287 different words. 1http://bv2.gva.es 47
Chapter 5. Experiments Figure 5.1: Some page examples of the “Cristo-Salvador” corpus. Figure 5.2: Detailed view of a “Cristo-Salvador” page image. Two different partitions are defined for this dataset. The first one, called the “page” partition, consists of 491 test line images, corresponding to the last ten lines of each document page, and 681 training line images (the rest of lines). The second one, the “book” partition, consists of 48 PRHLT-DSIC-UPV
5.1. Corpora 497 line images belonging to the last 21 pages of the collection, and the remaining 675 lines are used for training (corresponding to the first 29 pages). In the experiments conducted in this work, we use the “book” partition. Additional details of the training and test sets are depicted in Table 5.1. This table shows the statistics of the data used for the HMM and LM training. This database does not provide a default validation set and this is needed to tune some of the parameters of the different algorithms needed to perform HTR and KWS. In order to do so, the training set have been divided into 10 sub-partitions to perform 10-fold cross-validation to adjust the required parameters. As usually done in cross-validation, each of these sub-partitions is used for testing while the remaining 9 are used for training. Table 5.2 shows the averaged statistics among the 10 cross-validation partitions. Training Test Lines 675 491 Running chars 35,176 25,189 Char set size 53 52 Running words 6,227 4,691 Word set size 2,474 1,879 Table 5.1: Basic statistics of the “Cristo-Salvador” used partition. CV Train CV Test Avg. Lines 607.5 67.5 Avg. Running Characters 31,366.8 3,485.2 Avg. Running Words 5,603.3 621.7 Avg. Character Lexicon 78 78 Avg. Word Lexicon 2,072.6 354.3 Table 5.2: Basic averaged statistics of the “Cristo-Salvadors” cross-validation partitions. It is important to remark that this corpus has quite a small training PRHLT-DSIC-UPV 49
Chapter 5. Experiments when referring to Average Precision. 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 Precision Recall Interpolated RP curve RP curve Figure 5.5: An example of a Recall-Precision curve (dashed) and the RP curve with interpolated precision (solid). 5.2.3 Mean Average Precision The recall-precision curve and the Average Precision are usually computed for a set of queries, as explained before. However, in the literature there is also an alternative metric that consists in computing the area under the recall-precision curves for each keyword separately and then averaging all of them. This is metric is known as the Mean Average Precision (MAP) [32]. For both AP and MAP the value of the score which is assigned to each event is not important, the only important factor that determines 56 PRHLT-DSIC-UPV
5.2. Assessment metrics the area under the PR curve is the relative ordering between relevant and non-relevant results. As long as most of the relevant results have higher scores than the non-relevant results, both metrics will be similar. However, there is an important difference between MAP and AP. The latter computes the area under the recall-precision curve when all queries are considered simultaneously, while the former only considers queries one at a time. Then, when the score assigned to an event highly depends on the keyword, very different values for the AP and MAP may be obtained. Table 5.6 shows an example of this phenomenon. Observe that the scores of the keyword “K1” are systematically higher than the scores of the keyword “K2”. If the MAP metric is considered, which computes the area under the PR curve for each keyword separately, the performance is perfect since the relevant events have greater scores for both keywords, thus a MAP of 1.0 is achieved. On the other hand, if all events are considered together, as the AP metric does, the performance is considered worse, since the relevant event of keyword “K2” has a lower score than the non-relevant events of keyword “K1”. Then, the achieved AP has a value of 0.75. Document Keyword Relevant Score D1 K1 1 1 D2 K1 0 0.1 D3 K1 0 0.1 D1 K2 1 0.05 D2 K2 0 0 D3 K2 0 0 AP = 0.75 MAP = 1.0 Table 5.6: Example showing the difference between AP and MAP. There is some controversy in the Information Retrieval community regarding this phenomenon. Some authors defend that the AP metric should be used, since it demands a consistent and robust threshold which assigns high scores for relevant events and low scores for non-relevant ones, no matter which keyword or document is considered. Additionally, PRHLT-DSIC-UPV 57
Chapter 5. Experiments the MAP metric is not well-defined when the considered queries include non-relevant keywords (those which are not present in any document). On the other hand, other authors defend that the MAP metric should be used since it is more similar to the user point-of-view, because users do not search for all keywords at the same time, but they perform individual queries. Moreover, very few search engines let the user to adjust the threshold, but provide a sorted list of retrieved documents, where the events with the highest score are situated in the top positions of the results list. During the development of this thesis, we decided to measure both AP and MAP in order to have a broader view of the performance of the proposed algorithms. 5.3 Description of the underlying HTR system As mentioned in Chapter 3, KWS systems are built on top of a HTR engine. In this section we discuss the underlying HTR systems used for keyword spotting. We use the standard HMM-based approach for HTR. Once the text document images have been segmented into lines, several preprocessing steps are carried out to normalize the image (slope, slant and size normalization) and a sequence of feature vectors for each line image. In the case of the CS database, the images are processed using a sliding window approach were each original image line is segmented into r= 16 rows and a number of columns, c, is chosen so that the number of rows r cis three times the original line image aspect ratio. For each cell, the average gray-level and the horizontal and vertical gradients of the gray-level are used as features, thus each line is represented by a sequence of c48-dimensional vectors (frames). More details of this feature extraction process can be found in [44, 38]. On the other hand, for the IAM database, the carried image normalization preprocessing and the used features are presented in [33]. Same as before, a sliding window scheme is used here, but nine features are extracted from each frame: the number of black pixels in the window, the center of gravity, the second order moment of the window, the position of the upper and lower contour, the gradient of this contour, the number 58 PRHLT-DSIC-UPV
5.4. Baseline results of black-white transitions in vertical direction and the number of black pixels contained between the upper and lower contour. Once the the image features have been extracted, 78 character-HMMs were trained for the CS database. The number of states for each character- HMM was determined experimentally using force-alignment, as described in [43]. The average number of states per character was 14, with 16 Gaussian components for each state. These parameters were tuned for the cross-validation sets. A bi-gram language model was trained from the transcriptions and smoothed using the standard Kneser-Ney back-off technique [26]. The LM was estimated only using the transcriptions of the training set. Finally, the word insertion penalty and the grammar scale factor parameters were set to 80 and -160, respectively. They were also tuned using the crossvalidation sets. Regarding the IAM database, 72 character-HMMs were trained. The number of states was also variable and was adjusted using the validation set. The number of states per character-HMM varies from 2 to 28 states, with 12 Gaussian components per state. The bi-gram language model was trained on the LOB-Brown-Wellington corpora described in Section 5.1.2. The resulting language model was smoothed using also the standard Kneser-Ney back-off. In this case, the word insertion penalty and the grammar scale factor parameters were set to 28 and -17, respectively. Both adjusted on the validation set of the IAMDB. The software used to train the underlying handwriting text recognition system is the widely used Hidden Markov Model Toolkit (HTK)2 [53]. 5.4 Baseline results In this section we describe the baseline results achieved by the Fillerbased and the WG-based KWS systems described in Section 3.2 and Section 3.3, respectively. The baseline results for the CS database are shown in Table 5.7. Table 5.8 shows the baseline results for IAMDB. For the word graph-based 2http://htk.eng.cam.ac.uk/ PRHLT-DSIC-UPV 59
Chapter 5. Experiments KWS approach, different WG input degrees were tried. The results are given for each tried density, d. In the case of the CS database, the results on the Validation columns are the average of the AP and MAP achieved by the 10 partitions defined in Section 5.1.1. The confidence interval is computed at 95% of significance. AP MAP Validation Test Validation Test Filler 0.784 ±0.015 0.642 0.859 ±0.016 0.739 WG, d= 1 0.495 ±0.016 0.389 0.389 ±0.007 0.198 WG, d= 3 0.617 ±0.010 0.536 0.458 ±0.004 0.275 WG, d= 5 0.630 ±0.010 0.550 0.464 ±0.004 0.281 WG, d= 10 0.632 ±0.010 0.554 0.473 ±0.005 0.287 WG, d= 20 0.634 ±0.010 0.556 0.477 ±0.005 0.290 WG, d= 40 0.634 ±0.010 0.556 0.480 ±0.006 0.290 Table 5.7: Baseline AP and MAP for CS. AP MAP Validation Test Validation Test Filler 0.548 0.467 0.737 0.665 WG, d= 1 0.555 0.510 0.567 0.524 WG, d= 3 0.705 0.659 0.677 0.639 WG, d= 5 0.717 0.674 0.687 0.661 WG, d= 10 0.728 0.683 0.700 0.675 WG, d= 20 0.731 0.689 0.707 0.684 WG, d= 40 0.733 0.691 0.712 0.688 Table 5.8: Baseline AP and MAP for IAMDB. The previous tables show the role of the WG input degree in the performance of the WG-based method. While the AP and MAP increase with the input degree of the WG, the differences are not significant for d= 10,20,40, as the confidence intervals of the validation AP and MAP show for the CS database. For the IAM database, no confidence inter- 60 PRHLT-DSIC-UPV
5.5. Smoothing methods vals could be computed, but it is also seen that the improvement in the assessment metrics saturates for high-dense word graphs. Also, the importance of the out of vocabulary keywords and the language model can be observed. In the CS database, the Filler model outperforms the WG-based approach with a high margin, specially in the MAP metric. On the other hand, the WG-based model is much better than the Filler model in the IAM database. This is due to the fact that the CS language model was trained using very few data (only the transcriptions from the training set), whereas the IAMDB language model was trained using a huge external corpus. Also, many of the queries in the CS database were out of vocabulary (Table 5.5), while in the IAMDB scenario this percentage was not so elevated (see Figure 5.6, which shows the distribution of the AP among the test keywords in each database). This explains why AP and MAP are much better in the IAMDB for the WG, in comparison to the CS database. On the other hand, the reason that explains why the Filler behaves poorly in the IAMDB, in comparison to the CS, is that the latter case was written only by a single writer, and thus the variability that has to be modeled by the GMMs and HMMs is much lower in the second case, in comparison to the first. The WG-based approach is capable of handle this variability by using the information provided by the well-estimated LM. Moreover, the Filler approach suffers from a problem similar to the one present in the introduced smoothing techniques that used the stochastic error correcting approach: the score assigned to an event highly depends on the length of the keyword. These two effects explain why the AP of WG-based model outperforms the Filler approach, while the MAP is similar. Figure 5.7, which shows the distribution of the scores for relevant events, can help to understand these issues. 5.5 Smoothing methods In this section we explain the experiments performed to assess the improvements achieved by using the different smoothing methods presented in Chapter 4. The section is divided in four subsections: the first one describes the results of the line-level smoothing methods, the second one comprises the results of the frame-level methods, the third one explains PRHLT-DSIC-UPV 61
Chapter 5. Experiments 000111 00 00 11 11 000 000 111 111 000 000 111 111 0011 00 00 11 11 000111 0011 000111 00 00 11 11 000 000 000 000 111 111 111 111 000 000 111 111 00 00 11 11 000111 000111 0011 00 00 11 11 000111 0011 000111 00 00 11 11 000 000 000 000 000 000 000 111 111 111 111 111 111 111 IV OV 0 0.2 0.4 0.6 0.8 1 0 0.5 1 Keywords AP (a) CS, Filler 000111 0011 000111 000 000 111 111 00 00 11 11 0011 000111 0011 000 000 111 111 0011 000 000 000 111 111 111 000 000 111 111 00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11 000111 000 000 111 111 00 00 11 11 0011 000111 0011 000 000 111 111 0011 000111 IV OV 0 0.2 0.4 0.6 0.8 1 0 0.5 1 Keywords AP (b) CS, WG-40 000111 00 00 00 11 11 11 000 000 111 111 000111 0011 00 00 11 11 000 000 111 111 0011 000 000 111 111 00 00 11 11 000 000 000 000 000 111 111 111 111 111 000 000 111 111 0011 000 000 111 111 000 000 111 111 00 00 11 11 00 00 11 11 000 000 111 111 0011 000 000 111 111 0011 000 000 111 111 IV OV 0 0.2 0.4 0.6 0.8 1 0 0.5 1 Keywords AP (c) IAM, Filler 000111 00 00 11 11 000 000 111 111 000 000 111 111 00 00 11 11 00 00 11 11 000111 0011 000 000 111 111 0011 000 000 000 000 000 000 000 000 111 111 111 111 111 111 111 111 000 000 111 111 00 00 00 11 11 11 000 000 111 111 000 000 111 111 00 00 11 11 00 00 11 11 000111 0011 000 000 111 111 0011 000111 IV OV 0 0.2 0.4 0.6 0.8 1 0 0.5 1 Keywords AP (d) IAM, WG-40 Figure 5.6: Histogram of the AP of test keywords for CS and IAMDB using the baseline Filler and WG models. the experiments and performance of the previous methods combined with the baseline WG scores, using the Back-off approach described in Section 4.5, including the results of the Back-off method based on the Filler scores. Lastly, all results are summarized in the final subsection. Since most of the proposed methods involve different hyper-parameters that need to be tuned in order to achieve a proper performance, we restrict the further experiments to word graphs with a maximum input degree of 40. Thus, the following results must be compared to the last rows of Table 5.7 and Table 5.8, which show the results of the baseline 62 PRHLT-DSIC-UPV
5.5. Smoothing methods 000111 00 00 00 00 00 00 00 11 11 11 11 11 11 11 000 000 111 111 000111 0011 0011 000 000 111 111 0011 000111 00 00 11 11 000 000 000 111 111 111 000 000 111 111 00 00 00 00 00 11 11 11 11 11 000 000 111 111 000 000 111 111 0011 00 00 11 11 000111 0011 000111 0011 000111 IV OV 0 0.2 0.4 0.6 0.8 1 0 0.5 1 Events Score (a) CS, Filler 000111 00 00 11 11 000111 000111 0011 0011 000 000 111 111 0011 000111 00 00 11 11 000 000 000 000 000 000 111 111 111 111 111 111 000 000 111 111 00 00 00 00 11 11 11 11 000111 000111 0011 0011 000 000 111 111 0011 000111 00 00 11 11 000 000 111 111 IV OV 0 0.2 0.4 0.6 0.8 1 0 0.5 1 Events Score (b) CS, WG-40 000111 00 00 00 11 11 11 000111 000111 00 00 11 11 00 00 11 11 000 000 000 111 111 111 00 00 11 11 000 000 111 111 0011 000111 000 000 111 111 00 00 11 11 000111 000111 00 00 11 11 0011 000 000 111 111 0011 000 000 111 111 0011 000111 IV OV 0 0.2 0.4 0.6 0.8 1 0 0.5 1 Events Score (c) IAM, Filler 000111 00 00 00 00 11 11 11 11 000 000 111 111 000111 00 00 11 11 0011 000111 0011 000111 0011 000 000 000 000 000 000 111 111 111 111 111 111 000 000 111 111 00 00 00 11 11 11 000 000 111 111 000111 00 00 11 11 0011 000111 0011 000111 0011 000 000 111 111 IV OV 0 0.2 0.4 0.6 0.8 1 0 0.5 1 Events Score (d) IAM, WG-40 Figure 5.7: Histogram of the score of test relevant events for CS and IAMDB using the baseline Filler and WG models. WG method with a density of 40. 5.5.1 Line-level smoothing In this subsection we report the results achieved by all smoothing methods described in Section 4.2. These results are shown in Table 5.9 and Table 5.10, which correspond to the results on the CS and IAM databases, respectively. In order to adjust the hyper-parameters in each of the smoothing equations, the validation partitions of each database were used and a PRHLT-DSIC-UPV 63
Chapter 5. Experiments grid search was performed. The hyper-parameters were adjusted for each method and databse independently. For the Levenshtein Distance-based smoothing method (see Section 4.2.1), the optimal value of αwas found exploring values in the range [0,1] with 0.1 steps. The results of this method are tagged with the keyword “Levenshtein” in the tables. For the Stochastic Error Correcting-based (SEC) smoothing technique (see Section 4.2.2), which involves two parameters, αand β, a similar grid search was performed. The value of αwas optimized for values in the range [2−3,24]with exponential increments (2−3,2−2, . . .). On the other hand, the value of βwas determined in the range [0,2.5] with 0.1 increments. Observe that if βis zero, the SEC method with length correction (SEC-LC) is equivalent to the basic SEC method, with no length correction. AP MAP Validation Test Validation Test Levenshtein (α= 0.8)0.659 ±0.011 0.567 0.700 ±0.006 0.443 SEC (α= 0.5)0.617 ±0.014 0.544 0.684 ±0.008 0.450 SEC-LC (α= 1, β = 1)0.660 ±0.012 0.573 0.711 ±0.007 0.462 Table 5.9: Best AP and MAP achieved using the three proposed line-level smoothing methods on the CS database. AP MAP Validation Test Validation Test Levenshtein (α= 0.9) 0.735 0.694 0.798 0.761 SEC (α= 1) 0.710 0.665 0.795 0.760 SEC-LC (α= 2, β = 1.2) 0.735 0.691 0.794 0.761 Table 5.10: Best AP and MAP achieved using the three proposed line-level smoothing methods on the IAM database. Table 5.9 and Table 5.10 show that the method that usually outperforms the others across all configurations is the Stochastic Error Correctingbased method, with length correction. However, the differences between 64 PRHLT-DSIC-UPV
5.5. Smoothing methods this method and the Levenshtein Distance-based smoothing are not significant in the CS validation sets (with 95% confidence) and they are probably not significant either for the other scenarios (CS test set, and IAM validation and test sets). 5.5.2 Frame-level smoothing In this section we present the performance achieved by the frame-level smoothing methods described in Section 4.3. Validation and test results for each database are shown in Table 5.11 and Table 5.12, for CS and IAMDB respectively. In order to adjust the hyper-parameter βin the frame-level smoothing with length correction, the validation partitions of each dataset were used and a grid search was performed. The value of βwas adjusted for each dataset independently. The range of explored values for βwas [0,2.5] with 0.1 increments. Observe that if βis zero, the length correction factor is ignored, and then Eq. 4.23 is the same as Eq. 4.13. This means that the frame-level smoothing with length correction is a more general smoothing than the version without length correction. AP MAP Validation Test Validation Test Pstgram 0.605 ±0.015 0.532 0.718 ±0.008 0.471 Pstgram-LC (β= 1.5)0.612 ±0.016 0.532 0.713 ±0.008 0.463 Table 5.11: Best AP and MAP achieved using the two proposed frame-level smoothing methods on the CS database. AP MAP Validation Test Validation Test Pstgram 0.709 0.663 0.795 0.761 Pstgram-LC (β= 2.1) 0.719 0.672 0.794 0.754 Table 5.12: Best AP and MAP achieved using the two proposed frame-level smoothing methods on the IAM database. PRHLT-DSIC-UPV 65
Chapter 5. Experiments method is emphasized. In the cases where two methods achieved the same performance for a particular dataset-metric pair, both methods are emphasized. Finally, the global best method for each dataset-metric pair is marked in bold (the “best” for each group have been determined using the validation partition). CS IAMDB AP MAP AP MAP Baseline Filler 0.642 0.739 0.467 0.665 Baseline WG 0.556 0.290 0.691 0.688 Levenshtein 0.567 0.443 0.694 0.761 SEC 0.544 0.450 0.665 0.760 SEC-LC 0.573 0.462 0.691 0.761 Levenshtein Back-off 0.574 0.450 0.698 0.760 SEC Back-off 0.568 0.455 0.702 0.760 SEC-LC Back-off 0.585 0.464 0.700 0.760 Pstgram 0.532 0.471 0.663 0.761 Pstgram-LC 0.532 0.463 0.672 0.754 Pstgram Back-off 0.581 0.472 0.702 0.762 Pstgram-LC Back-off 0.581 0.466 0.702 0.761 Filler Back-off 0.725 0.766 0.769 0.822 Table 5.15: Summary table showing the test AP and MAP on the CS and IAM databases for all the presented methods and the original baselines. If one takes into consideration that, most of the line-level and framelevel methods had a confidence interval around 0.015 (95% confidence) in the validation set of the CS database, one realizes that the differences between these two approaches are subtle. Anyhow, the absolute winner above any method is the Filler back-off combination (where the WG scores are used for in-vocabulary keywords and a scaled version of the Filler scores are used for out of vocabulary keywords). However, one must realize that this comes with the price of running the expensive computation needed by the Filler model. Finally, comparing the best smoothing model in each group and dataset-metric pair with the baseline WG model, which is the one sensible 72 PRHLT-DSIC-UPV
5.5. Smoothing methods CS IAMDB AP MAP AP MAP Baseline WG 0.556 0.290 0.691 0.688 Line-Level 0.585 0.464 0.702 0.761 (5.2%) (60.0%) (1.6%) (10.6%) Frame-Level 0.581 0.472 0.702 0.762 (4.5%) (62.8%) (1.6%) (10.7%) Filler Back-off 0.725 0.766 0.769 0.822 (30.3%) (164.1%) (11.3%) (19.5%) Table 5.16: Summary table showing the best AP and MAP achieved for each smoothing level and the relative improvement respect the baseline WG method. to out of vocabulary words, results in Table 5.16. The relative increase of each metric is shown in parentheses. This table is useful to show how much is expected the system to improve using the best method of each smoothing level. Table 5.16 shows that the smoothing methods are specially useful when the number of expected out of vocabulary events is high (as is the case of CS). But even when the numbers of out of vocabulary events is not so high (IAMDB), the proposed line-level and frame-level smoothing methods provide moderate improvements on AP, and very good improvements on MAP. And the Filler Back-off combination provides even more excellent results for MAP and significant improvements in AP. The recall-precision curves of the best method for each level on each dataset, summarized in Table 5.16 are shown in Figure 5.12. This figure summarizes all the previous discussion and clearly shows that any type of smoothing helps the WG-based KWS to improve. The best results are achieved in both datasets with the Filler Back-off combination, which clearly outperforms any of the other methods. PRHLT-DSIC-UPV 73
Chapter 5. Experiments (a) (b) (c) (d) (e) 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 Precision Recall (a) CS (a) (b) (c) (d) (e) 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 Precision Recall (b) IAMDB Figure 5.12: Recall-Precision curves of the best methods on the CS and IAMDB test partitions. Curves: (a) Baseline Filler (b) Baseline WG (c) SEC-LC Back-off (d) Pstgram- LC Back-off (e) Filler Back-off. 5.6 Posteriogram compression Finally, we measured how much the posteriorgrams are compressed by taking into account the fact that many frames will have exactly the same word-posterior distribution, and thus, not all of them are required in order to perform the frame-level smoothing (recall Section 4.6). Different word graph input degrees were considered. The results for the test partitions of CS and IAMDB are shown in Table 5.17. The previous table shows that the compression achieved depends on the word graph density, as explained in Section 4.6. For the smallest word graphs, posteriograms are reduced to 1.5% (CS) and 0.8% (IAMDB) of their original size. For the largest explored input degree, they are reduced to 20.6% (CS) and 2.4% (IAMDB), repect the uncompressed posteriorgrams. We already pointed in Section 5.3 that the language models of the CS dataset were underestimated, due to the lack of training data. This directly affects the weights of the arcs in the word graph. Having a lower quality system implies that the system is less confident about the 74 PRHLT-DSIC-UPV
5.6. Posteriogram compression CS IAMDB # Frames 1659.0 1439.2 d= 3 24.2 11.0 d= 5 43.8 13.6 d= 10 97.2 18.9 d= 20 196.7 26.0 d= 40 342.3 34.1 Table 5.17: Average number of frames and resulting number of frames after compression, for the test partition of the CS and IAM databases. decoding, resulting, at the end, in higher perplexities at frame level, which prevents from a compression as effective as the one achieved in the IAM database. PRHLT-DSIC-UPV 75
Chapter 6 Conclusions In this work different methods are studied to handle out of vocabulary queries when a word graph-based keyword spotting system is used. WG- based KWS systems (presented in Section 3.3) have the shortcoming that assign a null score to any keyword that was not part of the data from which the language model was trained. The amount of out of vocabulary words depends on the particular task, but for all the considered datasets this was not negligible. Other models based on the modeling of the scores at a character-level have much better performance for the OOV keywords, as the Filler model presented in Section 3.2. However, character-level models are usually much more expensive in terms of computation time required to perform a search. Thus, we aimed to provide the WG-based approach with the versatility of the character-level models but providing also reasonable lookup times to the user. In Chapter 4 we presented several smoothing techniques that estimate the score of an out of vocabulary keyword based on its similarity among the keywords present in a word graph, and the score assigned to each of these present keywords. The proposed smoothing techniques are applied at two levels, one is the line-level, where the scores of the in-vocabulary keywords are directly used. The other proposed level, the frame-level, goes one step below and tries to smooth the frame-level word posterior probability at each frame, since this is directly used to compute the final score of a keyword for a line image. 77
Chapter 6. Conclusions We have seen during experimentation that there is not a significant difference, in terms of MAP, between the line-level and the frame-level smoothing methods. However, a significant difference was observed for AP (see Section 5.5.1 and Section 5.5.2). As we commented, this is due to the fact that the proposed frame-level tends to decrease excessively the score of in-vocabulary keywords. We decided then to use an heuristic approach were the smoothing is only applied to out of vocabulary keywords, while in-vocabulary keywords use the score directly given by the baseline WG-based system. We called this method “Back-off heuristic”, since it reminds to the Back-off smoothing used for Language Modeling (see Section 4.5). The Back-off method, once a certain parameter has been tuned, showed to be the key to significant improvements over the baseline AP and MAP (Section 5.5.3). Using this method, in combination to the smoothing techniques presented before, we observed a relative improvement of about 4.8% in the AP of the baseline WG-based system, for a dataset where the number of out of vocabulary events represents a big proportion of the queries. It also improved the baseline results on 1.6% relative points for a dataset where the number of out of vocabulary events is smaller. On the other hand, the MAP increases 60.4% relative points in the first task, and 10.6% in the second one (see Section 5.5.4). Taking advantage of the ability of the Filler to give reasonable scores for out of vocabulary queries, and the ability of the word graphs to provide very good scores for in-vocabulary scores, we applied the same Backoff heuristic using the Filler scores for OOV keywords. This combination scheme clearly outperformed all the previous proposed smoothing techniques. The AP relatively improved 30.3% points for the first dataset, and 11.3% for the second one, with less out of vocabulary events. Moreover, the MAP improved 164.1% relative points in the first task and 19.5% in the second one, respect the original WG-based baseline (see Section 5.5.4). Analyses of the computational cost of each proposed solution have been proposed in Section 4.6, where it is shown that the deeper level of smoothing we use, the more expensive results the lookup time (being the line-level the shallowest, and the Filler the deepest one). This suggests that a hierarchy of solutions for out of vocabulary queries could be provided to the user, so he or she can decide if they 78 PRHLT-DSIC-UPV
need a very accurate response, that would require maybe several minutes to be responded, or they prefer a fast search which will be completed in just a few seconds, at the expense of the accuracy of the responses. Several lines of future work can be devised from this master thesis. First, better smoothing approaches at line-level or frame-level should be explored, in order to try to make smaller the gap between these levels, which provide a very fast lookup time, and the Filler Back-off model. Although, it is clear that models that do not rely on a word vocabulary, will always be less sensible to out of vocabulary events. Finally, given that the Back-off heuristic gave such good results, other combination schemes should be explored, like interpolation of scores. For instance, the scores could be interpolated among different KWS approaches like WG, Filler and BLSTM. In the case of in-vocabulary keywords, this will not present any problem: Filler and BLSTM approaches are widely more expensive than the WG approach, but for in-vocabulary keywords, the score can be computed during indexing time. In the case of out of vocabulary keywords, the lookup speed would be obviously slower, so new ways of speeding up these models should be explored. PRHLT-DSIC-UPV 79
Bibliography [1] J.-C. Amengual and E. Vidal. On the estimation of error-correcting parameters. In Pattern Recognition, 2000. Proceedings. 15th International Conference on, volume 2, pages 883–886, 2000. [2] R. Baeza-Yates and G. Navarro. Fast approximate string matching in a dictionary. In String Processing and Information Retrieval: A South American Symposium, 1998. Proceedings, pages 14–22. IEEE, 1998. [3] C. M. Bishop and N. M. Nasrabadi. Pattern recognition and machine learning, volume 1. springer New York, 2006. [4] H. Bunke and P. S. Wang. Handbook of character recognition and document image analysis. World Scientific, 1997. [5] W. A. Burkhard and R. M. Keller. Some approaches to best-match file searching. Commun. ACM, 16(4):230–236, Apr. 1973. [6] S. F. Chen and J. Goodman. An empirical study of smoothing techniques for language modeling. Computer Speech & Language, 13(4):359–393, 1999. [7] F. Drira. Towards restoring historic documents degraded over time. In Document Image Analysis for Libraries, 2006. DIAL’06. Second International Conference on, pages 8–pp. IEEE, 2006. [8] R. O. Duda and P. E. Hart. Pattern classification and scene analysis. John Wiley, New York, 1973. [9] L. Egghe. The measures precision, recall, fallout and miss as a function of the number of retrieved documents and their mutual interrelations. Information Processing & Management, 44(2):856– 876, 2008. 81
List of Figures 5.9 Histogram of the distribution of the scores among the CS test events given by the baseline WG, the line-level and frame-level smoothing methods. . . . . . . . . . . . . . . 66 5.10 Histogram of the scores distribution for relevant events in the CS test partition, using different Back-off heuristics. 70 5.11 Histogram of the scores distribution for relevant events in the CS test partition, using different KWS approaches. Observe that the Back-off heuristic distributes the in-vocabulary scores as the “WG Baseline” and the OOV scores as the “FillerScaled”......................... 71 5.12 Recall-Precision curves of the best methods on the CS and IAMDB test partitions. Curves: (a) Baseline Filler (b) Baseline WG (c) SEC-LC Back-off (d) Pstgram-LC Back-off (e) Filler Back-off. . . . . . . . . . . . . . . . . 74 88 PRHLT-DSIC-UPV
List of Tables 5.1 Basic statistics of the “Cristo-Salvador” used partition. . 49 5.2 Basic averaged statistics of the “Cristo-Salvadors” crossvalidation partitions. . . . . . . . . . . . . . . . . . . . . 49 5.3 Basic statistics of the IAMDB corpus. . . . . . . . . . . . 51 5.4 Basic statistics of the LOB, Brown and Wellington corpora. 51 5.5 Basic statistics of the selected query keywords for CS and IAMDB. Data from the validation CS set is averaged across the10partitions. ...................... 53 5.6 Example showing the difference between AP and MAP. . 57 5.7 Baseline AP and MAP for CS. . . . . . . . . . . . . . . . 60 5.8 Baseline AP and MAP for IAMDB. . . . . . . . . . . . . 60 5.9 Best AP and MAP achieved using the three proposed linelevel smoothing methods on the CS database. . . . . . . 64 5.10 Best AP and MAP achieved using the three proposed linelevel smoothing methods on the IAM database. . . . . . 64 5.11 Best AP and MAP achieved using the two proposed framelevel smoothing methods on the CS database. . . . . . . 65 5.12 Best AP and MAP achieved using the two proposed framelevel smoothing methods on the IAM database. . . . . . 65 5.13 Best AP and MAP achieved with the Back-off combination heuristic for different smoothing methods, CS database. . 68 5.14 Best AP and MAP achieved with the Back-off combination heuristic for different smoothing methods, IAM database. 69 5.15 Summary table showing the test AP and MAP on the CS and IAM databases for all the presented methods and the original baselines. . . . . . . . . . . . . . . . . . . . . . 72 5.16 Summary table showing the best AP and MAP achieved for each smoothing level and the relative improvement respect the baseline WG method. . . . . . . . . . . . . . . 73 89
List of Tables 5.17 Average number of frames and resulting number of frames after compression, for the test partition of the CS and IAM databases........................... 75 90 PRHLT-DSIC-UPV