RefLAM: A Reference-Grounded Line Annotation Pipeline for Historical Arabic Manuscripts
Organizations: Higher School of Computer Science (ESI-SBA), Sidi Bel Abbes, Algeria
Abstract
Existing approaches to building line-level Arabic handwritten-text-recognition (HTR) training data either rely on fully manual annotation, which does not scale, or on automatic OCR-to-reference alignment methods not yet extended to multi-script, two-zone (main-plus-margin) manuscript layouts with a provable correctness guarantee. We present RefLAM (Reference-grounded Line Annotation for Manuscripts), a pipeline converting manuscript page images and clean transcriptions into validated, line-level ground truth without sacrificing human oversight. RefLAM couples a deep-learning page-segmentation model with a multimodal large language model (MLLM) for structured OCR and a diacritic-agnostic fuzzy alignment engine that grounds each OCR line in a contiguous span of the reference text, with a character-level confidence score in . A perfect score is provably equivalent to character-for-character identity of the normalised strings (the Confidence-100 rule), verified with no counterexample across the released corpus. A reviewer can thus trust a perfect score, confirming most lines at a glance rather than retyping them, so annotation becomes triaged, with attention concentrated on uncertain alignments. Across 7 fully page-validated books we measured a 75 throughput gain over manual annotation (3,000 vs. 40 lines/hr); applying the same guarantee to 7 further books, we retained 16,533 confidence-100 main-text lines within one week, excluding sub-100 lines rather than manually correcting them. Using RefLAM, we release AraMS-28k: 14 historical Arabic manuscript books, 3,043 pages, and 27,971 main-text and 629 margin-line annotations with bounding boxes, layout labels, and insertion anchors for 191 margin entries (30.4%). We also finetune Muharaf-pretrained baselines (including HATFormer) on AraMS-28k and report CER results confirming its practical utility for downstream HTR training.
Figures & tables
| Property | Value |
|---|---|
| Books | 14 |
| Total pages | 3,043 |
| Fully page-validated | 548 |
| Line-validated | 2,495 |
| Main-text lines | 27,971 |
| Margin lines | 629 |
| Book | Type | Script | Pages | Lines | C=100 |
| book_03 | PV | Maghrebi | 172 | 3,661 | 8.4% |
| book_05 | PV | Ruq‘ah | 95 | 2,028 | 28.0% |
| book_06 | PV | Naskh | 41 | 874 | 99.9% |
| book_09 | PV | Naskh | 46 | 1,057 | 9.8% |
| book_10 | PV | Lithograph | 13 | 674 | 14.1% |
| book_11 | PV | Naskh | 30 | 612 | 12.1% |
| Model / Test subset | CER (%) |
|---|---|
| Kraken [ 22 ] | |
| book_03 (Maghrebi) | 32.71 |
| book_05 (Ruq‘ah) | 11.65 |
| book_09 (Naskh) | 22.62 |
| Overall | 23.31 |
| HATFormer [ 10 ] | |
Historical Document Analysis
Historical document analysis uses AI to transcribe, interpret, organize, and retrieve information from archival texts and images.
See all 51 papers