ArabicOCR-KHATT — Arabic Handwritten Text Recognition (CRNN-CTC)
1
5 commits
2 repos using this model
2 linked in READMEs
updated Jul 8, 2026
Line-level Arabic handwritten text recognition, trained on the KHATT dataset (11,375 handwritten line images).
The architecture is a CRNN (CNN + BiLSTM) with CTC loss, with Arabic-specific design choices: input height 96 so diacritic dots stay detectable, 3-zone vertical pooling that preserves where dots sit (the only difference between ba/ta/tha/nun/ya), dot-safe augmentation, and beam-search decoding with an Arabic character bigram LM.
pip install arabicocr-khattfrom arabicocr_khatt import ArabicOCR
ocr = ArabicOCR.from_pretrained("FixFips/arabicocr-khatt")
text = ocr.recognize("handwritten_page.jpg") # segments lines automatically
print(text)
Or from the command line:
pip install arabicocr-khatt
arabicocr handwritten_page.jpg
| Metric | Value |
|---|---|
| CER | 6.09% |
| WER | 27.26% |
| WER (normalized) | 26.06% |
| Dot-group CER | 8.24% |
Dot-group CER measures errors only on dot-differentiated letter groups (ba/ta/tha, jim/ha/kha, nun/ya) — the #1 error source in Arabic OCR.
| File | Purpose |
|---|---|
crnn_best.pt | Model checkpoint: {"model": state_dict, "vocab": list[str], "arch_version": 2} |
bigram_lm.json | Arabic character bigram LM for beam-search decoding |
charset_arabic.txt | 75-class character set (70 characters + 5 special tokens) |
If you use this model, please also cite the KHATT dataset:
Mahmoud, S. A., et al. "KHATT: An open Arabic offline handwritten text database." Pattern Recognition 47.3 (2014): 1096-1112.
ArabicOCR-KHATT — Arabic Handwritten Text Recognition (CRNN-CTC)
1
5 commits
2 repos using this model
2 linked in READMEs
updated Jul 8, 2026
Line-level Arabic handwritten text recognition, trained on the KHATT dataset (11,375 handwritten line images).
The architecture is a CRNN (CNN + BiLSTM) with CTC loss, with Arabic-specific design choices: input height 96 so diacritic dots stay detectable, 3-zone vertical pooling that preserves where dots sit (the only difference between ba/ta/tha/nun/ya), dot-safe augmentation, and beam-search decoding with an Arabic character bigram LM.
pip install arabicocr-khattfrom arabicocr_khatt import ArabicOCR
ocr = ArabicOCR.from_pretrained("FixFips/arabicocr-khatt")
text = ocr.recognize("handwritten_page.jpg") # segments lines automatically
print(text)
Or from the command line:
pip install arabicocr-khatt
arabicocr handwritten_page.jpg
| Metric | Value |
|---|---|
| CER | 6.09% |
| WER | 27.26% |
| WER (normalized) | 26.06% |
| Dot-group CER | 8.24% |
Dot-group CER measures errors only on dot-differentiated letter groups (ba/ta/tha, jim/ha/kha, nun/ya) — the #1 error source in Arabic OCR.
| File | Purpose |
|---|---|
crnn_best.pt | Model checkpoint: {"model": state_dict, "vocab": list[str], "arch_version": 2} |
bigram_lm.json | Arabic character bigram LM for beam-search decoding |
charset_arabic.txt | 75-class character set (70 characters + 5 special tokens) |
If you use this model, please also cite the KHATT dataset:
Mahmoud, S. A., et al. "KHATT: An open Arabic offline handwritten text database." Pattern Recognition 47.3 (2014): 1096-1112.