TrOCR for Medieval HTR: A Systematic Ablation Study with Cross-Dataset Validation

Sachin Sharma, Michele Flammini, Federico Simonetta
6/23/2026
1 citation
cs.CVcs.DL
benchmark-datasettransformer-attention

Official code: LaudareProject/TrOCR-analysis (0 stars, Python, GPL-3.0, last commit 2026-02-24).

Abstract

Fine-tuning transformer-based handwritten text recognition (HTR) models on medieval manuscripts is challenging because these models are pre-trained on modern text and must adapt to a very different visual domain. This paper studies how three controllable fine-tuning choices (contrast normalization, data augmentation, and layer freezing) affect recognition accuracy when adapting TrOCR to small historical datasets.

Show full abstract

We run controlled experiments on a 13th-century Italian manuscript (I-CT 91 "Cortonese") and replicate the same experimental grid on the public READ-16 benchmark as robustness evidence. On Cortonese, our best configuration achieves 8.03% character error rate (CER). Statistical comparisons across 13 configurations show that freezing up to three encoder layers or six decoder layers does not significantly harm accuracy, while deeper freezing becomes progressively detrimental. Removing contrast normalization (CLAHE) yields 7.84% CER, comparable to a domain-specialized baseline, suggesting strong optimization can reduce reliance on image preprocessing. Cross-dataset validation on READ-16 shows that decoder freezing thresholds transfer more robustly than encoder thresholds, and combined freezing strategies require dataset-specific re-validation. Finally, we use Grad-CAM gradient attributions and decoder cross-attention maps to diagnose error patterns and failure modes revealed by the ablations. Source code is available at https://github.com/LaudareProject/TrOCR-analysis

View on arXivView PDF

Code Implementations(1)

GPL-3.0

Analysis of TrOCR on medieval laude manuscripts

00PythonNov 13, 20259 months agoGPL-3.0

Similar Papers

Cite this paper

@article{sharma2026trocr,
  title  = {TrOCR for Medieval HTR: A Systematic Ablation Study with Cross-Dataset Validation},
  author = {Sachin Sharma and Michele Flammini and Federico Simonetta},
  year   = {2026},
  eprint = {2606.24302},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2606.24302v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2606.24302.svg)](https://codeofpaper.com/paper/2606.24302)

Discussion