---
title: "Handwritten Text Recognition for Historical Documents using"
description: "How historical handwriting recognition combines visual transformers, medieval language training and synthetic lines, and where it still fails."
canonical: "https://research.elamur.ai/free/en/papers/aguilar-2024-handwritten-text-recognition-historical-documents/"
---
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/aguilar-2024-handwritten-text-recognition-historical-documents/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2024](https://md.research.elamur.ai/free/en/papers/2024/) / Handwritten Text Recognition for Historical Documents using Visual Language Models and GANs

# Handwritten Text Recognition for Historical Documents using Visual Language Models and GANs

Paper · 2024 · Sergio Torres Aguilar

**Authors:** [Sergio Torres Aguilar](https://md.research.elamur.ai/free/en/authors/sergio-torres-aguilar/) · **Year:** 2024 · **Venue:** HAL (Le Centre pour la Communication Scientifique Directe) · **Licence:** [CC BY (OpenAlex best open-access location)](https://creativecommons.org/licenses/by/4.0/)

HAL (Le Centre pour la Communication Scientifique Directe) · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://hal.science/hal-04716654)
- [PDF](https://hal.science/hal-04716654/document)

## What it is about

How historical handwriting recognition combines visual transformers, medieval language training and synthetic lines, and where it still fails. · about 35 minutes to read

**In this deep dive**

1. [Summary](#dd-summary)
2. [Ideas worth borrowing](#dd-ideas-worth-borrowing)
3. [How Mova uses it](#dd-how-mova-uses-it)
4. [The problem and its context](#dd-the-problem-and-its-context)
5. [The method, step by step](#dd-the-method-step-by-step)
6. [Experiments and results](#dd-experiments-and-results)
7. [What the ablations show](#dd-what-the-ablations-show)
8. [Limitations](#dd-limitations)
9. [What came after](#dd-what-came-after)

### Summary

Recognizing historical handwriting involves more than identifying letters. A manuscript may abbreviate a name, join words that a modern editor would separate, or use a spelling unfamiliar to a general-purpose recognizer. The intended transcription may also contain material that is not fully visible: expanded abbreviations, standardized punctuation, or capital letters supplied by an editor. Sergio Torres Aguilar studies these intertwined problems in medieval and early modern documents. The paper asks whether an image-to-text transformer, adapted to historical language and supplemented with synthetic handwriting, can produce better transcriptions than a convolutional recurrent system.

The study brings together documentary collections containing charters, registers, correspondence, and other administrative records. Its training inventory reports 210,218 graphical lines and 2,044,911 tokens. The broader collection contains 52 manuscripts, with Latin, historical French, Spanish, and German represented unevenly. The experiments compare a Kraken-based convolutional recurrent baseline with several transformer configurations derived from TrOCR or a vision transformer. Their differences concern the visual starting point, the language component, and the inclusion of generated handwriting. A historical RoBERTa component is trained using a cleaned textual collection described as 5GB and approximately 750 million tokens. Separately, a handwriting generator produces 420k synthetic lines, allowing text without aligned manuscript images to contribute additional training pairs.

The strongest overall configuration, TR γ, combines the historical-language setup with real and generated handwriting. Its benefits appear especially clearly in word error rate, which measures disagreement at the level of whole words. For external manuscripts, the paper reports median relative improvements over the original baseline of 14% in character error rate and 19% in word error rate under its raw evaluation. When punctuation and diacritics are removed, the reported median improvements are 26% and 27%. Adaptation using 150 lines from an external collection also helps. On Saint-Gall, for example, TR γ obtains a few-shot character error rate of 7.6, compared with 10.1 for the original recurrent baseline. The results support historical-language adaptation and synthetic augmentation in this experimental setting, although some descriptions of the configurations and validation scores are inconsistent.

The error analysis explains why linguistic support both helps and creates risk. A transformer can replace an implausible character sequence with a readable word, expand an abbreviation, or separate words according to editorial conventions. The same preference for plausible language can replace a rare surname, misunderstand a local place name, or complete a broken word incorrectly because the following line is unavailable. Readability therefore does not guarantee documentary fidelity. The paper’s practical contribution is a comparison of recognition architectures, historical-language adaptation, and generated training material, together with an account of where contextual interpretation improves transcription and where it can distort the evidence.

### Ideas worth borrowing

Make the target representation explicit. A transcription is governed by editorial choices as well as by visible marks. Expanding abbreviations and standardizing punctuation define a different task from preserving every written distinction. The paper makes this consequential by evaluating edited output and a version without punctuation or diacritics. Elsewhere, the same principle applies whenever a system converts evidence into a standardized representation: define which transformations count as correct before interpreting accuracy.

Adapt linguistic expectations to the material. A language component trained on unrelated writing can favor the wrong vocabulary and token boundaries. Historical-language adaptation gives the recognizer expectations closer to its documents, especially where images are ambiguous. This idea transfers to specialized terminology, regional language, and technical archives. The important qualification is coverage: a specialized component may lose its advantage when the input language falls outside its training distribution.

Separate content from surface variation. The handwriting generator treats textual content and writing style as different factors. This allows additional text to be rendered in varied handwriting rather than requiring every training sentence to have an original manuscript image. More broadly, separating what an example means from how it appears can support controlled augmentation. The resulting examples still need external evaluation, because a convincing surface does not establish that the generated distribution matches real use.

Evaluate beyond the familiar collection. Validation drawn from the training collection and testing on unseen manuscripts answer different questions. The paper also distinguishes direct application from adaptation using a small amount of target material. This design is useful wherever a system will encounter new institutions, authors, genres, or periods. It exposes whether a favorable result depends on familiar conditions and whether modest local annotation can repair the mismatch.

Measure fidelity and usability separately. Character error rate, word error rate, and an embedding-based similarity score emphasize different properties. A transcription can preserve many letters while producing unusable words, or produce fluent words that misrepresent a name. Combining metrics with inspected examples makes these tradeoffs visible. The same approach benefits extraction and correction systems whose outputs must be both useful and traceable to evidence.

Treat contextual correction as a possible source of error. Linguistic expectations can resolve ambiguity, but they can also erase unusual information. The paper’s examples show this particularly clearly for names, abbreviations, and incomplete words. A reusable design principle is to preserve the distinction between observed material and a contextually preferred interpretation. Systems handling rare events, unfamiliar terminology, or documentary evidence should make that distinction inspectable.

Match the context window to the phenomenon. A line recognizer cannot inspect the continuation of a word on the next line. Its linguistic reasoning is therefore bounded by a unit chosen for data preparation. The paper’s proposed move towards larger document regions expresses a broader lesson: select processing units according to the dependencies needed for the task. More context may help, but its benefit must be demonstrated rather than assumed.

### How Mova uses it

Mova is a transparent language system written in Rust. Its documented native path parses text into dependency trees, reads those trees into frames, and maintains a world from which it answers with reasons. The connections below concern transfers from the paper’s experimental design and error analysis. They do not establish that Mova implements historical handwriting recognition or that any proposed transfer has improved its results. The status marks are proposals against the documented mechanisms; an unmentioned capability remains unknown.

Idea: Declare the intended representation before evaluation. Where: Section III, “Datasets configuration.” Area: data representation. Mova: частково є (the `en` tree representation, frame interfaces, and source-bound groupant contracts). Mova could attach an explicit representation profile to imported historical text, distinguishing preserved spelling, expanded abbreviations, standardized punctuation, and editorial capitalization. Its existing typed structures provide a place for such a contract, but a historical-transcription profile is not established. Why Mova: A declared profile would help Mova avoid treating an editor’s transformation as a directly observed feature of the document.

Idea: Preserve distinct transcription layers. Where: Section III, “Datasets configuration,” and Section VII, “Editorial Normalization.” Area: provenance. Mova: частково є (`dictindex` retains exact source sentences and stable occurrence identities). A source adapter could retain the original transcription alongside any normalized derivative, with a recorded relation between them. The paper explains why multiple transcription levels serve different readers; it does not test this architecture in Mova. Why Mova: A free dictionary and a logical reading module both benefit when a user can inspect the wording behind a normalized lookup or inferred statement.

Idea: Evaluate edited and reduced text separately. Where: Sections III and VI, including Table 6. Area: evaluation. Mova: нове. A proposed assessment could compare results under declared punctuation and diacritic treatments, while retaining the original input and identifying the transformation used. This would be a diagnostic for representation sensitivity, rather than permission to discard distinctions in ordinary reading. Why Mova: It could reveal whether failures arise from editorial conventions, token boundaries, or deeper interpretation, making repairs more targeted.

Idea: Adapt vocabulary to a documented domain. Where: Sections IV and VI, historical RoBERTa experiments. Area: lexical semantics. Mova: частково є (compiled global knowledge, domain routing, and separately sourced dictionary layers). Mova need not adopt a neural decoder to borrow the principle of matching lexical expectations to a collection. A historical dictionary layer could offer period-specific forms and meanings with explicit scope and provenance. Why Mova: Domain vocabulary could reduce mistaken analyses of unfamiliar forms while preserving the project’s preference for rules, statistics, and inspectable evidence.

Idea: Treat linguistic coverage as a condition of use. Where: Sections VI and VIII, discussion of Faithful Transcriptions. Area: domain routing. Mova: частково є (`layers` records coverage decisions and can mark escalation). The paper shows that historical specialization does not ensure equal benefits for languages poorly represented during training. Mova could make source language, period, and dictionary coverage explicit conditions for applying a historical adapter. Why Mova: A logical module should explain when its resources cover an input and when its apparent confidence rests on an unsuitable vocabulary.

Idea: Keep tokenization under evaluation. Where: Sections IV and VIII, tokenizer and decoder discussion. Area: tokenization. Mova: частково є (`en` tokenization and the documented French contraction, elision, and clitic work). Historical word division could be assessed as its own source of downstream change. The paper supports the importance of token boundaries but does not supply a historical tokenizer for Mova. Why Mova: A wrong boundary can alter morphology, dependency structure, dictionary lookup, and the entities that enter a world.

Idea: Separate content from presentation in generated tests. Where: Section IV, “The GAN model.” Area: data generation. Mova: нове. Rather than reproducing the neural handwriting generator, Mova could construct controlled textual variants that hold an underlying event constant while changing a declared surface feature. The transfer would be a test-design hypothesis, not a claim that these variants reproduce historical documents. Why Mova: Controlled changes could show whether a rule follows meaning or depends accidentally on a familiar spelling or presentation.

Idea: Keep synthetic evidence distinct from original evidence. Where: Sections IV and V, generated lines and augmented training collections. Area: data provenance. Mova: частково є (`sources` manifests, dictionary source credits, and separate staged enrichment artifacts). Generated variants could carry their origin and transformation history through every proposed admission path. The handwriting paper demonstrates augmentation benefits, but it does not make generated material equivalent to historical testimony. Why Mova: Mova’s free dictionary and durable knowledge stores need to distinguish useful training material from independent evidence about the world.

Idea: Evaluate augmentation on external material. Where: Sections V and VI, comparisons involving TR γ and CRNN β. Area: evaluation. Mova: частково є (held-out gates, contrast sets, and separately assessed enrichment). Any new generated examples or induced rules could be judged on unchanged, independently selected source material. The existing gates support this principle, although the specific historical-text experiment is unknown. Why Mova: Improvement on generated examples alone could reward the generator’s habits rather than better reading.

Idea: Test transfer at the source level. Where: Section III, “Testing Corpora,” and Section V. Area: evaluation design. Mova: частково є (source identities in `dictindex` and held-out assessment practices). A proposed reading evaluation could hold out entire documents or collections, retaining their source identities in reports. This would distinguish transfer to a new source from success on new sentences within a familiar source. Why Mova: Dictionary evidence and text understanding often encounter collection-specific vocabulary and annotation conventions that sentence-level validation can conceal.

Idea: Separate direct transfer from local adaptation. Where: Section VI, Table 5. Area: evaluation design. Mova: частково є (distinct training, retained-state assessment, and bounded improvement paths). Reports could distinguish what a reader does before seeing a target collection from what it does after admitted local examples. The paper’s few-shot experiment supplies the design principle, not evidence about Mova’s adaptation efficiency. Why Mova: Users need to know whether a capability is already available or depends on additional teaching from their material.

Idea: Report several kinds of correctness. Where: Section VI, CER, WER, and BERT-score. Area: evaluation. Mova: частково є (`en rules-audit` reports several parsing and tagging measures). A historical reading evaluation could report surface fidelity, structural analysis, and answer correctness separately. These are proposed Mova measures rather than substitutes for the paper’s recognition metrics. Why Mova: A better-looking transcription can still damage a dependency relation or a factual answer, so a single aggregate score may hide the practical cost.

Idea: Inspect disagreement between metrics. Where: Sections VI and VII. Area: error analysis. Mova: частково є (diagnostic traces and explicit reasons for decisions). Mova could collect cases where lexical plausibility improves while exact source matching or downstream answers worsen. Such disagreement would identify candidates for review rather than automatically selecting a preferred output. Why Mova: This would direct attention to transformations that make text easier to process while potentially weakening its connection to the source.

Idea: Preserve observation separately from interpretation. Where: Sections VII and VIII, contextual replacement and abbreviation discussion. Area: knowledge representation. Mova: частково є (`Frame::evid`, hearsay admission gates, and the boundary between external receipts and native conclusions). A transcription adapter could type a visible fragment, an expansion, and a contextual proposal as different evidence kinds. Existing evidential distinctions provide a related mechanism, but they do not establish graphical provenance. Why Mova: A logical module should avoid converting a plausible reconstruction into an unqualified statement.

Idea: Protect unusual names from vocabulary pressure. Where: Section VII, “Statistical Pattern Misleading.” Area: named entity handling. Mova: нове. A proposed import policy could retain unfamiliar name candidates and their exact source occurrences instead of replacing them merely because a common dictionary item fits the context. The paper motivates caution but does not validate a particular preservation rule. Why Mova: A free dictionary and a knowledge graph can lose valuable information if rare names are normalized into familiar words before review.

Idea: Distinguish conventional expansion from unresolved identity. Where: Section VII, personal-name abbreviations. Area: inference. Mova: нове. Mova could represent an abbreviation as unresolved when its expansion requires local identity evidence, while allowing separately justified conventional expansions. This would require explicit rules and source support rather than a general preference for a common name. Why Mova: Leaving a referent incomplete can be more useful for later reasoning than introducing a specific but unsupported person.

Idea: Use external knowledge as attributed evidence. Where: Section VIII, proposed external knowledge bases and retrieval. Area: knowledge graphs. Mova: частково є (`global`, `onto`, and source-bearing dictionary evidence). A future historical adapter could consult an appropriate name resource while keeping the retrieved candidate separate from the accepted transcription. The paper presents this as future work, and no Mova implementation is established. Why Mova: External evidence could help resolve local references without making retrieval itself an automatic admission decision.

Idea: Preserve competing analyses. Where: Section IV, beam search, and Section VII, false expansions. Area: search and ambiguity. Mova: частково є (bounded candidate exploration in the maths reader and ambiguous complementary observations in groupants). A text adapter could retain plausible alternatives with their evidence and unresolved distinctions. This borrows the value of considering alternatives without assuming that the highest-scoring linguistic sequence is true. Why Mova: Explicit alternatives would let later context or a reviewer resolve an ambiguity that an early irreversible choice would conceal.

Idea: Make context boundaries visible. Where: Section VII, “Line-level Transcription Limitations.” Area: discourse and data processing. Mova: частково є (document worlds and shared retained graphs). Imported line-based text could retain adjacency information and mark incomplete words or clauses. Mova’s document state can support broader reasoning, but automatic reconstruction across manuscript lines is not documented. Why Mova: A reader should know whether relevant evidence is absent or merely lies outside the unit currently being processed.

Idea: Match the processing unit to the dependency. Where: Section VIII, proposed paragraph and page systems. Area: architecture. Mova: частково є (the document-level graph used by fast reading and the mice). A future source adapter could expose larger regions when a question depends on continuation, marginal material, or surrounding entries. The handwriting paper proposes larger visual context without measuring it. Why Mova: Existing shared context is more useful when the import path preserves the relations needed to answer across local boundaries.

Idea: Diagnose editorial mismatch before changing rules. Where: Sections III, VI, and VII, spacing and transcription conventions. Area: evaluation diagnosis. Mova: частково є (treebank dialect work and rule-based agreement with recorded evidence). Historical-text disagreements could be classified as source convention, tokenization, morphology, or interpretation before a repair is admitted. Why Mova: A rule intended to fix an apparent error may otherwise overwrite a legitimate convention used by a different collection.

Idea: Separate integrated interpretation from later correction. Where: Sections I and VIII, language support inside recognition. Area: pipeline design. Mova: частково є (explicit interfaces among parsing, pragmatics, world reading, and reviewed enrichment). Mova could identify which stage introduces an expansion or correction and preserve its justification. The paper’s integrated decoder motivates examining stage boundaries; it does not imply that Mova should merge its components. Why Mova: Attribution to a specific stage makes regressions easier to diagnose and prevents a later improvement from hiding an earlier unsupported change.

Idea: Stratify results by source conditions. Where: Sections III and VI, differences among external manuscripts. Area: statistics and evaluation. Mova: частково є (`dictindex` records source-domain strata and evaluation tools report several fields). Proposed reports could separate performance by collection, language, and representation profile where those attributes are known. Why Mova: Aggregate success can conceal a weakly covered language or a transcription convention that needs different handling.

Idea: Keep expert annotation decisions inspectable. Where: Sections II and III, ground-truth preparation. Area: annotation. Mova: частково є (`treeagree` records rule evidence and rejected changes, while teacher disagreements follow a separate review path). Historical editorial decisions could enter as attributed annotation proposals rather than silent replacements. Why Mova: Expert interpretation is valuable supervision, but its provenance and scope matter when it becomes dictionary evidence or retained knowledge.

Idea: Inspect local failures after aggregate improvement. Where: Section VII, error taxonomy and Figure 5. Area: error analysis. Mova: вже є (reader traces, explicit gaps, and fast-reader miss classification). The paper reinforces the value of examining what a successful configuration gets wrong, especially when the mistakes are plausible. A historical adapter could reuse that diagnostic discipline. Why Mova: A small average gain does not reveal whether a change damages names, logical relations, or the rare cases most important to a user.

Idea: Treat computational cost as part of a proposal. Where: Sections IV and VIII, training resources and pretraining discussion. Area: efficiency. Mova: частково є (`mova-twin` compares prospective costs with measured runs). Any proposed historical-text component could report resource requirements alongside quality under a declared scope. The paper supplies hardware descriptions but no matched efficiency benchmark. Why Mova: This would support Mova’s preference for economical, inspectable mechanisms without assuming that a larger component is either necessary or cost-effective.

Idea: Bind reported results to an unambiguous configuration. Where: Sections IV–VI, configuration descriptions and result tables. Area: reproducibility. Mova: частково є (source-version checks in `dictindex`, enrichment fingerprints, and groupant identities). A report should name the exact tokenizer, decoder, source versions, and evaluation profile that produced it. This proposal follows from ambiguities in the paper’s reporting rather than a claimed paper contribution. Why Mova: Reviewable configuration identities make a result usable as evidence and prevent a broad architectural label from concealing consequential differences.

These proposals preserve the paper’s central warning: linguistic plausibility is useful evidence, but it does not on its own establish the correct reading. Their practical effects in Mova remain unknown until evaluated within the relevant admission and assessment boundaries.

### The problem and its context

#### Historical documents require interpretation

The paper concentrates on documentary manuscripts: records created through administration, law, institutional business, and private transactions. Their contents include decisions, obligations, transfers, correspondence, and accounts. These materials matter because they preserve evidence of social and institutional activity, yet their handwriting and organization can make them difficult to process at scale.

The historical setting also explains why training data are scarce. According to the paper, documentary production expanded strongly in the later medieval period, but modern editions cover only selected portions. Some editorial effort concentrated on collections of charters or on cartularies, which copy documents into organized books. A large surviving archive therefore does not automatically provide a large collection of aligned manuscript images and verified transcriptions.

The difference between an image archive and recognition training data is substantial. A recognizer needs a correspondence between a graphical region and the text that should be produced from it. Establishing that correspondence requires transcription expertise, segmentation, and consistent editorial decisions. The paper emphasizes the contribution of historians and paleographers to this process, instead of treating ground truth as an automatic by-product of digitization.

Even an agreed reading can support several output conventions. A transcription may preserve a manuscript’s abbreviation mark, expand the abbreviated word, or add distinctions that improve readability. An editor may separate words differently from the visible spacing. Consequently, historical handwriting recognition combines visual recognition with decisions about how the document should be represented.

This distinction connects the task to [annotation](https://md.research.elamur.ai/free/en/concepts/annotation/). The reference transcription is an annotated interpretation with declared conventions. It is not simply a neutral string against which every possible transcription should be judged. The paper’s choice of semi-diplomatic output defines the particular problem its experiments address.

#### The recognition approaches described by the paper

The related-work discussion presents a progression from hidden Markov approaches toward neural recognition systems. In the recurrent approach used as the baseline, convolutional layers extract graphical features, recurrent layers process their sequence, and connectionist temporal classification handles the relationship between image positions and output characters. This avoids requiring a separately aligned image segment for every character.

The paper describes explicit linguistic support as a way to improve recognition when graphical evidence is weak. A language component contributes expectations about plausible sequences. Those expectations can help with noisy handwriting, unusual spacing, and ambiguous forms, because the visual evidence alone may not identify a unique reading.

The attraction of a [transformer](https://md.research.elamur.ai/free/en/concepts/transformer/) is that attention can connect relevant parts of an input sequence. The visual side represents an image through patches, while a text decoder produces an output sequence using the image representation and previously generated text. The paper cites [An Image is Worth 16x16 Words](https://md.research.elamur.ai/free/en/papers/dosovitskiy-2020-image-worth-16x16-words-transformers/) in its discussion of attention-based image processing.

Earlier recognition work, as described by the author, had already investigated transfer from pretrained systems and adaptation to historical writing. The present study therefore does not introduce historical handwriting recognition or the general idea of transformer-based recognition. Its focus is a comparative investigation of particular historical-language components and generated handwriting within a multilingual documentary setting.

The paper also discusses [RoBERTa](https://md.research.elamur.ai/free/en/papers/liu-2019-roberta-robustly-optimized-bert-pretraining/) and [mT5](https://md.research.elamur.ai/free/en/papers/xue-2021-mt5-massively-multilingual-pre-trained/) when motivating linguistic training and probability smoothing. Its experiments, however, should be distinguished from that broader discussion. Medieval RoBERTa and medieval GPT-2 configurations are tested; mT5 is background instead of an evaluated recognition configuration.

#### Why domain adaptation and augmentation belong together

The visual and linguistic problems are related but different. A recognizer may lack examples of a script style, while its language component may lack the words or spellings that style expresses. Adding textual material helps only the linguistic side unless that text can also be paired with suitable images.

Synthetic handwriting offers a bridge. Text from historical collections without aligned images can be rendered into generated line images. The resulting pairs expose recognition training to additional content while attempting to preserve relevant graphical characteristics.

The difficulty is generating variation that remains useful. A handwriting generator must represent both what the line says and how it is written. If those factors remain entangled, changing the text may disrupt the style, or reproducing a style may constrain the available content. The selected GAN architecture is intended to separate these factors.

The paper’s research question therefore concerns a combination of resources. It asks whether stronger historical-language expectations and a larger range of graphical training pairs can improve transcription together. Its later analysis shows why the answer cannot be reduced to “more context is always better”: the same expectations that repair damaged words may overwrite exceptional evidence.

### The method, step by step

#### Establish the transcription task

The authors work primarily with semi-diplomatic transcriptions. Under this convention, historical spellings remain, but several graphical distinctions are normalized. Abbreviations are expanded, punctuation is standardized, names receive capitalization, and many alternative letter shapes map to a canonical character.

Preserving spelling matters because normalization is not the same as regularizing language. The paper gives alternative historical spellings of a word as examples of forms that should remain distinct. The recognizer is therefore expected to handle orthographic variation even though some graphical variation has been removed from its target representation.

The training character inventory contains 123 characters. This inventory belongs to the selected transcription practice. A different editorial task, especially one preserving abbreviation signs or detailed graphical distinctions, would require a different target representation and potentially different supporting resources.

The evaluation then uses two treatments. Raw output retains the edited transcription conventions. Cleaned output omits punctuation and diacritics. The cleaned treatment does not remove every possible source of editorial disagreement, particularly word division, but it provides a diagnostic for some of the differences between graphical evidence and editorial output.

Historical handwriting recognition experiment The steps in order.

#### Assemble real manuscript training data

The training material combines collections with different documentary purposes. The e-NDP registers contain decisions from cathedral meetings. HOME-Alcar supplies aligned cartulary material with entity annotations. Himanis contributes royal chancery records, while Königsfelden supplies charters and institutional documents.

Other training sources broaden the material further. Bullinger Digital contributes correspondence, the Luxembourg collection contains regional institutional manuscripts, and CODEA supplies historical Spanish documents. These sources vary in language, period, and script, instead of constituting a single homogeneous handwriting collection.

The training table reports 210,218 lines and 2,044,911 tokens. The author describes five principal writing families and more than a hundred hands, while acknowledging that the precise number of interventions cannot be established. A manuscript can contain several hands or writing families, so manuscript identity is not equivalent to writer identity.

Language coverage is uneven. The paper gives a 5:2:1 distribution for Latin, French, and Spanish across the training and testing material, while German varieties occupy less than 5%. This imbalance is important when interpreting the specialized language component: the presence of a language in the corpus does not imply equally strong coverage.

The author argues for mixing hands, scripts, and languages because actual manuscripts themselves may contain this variation. This is a practical motivation for diversity, not a separately isolated experimental result in the paper. No controlled comparison establishes the individual contribution of each diversity dimension.

#### Prepare external tests

The external evaluation uses six manuscript collections absent from recognition training. Saint-Gall supplies an early manuscript benchmark, while the Vienna Collatio supplies legal material. The Troyes manuscript contributes heavily abbreviated preaching material, and Liber Feudorum supplies regional administrative records.

Cremma and Faithful Transcriptions add further variation. Faithful includes languages and varieties that are new or weakly represented relative to the training resources. This makes it particularly informative about the limits of historical-language specialization.

The test inventory reports 11,105 lines and 83,946 tokens. These external tests differ from validation sampled within the training collection. They challenge the recognizer with new documentary conditions, although they do not establish unrestricted generalization to every historical archive.

The experiments distinguish zero-shot use from few-shot adaptation. Zero-shot means applying the trained recognizer without local adaptation on the target manuscript. Few-shot testing uses 150 lines of target material. The distinction makes it possible to examine both immediate transfer and the value of a modest local transcription effort.

#### Build the recurrent baseline

The recurrent baseline has 6.3 million parameters. Its detailed architecture describes convolutional feature extraction followed by bidirectional long short-term memory layers and a connectionist temporal classification objective.

A convolutional layer learns local image patterns. In this task, those patterns can contribute evidence about strokes, letter fragments, and their surroundings. Pooling reduces the representation’s spatial dimensions, while dropout is used during training to discourage excessive dependence on particular internal features.

The recurrent layers process the feature sequence in both directions. Their purpose is to combine local graphical evidence across the line. Connectionist temporal classification then supports alignment between an image-derived sequence and a shorter character transcription without requiring a character-by-character segmentation in the input.

The detailed architecture uses four convolutional layers and three bidirectional recurrent layers. Elsewhere, the hyper-parameter description calls the baseline a three-convolution arrangement. This inconsistency does not prevent understanding the baseline family, but it limits exact reconstruction from the prose alone.

The input height is fixed at 140 pixels. The author also specifies padding of 24 pixels and a learning-rate reduction strategy with patience 3. These details establish that the baseline is a configured and trained recognition system, rather than an abstract comparison against recurrent processing.

#### Adapt the transformer recognizer

The main transformer family follows TrOCR’s image-encoder and text-decoder arrangement. The image is divided into patches, which are flattened and projected into a vector representation. Position information records where those patches belong.

The text side generates wordpieces. A wordpiece is a vocabulary unit that may correspond to a complete word or to part of one. This connects recognition to [subword tokenization](https://md.research.elamur.ai/free/en/concepts/subword-tokenization/): the decoder’s available units shape how easily it can express familiar words, rare spellings, and incomplete fragments.

At each generation step, the decoder uses the encoded image and the output prefix. Its internal representation is mapped to vocabulary probabilities through softmax. Beam search retains several promising output sequences instead of committing immediately to a single continuation.

The experiments use a beam value of 3. This gives the search a limited collection of competing sequences. It does not guarantee that the correct transcription survives, particularly if the vocabulary or learned sequence preferences strongly favor an incorrect expansion.

The architectural prose contains an apparent reversal when assigning image and language components to encoder and decoder roles. The functional explanation is clearer: image patches feed the visual encoder, and the text component generates output. The paper’s configuration labels should therefore be read together with their detailed descriptions rather than treated as fully unambiguous implementation specifications.

#### Train historical linguistic resources

The medieval RoBERTa component is trained from scratch for 10 epochs. Its described base configuration has 768-dimensional representations, 12 attention heads, and 12 hidden layers. The vocabulary contains 8k units.

The textual sources include Latin collections, historical documentary resources, and medieval French material. Some large sources overlap. After cleaning, the author describes the combined resource as 5GB and approximately 750 million tokens.

These textual resources are also used for the GPT-2 experiment. The purpose is to compare historical-language support under different recognition configurations, rather than simply attach a contemporary general-language component to manuscript images.

When incorporating medieval RoBERTa into the TrOCR-derived system, the author reinitializes the decoder’s embedding and output layers. The positional component is also restarted. The stated motivation is to adapt representations and ordering expectations to the historical languages rather than preserve all English-specific behavior.

The paper discusses restricted vocabulary size as potentially useful when textual training material is limited. It also discusses label smoothing as a way to reduce overly concentrated output probabilities. Neither vocabulary size nor smoothing receives a complete isolated recognition ablation, so these explanations remain part of the training rationale rather than independently quantified causes of the final improvement.

#### Generate synthetic handwriting

The synthetic images come from HiGAN+, a generative adversarial architecture. A generator produces handwriting images, while discriminators evaluate whether the images resemble the desired graphical distribution. Training uses their competing objectives to improve the generated output.

The architecture separates several functions. A style encoder represents handwriting characteristics. A text recognizer encourages the generated image to remain readable as its conditioning text. Global and patch-level discriminators examine broader appearance and local texture, respectively.

In this study, the system is modified to handle color images whose widths vary but whose height is fixed at 64 pixels. The paper also mentions 4-pixel patches and lines up to 30 characters. Its later description of generated lines uses token counts instead, leaving the relationship between those limits insufficiently explained.

The GAN training subset contains shorter lines from the recognition material. The style configuration uses 372 writer identities, and interpolation between styles is enabled. That configured count should not be confused with a verified count of independent historical scribes.

The generator receives text from collections that lack aligned graphical lines. It produces 420k synthetic lines, described as containing 8 to 12 tokens. These pairs enlarge recognition training without requiring a new original manuscript image for each text.

The paper gives individual loss weights but does not provide a complete algebraic derivation of the combined GAN objective.

```
λ_kl = 1 × 10⁻⁴
```

Here, λ_kl is the regularization weight governing how closely the encoder’s latent distribution follows its prior. The assignment specifies the strength of this constraint; it is not an independently reported recognition result.

```
λ_ctx = 5.0
```

Here, λ_ctx weights the content-preservation objective. The paper says that other loss weights are adjusted through gradient balancing, but it does not supply enough mathematical detail to reconstruct that entire procedure from the article alone.

#### Train the comparison configurations

The original recurrent system is CRNN α. Its augmented counterpart, CRNN β, adds synthetic handwriting. TR α adapts the English TrOCR starting point, while TR β introduces the historical RoBERTa arrangement.

TR γ is defined in the principal comparison table as the TR β configuration trained with real and synthetic pairs. TR δ combines a vision-transformer starting point with medieval GPT-2 in causal operation. An earlier experimental description associates TR γ with the GPT-2 group, which conflicts with the table and the later discussion.

The most consistent interpretation of the main results is therefore to follow Table 4 and the surrounding analysis: TR γ is the synthetic-augmented historical RoBERTa configuration. The conflicting description remains a reproducibility limitation and should not be silently resolved into certainty.

Training also includes image distortion, blur, rotation, and blot-like changes. The author reports a Threadripper PRO system with dual A100 hardware and 128GB of RAM. These details describe the available resources, but the paper does not give a matched runtime or energy comparison establishing an efficiency advantage.

### Experiments and results

#### What the measurements capture

Character error rate evaluates transcription disagreement at the character level. Word error rate evaluates disagreement over word units. Both are lower-is-better measures, but they respond differently to the same mistake. Replacing an abbreviation with an incorrect complete name can introduce many incorrect characters while remaining a word-level substitution.

BERT-score compares candidate and reference text through contextual representations. The paper uses it to discuss lexical similarity and readability. It offers a complementary view, but similarity in that representation does not establish that a transcription preserves the right person, place, or documentary claim.

The paper evaluates these measures on validation material drawn from 10% of the training dataset and on external manuscripts. It also distinguishes raw from cleaned evaluation. These conditions must remain attached to every result: a cleaned validation score and a raw external score answer different questions.

#### Validation within the training collection

The validation table shows a substantial advantage for historical-language adaptation on word error rate relative to the English TrOCR configuration. It also shows that synthetic augmentation helps the recurrent baseline. The strongest cleaned word error rate belongs to TR γ.

Training-collection validation, cleaned word error rate The historical transformer with synthetic handwriting has the lowest word error rate in this comparison.

**The numbers**

| System or setting | WER |
| --- | --- |
| CRNN α | 19.3 |
| TR α | 20.7 |
| TR β | 14.3 |
| TR γ (this paper) | 12.9 |
| TR δ | 24.8 |
| CRNN β | 16.4 |

This comparison supports two observations without requiring an architectural story stronger than the evidence. First, the historical transformer configuration performs better here than the English-derived transformer. Second, generated handwriting benefits a recurrent recognizer as well, so augmentation is not useful only when paired with an explicit language decoder.

The validation ordering also warns against treating every transformer configuration as an improvement. TR δ performs poorly, and TR α does not consistently surpass the original recurrent baseline. The successful result depends on the selected starting point, linguistic adaptation, and training material.

The narrative description of TR γ’s validation result does not fully agree with the table. The prose reports a character error rate of 0.064 and a word error rate of 0.143, whereas Table 4 presents raw and cleaned entries that do not match that pair exactly. The table should therefore be used with its row labels intact, and the prose values should be recognized as a reporting discrepancy rather than silently converted into a single authoritative result.

#### Adaptation on Saint-Gall

Saint-Gall supplies a clear comparison between zero-shot use and adaptation. In zero-shot testing, TR γ has a character error rate of 10.9. After adaptation on 150 lines, its character error rate is 7.6.

The original recurrent baseline also benefits from local examples. Its zero-shot character error rate is 12.5, and its few-shot result is 10.1. The important result is therefore not that adaptation helps only the preferred transformer. Local manuscript evidence improves several configurations, while the best historical transformer retains an advantage on this collection.

Saint-Gall after adaptation on 150 lines, character error rate The synthetic-augmented historical transformer performs best after local adaptation.

**The numbers**

| System or setting | CER |
| --- | --- |
| CRNN α | 10.1 |
| TR α | 9.8 |
| TR β | 9.0 |
| TR γ (this paper) | 7.6 |
| TR δ | 11.7 |
| CRNN β | 9.5 |

Word-level results support the same practical conclusion. On Saint-Gall, TR γ records zero-shot word error rate of 30.4 and few-shot word error rate of 24.0. The original recurrent baseline records 41.8 and 35.6 under those respective conditions.

These are manuscript-specific results. They show useful transfer and adaptation for this benchmark, not a universal recognition level for every early manuscript or every script. The author’s broader claims about generalization should be read alongside the substantial variation among external collections.

#### The harder external collections

The Vienna Collatio remains difficult even for the preferred system. Its legal text and early script lie outside the central documentary profile of much of the training material. The raw character error rates reported for CRNN α and TR γ are 29.5 and 22.7, respectively.

The word-level comparison shows improvement while preserving the scale of the remaining problem.

Collatio zero-shot recognition, raw word error rate The strongest transformer improves the result, but the manuscript remains difficult.

**The numbers**

| System or setting | WER |
| --- | --- |
| CRNN α | 86.1 |
| TR α | 80.4 |
| TR β | 73.8 |
| TR γ (this paper) | 71.6 |
| CRNN β | 79.3 |

The cleaned evaluation changes the picture further. For Collatio, TR γ has cleaned character error rate of 18.3 and cleaned word error rate of 59.5. Removing punctuation and diacritics therefore makes some disagreements disappear, but the remaining errors are still substantial.

Liber Feudorum offers another informative comparison. TR γ records raw character error rate of 12.8 and raw word error rate of 32.7, while the original recurrent baseline records 15.6 and 40.8. Under cleaned evaluation, TR γ records 9.6 and 24.1 for those measures.

Faithful Transcriptions tests a different boundary: linguistic coverage. In zero-shot recognition, TR γ records character error rate of 11.2, compared with 12.2 for CRNN β. After few-shot adaptation, the corresponding results are 8.5 and 9.0. These values illustrate the paper’s argument that a historical-language decoder has less room to help when relevant languages or varieties are weakly represented in its resources.

#### The overall pattern and its limits

Across external tests, the paper reports median relative improvements for TR γ of 14% in raw character error rate and 19% in raw word error rate. The cleaned evaluation raises the reported medians to 26% and 27%. The augmented recurrent system has smaller reported median improvements of 7% and 5%.

These aggregate figures support the preferred configuration, but they do not imply uniform improvement on every manuscript or every metric. The detailed tables matter because a collection with unfamiliar language, unusual spacing conventions, or exceptionally heavy abbreviation can behave differently.

The author also reports an overall BERT-score of 85% in zero-shot use and above 90% in few-shot conditions. Those broad statements should be interpreted as the paper’s synthesis of its tests. They are not guarantees for each collection, and they do not replace the source-specific error rates.

The practical result is therefore qualified but useful. Historical linguistic adaptation and synthetic handwriting improve the strongest tested setup, particularly in word-level output. At the same time, external manuscripts expose large residual errors and show why a readable result still requires documentary checking.

### What the ablations show

The paper offers configuration comparisons, input treatments, and qualitative error analysis, but it does not provide a fully isolated component-by-component ablation.

#### Synthetic handwriting helps more than one architecture

The comparison between CRNN α and CRNN β examines augmentation within the recurrent family. The improved validation and external results show that synthetic material can help even without the historical transformer decoder.

The TR β and TR γ comparison provides a corresponding transformer-family test. Under the table’s configuration definitions, adding synthetic pairs improves the preferred historical-language setup. Agreement across the recurrent and transformer comparisons strengthens the claim that generated handwriting is a useful resource in these experiments.

What remains unresolved is why augmentation helps. The generated pairs add both textual material and graphical variation. The paper does not separately compare additional text under fixed style, additional styles under fixed text, and simple repetition of existing pairs. The benefit therefore belongs to the combined augmentation procedure.

Nor does the experiment isolate every design choice inside HiGAN+. There is no recognition comparison disabling the style encoder, removing a discriminator, or changing the content-preservation objective. The paper adopts that generator and measures the usefulness of its output; it does not establish which internal generator component is responsible for downstream gains.

#### Historical-language adaptation improves the successful transformer family

TR α and TR β contrast English-derived linguistic resources with historical adaptation. The results support a better fit between the specialized language component and the documentary material.

However, “the decoder” is not a single isolated variable here. Tokenization, embeddings, output representations, and positional treatment are all implicated in the adaptation procedure. The paper sometimes describes the historical component as a tokenizer and elsewhere as a decoder. It therefore supports the value of the adapted package more clearly than the individual contribution of any one linguistic component.

The Faithful results provide an important counterweight. Historical specialization is beneficial only to the extent that the historical resources cover the relevant language. This is a distributional limitation, not a contradiction: a component can be well adapted to some historical material and poorly adapted to another historical collection.

#### The causal GPT-2 result is suggestive, not decisive

TR δ performs poorly, and the author attributes this partly to causal operation and limited use of bidirectional context. This is a plausible interpretation of the observed failures, especially where a local reading depends on surrounding linguistic evidence.

The experiment does not hold all other factors constant, however. TR δ also uses a different visual starting point and a different language architecture. Its result cannot uniquely identify causal decoding as the source of the problem.

The narrower supported conclusion is that this particular ViT and medieval GPT-2 configuration did not perform well under the reported training conditions. A stronger general statement about all causal recognition approaches would require more controlled comparisons.

#### Cleaning reveals convention-sensitive errors

Raw and cleaned scoring evaluate the same general recognition task under different text treatments. The stronger cleaned results show that punctuation and diacritics account for a meaningful portion of disagreement.

The paper connects this observation to editorial intervention. Some reference punctuation was introduced by modern editors rather than copied directly from visible marks. A recognizer may therefore face an uncertain prediction target even when it reads the surrounding words reasonably well.

Cleaning is still only a partial diagnostic. It does not resolve differences in word division, expansion policy, or interpretation of a name. The experiment reveals sensitivity to selected conventions; it does not produce a convention-free measure of transcription quality.

#### The qualitative analysis exposes plausible mistakes

Figure 5 and the accompanying taxonomy identify failures that aggregate metrics cannot explain alone. A common personal name may replace a less familiar expansion. A rare lexical form may become a familiar but incorrect word. An incomplete word can be completed according to the wrong continuation.

The broken-word example is particularly revealing. A word begins on one line and finishes on the next, but recognition sees only the first line. The transformer proposes a complete plausible expression because the evidence needed to preserve the fragment is outside its input.

These examples demonstrate possible mechanisms of error. They do not establish how often each category occurs, because the paper does not present a comprehensively counted, independently annotated error inventory. Their value is diagnostic: they explain why the same linguistic machinery can improve ordinary text while harming exceptional details.

### Limitations

#### Limits explicitly discussed by the author

The author identifies the scarcity of aligned historical training material as a central constraint. Expert transcription is expensive, and surviving editions do not cover the full variation of manuscripts. Synthetic pairs help enlarge training, but they do not remove the need for reliable original material.

Language coverage is another stated limitation. A medieval language component cannot contribute equally to every historical language or regional variety. The Faithful collection exposes this issue because some of its material is absent or marginal in the linguistic training resources.

Line-level processing imposes a further boundary. Short lines, interrupted words, marginal entries, and tabular structures may require context beyond the available image. Attention can connect information inside the input, but it cannot recover evidence from a neighboring line that the recognizer never receives.

The paper also acknowledges overcorrection. Contextually likely output can diverge from the written form, particularly for names, abbreviations, and unusual vocabulary. This is especially consequential in documentary research, where an exceptional name or spelling may be the information a reader most needs to preserve.

Finally, the author notes the computational demands of transformer pretraining and training. The discussion presents these demands as part of the explanation for the success of strong pretrained foundations and the weakness of some alternative configurations.

#### Limits visible in the experimental design

A careful reader should distinguish a multilingual collection from balanced multilingual coverage. The corpus includes several languages, but their representation differs considerably. Aggregate improvement does not establish equivalent performance across them.

The external evaluation is broader than a single held-out collection, yet it still covers a selected set of manuscripts. Its scope does not support claims about every archive, script family, or historical language. It also evaluates line recognition instead of a complete workflow that detects page regions, orders them, and transcribes an entire complex document.

The validation material comes from a portion of the training dataset. The paper does not explain the division in enough detail to establish a writer-independent or manuscript-independent validation split. Those scores should consequently be interpreted as within-collection validation, with external tests carrying the stronger evidence about transfer.

Several reporting inconsistencies limit reproducibility. The baseline’s convolutional depth differs between descriptions. The transformer architecture paragraph appears to reverse encoder and decoder assignments. TR γ receives conflicting configuration descriptions, and the narrative validation figures do not fully match the main table.

These issues do not erase the observed pattern, but they reduce confidence in reconstructing the exact experiment from prose alone. Released artifacts can assist reproduction, yet their existence is not itself a reported independent replication.

#### What the metrics do not establish

Character and word error rates measure agreement with a selected reference. They do not independently establish that the reference preserves every graphical distinction or that its editorial decisions fit another project’s needs.

Embedding-based similarity is also bounded. A plausible replacement may remain close to its reference in contextual representation while changing a person’s identity or a legal detail. The paper’s own examples show why readable output cannot be equated with reliable historical evidence.

The error taxonomy offers explanations but not prevalence estimates. Without a counted category analysis, the reader cannot determine which failure type dominates across collections or how much of the total improvement comes from abbreviation handling, word separation, or lexical correction.

The paper does not report repeated training runs, uncertainty intervals, or significance tests for the recognition comparisons. The results establish the observed ordering in the reported experiments. They do not quantify how stable every small difference would be under another initialization or sample.

#### What remains a proposal

The discussion suggests external knowledge resources, including [retrieval-augmented generation](https://md.research.elamur.ai/free/en/concepts/retrieval-augmented-generation/), as possible support for names and local references. It also proposes paragraph-level or page-level recognition and more capable layout handling.

These are future directions. The experiments do not measure whether retrieval improves abbreviation expansion, whether a name resource reduces false completions, or whether larger visual context produces a better balance between fidelity and linguistic interpretation.

Likewise, the paper’s favorable discussion of scalability does not amount to a controlled efficiency result. Hardware is described, but there is no complete comparison of training time, inference cost, or resource use under matched recognition quality.

The strongest supported conclusion remains specific: the historical transformer configuration with generated handwriting performs well relative to the tested recurrent baselines and alternative transformer setups, while retaining serious weaknesses on unfamiliar and difficult material.

### What came after

No subsequent citing study is identified in the available later-work record, so there is no supported account of follow-up experiments, independent replications, or later systems that adopted this paper’s particular configuration. A citation to the paper would not by itself establish any of those developments.

The paper instead leaves a research agenda. Its error analysis motivates better preservation of uncertain readings, more appropriate context for broken words, and external evidence for names whose expansion depends on local knowledge. Its comparisons also motivate separating the effects of tokenizer adaptation, decoder training, visual pretraining, and synthetic style variation more carefully.

Those directions follow from the author’s discussion and the limits of the reported comparisons. Their eventual effectiveness remains unresolved. The contribution available for reuse is the experimental combination and its diagnostic lesson: stronger linguistic expectations can improve historical transcription while making the remaining errors more plausible, and therefore harder to detect without access to the documentary evidence.

## Cite

Cite as Sergio Torres Aguilar. 2024. Handwritten Text Recognition for Historical Documents using Visual Language Models and GANs. HAL (Le Centre pour la Communication Scientifique Directe).

The paper itself, not this page. BibTeX from the library's record of the work.

```bibtex
@inproceedings{aguilar2024handwritten,
  title = {{Handwritten Text Recognition for Historical Documents using Visual Language Models and GANs}},
  author = {Sergio Torres Aguilar},
  booktitle = {HAL (Le Centre pour la Communication Scientifique Directe)},
  year = {2024},
  url = {https://hal.science/hal-04716654}
}
```

> 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)
