Does a Modern-Handwriting Warm-Up Help Historical Arabic OCR? A Reproducible, Compute-Matched Evaluation on Muharaf and KHATT
Organizations: Dal Research Team, Riyadh, Saudi Arabia
Abstract
Whether an intermediate stage of modern Arabic handwriting helps or hurts historical Arabic HTR is usually decided from one implementation and one comparison, too thin a basis for a claim either way. We test stability by running the same nominal ablation four times, letting the base checkpoint, encoder-freezing strategy, epoch budget, precision, and learning-rate schedule vary as they naturally did during development, while holding the normalization, scorer, and interval estimation fixed. Each run compares intermediate training on modern handwriting (KHATT) then fine-tuning on historical manuscripts (Muharaf) against fine-tuning on Muharaf directly. Across the four runs the estimated effect swings from -17.64 to +14.52 CER points and reverses sign. The two extremes are exactly the two runs with an identifiable confound (a fivefold lower learning rate in one; a checkpoint of undisclosed provenance in the other); the two clean runs land at -0.25 and +0.94, i.e. no effect. A tight interval from one implementation says nothing about the next. We then run a compute-matched experiment with identical budgets over three seeds: KHATT warm-up is +2.42 CER points worse than a matched same-domain control (95% interval [+0.60, +4.25]); the part of that gap specific to the handwriting domain is only about 0.6 points a small negative effect under this configuration, not a universal result. We release a SaudiHeritage-OCR package with the normalizer, interval scorer, a verified KHATT decoder, experimental manifests, VLM baselines, and an edition-alignment protocol, so the result can be checked independently. The Al-Mahd inscription line is held strictly out and is not offered as a benchmark.
Figures & tables
| Source | Surface | Role | Lines |
|---|---|---|---|
| KHATT [13] | modern ink | warm-up | 9,497 / 1,901 |
| Muharaf [14] | historic ink | train + bench. | 22,091 / 1,069 / 1,334 |
| Al-Mahd (ours) | inscribed stone | test-only, qual. | 1 |
| Base checkpoint | Encoder | Epochs | Batch | Precision | Target-stage LR (M1 / M2) | |
|---|---|---|---|---|---|---|
| I1 | RayR1/trocr-base-arabic-hw | trainable | 5 | fp16 | / | |
| I2 | RayR1/trocr-base-arabic-hw | trainable | 8 | 16 | fp16 | / |
| I3 | ViT-B/16-384 + AraBERT | frozen | 15 | 16 | fp32 | / |
| I4 | ViT-B/16-384 + AraBERT | frozen | 15 | 8 | fp32 | / |
| I5 | ViT-B/16-384 + AraBERT | frozen | fp16 | (matched, all arms) |
| Source form(s) | Normalized to |
|---|---|
| Alef with hamza, madda, or wasl | bare alef |
| Alef maqsura | ya |
| Ta marbuta | ha |
| Waw-hamza | waw (bare) |
| Ya-hamza | ya (bare) |
| Standalone hamza | (removed) |
| Split | Lines |
| Muharaf train (raw) | 22,091 |
| Muharaf validation | 1,069 |
| Muharaf test | 1,334 |
| Arm-E warm-up slice (from train, seed ) | 9,497 |
| Target split (remaining train, all arms) | 12,594 |
| Overlap, target split vs. E slice | 0 |
| Arm | Warm-up source | Role |
|---|---|---|
| A+ | Same-domain Muharaf | Compute-matched ctrl. |
| B | KHATT (modern hw) | Primary contrast |
| A0 | None (target-only) | Practitioner ref. |
| E | Disjoint real-Muharaf | In-domain-real ctrl. |
| Setting | Value |
|---|---|
| Learning rate | |
| LR warmup ratio | 0.05 |
| Weight decay | 0.01 |
| Per-device batch size | 8 |
| Gradient accumulation | 2 (eff. batch 16) |
| Warm-up steps (A+, B, E) | 1,200 |
| CER (%) | WER (%) | |||
|---|---|---|---|---|
| Run | raw | norm. | raw | norm. |
| A | 84.46 | 78.59 | 113.85 | 111.39 |
| B | 95.14 | 80.71 | 114.68 | 111.42 |
| Stage | Eval set | CER (%) | WER (%) |
|---|---|---|---|
| 1 (KHATT) | KHATT val | ||
| 2 (Muharaf) | Muharaf test |
| M1 | M2 | CER | Warm-up | |
| I2 | 45.86 | 28.22 | helps (contam.?) | |
| I3 | 82.88 | 82.63 | no effect | |
| I4 | 77.51 | 78.45 | no effect | |
| I1 | 42.81 | 57.33 | hurts (LR confound) | |
| Range across impl. 32.16 points, sign flips | ||||
| Arm | CER (%) | SD | 95% CI |
|---|---|---|---|
| A+ (control) | 79.16 | 1.44 | |
| B (KHATT) | 81.59 | 0.91 | |
| A0 (no warm-up) | 79.76 | 0.97 | |
| E (in-domain real) | 80.95 | 0.55 |
| Contrast | CER | 95% CI | Role |
|---|---|---|---|
| B A+ | Primary contrast | ||
| A0 A+ | Secondary (incl. 0) | ||
| E A+ | Secondary (incl. 0) | ||
| B E | (not tested) | Domain-isolating |
| Arm | MMD 2 image [95% CI] | JS (3-gram) |
|---|---|---|
| B (KHATT) | 0.4361 | 0.2530 |
| E (Muharaf slice) | 0.0000 | 0.0167 |
Optical Character Recognition
Optical character recognition converts text in images into machine-readable text, from printed pages and handwriting to signs and symbols.
See all 198 papers