Source-linked AI summary

AraMS-28k: The Largest Publicly Released Line-Level Dataset of Historical Arabic Manuscripts with Margin and Insertion-Anchor Annotations

Mohamed Guechaoui, Mohamed Diaa Zellagui, Souleyman Chaib, Sahraoui Dhelim

arXiv:2608.26921v1cs.CVcs.CL

TL;DR

Historical Arabic HTR lacks large, genuine manuscript corpora with fine-grained marginalia order annotations. AraMS-28k addresses this gap through reference-grounded construction and human-reviewed validation, and its baselines expose substantial cross-script generalisation differences.

  • Problem

    Historical Arabic HTR is limited by scarce large, line-level corpora from genuine manuscripts and by the absence of line-level annotations linking margin lines to the main-text reading flow.

  • Method

    AraMS-28k is constructed from diverse historical sources using RefLAM to align multimodal-LLM OCR with independently sourced references, followed by human review and separate validation regimes.

  • Results

    Kraken CER rises from 11.65% on the Ruq‘ah test book to 22.62% on Naskh and 32.71% on Maghrebi, with HATFormer showing the same ordering.

  • Takeaways & Limitations

    The dataset provides a public resource for Arabic manuscript recognition, layout analysis, and line-level reading-order recovery with reproducible splits.

  • Takeaways & Limitations

    The line-validated subset may favor cleaner scans and regular hands, roughly 70% of margin lines lack confident anchors, and each script has one test book.

Abstract

from arXiv · show

We introduce AraMS-28k, the largest publicly released line-level dataset of genuine historical Arabic manuscripts, comprising 14 books, 3,043 pages, and 28,600 annotated text lines (27,971 main-text, 629 margin). Thirteen books are hand-copied manuscripts spanning three script traditions -- Naskh, Ruq'ah, and Maghrebi -- and one is a lithographed printed edition included to broaden format diversity. Each line is labelled as main-text or margin, and margin lines that have an unambiguous attachment point in the main text are further annotated with an insertion anchor, recovering the manuscript's true non-linear reading order at line-level granularity -- to our knowledge the first such annotation released for a historical Arabic manuscript corpus. Because reference transcriptions are fully vocalised while manuscript hands are typically undiacritised, we release both the raw diacritised transcription and a diacritic-normalised counterpart for every line. The dataset was constructed with RefLAM, a reference-grounded annotation pipeline that aligns multimodal-LLM OCR against independently sourced clean transcriptions and routes every line through human review, combining automatic verification with expert oversight. We describe the construction and quality-control process, present the annotation schema, report dataset statistics at both the corpus and per-book level, and provide baseline HTR results using Kraken and HATFormer, including a cross-script generalisation gradient from in-distribution pages to fully unseen books. AraMS-28k is released with page images, line-level annotations, and fixed train/val/test splits under CC BY-NC-SA 4.0 to support reproducible research on Arabic manuscript recognition, layout analysis, and reading-order recovery.

1 Introduction

AraMS-28k addresses the shortage of large, genuine historical Arabic manuscript corpora and adds line-level annotations for recovering marginalia’s non-linear reading order.

  • Historical Arabic HTR lacks large, line-level corpora based on genuine manuscripts rather than modern handwriting or synthetic renderings.
  • Existing resources generally do not record which main-text line a specific margin line belongs next to.
  • AraMS-28k labels lines as main-text or margin and adds insertion anchors where margin lines have unambiguous attachment points.
  • 28,600 line-level transcriptions span three script traditions, supporting HTR, layout analysis, and reading-order recovery.

2 Related Arabic HTR Datasets

Existing public Arabic resources vary in scale and target, but they generally lack line-level links from marginal text to its main-text insertion point.

  • RASM2018 covers approximately 120 pages and provides line transcriptions without linking margin lines to specific main-text reading positions.
  • RASAM offers approximately 300 pages and 7,540 lines for Maghrebi recognition, but is an order of magnitude smaller than AraMS-28k and lacks insertion anchors.
  • KHATT contains 4,000 pages and 13,435 lines of modern handwriting, not genuine historical manuscript material.
  • OpenITI MAKHZAN spans 1,497 pages across seven Arabic-script languages but does not link margin lines to main-text reading positions.
  • Muharaf’s public subset contains 1,216 pages and 24,495 lines, while other resources target sub-word annotation, baseline annotation, broader document OCR, or synthetic data.
  • AraMS-28k restricts its comparative claim to publicly released corpora and does not claim to be the largest Arabic manuscript resource absolutely.

3 Dataset Construction

AraMS-28k combines diverse historical sources with the RefLAM reference-grounded pipeline and two validation regimes that trade review depth against scale.

  • 3.1 Source Material: The corpus contains 14 books, including 13 hand-copied manuscripts and one lithographed volume selected across scripts, diacritisation, scan quality, and layout complexity.
  • 3.1 Source Material: Clean transcriptions from external digital repositories or a scanned critical edition serve as references for aligning manuscript pages.
  • 3.2 Annotation Pipeline: RefLAM segments pages into lines, uses multimodal-LLM OCR to separate main text from marginal content, aligns hypotheses to references, and routes every line through human review.
  • 3.3 Quality Control and Validation: The page-validated phase has two independent reviewers inspect every line, whereas the line-validated phase retains only main-text lines with perfect reference alignment.
  • 3.3 Quality Control and Validation: Line-validated statistics may favor cleaner scans and regular hands, so the paper reports page-validated and line-validated subsets separately.
  • 3.3 Quality Control and Validation: Users can choose full manual verification or scale combined with automatic reference agreement, and most of the corpus was constructed in approximately one week.

4 Annotation Schema

AraMS-28k records line metadata, transcriptions, review status, and margin-specific insertion information in a uniform schema. Its precision-first anchors recover non-linear reading order only where attachment points are unambiguous.

  • Record structure: Each line record contains identifiers, page metadata, spatial geometry, transcription and alignment confidence, margin anchoring metadata, and human review flags.Every schema key is present; geometry and margin fields are null when not applicable.
  • Record structure: Main-line records include identifiers, transcription fields, review status, split assignment, and null geometry or margin-anchor fields when inapplicable.The example record includes gt_raw, gemini_raw, confidence, gt_normalized, validation flags, and a test split.
  • Margin annotations: Margin-line records populate margin_anchor with contextual text, an insertion-line index, and rotation information.The insertion-line field identifies the main-text line associated with the margin content.
  • Transcription representation: Reference transcriptions include vocalisation and orthographic marks that may lack visual evidence in undiacritised manuscript images.The paper motivates releasing a diacritic-normalised counterpart to address this transcription–image mismatch.
  • Margin annotations: 189 of 629 margin lines receive confident insertion anchors, while ambiguous or non-attachable lines retain null anchors rather than forced guesses.This precision-first policy preserves trustworthy reading-order information and avoids silently corrupting downstream evaluation.

5 Dataset Statistics

AraMS-28k comprises a large, diverse corpus of historical Arabic manuscript pages and line annotations, with fixed splits and subsets supporting recognition, detection, segmentation, and reading-order research.

  • Corpus scale: 3,043 pages and 28,600 annotated lines span 14 books, including 27,971 main-text and 629 margin lines.Thirteen books are hand-copied in Naskh, Ruq‘ah, or Maghrebi, while one is a lithographed printed edition.
  • Validation subsets: 548 page-validated pages contain every line on the page, supporting exhaustive text-line detection and segmentation ground truth.Line-validated pages contain only reference-verified lines and are suitable for recognition rather than exhaustive detection evaluation.
  • Supported tasks: Main-text and margin labels, together with insertion anchors, enable layout analysis and reading-order-recovery research.The paper releases these annotations but defines no evaluation protocol or baseline for those two tasks.
  • Supported tasks: 177 naturally degraded lines from held-out book_09 form an out-of-distribution evaluation subset for restoration and recognition robustness.The subset covers native fading, staining, and bleedthrough.

6 Baseline Recognition Results

Baseline recognition experiments show substantial cross-script variation, with performance degrading from Ruq‘ah to Naskh to Maghrebi and worsening sharply on unseen books and scripts.

  • 11.65% CER was achieved by Kraken on the Ruq‘ah test book, compared with 22.62% on Naskh and 32.71% on Maghrebi.
  • 13.26%, 25.37%, and 37.88% CER were obtained by HATFormer on Ruq‘ah, Naskh, and Maghrebi test books, respectively.Both recognisers exhibit the same script ordering.
  • Ruq‘ah’s best performance despite the smallest script-specific training set indicates that training-data volume was not the primary driver of the ordering.Ruq‘ah had 3,282 training lines, while Maghrebi had 5,229 yet performed worst.
  • Muharaf pretraining likely benefits Ruq‘ah through closer script-distribution proximity, while Maghrebi is largely absent from its Levantine-focused composition.The paper does not make a specific proximity claim for Naskh because Muharaf’s per-script composition is not reported.
  • 6.48% CER on in-distribution pages rose to 13.26% on an unseen Ruq‘ah book, 25.37% on Naskh, and 37.88% on Maghrebi.The in-distribution condition withheld pages from training books, whereas the other conditions used fully unseen books.
  • Removing Muharaf finetuning increased in-distribution HATFormer CER from 6.48% to 7.44%.This comparison supports transfer from exposure to a large, diverse body of historical Arabic before AraMS-28k specialisation.

7 Conclusion

AraMS-28k is released as a large, richly annotated historical Arabic manuscript dataset with reproducible splits and complementary data formats, while its scope includes several explicit limitations.

  • AraMS-28k comprises 3,043 pages spanning three hand-copied script traditions and one lithographed edition.
  • Main/margin labels and insertion anchors recover the non-linear reading order of marginal content at line level.
  • Every line is released with both diacritised and diacritic-normalised transcriptions.
  • Baseline HTR experiments show that existing recognisers can be finetuned on the dataset, while its cross-script gradient provides a reference point for future recognition and layout research.
  • The line-validated subset may favour cleaner scans and regular scripts because it requires agreement between OCR and reference transcription.
  • Fixed train/val/test splits, manifests, checksums, and test_seen_pages.txt enable exact reproduction without re-deriving splits or rerunning construction.
  • The full annotation release preserves geometry, transcription, anchors, and review metadata, while AraMS-28k-HTR provides segmented images with normalised text.

A Per-Book Statistics

The appendix documents per-book statistics using PV and LV subsets, with production format explicitly distinguished for the lithographed volume.

  • Table 6 reports per-book statistics for both page-validated (PV) and line-validated (LV) construction phases.
  • “C=100” denotes the percentage of reviewed main lines achieving a perfect alignment score against the reference transcription.
  • For line-validated books, C=100 is guaranteed by construction because only perfectly aligned lines were retained.
  • Book_10 is identified as Lithograph, distinguishing its production format from the three hand-copied script traditions.

B Datasheet Summary

The datasheet frames AraMS-28k as a reference-grounded resource for Arabic HTR and layout analysis, constructed with human verification and released for related research uses.

  • The dataset addresses the margin/insertion-anchor gap in Arabic HTR and manuscript layout analysis.
  • Its construction uses multimodal-LLM OCR grounded against independent reference transcriptions and human verification of every line.
  • A diacritic-normalised transcription is released alongside the raw transcription because references are fully vocalised while manuscript hands generally are not.
  • Intended uses include Arabic HTR, text-line detection and segmentation, manuscript layout analysis, and reading-order recovery.

B.1 Finetuning Hyperparameters

The finetuning recipes use distinct pretrained and from-scratch configurations, with checkpoint selection based on validation CER.

  • AdamW uses β1=0.9, β2=0.999, ϵ=10−6, weight decay 0.01, and a 5 × 10−5 learning rate.Training uses batch size 8, 500 linear warmup steps, gradient clipping at 5.0, and up to 20,000 steps.
  • Both configurations select checkpoints using validation CER with greedy decoding.
  • The Muharaf-initialized model freezes its backbone for epoch 1 and uses a 5 × 10−4 learning rate with cosine decay.It applies augmentation, early stopping after 15 epochs without validation CER improvement, and a 100-epoch maximum.

C Release Formats and Availability

AraMS-28k is distributed in complementary full-annotation and training-ready formats, with reproducible hosting, integrity, and maintenance procedures.

  • C Release Formats and Availability: AraMS-28k is distributed as two artifacts derived from shared annotations for different user tasks.
  • C.1 AraMS-28k (Full Annotation Release): The canonical release combines page images with per-line JSONL records containing geometry, transcriptions, provenance, anchors, and review metadata.It supports layout analysis, reading-order recovery, and tasks requiring geometry or diacritics.
  • C.1 AraMS-28k (Full Annotation Release): The full release organizes images, book-level annotations, train/validation/test book splits, and a line-record schema.
  • C.1 AraMS-28k (Full Annotation Release): Auxiliary files provide the withheld seen-page diagnostic lines and real-damage line flags outside the core archive.The seen-page file enables exact reproduction of the HATFormer in-distribution diagnostic.
  • C.2 AraMS-28k-HTR (Recognition-Ready Release): AraMS-28k-HTR supplies cropped line images, gt.txt targets, manifests, and metadata in a training-ready layout using gt_normalized.Its split manifests support direct comparison with the reported recognition experiments.
  • C.2 AraMS-28k-HTR (Recognition-Ready Release): The recognition-ready release is generated reproducibly from AraMS-28k and distributed pre-built to avoid requiring users to rerun segmentation and cropping.
  • C.3 Hosting, Versioning, and Integrity; C.4 Maintenance Plan: Both releases are hosted on Hugging Face and Zenodo, versioned with published SHA-256 checksums and changelogs for future corrections.The maintenance plan accepts issue reports, batches validated corrections into versioned releases, and does not currently plan additional books.
Loading 2608.26921v1…