Muharaf: Manuscripts of Handwritten Arabic Dataset for Cursive Text Recognition

Mehreen Saeed, Adrian Chan, Anupam Mijar, Joseph Moukarzel, Georges Habchi, Carlos Younes, Amin Elias, Chau-Wai Wong, Akram Khater

TL;DR

The authors introduce Muharaf, the largest publicly available dataset of historic handwritten Arabic, featuring over 1,600 expert-transcribed page images and 36,000+ annotated text lines. By combining expert paleographic knowledge with an iterative deep learning-assisted annotation pipeline, the project provides a high-quality benchmark to advance Handwritten Text Recognition (HTR) for complex, cursive scripts.

What Problem Does This Paper Address?

While modern OCR (Optical Character Recognition) is highly effective for printed text, HTR for historical manuscripts remains a significant challenge, particularly for Arabic. Arabic script is inherently cursive, meaning letter shapes change drastically depending on their position within a word (initial, medial, final, or isolated). Furthermore, the use of ijam (dots) and tashkil (diacritics/vowels) adds layers of visual complexity that can lead to misclassification.

Existing Arabic HTR datasets are often small, proprietary, or "scribed" (where modern writers copy text in controlled conditions). There is a critical shortage of "Category 2" datasets—genuine historical documents with diverse, informal, and sometimes barely legible handwriting styles. Without large-scale, expert-verified data, deep neural networks cannot generalize well enough to digitize the millions of historical Arabic manuscripts currently locked away in global archives.

Methods

The researchers developed a specialized data acquisition pipeline to bridge the gap between archival expertise and machine learning requirements:

  1. ScribeArabic Software: The team built a custom web-based tool for annotating polygonal boundaries around text lines and entering ground-truth transcriptions. It also allows for tagging page elements like graphics, signatures, and page numbers.
  2. Iterative Human-in-the-Loop Annotation: To speed up the process, the team used an iterative approach. After experts manually labeled the first 500 pages, they trained a preliminary HTR model to predict transcriptions for the next batch. Experts then only had to correct the model's output, significantly reducing manual labor.
  3. SFR Architecture: For their baseline, they employed the Start, Follow, Read (SFR) system. This consists of three specialized CNN-based networks:
  4. SOL (Start of Line): Detects where a line begins.
  5. LF (Line Follower): Tracks the trajectory of the line (crucial for slanted or curved historical text).
  6. HW (Handwriting Recognition): A CNN-BLSTM network that converts the visual line into text using Connectionist Temporal Classification (CTC) loss.
A screenshot of the ScribeArabic interface used by experts to transcribe and annotate manuscripts.

Datasets

The primary contribution is the Muharaf dataset (Arabic for "typeface"):

  • Composition: 1,644 images (1,216 public, 428 restricted) spanning the 19th to early 21st centuries.
  • Content: Personal letters, diaries, legal records, and church documents from 50 different collections.
  • Annotations: 36,311 text lines and 4,867 text regions.
  • Comparison: Unlike the KHATT or MADCAT datasets, which use controlled writing, Muharaf features "wild" historical handwriting. It contains significantly more annotated lines than other historical Arabic datasets like RASM or RASAM.
Histograms comparing the distribution of line widths in Muharaf versus other common datasets.

Key Insights and Ideas

  • Script Matters: Most Muharaf samples use the Ruq‘ah script, common for everyday writing in the late Ottoman period. This differs from the calligraphic Maghrebi or scientific scripts found in other datasets, making Muharaf more representative of common historical correspondence.
  • Efficiency through AI: The "evolution" of the model (shown in Figure 5) demonstrates that the error rate dropped below 20% after just 500 training images, proving that even a modest amount of expert data can jumpstart an effective HTR pipeline.
  • Low-Resource Deployment: The authors prioritized the SFR architecture because it can fit on an 8GB GPU, making it accessible for researchers and libraries without massive computing clusters.

Key Results

The authors established a baseline for the dataset using the SFR system:

  • Full Dataset Performance: Achieved a Character Error Rate (CER) of 0.134 (13.4%) and a Word Error Rate (WER) of 0.353 (35.3%) at the page level.
  • Public Subset: Training on only the public portion resulted in a slightly higher CER of 0.157.
  • Cross-Dataset Validation: When the HW network was trained on a combination of Muharaf, RASAM, and RASM, the CER on the external KHATT dataset improved by approximately 16%, highlighting Muharaf's value as a general-purpose training resource.
Plots showing the steady decline of CER and WER as more expert-verified data was added to the training set over 15 trials.

Limitations and Future Work

  • Writer Identification: While the dataset is large, many writers remain unidentified due to the nature of archival records (e.g., anonymous church scribes).
  • Annotation Tightness: Some text line polygons were generated automatically and may overlap with adjacent lines, which can confuse recognition models.
  • Linguistic Potential: The authors suggest that future work could involve using these transcriptions to study colloquial Arabic dialects from different historical periods, which often differ significantly from Modern Standard Arabic.
  • Layout Analysis: While basic page elements are tagged, the dataset is not yet optimized for complex layout detection (e.g., distinguishing between marginalia and main text flow).

Summary updated

BibTeX
@inproceedings{saeed2024muharaf,
  author = {Mehreen Saeed and Adrian Chan and Anupam Mijar and Joseph Moukarzel and Georges Habchi and Carlos Younes and Amin Elias and Chau-Wai Wong and Akram Khater},
  title = {{Muharaf: Manuscripts of Handwritten Arabic Dataset for Cursive Text Recognition}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=1s8l1tnTXW},
}
Figure