Handwritten Text Recognition for Historical Documents using Visual Language Models and GANs
Paper · 2024 · Sergio Torres Aguilar
Summary
A clerk can write a name as an initial and expect a contemporary reader to know who it means. A transcription may give the name in full, even though the remaining letters appear nowhere on the line. Medieval and early modern records present this problem alongside crowded handwriting, shifting spellings, and uncertain word divisions. Sergio Torres Aguilar studies whether a system that reads images and draws on historical language can produce better transcriptions of these documents. The task involves learning how writing looks and how editors turn it into text that can be read and searched.
The paper compares a convolutional recurrent recognizer built in Kraken with image-to-text systems based on the transformer. The manuscript material covers 52 manuscripts, and the inventory of real training pairs lists 210,218 line images and 2,044,911 tokens. Latin, French, Spanish, and German varieties appear in unequal proportions. To give the recognizer more suitable linguistic expectations, the study trains a historical RoBERTa component on a cleaned collection of 5GB, or about 750 million tokens. A separate generator turns historical text into 420k synthetic handwriting lines, making it possible to train on wording for which there are no corresponding annotated images.
The strongest configuration overall, TR γ, uses the historical RoBERTa setup and trains on real and generated lines. Scoring the edited text of the external manuscripts as it stands, the paper reports median relative improvements of 14% for character error rate and 19% for word error rate over the original Kraken baseline. When punctuation and diacritics are omitted, those reported gains reach 26% and 27%, respectively. Learning from a small sample of the target collection also helps. With adaptation on 150 lines, TR γ records a character error rate of 7.6 on Saint-Gall, compared with 10.1 for the original recurrent system under the same condition. The paper describes parts of the transformer setup and some validation scores inconsistently, so the detailed results need to be read with their table labels and conditions attached.
Looking at individual lines explains what the scores leave open. Historical language can help a recognizer divide joined words, supply a conventional expansion, or turn a sequence of uncertain letters into a readable expression. It can also turn a local name into a familiar one or guess the ending of a word whose remaining letters are on the next line. The paper shows how language training and generated handwriting can improve agreement with an edited reference. Its examples also show why an apparently fluent transcription can still misidentify a person or change what a record says.
Deep dive: Handwritten Text Recognition for Historical Documents using Visual Language Models and GANs
Historical handwriting recognition improves with medieval language training and synthetic lines, but plausible readings can still distort the record. · about 36 minutes to read
The problem and its context
Why documentary handwriting is hard to turn into text
The paper takes its subject from the working records of institutions and individuals. A cathedral chapter records its decisions. A chancery issues mandates and letters. An abbey preserves transactions in a cartulary, a manuscript containing copies of documents such as charters. A correspondent writes privately about events of the day. The resulting material includes different ways of organizing a page and different reasons for putting words on it. A heading, a list, a marginal addition, and the main body of an entry can coexist in the same register.
The author describes a marked increase in documentary production from the late 14th century. More systematic record-keeping by royal, state, and urban administrations left substantial collections for historians to consult. The volume is part of the reason to automate transcription. Familiarity with an individual hand can help someone reading a particular register, but the effort of reading and entering each line still grows with the collection. Cursive writing and specialized expressions complicate the work, especially where a record was prepared for immediate use by people who understood its conventions.
A manuscript image and a published edition each provide something a recognition project needs. The image shows the writing. The edition gives a reading that a system can be trained to predict. The pair becomes useful for line-based training once the project knows which passage of the edition corresponds to which image line. This requires decisions about the position of line breaks and how to handle wording that an editor expanded or marked differently. An edition can be valuable to a historian without already supplying the correspondences the recognizer needs.
The paper traces part of the scarcity of aligned data to the scope of earlier editing. Cartularies and groups of royal or abbey charters received attention. The range of documentary material available to train recognition systems remains wider than the range for which reliable editions can readily be aligned. Digitizing more collections exposes the gap. It adds images to consult, while the paired readings still depend on people with the necessary language and script expertise.
What the target transcription asks the system to learn
The study works with a semi-diplomatic transcription. In this approach, a text keeps historical spellings while following specified editorial conventions. When a word has several attested spellings, the edition can preserve each occurrence in its own form. The transcription can at the same time expand abbreviations, render variant forms of a letter with the same ordinary character, and supply punctuation and capitals. These choices make many kinds of manuscript writing available through a common textual representation.
Each choice changes what counts as a successful reading. For a variant letter shape, the system is expected to recognize the underlying letter. For an abbreviated word, it may have to produce characters implied by the abbreviation. When an editor capitalizes a personal name, the reference can require the correct case even if the original letter shape does little to distinguish it. A punctuation mark can represent the editor’s reading of a pause. The different decisions end up in the same output string, where each can affect the error score.
The paper associates this form of transcription with uses such as searching collections and preparing text for further processing. It also describes transcription practices in which the detail of the written form is itself the object of study. In that case, preserving an abbreviation sign or distinguishing letter shapes may be essential. Two editions can consequently give different renderings of the same line while being consistent with their own aims. Training examples teach a particular relationship between the image and the expected text.
Historical spelling gives this choice a further consequence. Expanding a contraction does not license updating every word to a present-day form. The recognizer needs to learn how much transformation the reference calls for. A historically common spelling, an unusual local word, and a mistake in reading a glyph can all look unfamiliar to a system prepared on other material. The paper’s account of medieval linguistic variation makes the target more specific than general spelling correction. Historical linguistics & language change
What earlier approaches made possible
The paper describes a move from Markov-based recognition to neural systems that learn from examples of characters in lines. It emphasizes connectionist temporal classification, or CTC, and recurrent networks that process a sequence in both directions. Together these developments let a system learn from an image and a line transcription without requiring a person to draw an alignment around every individual letter.
That property matters because an image of handwriting has no ready-made list of character positions. A broad stroke, a compressed cluster of letters, and a space may occupy very different amounts of the line. A visual feature sequence can have more positions than the transcription has characters. Earlier neural approaches already had a way of learning which ordered stretch of visual information was compatible with the target text. They also made use of context within the line through their recurrent processing.
The paper describes attention-based image processing as a subsequent development. An image can be cut into patches and represented as a sequence of vectors. Attention lets the representation of one patch draw on other patches, so that interpreting a local shape can depend on features elsewhere in the image. An image encoder built on this principle can feed a text decoder, a component that generates the reading. The study cites the vision transformer work as the basis for treating image patches in this way. An Image Is Worth 16x16 Words
The older recurrent approach and the image-to-text approach can both benefit from prior training. The paper follows historical recognition projects that take an existing recognizer and continue training it with manuscript lines. This is fine-tuning. Starting with a recognizer that has learned some useful visual or sequence structure reduces the work that must be done with the local transcriptions alone. The author cites historical TrOCR experiments, including work on handwritten Old Occitan, and notes that performance can fall when a recognizer moves to a new domain or script family. Automatic Transcription of Handwritten Old Occitan Language
The related work also gives the author a reason to test explicit language support. A language model learns which sequences of textual units are plausible in its training material. A conventional recurrent recognizer can learn recurring patterns through its exposure to image–text pairs. An explicit text component also has access, through prior training, to patterns in text collections that can be much broader than the sources with aligned images. The paper discusses both RoBERTa and mT5 in this context. The experiments use RoBERTa and GPT-2 variants for the language-side comparisons. RoBERTa · mT5
Prior work on synthetic lines supplies the other part of the motivation. If a recognizer needs a picture for every training transcription, a corpus of edited text can contribute directly only after images have been paired with it. An alternative is to generate a line image for a known string. The paper describes earlier attempts to do this with historical material, where the design problem is to transfer the look of a hand to new content while keeping the result legible. This study brings that approach into the same comparison as historical linguistic preparation and asks how the resulting systems behave on real manuscripts.
The method, step by step
Assemble line images and their readings
The basic example is an image of a handwritten line paired with the characters the recognizer should return. These real pairs make up the ground truth, abbreviated GT in the experimental descriptions. The author draws on freely available collections with different document types and transcription practices, using editions aligned to the images or material prepared for recognition. The combined corpus exposes the system to more than one layout, institution, and writing tradition even though its immediate input is a single line.
The e-NDP collection contributes cathedral chapter registers. These contain decisions from meetings as well as features such as lists, headings, and marginal notes. The project description gives 523 transcribed pages from 26 registers. For the training inventory in the study, e-NDP supplies 33,800 lines. HOME-Alcar supplies 103,412 lines. Its cartularies contain copies of documents concerning such matters as property transfers, disputes, and agreements, and the collection provides line-aligned scholarly readings. It also includes detailed markup for named entity recognition, the task of identifying expressions such as names of people and places. The recognition scores in this study concern the transcribed text.
The Himanis contribution comes from registers of the French Royal Chancery, with lines matched to a semi-diplomatic edition. The study’s inventory lists 15,600 Himanis training lines. That entry identifies the quantity used in the recognition corpus, while the project description discusses the larger release from which the material comes. Königsfelden Abbey provides 12,823 lines from its charter and record material. The author describes the edition as bringing together facsimiles, transcriptions, and markup that includes documentary and named-entity information.
Bullinger Digital supplies 10,000 training lines from a randomly chosen multilingual part of the correspondence. The letters figure in the study because they bring early modern material, including German and Latin, into a collection otherwise rich in earlier institutional records. The Monumenta Historica Luxemburgensica inventory contributes 22,433 lines. Its material includes regional cartularies and registers in several languages. CODEA contributes 12,150 lines, giving the study a body of Spanish documentary writing. The author describes selecting 250 documents from that corpus and aligning them manually for handwriting research.
The overall inventory reports 210,218 real training lines and 2,044,911 tokens. A token here is a unit counted in the corpus. The recognizer’s decoder can use a finer division into pieces of words, so the inventory figure and the decoder vocabulary answer different questions. The study describes five main script families and over a hundred hands, with the exact number of scribal interventions uncertain. Different hands can occur inside the same manuscript or on the same page. Variety within a training collection is therefore relevant even to a project concerned with a single volume.
The author describes the balance of Latin, French, and Spanish using the ratio 5:2:1, and puts the share of High German variants at less than 5%. These are descriptions of the corpus mix. They provide no assurance that each language has the same distribution of periods, hands, or documentary genres. A term usual in a Latin charter may have many occasions to appear in the training data, while a word used in a German variety can come from much thinner coverage. This asymmetry later becomes important for interpreting transfer to unfamiliar material.
Set the text conventions and prepare both kinds of training material
The transcriptions preserve historical spellings while expanding abbreviations and regularizing certain aspects of presentation. Most allographs, alternative shapes used for the same letter, are reduced to a common character. All 123 characters used in transcribing the training material are shown in the study. The inventory reflects the edition conventions. It specifies what distinctions the transcribed string can carry, including which graphical differences are represented by the same output character.
Some training lines illustrate recurrent dating expressions in documentary records. Across the languages represented in the figure, dates can be expressed with recognizable formulas tied to the year of the Incarnation. A language component has something to learn from the repeated shape of these expressions. It still has to read the variable parts of an entry, and the recognizer must be able to cope with the different scripts in which the formulas appear. The paper uses the examples to illustrate the regularities available in a diverse corpus.
For the augmented experiments, text and images are brought together by another route. Historical texts are collected for language training. Some of those texts also supply strings for a handwriting generator. The generator learns from real handwriting how to render a given string in an available style. Generated images can then be added to the training inventory alongside the real pairs. The diagram follows the augmented transformer route, with the last stages showing how the trained recognizer produces a line transcription.
Training and using the augmented historical recognizer
The steps in order.
Train the recurrent comparison system
The Kraken system is a convolutional recurrent neural network, or CRNN. The architecture description gives it 6.3 million parameters. Its convolutional stages detect visual features in local image regions. Later stages interpret how the features are ordered across the line. The design combines the local evidence needed to distinguish shapes with the information available from neighboring positions.
The detailed specification uses four convolutional layers and lists filter counts of 32, 32, 64, and 64. It gives kernel sizes of 4x16 and 3x8. The kernels determine the dimensions of the local regions used by those operations. Pooling reduces the feature maps, and dropout, specified at 0.1 in the convolutional description, is a training technique that interrupts reliance on particular activations. ReLU is the activation function named for this block. A reshaping operation converts the remaining height information into features that can be passed along the sequence. The image height is set to 140 pixels.
The recurrent part of the architecture is described as three bidirectional long short-term memory layers. Bidirectionality here means that a position in the visual sequence can be informed by features on either side. CTC links the resulting predictions to the reference string, accommodating a visual sequence whose positions need not be paired individually with letters by a human annotator. The paper gives a Kraken VGSL specification, the format Kraken uses to describe the arrangement of layers.
In the hyper-parameter account, the author describes a pad size of 24 pixels and settings for reducing the learning rate, with patience 3. Padding gives operations room at the image boundary. Patience controls how long the training procedure waits for improvement before reducing the learning rate under the stated schedule. That same account describes the convolutional depth differently from the detailed layer description. The comparison is clear at the level of training data and recognition family. Exact reconstruction of the recurrent setup requires resolving the discrepancy in the paper’s architectural descriptions.
The experiments use Kraken v4. CRNN α starts from scratch and learns on the real pairs. CRNN β also starts from scratch and uses the enlarged corpus, in which generated images come with the strings they were meant to depict. This gives the study a way to test synthetic training material in a system whose text output is based on CTC and which has no explicit historical wordpiece decoder.
Encode an image and generate a string
The transformer setup follows TrOCR’s division into a visual encoder and a textual decoder. The encoder first cuts the line image into patches. Each patch is flattened and projected into a vector. Positional information tells the encoder where the patch came from, which is essential when the same shapes can occur at different points in a line. The architecture description also names the special [CLS] token, which can collect information across patches.
Attention operates over the sequence of image representations. The decoder uses the encoded visual evidence and the output it has already generated to predict what comes next. In an architectural paragraph, the paper assigns the image and language initializations to opposite sides from those indicated by this functional account. The experimental descriptions later give the clearer division: the vision component processes the image, and the language component participates in producing the transcription.
The decoder predicts wordpieces. A wordpiece can correspond to a complete word or to part of one, depending on how the text is broken down. This division is subword tokenization. It gives the system a way to build words out of smaller units, but the vocabulary and the frequencies learned during training affect which sequences it favors. A change to the vocabulary can make some historical forms more readily represented while changing the units the decoder must learn to predict elsewhere.
At a decoding step, the system projects its internal representation onto scores for the vocabulary. A softmax operation converts those scores into probabilities across the available choices. For the output search the paper specifies a beam value of 3. Beam search keeps a small set of promising partial readings, extends them, and retains the most promising candidates for the next step. A choice that is less likely on its own can survive if the longer sequence remains competitive. The beam still ranks candidates by the system’s learned preferences, so a familiar but mistaken completion can win.
The study uses TrOCR-large as the starting point for the main transformer comparisons and specifies 1024 dimensions in its experimental description. It describes the original handwritten TrOCR checkpoint as benefiting from extensive pretraining on synthetic line images. In Table 4, the English-derived configuration is also described in connection with IAM. That existing preparation matters when interpreting the experiments. The question is how these starting points and subsequent training choices perform for historical recognition. The study does not set up a comparison in which the recurrent and transformer systems receive equivalent prior exposure.
Give the text component historical material
The author trains medieval RoBERTa from scratch using a historical text collection. The stated setup has 768 dimensions, 12 attention heads, and 12 hidden layers, with an 8k vocabulary and training for 10 epochs. The heads are parallel parts of the attention operation that can attend to different relationships in the sequence. The hidden layers apply successive transformations to the input representation. The vocabulary supplies the units the text component is trained to work with.
The text sources include Latin from Corpus Corporum and Latin Wikipedia, web material from Commoncrawl 100, and charter material from CEMA. HOME and e-NDP contribute documentary text to this side of the study as well. The collection includes CODEA and resources for medieval French, among them the Base de Français Médiéval and the Nouveau Corpus d’Amsterdam. This material spans classical and historical usage and extends into later text. Its range makes the name medieval RoBERTa a description of its intended use and specialization, rather than a date restriction on everything in the corpus.
The author notes that some large sources overlap. The cleaned collection is described as 5GB, with approximately 750 million tokens. This is text for language training, distinct from the inventory of aligned recognition pairs. The same textual material is reported for the medieval GPT-2 experiment. Hence, historical text preparation is shared across approaches that differ in how the text component is used during recognition.
The paper discusses a restricted vocabulary as a choice for the amount of language data available. It gives a range from 10k to 8k tokens in the broader vocabulary discussion and specifies 8k for the medieval RoBERTa run. Its training table gives the masked language setting as 0.15. Masked language training asks the text component to infer hidden units using surrounding text. The discussion also mentions label smoothing, which gives alternative outputs some probability during training and discourages excessive confidence in the target. There is no separate recognition run varying smoothing alone.
When reusing TrOCR-large weights with the historical RoBERTa setup, the paper specifies restarting the decoder’s embedding layer, its fully connected output layer, and its positional encoding. The embeddings represent the incoming textual units. The output layer provides scores for the available vocabulary, and positional encoding makes order available to the decoder. Restarting these components gives them scope to adapt to the historical vocabulary and sequences. It also means the change from English TrOCR to the historical configuration involves several related decisions.
Generate handwriting for text without aligned images
The handwriting generator is based on HiGAN+, a generative adversarial network designed to render text in different handwriting styles. In adversarial training, the generator learns to produce images while discriminators learn to distinguish convincing outputs from weak ones. Here, visual resemblance is only part of the task. The image is supposed to show a specified string. A system that produced convincing pen strokes but lost letters would provide unreliable supervision for handwriting recognition.
The generator uses the input text and a representation of style to produce a line of variable width. A style encoder learns features from handwriting images that can be used to guide that appearance. A global discriminator judges the generated image as a whole, while a patch discriminator focuses on local texture. A text recognizer supplies pressure to make the conditioning string readable in the result. The paper describes writer-specific and contextual objectives as ways to separate information about the hand from information about the words.
The adaptation handles color images at a fixed height of 64 pixels and uses patches of 4 pixels. The architecture description gives a line capacity of up to 30 characters. The data procedure separately says that real lines of up to 12 tokens were selected for training the generator and that generated lines vary from 8 to 12 tokens. The paper leaves the relationship between the character limit and the token ranges unspecified. The figures render historical and illustrative strings in styles associated with Cursiva and Textualis, showing the intended independence of what is written and how it looks.
The GAN settings include a coefficient for matching the latent distribution to its prior. A latent distribution is the distribution of internal representations learned by the encoder. A prior is the distribution it is encouraged to approximate. The paper gives the coefficient as follows.
λₖₗ = 1 × 10⁻⁴
Here λ is a loss weight and the subscript kl identifies the regularization term for matching the latent distribution to the prior. The equality gives the value used, with × indicating multiplication and the superscript −4 giving the exponent of 10. This weight determines how much the distribution-matching term contributes during training.
The paper gives a separate coefficient for a contextual loss concerned with preserving the text.
λ꜀ₜₓ = 5.0
The symbol λ again denotes a weight. The subscript ctx identifies the contextual term, and 5.0 is the coefficient assigned to it. The paper also names λₗₛ for the remaining loss weights it adjusts through gradient balancing, a procedure that responds to the relative influence of the losses during training. These settings specify selected parts of the optimization. The paper gives no full symbolic expression for the combined objective.
For the style inventory, the generator is configured with 372 writer styles, and interpolation is enabled so that generation can use variation between style representations. That is a setting in the synthesis procedure. The author’s historical description of how many hands contributed to the real manuscript corpus is less definite. The new strings are drawn from charter and literary resources without annotated graphical lines for the material used. This procedure yields the reported 420k synthetic line images. The recognition table gives 630,654 lines for the augmented corpus.
Put the variants into a common comparison
Table 4 defines the main transformer sequence as TR α, the English TrOCR-derived recognizer, followed by TR β, the version with medieval RoBERTa, and TR γ, the augmented version of TR β. The separate TR δ entry gives a ViT visual starting point and a medieval GPT-2 decoder. This GPT-2 arrangement predicts causally, using preceding output to generate the next unit. The paper at times calls medieval RoBERTa the tokenizer, and elsewhere calls it the decoder. One description also groups TR γ with the GPT-2 setup. Table 4 and the results discussion identify TR γ with the augmented historical RoBERTa configuration, which is the identification used for its comparisons here.
All image-training procedures also use ordinary image perturbations. The author names distortion, blur, rotation, and blots. These transformations operate on the appearance of an existing line, whereas HiGAN+ creates a new image from selected text and a style representation. The stated hardware includes a Threadripper PRO with 24 cores, dual A100 hardware described with 32GB vRAM, and 128GB of RAM. The paper names two transformer releases, Tridis HTR and Tridis v2 HTR historical manuscripts, alongside the Kraken weights, the medieval RoBERTa weights, and the historical HiGAN+ implementation.
Experiments and results
Distinguish validation from recognition of an unfamiliar collection
The experimental design evaluates validation on 10% of the training dataset and tests on external material held out from recognition training. The validation split provides a common test of the training configurations on material drawn from the assembled corpus. The external test asks whether the trained recognizers can handle different sources, including manuscripts that change the script, period, subject matter, or language mix. The test inventory lists 11,105 lines and 83,946 tokens.
Saint-Gall provides a binarized version of a hagiographical manuscript written in Carolingian minuscule. Binarization reduces the image to foreground and background. The Vienna manuscript containing the Collatio is also an early witness in a script new to the main documentary training mixture. Its subject is legal, while Saint-Gall contains saints’ lives. Their shared age and script classification leave room for substantial differences in what the systems have to read.
The other tests extend the range of genres and reference practices. The Troyes manuscript used for the Summa of Abstinentia contains heavily shortened writing in a collection of material for preaching. The expanded Cremma test includes material from the Chanson d’Otinel, with the reference adapted to expand abbreviations. Liber Feudorum is a Luxembourg feudal book with charters and financial material. Faithful Transcriptions pools manuscript pages with religious texts in several languages and script traditions, including Low German and Dutch. Each test collection puts a different combination of visual and linguistic demands on the systems.
The external comparisons use zero-shot recognition, meaning the recognizer is applied to target material before target-specific training. For selected tests the author also studies few-shot learning, with 150 lines available for adaptation. Both approaches start with a trained recognizer. The distinction is whether an archive supplies some of its own image–text pairs to teach the system local conventions and shapes before evaluating the rest of the material.
Understand what an error score counts
Character error rate, or CER, measures the editing needed to make the predicted character sequence match its reference, relative to the reference length. A wrong letter, an extra one, or an omission contributes to the disagreement. Word error rate, or WER, measures disagreement in units of words. A replacement can count as a word error when the handwriting system recovers nearly every letter in that word. Moving or inserting a space can change which units are compared. The study treats lower values as better agreement for both metrics.
BERT-score gives a different comparison. It uses cosine similarity in a BERT embedding space, where the text is represented by vectors. Cosine similarity measures how closely two vectors point in the same direction. Candidate and reference can therefore have some contextual similarity even when their literal strings differ. The author uses the score as an indication of the readability and lexical quality of the transcription. The difference between contextual similarity and exact spelling is particularly relevant to the line examples, where a substitute can make sense in its sentence and still identify the wrong entity.
The paper calls the full edited reference the raw condition. This includes conventions supplied by the editor. Cleaning removes punctuation and diacritics for scoring. The step leaves words, their boundaries, and expanded forms available for comparison. Therefore, a cleaned CER result still measures agreement with an editorial transcription, with fewer marks counted in the disagreement. The normalization is a scoring treatment, rather than a training corpus or an additional round of target adaptation.
Validation favors the historical transformer trained with synthetic lines
In the within-corpus validation comparison, the English TrOCR-derived TR α has poorer word agreement than CRNN α in both scoring treatments. The standard vision encoder and historical GPT-2 combination, TR δ, also performs poorly there. The rankings change with the introduction of the historical RoBERTa setup and with synthetic pairs. The cleaned WER comparison shows the shape of the result across the configurations.
Cleaned WER on the within-corpus validation split
The augmented historical transformer has the best word agreement under cleaned scoring.
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 |
The character scores help specify what changed. Without generated lines, TR β and CRNN α both have cleaned validation CER of 6.4 in Table 4. Their cleaned WERs differ considerably. With generated lines, TR γ reaches cleaned validation CER of 5.7 and cleaned BERT-score of 95.3. Against that same validation split, adding generated lines to the recurrent recognizer brings its cleaned CER to 5.8. The paper gives the latter change as a relative improvement of 9% in CER, alongside 15% in WER, over the recurrent baseline.
The results prose attributes relative improvements of 11% in CER and 33% in WER to TR γ in validation. It also gives that configuration a CER and WER pair of 0.064 and 0.143. Those values do not correspond to a single TR γ row as displayed in Table 4. The chart and the cleaned results above therefore use the table’s entries. Keeping the narrative pair attached to its source makes the reporting inconsistency visible without selecting a new value for either metric.
Local adaptation helps on Saint-Gall and other external material
On Saint-Gall, the original recurrent system has zero-shot CER of 12.5 and WER of 41.8. With no local training, TR γ reaches CER of 10.9 and WER of 30.4. The result illustrates the relative strengths of the two systems on this manuscript. TR γ improves on the original baseline for characters, and its absolute WER remains substantial even with the better word agreement.
Saint-Gall CER after few-shot adaptation
The augmented historical transformer produces the closest character sequence after training on local lines.
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 |
With adaptation, the original recurrent system records a Saint-Gall WER of 35.6, and TR γ records 24.0. The augmented transformer’s BERT-score on this test is 88.1 without adaptation and 91.5 with it. The comparison shows that a small target sample can be valuable even after training on heterogeneous sources. It also shows why the zero-shot ranking and the few-shot ranking answer different questions. For instance, TR α is behind the original recurrent baseline on zero-shot Saint-Gall CER, at 13.1 against 12.5. After adaptation, its CER of 9.8 is lower than the baseline’s 10.1.
The paper reports a similar direction of change for the expanded Cremma collection. TR γ has CER of 9.8 in zero-shot recognition and 8.1 after adaptation. Its WER is 41.2 without local examples and 37.3 with them. CRNN α has CER of 11.0 and WER of 50.4 on the zero-shot test, and CER of 9.5 and WER of 46.7 with local training. The relatively high word errors on Cremma are discussed in relation to reference spacing, which can preserve streams of writing that the recognizer divides into separate words.
Faithful Transcriptions puts the historical language setup under a different kind of pressure. On this collection, TR γ obtains zero-shot CER of 11.2 and few-shot CER of 8.5. The corresponding augmented recurrent figures are 12.2 and 9.0. The author connects the narrower advantage to language coverage, given the presence of Dutch, Low German, and German variants for which the resources available to the system are limited. Adaptation is helpful here too. The result gives a view of how much historical specialization can offer when a collection only partly overlaps with the language the system learned.
Taking the few-shot comparisons together, the author reports improvements over zero-shot recognition of 2–3 points for CER and 5–8 points for WER. These are the paper’s overall descriptions, with the detailed values varying by collection and configuration. The conclusions also describe BERT-score of 85% in zero-shot use and above 90% after adaptation on 150 lines. Individual test entries give a more specific estimate for work on any one of the tested sources.
The raw and cleaned tests expose difficult cases
The Collatio results show how much error can remain after a substantial improvement. Under raw scoring, CRNN α has CER of 29.5, while TR γ has CER of 22.7. Word error is especially high, including for the strongest configuration on this test. The results are a reminder that transfer gains are measured against a baseline facing the same difficult manuscript.
Collatio WER in zero-shot recognition under raw scoring
The augmented historical transformer leads the comparison while substantial word disagreement remains.
The numbers
| System or setting | WER |
|---|---|
| CRNN α | 86.1 |
| TR α | 80.4 |
| TR β | 73.8 |
| TR γ (this paper) | 71.6 |
| TR δ | 79.3 |
| CRNN β | 79.3 |
With punctuation and diacritics removed from the Collatio evaluation, TR γ reaches CER of 18.3 and WER of 59.5. The same treatment puts CRNN α at CER of 28.0 and WER of 84.2. The augmented recurrent system comes close to the augmented transformer in raw character agreement, with CER of 22.8 against 22.7. Its raw word score of 79.3 is further from the transformer’s 71.6. Looking at both metrics makes clear which part of the comparison changes most.
The Summa of Abstinentia provides an example where the historical transformer without the synthetic addition does not lead the character comparison. TR β has raw CER of 19.8 against 18.7 for CRNN α, though its raw WER is 51.5 against 56.9. TR γ brings the raw figures to CER of 16.7 and WER of 44.5. On the cleaned Summa test, TR γ records CER of 13.7 and WER of 36.5. Heavily abbreviated text and editorial spacing are prominent concerns in the author’s account of this collection.
In Liber Feudorum, TR γ obtains raw CER of 12.8 and raw WER of 32.7. The unaugmented recurrent baseline records raw CER of 15.6 and raw WER of 40.8. With cleaned scoring, the augmented transformer gives CER of 9.6 and WER of 24.1. The recurrent augmentation has a different outcome here from the one seen on Collatio. On Liber Feudorum, CRNN β reaches raw CER of 16.0 and WER of 41.4, both slightly above the scores of CRNN α. The value of the generated training material depends in part on the target and the recognizer using it.
Across the external tests, the author reports medians of the relative improvements over the original baseline. In raw mode, TR γ has reported median values of 14% for CER and 19% for WER. They reach 26% and 27% in cleaned mode. The paper compares the raw medians with 7% and 5% for augmented CRNN β. The central result is the performance of the combined historical and synthetic setup. The variation in the manuscript results gives that aggregate a practical interpretation: improvements can coexist with difficult absolute error rates, and the gains are larger on some kinds of disagreement than on others.
What the ablations show
Synthetic lines help through more than one recognition architecture
The recurrent comparisons provide the most direct test of the additional training material. Both recurrent variants use the Kraken family and train from scratch. CRNN β receives the generated pairs alongside the genuine pairs used by CRNN α. The improvement in the validation comparison therefore supports synthetic augmentation even where there is no explicit historical text decoder. The external tables show that the benefit can carry into new source material, with Liber Feudorum illustrating that a gain on every manuscript would be a stronger claim than the data support.
Using Table 4’s configuration definitions, the comparison between TR β and TR γ asks a similar question for the adapted transformer. The additional pairs improve its cleaned validation scores and accompany the strongest results across the selected external tests. The fact that both recognition families can benefit is evidence for the value of the resulting image–text pairs. The different sizes and consistency of their gains leave room for an interaction between augmented data and the way each recognizer uses textual context.
The comparison changes the amount of training data, the words and combinations of words available, and the visual variation. The generator is trained on short examples and allowed to interpolate styles, while text for the new lines comes from historical sources without a corresponding aligned image. The paper has no separate comparison holding those content choices fixed while varying the handwriting styles. Its results support the combined augmentation procedure. They leave the contributions of text coverage, rendering variation, and added training volume unresolved.
The language comparison changes several connected components
The English-derived and historical RoBERTa configurations share the TrOCR-large starting point described in the experiments. TR β’s word-level advantage is consistent with the reason for introducing historical language training. The reference forms should be easier to produce when the vocabulary and sequence preferences reflect historical corpora. The validation comparison, where cleaned CER can stay at the baseline level while WER improves, illustrates why a change to the language side can be more evident in whole words than in letters.
Changing the historical component also changes the representation of sub-words and entails restarting decoder layers. Descriptions of the configuration alternate between naming the tokenizer and the decoder. The result supports the historical setup as a package. A separate comparison with a common vocabulary and different decoder weights, or a common decoder initialization and different tokenization, would be needed to distinguish their roles. The paper provides no such component-level experiment.
TR δ tests another package by pairing ViT with medieval GPT-2 in causal operation. The author proposes that its weak performance comes in part from limited access to bidirectional linguistic context. The image initialization also differs, as does the text architecture itself. The comparison establishes how that arrangement performed in this study and motivates the explanation. It cannot determine how much of the change to recognition can be assigned to causal operation alone.
The external behavior of TR α offers a further control on the interpretation. Though this English-derived configuration is weak in within-corpus validation, it can still improve on the original recurrent baseline on external measures. Its Saint-Gall word scores, for example, are better than the baseline’s in both adaptation conditions. The author’s comparisons therefore support two ideas at once. General image-to-text pretraining can carry useful capabilities into historical recognition, and historical adaptation delivered further benefits in the tested RoBERTa family.
Editing the scoring text reveals some of the editorial burden
Raw and cleaned scoring compare the same predictions under different rules for which distinctions matter. The larger reported relative gains for TR γ in the cleaned condition show that punctuation and diacritics affect its standing against the baseline. This is relevant to the reference construction because some punctuation encodes a decision made in editing. The recognizer may read the written language well enough to recover the words and still disagree on how that line should be punctuated.
The analysis cannot apportion the score change between the different kinds of removed marks. It also leaves word division in place. The author discusses spacing in explaining the behavior of WER, especially where the reference is relatively conservative about preserving joined writing. A system can recognize the components of a continuous sequence and present them as separate words. In a reference with a different spacing convention, that recognition decision can lower word agreement. The cleaning comparison has a narrower scope because it removes punctuation and diacritics.
These treatments are most informative when read alongside the example lines. A disagreement over a supplied pause mark involves different evidence from a disagreement over letters in a name. Both can contribute to raw CER. Cleaning can reduce the influence of the pause mark, while a wrong name can still be counted as one wrong word even when the substitution changes the historical interpretation of the passage.
The line examples reveal how language alters the reading
The error analysis examines transcriptions from Liber Feudorum, the Collatio, the Summa of Abstinentia, and a manuscript in Faithful Transcriptions. It compares incorrect outputs from different recognition systems against the reference. These cases are useful for tracing a decision to an apparent ambiguity, a missing part of the image, or an editorial convention. The paper gives examples of the mechanisms instead of counting their occurrence throughout the test sets.
In the Liber Feudorum example, the same written initial H. occurs where the reference gives Henrions and Henri. The author describes a predicted expansion to Hugues in one case and retention of the initial in the other. The handwritten initial is compatible with several names. Language training can rank familiar completions, but resolving an individual’s identity can depend on the people named elsewhere in a record or on local evidence outside it. A plausible expansion can introduce multiple character errors and, more importantly for the archive, attach the statement to the wrong person.
A related problem arises with place names and local expressions. The error discussion gives Lucelburch as a form reduced to Luce in a prediction. A partial overlap between the readings can make the shorter result appear credible. The loss of the remaining characters matters if the place name is the information sought. The paper contrasts this tendency to fill uncertain readings with familiar forms with the recurrent system’s tendency to reproduce an approximate sequence of letters. An awkward sequence may preserve clues for an editor, while a fluent replacement can make it difficult to see that the name is uncertain.
Abbreviations also vary in how much language knowledge can settle. A familiar contraction may have an expansion supported by the grammar of its clause. For another contraction the expected form can depend on how people wrote in a particular locality or period. The author finds cases where transformer output gives a better contextual reading and cases where it supplies the wrong abbreviation expansion. A language component is most useful where the recurrent evidence across historical texts is relevant to the mark at hand.
The Collatio example shows a failure caused by the size of the input. The beginning paren falls at the end of one line, and tis continues it on the next. The transformer predictions discussed in the paper give patri and Petri where the first segment should be. Both guesses turn the ending into something that can be treated as a familiar word or name. The continuation needed to check the choice belongs to the next image. Because the test feeds the recognizer a line at a time, attention can examine the available positions closely and still miss the decisive evidence.
Word boundaries show the same linguistic influence in a more favorable guise. A recurrent recognizer can join neighboring forms into a string that follows the image closely but has no ordinary reading as a single word. The transformer can select separate vocabulary units that match an editor’s segmentation. The author also describes contextual substitutions that go too far. In the illustrated cases, a form for a devil becomes a form for a deacon, and Iudeis is rendered as Indeis. The outputs are interpretable strings. Their readability gives no independent support for the substitution.
Taken together, the examples explain why better word agreement and residual character errors can accompany each other. Improving common phrases can reduce the number of incorrect words. In a remaining error, the system can replace much of a word at once in order to produce a plausible completion. The paper’s close readings connect these outcomes to the same decoding process. The cases show what to look for in a transcription, while the aggregate results give the comparative error rates for the test sets.
Limitations
Limits identified by the author
The author emphasizes the dependence on linguistic coverage. The historical RoBERTa setup was built from substantial text, but that material represents certain languages, periods, and genres more strongly than others. An unfamiliar historical language is still unfamiliar to a system trained on other historical material. Faithful Transcriptions illustrates the issue because its range includes languages with limited or absent coverage. In that setting, a robust recurrent recognizer can come closer to the specialized transformer.
The author also identifies a limit of interpreting editorially expanded text from the image. Reading a common abbreviation may be possible from its form and the nearby syntax. Recovering a particular name or a local use can require evidence unavailable in the visual signal. This affects the expected output itself. A confident transcription might supply an expansion that looks appropriate and still commit the edition to the wrong reading. Some parts of the target demand more than graphical recognition and general language familiarity.
Input size is a separate constraint. The study feeds line images to the recognizers, a choice that allows alignment and training over the assembled collections. Short lines in columns, words broken at a line boundary, and material in tables or margins can all leave little context inside a single crop. The author proposes paragraph- or page-level processing and improved layout analysis to give a recognizer access to the relevant surroundings. Those proposals address where the evidence would come from. The paper measures the line-based systems.
The discussion also proposes using an external knowledge base or lexical resource to resolve local references, including through retrieval-augmented generation. In the proposed approach, information retrieved about a name or term would provide more context for the reading. The study does not run that test. Whether such a resource contains the right evidence, and whether the system can use it without preferring another plausible but unsupported reading, remain open questions.
The author acknowledges substantial demands for data and computation when training recognizers with a transformer architecture. The study benefits from prior image training, historical text preparation, and generation of synthetic handwriting. Its architectural account explains how linguistic selection can be incorporated into decoding rather than being applied later as a correction pass. That observation concerns workflow design. The experiments contain no matched comparison of training cost or recognition throughput at the same quality level.
Limits visible in the experimental design
The makeup of the corpus affects the reach of the conclusions. The collection includes different writing families and languages, but the distribution is uneven. Results pooled across collections offer limited evidence about a single underrepresented variety. In addition, a target can change in language, script, date, and editorial practice at the same time. A weak score can reflect several of these changes together. The external comparisons document the combined challenge each collection presents.
The validation split covers 10% of the training dataset. The paper does not spell out whether it was partitioned to keep every hand or manuscript distinct across training and validation. The external sets make a stronger test of source transfer because they are described as unseen in recognition training. There is also limited detail about selection of the local target lines and their relationship to those evaluated after adaptation. The scores establish what happened under the reported few-shot condition, with incomplete information for repeating the split.
The apparent advantages of individual components also depend on how the configurations are defined. The paper gives conflicting accounts of the convolutional depth and once reverses the functional assignment of the vision and text components. It describes TR γ in different configuration groups and alternates between assigning medieval RoBERTa a tokenization role and a decoder role. The table’s augmented TR β definition is consistent with the major results discussion, while the narrative validation score pair remains inconsistent with that table. These issues matter most to readers comparing implementations or trying to attribute performance to a particular change.
The comparisons give point results for the tested configurations. The paper supplies no repeated-run estimates or uncertainty bounds that would establish the stability of small gaps across training repetitions. It also provides selected examples for its error taxonomy. These make the mechanisms intelligible, while leaving their frequency undetermined. A high BERT-score and a convincing example of improved word separation give different evidence from a systematic count of errors in people’s names, places, or legally significant expressions.
Finally, correctness is defined primarily through the available editorial readings. Removing punctuation and diacritics is a useful diagnostic but still evaluates the edited word sequence and its expansions. A project that needs to preserve abbreviation marks or distinguish original letter forms would be asking for a different output. The paper demonstrates improved agreement on its own transcription task and exposes some of the consequences of that choice. Judging the recognizer as a record of what is visibly present on a page would require references that preserve those graphical distinctions.
What came after
No later citing work is identified, so there is no documented successor to describe. The next steps set out in the paper remain proposals: supplying local evidence for names and abbreviations, and widening the input so that a reading can draw on the following line or the surrounding entry. The reported experiments establish why those proposals matter through cases where a plausible transcription departs from the manuscript or where the evidence required for a correct reading falls outside the image.
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).
@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}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/aguilar-2024-handwritten-text-recognition-historical-documents/