---
title: "Supervised OCR Error Detection and Correction Using Statistical"
description: "How character-based translation finds and repairs OCR errors in historical English and French, and which methods worked best at each task."
canonical: "https://research.elamur.ai/free/en/papers/amrhein-2018-supervised-ocr-error-detection-correction/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/amrhein-2018-supervised-ocr-error-detection-correction/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2018](https://md.research.elamur.ai/free/en/papers/2018/) / Supervised OCR Error Detection and Correction Using Statistical and Neural Machine Translation Methods

# Supervised OCR Error Detection and Correction Using Statistical and Neural Machine Translation Methods

Paper · 2018 · Chantal Amrhein and Simon Clematide

**Authors:** [Chantal Amrhein](https://md.research.elamur.ai/free/en/authors/chantal-amrhein/) and [Simon Clematide](https://md.research.elamur.ai/free/en/authors/simon-clematide/) · **Year:** 2018 · **Venue:** LDV-Forum/Journal for language technology and computational linguistics · **Licence:** [CC BY (OpenAlex best open-access location)](https://creativecommons.org/licenses/by/4.0/)

LDV-Forum/Journal for language technology and computational linguistics · [licence](https://creativecommons.org/licenses/by/4.0/)

- [PDF](https://jlcl.org/article/download/218/216)
- [DOI 10.21248/jlcl.33.2018.218](https://doi.org/10.21248/jlcl.33.2018.218)

## Summary

A searchable collection of historical books or newspapers depends on the quality of the text produced by optical character recognition, or OCR. A misread letter can hide a word from an index, and a missing space can turn neighbouring words into a single string. Amrhein and Clematide study how to repair these errors after recognition, using the digitized text and examples of how it should read. The intended correction preserves the spelling in the original document, including forms that look unusual today.

The authors treat post-correction as [machine translation](https://md.research.elamur.ai/free/en/topics/machine-translation/) between two versions of a passage in the same language. A system learns to turn OCR output into the corresponding transcription, working with individual characters so that it can handle damaged words it has never seen before. The paper compares statistical and neural approaches on English and French periodicals and monographs from the ICDAR 2017 shared task. It also tests ways of giving the systems more evidence, including nearby words, publication dates, samples enriched with errors, and visual representations of letters.

The comparison turns on a distinction between finding an error and repairing it. Neural systems delivered the strongest internal results for finding erroneous tokens, while statistical translation was generally stronger at generating repairs. On the internal French periodical test set, for example, a neural ensemble trained on error-enriched data reached a detection F1 of 65.30. Statistical translation with surrounding words reported a 19.64 relative improvement in edit distance on the correction measure. Context usually helped, but pooling collections or languages often hurt. A change that made a system flag more errors could also make its corrections worse.

The authors combined outputs from several systems for the official competition. Their entry placed first in correction and was competitive in detection, with an official mean detection F-measure of 0.53. The correction ranking applies to a task in which the organizers supplied the error locations. For automatic cleanup of a whole collection, the system must also find those locations and avoid disturbing text that is already right. The results show how different approaches can help with those decisions and how much their success depends on the material being corrected.

## Deep dive: Supervised OCR Error Detection and Correction Using Statistical and Neural Machine Translation Methods

How character-based translation finds and repairs OCR errors in historical English and French, and which methods worked best at each task. · about 32 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### Repairing an existing transcription

OCR converts text in an image into characters that a computer can store, search and index. In the historical material discussed in the paper, recognition has to contend with the condition of the original documents as well as variation in type and spelling. A newspaper in poor condition can yield many more errors than a well-preserved book. Letter shapes differ across typefaces, and the conventions of printed language change over time. When a project already has OCR output and cannot run recognition again on the source images, the existing text is the material available for repair.

The paper distinguishes intervention at different stages of digitization. Earlier work described improving the input images, modifying the recognizer itself, or correcting its textual output afterward. The last option makes it possible to work on a collection even when the first stages are inaccessible. It also changes what counts as evidence. A post-correction system working from text can examine a suspicious sequence of letters and the words around it. Doubts about a particular printed shape have to be resolved indirectly when the image is unavailable.

The desired output is a transcription of what was printed. The paper illustrates the coexistence of old and modern spellings with *compleated* in a document dated 1744 and *completed* in one dated 1894. A correction system that systematically favours the latter spelling could make historical text easier for a modern reader while making the transcription less faithful. The same issue arises for rare names and other legitimate forms that might look unlikely in a vocabulary assembled from different material. The reference for a correction is the source spelling recorded in the ground truth.

An unusual spelling is only part of the detection problem. A recognition error can turn one valid word into another. In the French material, OCR sometimes produces *font* where the document reads *sont*. Both are ordinary French words, so a dictionary lookup accepts either in isolation. Nearby words can make the difference. A missing or extra space brings a related difficulty. The printed unit may be represented by several tokens, or several printed words may appear as one token. In such cases the spacing is part of what needs repairing.

These problems motivate the paper’s separate treatment of detection and correction. Detection locates text that needs attention. Correction proposes what belongs there. A method can be good at raising the alarm on a malformed string and still propose an implausible repair. Another method can repair an error accurately once it is pointed out but leave many errors untouched when it has to find them by itself. Those differences matter both when the text is changed automatically and when a person reviews proposed changes.

#### What earlier approaches contributed

The paper describes a tradition of post-correction based on dictionaries, [n-grams](https://md.research.elamur.ai/free/en/concepts/n-gram/), and spelling error techniques. An n-gram is a sequence of neighbouring units, so its frequency can give evidence about how plausible a sequence is. Dictionary methods have a different kind of evidence, membership in a list of known words. The paper describes TICCL as a corpus-based approach that works across several languages and depends on high-quality lexicons for effective correction. That dependence matters for sources containing old spellings or specialized forms.

Edit-distance approaches compare how much work it takes to turn one string into another. A weighted version can assign different importance to different edits. A noisy-channel spelling approach instead treats the observed string as a corrupted version of an intended one and uses evidence about likely corruptions in choosing a repair. In the comparison by Eger and colleagues that Amrhein and Clematide discuss, more general string-to-string methods did better on OCR data than the edit-distance and noisy-channel approaches tested there. The earlier spelling work cited for that comparison is by [Brill and Moore](https://md.research.elamur.ai/free/en/papers/brill-2000-improved-error-model-noisy-channel/).

Statistical translation had already been applied directly to OCR. In work on historical French, Afli and colleagues trained on more than 60 million tokens and obtained better results than the language-based alternatives they examined. Another comparison from the same line of work found a slight advantage for word-level over character-level statistical translation with a training set of over 90 million tokens. Both training collections were much larger than the ICDAR material used by Amrhein and Clematide. The earlier word-level advantage therefore gave them a comparison to investigate under different data conditions.

Other historical OCR work framed the problem differently. The paper describes a supervised Finnish study that corrected isolated words through sequence labelling with weighted finite-state techniques. It also describes Schulz and Kuhn’s architecture, which combined statistical translation at the character and token levels with components for splitting and merging tokens. The latter system makes explicit a difficulty that a correction method can otherwise overlook. A system that only replaces words in fixed positions has trouble correcting a recognition error that changes the word boundaries themselves.

#### Why translation at the character level was worth testing

The authors situate their neural approach in earlier work on converting one sequence into another. In this setting, a sequence can be a string instead of a sentence of words. Transliteration, the conversion of spelling to pronunciation, and historical spelling normalization can all be framed that way. The purposes of those tasks differ from faithful OCR transcription, but their use of paired strings suggested that a similar learning procedure could be applied to OCR. The paper points to [sequence-to-sequence learning](https://md.research.elamur.ai/free/en/papers/sutskever-2014-sequence-sequence-learning-neural-networks/) and to [character-based language correction](https://md.research.elamur.ai/free/en/papers/xie-2016-neural-language-correction-character-based/).

The earlier OCR evidence was mixed. In a study discussed by the authors, Schnober and colleagues used a training set of 72,000 misrecognized words. Their neural systems did not outperform an approach based on pruned conditional random fields in that setting. Neural systems with attention performed better than plain sequence-to-sequence systems, and on a smaller training set the attention-based systems also surpassed the conditional random field approach. Amrhein and Clematide faced an additional requirement because their data included correctly recognized words alongside erroneous ones. The relevant earlier work on learning to align parts of an input and output is by [Bahdanau and colleagues](https://md.research.elamur.ai/free/en/papers/bahdanau-2014-neural-machine-translation-jointly-learning/).

A fixed vocabulary also creates a practical problem for word-based translation. A misspelling or damaged token may have no entry, even when its letters and the corresponding repair are familiar. The paper surveys alternatives ranging from dictionary lookup to mixed word and character processing. It also discusses [subword tokenization](https://md.research.elamur.ai/free/en/concepts/subword-tokenization/), where a vocabulary built from characters can include frequent longer pieces and whole words. That approach preserves a way of representing unfamiliar words while letting common sequences be processed together. The paper cites [Sennrich and colleagues’ work on rare words](https://md.research.elamur.ai/free/en/papers/sennrich-2016-neural-machine-translation-rare-words/) for this design.

Character-based translation takes the idea further by processing strings through their constituent characters. The authors point to prior work on a [character-level decoder](https://md.research.elamur.ai/free/en/papers/chung-2016-character-level-decoder-without-explicit/) and a [fully character-level translation system](https://md.research.elamur.ai/free/en/papers/lee-2017-fully-character-level-neural-machine/). The latter could still produce the intended translation in the presence of spelling errors. For OCR, the potential benefit is that a damaged word can share usable evidence with other words through its letters and letter sequences. Whether this is enough to identify an error, or to restore the particular form in the original, is the question the experiments address.

### The method, step by step

#### Turn aligned paragraphs into examples

The starting point is a pair of texts for each paragraph. One is the raw recognition output. The other, called the ground truth, records the transcription used as the reference. The ICDAR files also supply an aligned version of the OCR text, with positions lined up against the ground truth. A position can contain a gap if a character on one side has no counterpart on the other. The paper uses these alignments to construct paired strings and to distinguish recognized text that should be copied from text that needs changing.

Consider a missing space. In the paper’s example, *ATRAVELLER* has no space after *A*. The aligned OCR line uses `@` to leave a position for the absent character, and the aligned ground-truth line has a space there. An extra OCR character gets a gap on the ground-truth side instead. This arrangement identifies the difference without treating the alignment symbol as an actual part of the passage. `#` marks ground truth that cannot be established with confidence. The authors remove unrecognizable material when preparing the internal experimental data. They retain hyphens for training and omit them from evaluation and error analysis because their treatment in the ground truth is inconsistent.

The official training portion is the source of the authors’ internal experimental data. They split it randomly into 80% for internal training, 10% for development, and 10% for internal testing. The development portion is where they choose combinations or settings to evaluate. The internal test portion supports comparisons among those settings while the official competition test remains separate. The same training data support both the detection and correction investigations.

The simplest example format supplies a token or an aligned span without its neighbouring words. The authors start a new line wherever the aligned OCR and ground truth both contain a space. An unmatched space does not create a break under that rule. This is important because a span with a spacing error needs to stay together as a source and target pair. If an OCR string has joined separate words, its target can still contain the boundary that should be restored.

Then the authors insert a separator after each actual character for the translation software. In normal [tokenization](https://md.research.elamur.ai/free/en/concepts/tokenization/), the tokens handed to that software might be words. Here the added whitespace makes the software read letters, punctuation and other characters as the units to process. The paired lines are still stored in the usual format for translation training. The artificial separators serve the training representation and can be distinguished from the word boundaries that belong to the text.

From aligned OCR paragraphs to detection and correction The steps in order.

#### Train statistical and neural systems on the same representation

The statistical machine translation system, abbreviated SMT, uses Moses. The authors use GIZA++ for character alignment within the training pairs and minimum error rate training, or MERT, to tune the system. For each experiment they use a 10-gram component that scores the plausibility of sequences on the target side. The character alignment for learning translation correspondences is part of the translation setup. The alignments distributed with the dataset are what allow the authors to prepare the paired training lines in the first place.

The neural machine translation system, abbreviated NMT, learns to produce a target sequence of characters from the source sequence. The authors initially try a convolutional framework built for character-level translation. Those early experiments lead them to switch to Nematus, and the reported neural experiments that follow use that toolkit. As in Moses, the inserted spaces cause Nematus to read characters as input units. Training examples place the recognized sequence on the source side and the reference sequence on the target side. The relevant toolkit is [Nematus](https://md.research.elamur.ai/free/en/papers/sennrich-2017-nematus-toolkit-neural-machine-translation/).

A character embedding is a learned vector used to represent a character inside the system. The authors test embedding sizes of 32, 256 and 512 and choose 256. They usually tie the embeddings, which means that a character such as *e* shares its representation across the OCR input and corrected output. That choice fits a task where source and target mostly use the same characters. The authors find that separate embeddings do better at detection but worse at correction in their exploration. They choose tied embeddings for the standard setup because it trains faster.

The authors explore these choices on the French periodical data. This subset is relatively small, which makes repeated training faster, and their earlier statistical experiments suggested it was difficult to correct. Even on fast graphics processors a training run could take several hours, so the selected setup serves as a common starting point. The dropout rate is 0.2. Dropout temporarily disables some units while learning so that the system has to make useful predictions without always relying on the same internal signals.

The batch size is 100 after trials with 50 and 200. Each batch supplies the examples used for a training update. The authors keep the toolkit’s hidden size of 1000, the Adadelta optimizer, gradient clipping threshold of 1, and learning rate of 0.0001. The optimizer governs how the learned parameters are updated, the clipping threshold limits the size of the gradient, and the learning rate sets a scale for updating the parameters. The maximum input sequence length is 23 without context and 53 with context. The paper says these limits cover 99.99% of the training examples.

#### Give each focus word a neighbourhood

In the isolated setting, *font* can be copied faithfully or changed to *sont* based on evidence learned from other examples of the same form. The system has no way to consult the surrounding words in that particular occurrence. The authors’ context-sensitive format gives each focus token two preceding words and one following word. The difference between *principes font fondés* and *principes sont fondés* then falls inside a sequence whose surrounding text is relevant to the choice.

The authors mark each word boundary inside the context with a symbol that is otherwise absent from the training material for this representation. They ask the system to produce both the focus token and the surrounding reference words. In their experiments this works better than giving context only on the input side and asking for the focus word alone. Producing the full target also means that a word can appear as context in several overlapping examples. The increase in training material comes with longer training times.

When a translated window has the expected boundaries, the focus token can be read from its position in that window. When the output contains anything other than three occurrences of the boundary marker, the authors select the translated word whose edit distance from the original focus word is lowest. This provides a way to recover one answer from a string whose structure has changed during translation. It also shows why the final system needs a procedure for interpreting the generated output. Training on character strings does not itself guarantee that those strings will retain the expected number of word boundaries.

#### Add data and label where it comes from

The basic training pools come from the language and document-type partitions. The authors then mix periodicals and monographs in the same language for a medium training set, and combine material across languages for a large set. There is a reason to try both. English and French use a common script, and OCR can confuse similar glyphs in different languages. A letter substitution learned from a newspaper might also occur in a book. The question is whether the additional examples carry useful correction patterns for the collection under evaluation.

Pooling also removes information about where an example came from unless that information is supplied separately. The neural experiments can therefore attach factors, or structured labels, to the input characters. A factor can identify the publication interval, document type, or language. Nematus represents the factor as a vector and puts it alongside the embedding for the input character. The factors accompany the source only. The target remains the corrected text in character form. The authors draw on earlier work on [linguistic input features for translation](https://md.research.elamur.ai/free/en/papers/sennrich-2016-linguistic-input-features-improve-neural/).

The paper’s publication-time factor groups years into bins of 50 years. It computes the identifier as follows.

```
YYYY // 50
```

`YYYY` is the publication year. The operator `//` denotes integer division, which keeps the whole-number quotient for these years. `50` is the width of a publication interval in years. The format illustrated in the paper gives an English periodical from 1800 through 1849 the time label `36`. The same periodical and time information accompanies each character in the example.

The time label is meant to let learned correction behaviour vary with the period. An observed character sequence can be evidence for an OCR mistake in material from one interval and a weak signal for the same mistake elsewhere. A document-type or language label similarly gives the system information it can use when properties of the pooled data differ. The implementation imposes a relevant constraint. The authors could not use tied embeddings with factors in Nematus, so the factored configurations also differ from the usual setup in how the source and target characters are represented.

#### Change what the system sees during learning

In one neural experiment, the authors initialize character embeddings using visual information. A glyph is the shape in which a character is drawn. Since the authors have no source images, they render the characters in Helvetica and use the grey levels from a 16 by 16 pixel grid. The resulting values are normalized between -1 and 1 and scaled by 0.01, in line with the scale used for random initialization in Nematus. These renderings supply initial character vectors. The correction system subsequently works from the text.

The motivation differs from that of distributional [word embeddings](https://md.research.elamur.ai/free/en/concepts/word-embeddings/), which place words near each other when their contexts are similar. A recognition mistake may reflect visual similarity between characters even when those characters have different distributions in the language. A rendered character can supply some evidence about shape. The resulting resemblance is only as relevant as the relationship between the chosen rendering and the printed glyphs that caused the recognition difficulty.

A separate experiment changes how often the learner sees an error. In the original data, many training pairs demonstrate that the characters should be copied. To give repair examples greater weight, the authors randomly remove some pairs whose OCR text is already correct. They initially try a training mixture with 75% erroneous tokens and 25% non-erroneous tokens. Because errors are less common in monographs, the error proportions used for that document type are adjusted to 50% for French and 37.5% for English.

This operation changes both the error proportion and the supply of examples demonstrating when to leave the text alone. It does not create new kinds of error. The hypothesis is that a system exposed to a higher share of erroneous inputs will recognize more of them when tested. The accompanying question is whether it will also make more damaging changes. The paper evaluates that tradeoff using both detection scores and the quality of the resulting corrections.

#### Combine probabilities or combine finished candidates

The paper uses two kinds of combination. In neural ensemble decoding, several systems contribute probability distributions while the output characters are being chosen. The distributions are averaged, so a candidate can obtain support from several sources before the system produces a finished translation. The authors use this procedure only with the context-sensitive input format.

One kind of ensemble combines checkpoints from a single training run. A checkpoint is the learned state saved at a particular point during training. The authors combine the strongest checkpoint with the two previous saved states, testing the idea both for the ordinary context-sensitive system and for the error-focused one. The other kind combines the best checkpoints from different setups: the ordinary context-sensitive system, the system initialized with glyph information, and the error-focused system. Its inputs therefore differ in their training evidence as well as in the parameters they have learned.

The competition submission also combines systems after translation. At this stage each system has already produced candidate text. The authors select five systems for a data partition based on how their outputs work together on the development set. The resulting group can contain statistical translation and several neural variants. Its composition can differ by language, document type and task.

For detection, the algorithm processes the whole OCR input. It flags a token if the system with the smallest development-set edit distance proposes a change, or if the most frequent proposed token across the selected systems differs from the OCR form. It also flags a token that does not occur in the ground-truth training and development material for either document type in the relevant vocabulary check. A further rule looks for a bad split. If the current token and a neighbour fail the training-vocabulary check separately but their concatenation occurs, the algorithm can flag them for merging. The check can use translated or untranslated versions of those tokens.

The correction task starts with error locations supplied by the competition. The authors use the five systems with the lowest development-set edit distance to propose repairs at those locations. If the strongest system proposes a change, its answer is the sole candidate. Otherwise, changes proposed by the selected systems are weighted according to how frequently each distinct alternative occurs. This produces an ordered set of alternatives for the assisted scenario and a leading candidate for the automatic scenario. The distinction between the competition tasks is already present at this step. Detection must decide which locations deserve attention, while the correction combination can devote its candidate choices to locations marked by the organizers.

### Experiments and results

#### The material and how it is scored

The ICDAR 2017 data come from the AmeliOCR corpus and cover English and French in equal amounts. The distributed dataset contains 12M OCR characters together with aligned ground truth. The official training set contains 10M characters, or 83% of the total, and the official test set contains 2M, or 17%. The documents come from collections of the BnF and the British Library. They were published between 1654 and 2000, with 92% of documents of known date coming from the nineteenth century. The collections also vary in how the OCR and subsequent transcription were produced.

The authors typically report internal results separately for each combination of language and document type. In the internal English periodical test set, the original OCR has a character error rate of 3.47% and a token error rate of 11.28%. The English monograph rates are 1.79% and 6.38%. For French periodicals the rates are 3.41% and 11.85%, while French monographs have rates of 1.61% and 6.18%. The document-type contrast is visible in both languages using either unit. There is more erroneous material for a detector to find in these periodical test partitions.

Detection is scored at the token level. Precision asks what share of the flagged tokens really contain an error, while recall asks what share of the erroneous tokens were flagged. The two can move in opposite directions. If a detector flags more text, it may find additional errors while also adding more false alarms. The paper combines these quantities using the harmonic mean.

```
F₁ = (2 × P × R) / (P + R)
```

`F₁` is the detection score, `P` is precision, and `R` is recall. `2` is the constant used in the harmonic mean of these two quantities. The multiplication signs combine the terms in the numerator, `+` adds precision and recall in the denominator, and `/` divides the numerator by that sum. The resulting value gives weight to both detection measures and is sensitive to a low value on either side. The internal tables express the scores on a percentage scale, while the official comparison reports F-measure as a fraction.

Correction quality is judged by the Damerau–Levenshtein distance between a candidate and the reference, averaged over evaluated tokens. This distance counts the fewest character edits needed to turn one string into the other. In addition to insertions, deletions and substitutions, it permits swapping adjacent characters. The paper notes that the official evaluation script uses this version of the distance despite the use of the shorter name Levenshtein in the competition report and result labels.

The raw OCR serves as the reference point for edit-distance improvement. Leaving it as it is gives an improvement of 0% by definition. A candidate can bring a token closer to the target without reproducing it exactly. The paper also gives the percentage of words translated correctly, a measure that rewards exact matches. On the internal test, a single candidate is evaluated. For the official assisted scenario, the evaluator weights each candidate’s distance by its assigned probability and adds the weighted distances. The official improvement figures discussed below concern the top-ranked candidate.

For each internal configuration, the authors score three individual runs using the same settings and average those scores. This macro-average is intended to reduce the influence of variation among runs. The reported comparisons therefore concern the expected performance of a configuration in this experimental setup more directly than a comparison of the best individual checkpoint from each run would. The official results concern the actual submitted output.

#### What the internal comparisons show

The raw OCR establishes the amount of damage available to repair. The trained baselines are the context-insensitive statistical and neural systems. Comparisons to these baselines help separate the broad question of whether translation works from the more specific question of what is gained by a different source of evidence. In French periodicals, the neural baseline has an F1 of 58.21, compared with 49.62 for the statistical baseline. On the same internal partition, the statistical baseline reports a relative edit-distance improvement of 16.54, compared with 13.53 for the neural baseline. Thus the stronger detector among those baselines provides the weaker correction by that measure.

Context and ensembling give both approaches ways to improve on their starting points. For the internal French periodical test set, ordinary context-sensitive neural translation increases detection F1 to 59.01. Ensembling checkpoints of the error-focused neural system reaches 65.30. Those systems have quite different implications for a correction pipeline. The ordinary context-sensitive setup reports a relative edit-distance improvement of 17.32, whereas the error-focused checkpoint ensemble reports 1.40. Higher detection F1 on this partition leaves open a wide range of correction outcomes.

Detection F1 on the internal French periodical test set Combining checkpoints of the error-focused system gives the strongest detection result in this comparison.

**The numbers**

| System or setting | F1 |
| --- | --- |
| Statistical baseline | 49.62 |
| Neural baseline | 58.21 |
| Neural with context | 59.01 |
| Error-focused neural checkpoint ensemble (this paper) | 65.30 |

For internal English periodicals, statistical translation with context reports a relative edit-distance improvement of 41.83, and the statistical baseline reports 40.96. The neural system with context reports 34.95, rising to 38.68 in the ensemble that combines different neural setups. The corresponding edit distances for the context-sensitive statistical system and the neural ensemble are 0.1339 and 0.1369. The raw OCR edit distance for that partition is 0.1898. These figures show both substantial room to improve the OCR and a smaller remaining gap between the strongest statistical system and the combined neural approach.

Relative edit-distance improvement on the internal English periodical test set Statistical translation with context leads this comparison, with the neural ensemble ahead of the ordinary neural context system.

**The numbers**

| System or setting | relative improvement % |
| --- | --- |
| Neural with context | 34.95 |
| Neural ensemble across setups | 38.68 |
| Statistical baseline | 40.96 |
| Statistical with context (this paper) | 41.83 |

On English monographs, adding the time factor to context-sensitive neural translation yields a detection F1 of 58.94 on the internal test, compared with 54.92 for context alone. On French monographs, the ensemble that combines different neural setups reaches a detection F1 of 58.91. The detailed French monograph results give the statistical baseline a relative edit-distance improvement of 24.00. The statistical system with context reaches a higher percentage of exactly correct translated words, at 58.47 versus 55.04 for the baseline. Choosing a correction system by exact matches can therefore give a different answer from choosing it by distance.

The detailed results are also the clearer source for individual correction scores. The compact best-system table associates its French monograph correction result of 24.0 with statistical translation using context, while the detailed table attaches 24.00 to the statistical baseline and 22.15 to the context setting. For English monographs, the detailed table includes a relative improvement of 32.87 for the neural checkpoint ensemble and 32.25 for statistical translation with context. The paper’s general conclusion that statistical translation is stronger at correction describes the overall pattern. The individual rankings depend on the partition, configuration and correction measure.

#### The official competition

The shared task places the authors’ combined system alongside submissions using other approaches. The paper reports that its Char-SMT/NMT entry led the correction task across the English and French monograph and periodical partitions on the top-ranked-candidate measure. Its official relative improvement is 43% for English monographs, 44% for French monographs and 29% for French periodicals. In the French monograph partition, for example, the table reports 23% for EFP and 3% for MMDT. Several entries in the competition produced no improvement in some partitions, and some submissions have missing or malformed results.

Detection gives a different ranking. The authors’ mean official F-measure is 0.53. The paper reports 0.66 for WFST-PostOCR, which uses a noisy-channel approach with a vocabulary and sequence statistics from Google Books n-grams. EFP reaches 0.54 and CLAM reaches 0.52 in the official table. The authors train their translation systems on the shared-task material. The comparison establishes how the submitted methods performed under the competition rules, and the systems differ in both their algorithms and the resources they use.

Mean detection F-measure on the official ICDAR 2017 test set The authors’ combined system is close to several submissions, while WFST-PostOCR leads this comparison.

**The numbers**

| System or setting | F-measure |
| --- | --- |
| WFST-PostOCR | 0.66 |
| EFP | 0.54 |
| Char-SMT/NMT (this paper) | 0.53 |
| CLAM | 0.52 |

The official breakdown helps explain the detection score. For English monographs the entry has reported accuracy of 0.98 and recall of 0.51. The corresponding values on French monographs are 0.74 and 0.19. For WFST-PostOCR, recall on those partitions is 0.82 and 0.59. The authors describe their own entry as especially strong on the official accuracy measure, and the recall results show the missed errors that can coexist with that strength. They also report net improvement from their corrections on 102 documents, more than for any of the other systems in the comparison.

After the competition the authors evaluated a simpler neural alternative. For each language it pools periodicals and monographs, uses contextual windows, and attaches time and document-type factors. Its mean official detection F-measure is 0.52, close to the submission’s 0.53. Its reported top-candidate correction improvement for English monographs is 18%, compared with 43% for the submitted combination. The configuration reduces the number of systems that have to be trained and maintained. The measured price of that simplification is particularly visible in the English monograph correction result.

### What the ablations show

#### Why data from elsewhere can hurt

The paper compares changes in training material and system design. One set of comparisons asks whether adding examples helps when those examples come from another text type or language. The motivation is straightforward. Visually similar characters can be confused in more than one collection, and a larger pool offers more chances to observe such confusions. In practice, pooling changes the distribution of the examples, including which errors occur frequently and how frequently an input should be left alone.

Internal English periodical results illustrate the cost. For the isolated statistical system, detection F1 goes from 71.17 in the baseline to 61.94 with the medium pool and 56.47 with the large pool. The relative edit-distance improvement goes from 40.96 to 29.96 and 25.71. Neural detection and correction on this partition also deteriorate with pooling. The English periodical data give the clearest example in the paper of more examples providing worse evidence for the target partition.

The pattern allows exceptions. On internal French periodicals, statistical detection F1 rises from 49.62 with the original training partition to 52.87 with the medium pool, while the relative edit-distance improvement goes from 16.54 to 16.06. This comparison makes the reporting of both tasks especially important. A larger collection can help the system locate more errors or change the precision–recall balance while giving it weaker evidence about the forms it should produce for those errors.

Factors recover some of the value of pooling in particular settings. On internal French monographs, factored neural translation with the large pool has a relative edit-distance improvement of 20.11, compared with 13.66 for the context-insensitive neural setting using the large pool and 15.00 for the isolated neural baseline. The factored setting incorporates other choices as well, so those figures describe configurations. They show that pooled data can support a stronger system in a suitable setup, while the paper reports that adding language information to a combined pool still fails to deliver a general improvement.

#### What surrounding words contribute

The data analysis identifies a reason to work below the word level. Among erroneous tokens in training, 87.2% in English and 90.2% in French occur only once after punctuation is excluded from the count. The paper records 275 distinct OCR forms for the English reference word *the* and 214 for French *de*. A word-level learner would have little direct evidence for many of the exact damaged strings. At the character level, different misspellings can share a repeatable substitution or another edit.

The same analysis explains why character-level information alone is insufficient for some examples. Wrong tokens can be real words, including the French *font* example and cases listed for English. The context experiment supplies evidence from the surrounding passage. On internal French periodicals, statistical detection F1 moves from 49.62 without context to 53.71 with it, and relative edit-distance improvement moves from 16.54 to 19.64. Neural detection F1 changes from 58.21 to 59.01, while correction improvement changes from 13.53 to 17.32.

The experiment supports the use of the authors’ window because improvements occur across several settings. The size and direction of the effect still depend on the partition and measure. For internal French monographs the statistical system with context improves detection F1 from 52.52 to 54.18, while its relative edit-distance improvement is 22.15 against the baseline’s 24.00. Its percentage of exactly correct translated words rises. The counterexample shows how evidence from neighbours can help some decisions while shifting the overall size of the remaining edits.

There is also a difference between showing that the contextual representation helps and determining precisely which part of it helps. The authors change the unit on both sides of the training pair, producing larger target sequences and overlapping examples. The strongest evidence is the effect of this joint change. The results do not separately assign gains to the preceding words, the following word, or the demand to reproduce the entire contextual sequence.

#### When dates and glyph shapes help

The time-factor experiment is grounded in the error analysis of English monographs. The authors group examples into 30-year intervals and plot common OCR substitutions using frequencies normalized by the number of files in each interval. They report that the most prevalent error around 1800 occurs 1,000 times less often around 1830. Different fonts or printing conditions could contribute to such a distribution, and a date label gives the translation system an indirect way to respond to it.

On the internal English monograph test set, the context-sensitive neural system with a time factor reaches recall of 45.04, compared with 39.93 without it. Precision is 85.31 with the factor, compared with 87.97 without. F1 rises to 58.94 from 54.92, while relative edit-distance improvement goes from 31.27 to 28.77. The numbers fit the authors’ interpretation that time information can make detection more active where the error profile changes. The change in correction shows that finding more errors and finding good repairs remain distinct goals.

For visual initialization, the authors report small improvements on monographs and slightly worse results on periodicals in a comparison with random initialization. The detailed internal tables indicate the scale of the differences among the configurations there. On French monographs, the glyph setting has a detection F1 of 57.00 and a correction improvement of 18.73, compared with 56.85 and 18.26 for the ordinary contextual neural system. On French periodicals the glyph setting reports 58.03 for detection F1 and 16.45 for correction improvement, compared with 59.01 and 17.32 for the ordinary contextual setting. In this experiment the visual information is a convenient proxy for the original shapes. Its mixed effect shows the limits of that particular initialization.

#### What happens when errors receive more weight

The error-focused comparisons make the cost of a more active detector visible. On the internal French periodical test, moving from the ordinary contextual neural system to the error-focused system changes recall from 44.26 to 60.72 and precision from 88.53 to 67.47. Detection F1 moves from 59.01 to 63.91. The relative edit-distance improvement changes from 17.32 to -1.32. By the correction measure, that error-focused output is worse than leaving the relevant OCR text as it was.

For internal English monographs, the ordinary context-sensitive neural system reports detection F1 of 54.92, while the error-focused version reports 50.60. Recall increases from 39.93 to 50.81, but precision goes from 87.97 to 50.51. The near balance of precision and recall in the latter configuration coexists with lower F1. What matters is the level reached by both quantities. Adjusting the training distribution can shift the balance in a desired direction while reducing the overall quality of the detector.

The results are consistent with the reason for including correct examples in the first place. Copying is the right operation on much of the input. When training removes many of the examples that demonstrate this action, the system gains incentive to propose substitutions, insertions or deletions. What this achieves depends on how many such changes are warranted in the test partition and whether the resulting candidates are close to the reference.

#### The gains and limits of ensembling

The checkpoint comparisons ask whether predictions made at different points in one training run have complementary value. On internal French periodicals, the ensemble of error-focused checkpoints raises detection F1 from 63.91 to 65.30 and changes relative edit-distance improvement from -1.32 to 1.40. Ensembling in this case recovers enough correction quality to move the output to the favourable side of the raw OCR comparison, though the ordinary contextual system remains stronger on correction.

The same procedure can preserve the underlying weakness. On internal English monographs, the error-focused system reports a relative improvement of -6.01 and its checkpoint ensemble reports -6.31. Averaging different learned states helps when their disagreements contain useful alternatives. If the states share a tendency to change text that should be preserved, averaging can leave that tendency in place.

Ensembling across different training setups has a different basis for diversity. On internal English periodicals, the ensemble across neural configurations reaches detection F1 of 72.30 and relative correction improvement of 38.68. The ordinary contextual neural system reports 71.46 and 34.95. The ensemble improves both measures in that comparison, while the contextual statistical system retains the stronger correction improvement of 41.83. The results give a concrete reason for the competition entry to draw candidates from both families rather than rely on neural decoding alone.

The article also distinguishes benefits of ensembling from benefits of selecting the members. The competition combination was tuned for how systems behaved together. A system that is modest on average can still supply a useful proposal in cases where the other members reproduce the original OCR. The paper does not isolate the contribution of each individual rule or member of the submitted combination. The evidence for the full combination comes from the competition result, and the internal experiments establish which forms of diversity helped in the tests that preceded or followed it.

### Limitations

#### Limits identified by the authors

The official correction task supplies the location of each erroneous token. The authors describe this as artificial because a practical system receives text in which correct and incorrect tokens are mixed. Correction at a known location removes the decision about whether that location deserves intervention. A leading competition result under those conditions establishes the quality of the repairs conditional on the marked errors. It leaves the quality of a fully automatic pass dependent on the detector and on how the components interact.

The authors’ recall results leave room for a detector that flags more of the mistakes. They note that the official detection leader uses additional data from Google Books n-grams, whereas their trained translation systems rely on the shared-task material. External evidence might help identify when something is wrong. Generating the spelling actually found in the document remains a separate requirement, especially when old and modern forms coexist.

The authors also identify a practical cost to building a collection of systems for each new dataset. It takes effort to train them and determine which work well together. The simpler post-submission system addresses that cost, and its official results illustrate the possible loss in correction quality. The paper explores configurations chosen for their plausible compatibility. It does not exhaustively test all their combinations.

For the practical question of how much supervision is needed, the authors propose experiments that reduce training data systematically. The comparisons they report answer a different question because pooling adds examples from other distributions. They also describe the error-focused proportions as candidates for further tuning. The results on monographs and periodicals differ enough that the tested proportions give little basis for choosing a common setting for another collection.

For context, only one allocation of neighbouring words is examined in detail. The authors propose exploring other ways of incorporating it. They make a similar point about glyph information. A Helvetica rendering is available and easy to use, but may be a poor match for historical fonts. They suggest closer approximations to the original shapes and a different way of adding those representations to the character embeddings. The paper leaves those possibilities as future work.

#### Limits of the comparisons

The internal partition is a random split of the official training material. The comparisons thus show how well the systems do on held-out examples within that collection. The setup does not establish how they transfer to a collection held out as a whole, or to an unfamiliar OCR engine, typeface or publication interval. Variation within the corpus supplies opportunities to observe inconsistent behaviour. It does not supply a controlled experiment in which date, language, document type and OCR engine can be varied independently.

The time experiment illustrates this distinction. A year label can help the system respond to a changing distribution of errors. Publication date can also stand in for printing practices or collection-specific characteristics. Without source images the paper cannot explain how much of the measured change comes from each of these influences. There is an additional comparison issue for time and other factors. The factor settings require untied embeddings, so their results include a change to the character representations as well as the added information.

The excluded material also sets a boundary on what the evaluation covers. Spans whose transcription could not be established are taken out of the experimental data, and hyphens are ignored when scoring. Those decisions make the reference more reliable for the comparisons the authors conduct. They leave some difficult sources of error in historical material outside the reported evaluation, including cases where even the source image was judged uncertain.

Settings explored on French periodicals serve as the basis for the neural experiments more broadly. This is practical in light of training time and gives the comparisons a common starting point. It does not show that the settings are optimal for English books or French monographs. Averaging three runs helps account for variation from repeated training, but the reported averages by themselves do not establish whether small differences would persist with a different split.

Finally, the official comparison with outside submissions combines several differences at once. The stronger recall of a competitor with external resources is consistent with the authors’ suggestion that additional evidence can help detection. Because the competitor also uses a different method, the comparison does not isolate the effect of adding those resources to the authors’ own system. Similarly, missing and malformed outputs affect which competition results can be compared. The most direct evidence for a design choice remains the comparison between configurations tested under the same internal conditions.

### What came after

The follow-up reported by the authors was their simpler post-submission experiment. It kept character-level translation, supplied nearby words, and used document-type and date information so that periodicals and monographs could share a training pool within each language. In doing so, it tested whether one configuration could capture enough of the benefits that the competition entry obtained by combining several systems. Its detection score stayed close to the submission’s mean F-measure, while the correction results exposed a larger cost to simplification, especially for English monographs.

The paper also points to follow-up experiments on how correction quality varies with the amount of supervised data, the original error rate and the period represented in training. It proposes narrower publication intervals as a way to study time variation more directly. These are questions left open by the experiments. Later citing work is undocumented here, so there is no subsequent result to report on whether those directions improved detection or made the correction systems easier to transfer.

## Cite

Cite as Chantal Amrhein and Simon Clematide. 2018. Supervised OCR Error Detection and Correction Using Statistical and Neural Machine Translation Methods. LDV-Forum/Journal for language technology and computational linguistics.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.21248/jlcl.33.2018.218](https://doi.org/10.21248/jlcl.33.2018.218)

```bibtex
@article{amrhein2018supervised,
  title = {{Supervised OCR Error Detection and Correction Using Statistical and Neural Machine Translation Methods}},
  author = {Chantal Amrhein and Simon Clematide},
  journal = {LDV-Forum/Journal for language technology and computational linguistics},
  year = {2018},
  doi = {10.21248/jlcl.33.2018.218},
  url = {https://doi.org/10.21248/jlcl.33.2018.218}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
