Transformer-based HTR for Historical Documents

Phillip Benjamin Ströbel, Simon Clematide, Martin Volk, Tobias HodelarXiv 2022 · DOI

Abstract

Handwritten Text Recognition (HTR) for historical manuscripts is often hindered by the extreme variability of handwriting styles and the scarcity of transcribed training data. This paper explores the application of the Transformer-based Optical Character Recognition (TrOCR) framework to 16th-century Latin manuscripts. Despite being pre-trained primarily on English text, TrOCR models demonstrate superior performance and generalization capabilities compared to the industry-standard Transkribus HTR+ model, particularly in multi-author scenarios.

Introduction

While digital archives have made millions of historical pages accessible, the vast majority remain untranscribed. For example, on the Swiss platform e-manuscripta, only 0.1% of the 45,000 titles in the "correspondence" category have transcriptions. The primary obstacle is the variability of handwriting; a single author's script can change significantly based on context, and large collections often feature hundreds of different "hands." Traditional HTR systems often struggle to generalize across these stylistic shifts without extensive manual transcription for training.

Methodology

The researchers employed TrOCR, an end-to-end Transformer-based architecture, moving away from traditional Recurrent Neural Network (RNN) approaches.

  • Architecture: TrOCR utilizes a Vision Transformer (BEiT) as an encoder to extract visual features from image patches and a Language Model (RoBERTa) as a decoder to generate text.
  • Pre-training & Fine-tuning: The model was originally pre-trained on printed and synthetic English handwriting. The researchers fine-tuned BASE and LARGE versions on specific historical Latin datasets to test cross-lingual transferability.
  • Comparison: Performance was benchmarked against Transkribus HTR+, a widely used model in archival research.

Datasets

The study utilized two primary datasets of 16th-century Latin, representing different levels of complexity:

  1. Rudolf Gwalther’s Lateinische Gedichte: A single-author dataset (4,037 lines) featuring formal poetry and informal letters.
  2. Heinrich Bullinger’s Correspondence: A multi-author dataset (16,584 lines) written by approximately 60 different people, presenting a significant challenge due to the diverse handwriting styles.
Examples of 16th-century Latin handwriting from the Gwalther and Bullinger datasets.

Key Results

Performance was evaluated using the Character Error Rate (CER). TrOCR consistently outperformed the baseline, especially on the more complex multi-author dataset.

Comparison of CER (%) between HTR+ and TrOCR models across different datasets and fine-tuning epochs.
  • Single-Author (Gwalther): TrOCR_LARGE achieved a CER of 2.55%, surpassing the Transkribus HTR+ baseline of 2.74%.
  • Multi-Author (Bullinger): TrOCR showed a dramatic improvement, reaching a CER of 16.53% compared to 21.13% for HTR+.
  • Training Dynamics: The BASE model showed signs of overfitting after 10 epochs on smaller datasets, whereas the LARGE model maintained better stability and performance.

Discussion and Insights

The study revealed several critical advantages of the Transformer approach:

  • Cross-Lingual Transferability: The model's ability to excel at Latin after English pre-training suggests it learns a generalized representation of letter formation that transcends specific languages.
  • Style Agnosticism: TrOCR proved more robust than the baseline when handling stylistic variations within a single author's work (e.g., poetry vs. letters).
  • Simplified Pipeline: Unlike many HTR systems, TrOCR functions effectively without requiring explicit "baseline" information (the physical lines on a page) to guide recognition.

Conclusion

The application of TrOCR to historical Latin manuscripts demonstrates the power of transfer learning in paleography. Future work will focus on integrating Latin-specific decoders and testing the model on even more diverse datasets. Additionally, integrating line-level recognition into full-page layout analysis remains a key step for large-scale archival automation.

Summary updated

BibTeX
@misc{strobel2022transformer,
  author = {Phillip Benjamin Ströbel and Simon Clematide and Martin Volk and Tobias Hodel},
  title = {{Transformer-based HTR for Historical Documents}},
  year = {2022},
  eprint = {2203.11008},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2203.11008},
}
Figure