TL;DR
This paper evaluates how well modern object detection models (Hi-SAM, YOLOv8, and RT-DETR) generalize to unseen historical document collections for text line segmentation. The authors demonstrate that while the transformer-based Hi-SAM excels at zero-shot generalization, lightweight models like YOLOv8 can achieve competitive performance with as few as 10 fine-tuning samples, and they highlight why standard detection metrics like mAP are often misleading for downstream recognition tasks.
What Problem Does This Paper Address?
Handwritten Text Recognition (HTR) for historical archives is a multi-step pipeline. Before a model can "read" the text, it must first "find" it—a process called text line segmentation. Historical documents present a nightmare for automation: they feature varied layouts, bleeding ink, yellowed paper, and diverse handwriting styles across centuries and languages.
The central challenge is scalability. Museums and libraries have millions of pages but lack the resources to manually label thousands of training examples for every new collection. This paper investigates whether we can build "foundation" models that work out-of-the-box (zero-shot) or require only a handful of labeled pages (few-shot) to adapt to a new archive.
Methods
The researchers compared three state-of-the-art architectures:
- Hi-SAM: A transformer-based model built on the Segment Anything Model (SAM), featuring a self-prompting mechanism specifically designed for hierarchical text segmentation.
- YOLOv8 (l-seg): A popular real-time instance segmentation framework known for its efficiency.
- RT-DETR: An end-to-end transformer-based detector that eliminates the need for post-processing steps like Non-Maximum Suppression (NMS).
To evaluate the impact on actual reading performance, they fed the segmented lines into a CRNN (Convolutional Recurrent Neural Network) HTR model. This allowed them to measure success not just by how well a box fits a line, but by the Character Error Rate (CER) of the resulting transcription.
Datasets
The study utilized nine distinct historical datasets spanning the 15th to 20th centuries, covering English, Norwegian, Swedish, and German.
A key contribution was the creation of a "Mix" dataset, which combined samples from three primary sources (NorHand, READ 2016, and Nuremberg LB 3) to create a more diverse training foundation. The authors also released new dataset splits for several Swedish and Norwegian collections to aid future research.
Key Insights and Ideas
- mAP is a Deceptive Metric: In standard object detection, Mean Average Precision (mAP) is king. However, the authors found it poorly correlates with HTR quality. A predicted box might have a low Intersection over Union (IoU) because it's slightly too tall, yet it still contains 100% of the text. Conversely, a box with high IoU might clip the edge of a single character, causing a transcription error.
- The Power of 10 Pages: One of the most encouraging findings is the efficacy of few-shot learning. Fine-tuning YOLOv8 on just 10 pages from a target domain drastically closed the performance gap with the much larger Hi-SAM model.
- Hi-SAM as a Zero-Shot Foundation: Hi-SAM proved remarkably robust. Even when trained on a single dataset, it generalized to others far better than YOLO or RT-DETR, likely due to its transformer-based architecture and SAM-derived weights.
- RT-DETR Struggles with Overlap: While RT-DETR is fast, it produced many overlapping predictions in the dense text environments of historical pages, making it less suitable for this specific task compared to the other two.
Key Results
- Zero-Shot Performance: When trained on the "Mix" dataset and tested on unseen domains, Hi-SAM achieved an average CER gap of only 2.90 percentage points (pp) relative to the ground-truth baseline.
- Few-Shot Gains: Fine-tuning Hi-SAM with 10 pages reduced that CER gap to 1.69pp. For YOLOv8, the gap dropped from a poor 4.36pp (zero-shot) to a competitive 2.04pp with just 10 pages.
- Efficiency: The authors quantified the hardware trade-offs. While Hi-SAM provides the best accuracy, it is computationally heavy. YOLOv8 offers a "sweet spot" for institutions with limited hardware, as it can be fine-tuned and run efficiently even on consumer-grade laptops.
Limitations and Future Work
The authors acknowledge that their study focused on relatively "clean" layouts—mostly single-column text with horizontal lines. Real-world archives often contain much more complex structures, including:
- Multi-column layouts and tables.
- Marginalia (notes in the margins).
- Curved or rotated text lines.
Future work will need to address these complex layouts and investigate more advanced domain adaptation techniques to further reduce the manual labeling burden for archivists.
Summary updated