Surya OCR for historical Ethiopic manuscript lines (Fidel → HHD-Ethiopic)
Line-level OCR for Ge'ez/Amharic handwritten manuscripts (18th–20th century). Two-stage fine-tune of the
Surya text recognizer (surya-ocr==0.13.1, ~470M parameters):
- Stage 1 –
kiyam/surya-fidel-amharic: Surya fine-tuned on the Fidel dataset (modern Amharic: handwritten, typed, synthetic). - Stage 2 (this model) – further fine-tuned on HHD-Ethiopic (historical manuscript line crops), with Fidel lines replayed to limit forgetting.
Output convention: the Ethiopic word separator ፡ (U+1361) is kept, as written in the manuscripts.
Results (before = stage-1 model, after = this model; same lines)
| Test set | Group | Lines | CER % before | CER % after | WER % before | WER % after |
|---|---|---|---|---|---|---|
| HHD test I (IID) | ALL | 6375 | 310.46 | 13.58 | 304.00 | 34.83 |
| HHD test II (18th c., OOD) | ALL | 15935 | 239.89 | 20.51 | 239.83 | 54.59 |
| Fidel test subset | handwritten | 200 | 15.79 | 14.98 | 38.54 | 36.62 |
| Fidel test subset | synthetic | 200 | 1.92 | 1.97 | 4.51 | 4.33 |
| Fidel test subset | typed | 200 | 3.90 | 4.08 | 6.93 | 6.42 |
| Fidel test subset | ALL | 600 | 6.15 | 6.04 | 14.27 | 13.51 |
- HHD test II (18th-century manuscripts, out of distribution) is the honest generalisation number. HHD test I and the validation split are random draws from the same pool as training (HHD publishes no page/writer ids), so they are optimistic.
- The Fidel rows check forgetting of modern Amharic (stratified sample of the Fidel test set).
- CER/WER are micro-averaged edit distances; WER splits words at spaces and at
፡. Best HHD validation CER: 13.17% (epoch 3).
Usage
Requires surya-ocr==0.13.1 and transformers==4.48.3. Input is a cropped image of a single text line.
from PIL import Image
from surya.recognition import RecognitionPredictor
predictor = RecognitionPredictor(checkpoint="kiyam/surya-fidel-hhd-ethiopic")
# Surya always resizes to its built-in 256x896; this model was trained at 256x1024, so set it explicitly
predictor.processor.image_processor.max_size = {"height": 256, "width": 1024}
text, conf = predictor.batch_recognition([Image.open("line.png").convert("RGB")], [['am']])
print(text[0])
Training (stage 2)
- Start:
kiyam/surya-fidel-amharic; encoder, text encoder and decoder all trained - Data: HHD-Ethiopic train pool minus a random 10% validation hold-out, plus 8000 Fidel train lines (equal per modality) mixed into every epoch
- 3 epochs, AdamW peak lr 3e-05, 100 warm-up steps then cosine decay to 0.1x, weight decay 0.01, effective batch 32, grad clip 1.0, bf16, one NVIDIA A100
- Input 256x1024, language prompt
['am'](Surya has no Ge'ez token) - Code: https://github.com/kidist-amde/fidel-ocr (
configs/surya/hhd_finetune_a100.yaml)
License and citation
These weights are a derivative of the Surya model weights and are released under the same terms: cc-by-nc-sa-4.0, plus Datalab's conditions for the Surya weights (free use only for organisations under $5M revenue / funding that are not competitive with the Datalab API; see the Surya repository). Not for commercial use otherwise. Training data: HHD-Ethiopic (CC BY 4.0) and the Fidel dataset (see its card). If you use this model, please cite HHD-Ethiopic:
Belay et al., "A Historical Handwritten Dataset for Ethiopic OCR with Baseline Models and Human-level Performance", ICDAR 2024.