Macedonian OCR V8
Fine-tuned PaddleOCR recognition model for Macedonian Cyrillic text in scanned books, paired with PP-OCRv6 medium detection.
Results
| Engine | CER |
|---|---|
| V8+LM (this model + KenLM post-processing) | 0.20% |
| V8 (this model, raw) | 0.26% |
| V7 (previous) | 1.02% |
| Tesseract (mkd) | 1.43% |
| Qwen 3.5 122B (best VLM) | 0.39% |
Measured on 10 held-out scanned Macedonian book pages.
Usage
from paddleocr import PaddleOCR
ocr = PaddleOCR(
text_detection_model_name='PP-OCRv6_medium_det',
text_recognition_model_name='PP-OCRv5_server_rec',
text_recognition_model_dir='./mk_rec_v8_infer',
text_det_thresh=0.15,
text_det_box_thresh=0.28,
text_det_unclip_ratio=3.0,
use_doc_orientation_classify=False,
use_doc_unwarping=False,
use_textline_orientation=False,
)
result = ocr.predict('your_page.jpg')
for page in result:
for text, score in zip(page['rec_texts'], page['rec_scores']):
print(f'{score:.2f} {text}')
Download
pip install huggingface_hub
python3 -c "
from huggingface_hub import snapshot_download
snapshot_download('mjurukov/macedonian-ocr-v8', local_dir='./mk_rec_v8_infer')
"
Training
- Base model: PP-OCRv5 mobile SVTR_LCNet with MultiHead (CTC + NRTR)
- Dictionary: 170 characters — full Macedonian Cyrillic, Latin, digits, punctuation
- Detection: PP-OCRv6_medium_det (34.5M params) — 36% faster than v5
- Training data: 583k synthetic + 172k targeted + 42k IED-boost + 1,674 real annotated lines
- Post-processing: KenLM 3-gram language model from 1,065 Macedonian books + 256k-word frequency dictionary
- Hardware: NVIDIA RTX 2080 Ti (11 GB), 50 epochs, ~4 days training
Preprocessing
Winning pipeline (validated via A/B testing):
- Grayscale
- Deskew (HoughLinesP, max ±15°)
- Illumination flattening (morphological close divide)
- Unsharp masking (gain 0.4, σ=1.5)
License
Model weights: CC BY 4.0 — free to use, modify, and redistribute with attribution. Code: MIT
Links
- GitHub: https://github.com/mjurukov/macedonian-ocr
- V7 model: https://huggingface.co/mjurukov/macedonian-ocr-v7
- Paper: Fine-Tuning PaddleOCR for Macedonian Cyrillic Script
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support