🤖 AI Summary
This study addresses the challenge of adapting modern text-pretrained Transformer models, such as TrOCR, to handwritten text recognition (HTR) in medieval manuscripts, where significant visual domain discrepancies hinder performance. The authors systematically evaluate the effectiveness of three fine-tuning strategies—contrast-limited adaptive histogram equalization (CLAHE), data augmentation, and layer-wise freezing—on small-scale historical datasets. Their analysis reveals an asymmetry in how freezing the encoder versus the decoder impacts accuracy, demonstrates that strong optimization can reduce reliance on image preprocessing, and introduces a cross-dataset validation framework to assess strategy transferability. Achieving a character error rate (CER) of 7.84% on the Cortonese dataset—the lowest reported to date—the work validates the generalizability of decoder-freezing strategies and establishes reproducible best practices for fine-tuning HTR systems on historical documents.
📝 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. 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