Qori-OCR
A 3.13 M-parameter CTC text recogniser for English word crops — released with its benchmark results, including the ones it loses.
Qori-OCR is a from-scratch character-level recogniser trained by Hadal Research on 300k synthetic word crops plus 6,106 real scene-text crops. It is small (3.13 M parameters, 4.05 MB as int8) and it runs in 11.4 ms per crop on a single x86 core. It is not competitive with released compact recognisers on accuracy, and this card says so up front rather than in a footnote: on the identical 5,722-crop benchmark, PP-OCRv6_tiny — 1.11 M parameters, 4.46 MB — is 8.3 points more accurate and runs 2.2× faster.
Read this as a reproducible baseline from a small-data training pipeline, not as a PP-OCR
replacement. The full evaluation, error analysis and protocol are in
BENCHMARK_REPORT.pdf.
| Task | Word / short-line text recognition (no detection) |
| Architecture | depthwise MetaFormer (RepDW mixers, 4 late attention blocks) + BiGRU neck + CTC head |
| Parameters | 3,126,864 (4,492,032 before 30.4% structured pruning) |
| Input | RGB 3×48×320, aspect-preserving, right-padded to a multiple of 8 |
| Output | up to 40 characters from a 96-class charset (95 printable ASCII, case-sensitive) |
| Decoding | greedy CTC (no lexicon, no beam search) |
| Training data | 300,000 MJSynth crops + 6,106 real crops (ICDAR-2015, SVT, IIIT-5K train splits) |
| Licence | research use (see Licence) |
Files
| File | Size | sha256 | Use |
|---|---|---|---|
qori-ocr.fp32.onnx | 11.99 MB | 01d7af0e6a43a5bb9038c0f484cd13101a2062facea19f5a32200426695e6550 | fine-tuning, reference accuracy |
qori-ocr.dynint8.onnx | 7.69 MB | b98c1c276f70c51bf9cd25252b7e910585fc861e53d86a81050fbbc544d5b11a | default for inference |
qori-ocr.qoperator.onnx | 4.05 MB | 2e0daf0bf77aa456a075cd7a77e73f3fde7b8766d8bb12a64886dd79c14bdf80 | smallest; re-measure accuracy on your platform |
charset.json | 1 KB | 2c48e5ee26ddeae74ac7be6ad83583253d8503b569fd407f0fd52444231fea82 | index → character map (index 0 = CTC blank) |
ocr_infer.py | 5 KB | — | tested inference example (preprocessing + greedy decode) |
config.json | 1 KB | — | architecture and preprocessing parameters |
Usage
Only ONNX Runtime, numpy and pillow are required — no torch, no paddle:
pip install onnxruntime numpy pillow
python ocr_infer.py word.png
from ocr_infer import Recognizer
rec = Recognizer("qori-ocr.dynint8.onnx", "charset.json", threads=2)
print(rec.recognize("word.png")) # 'HADAL'
print(rec.recognize_batch(["a.png", "b.png"])) # ['HADAL', 'JOINT']
Preprocessing must match training. Keep the aspect ratio, resize to height 48 (bicubic), clamp width
to 320, normalise with mean/std 0.5, pad the right edge with the background value to a multiple of 8,
and decode only width // 8 frames of the output. ocr_infer.py does exactly this; copy it rather
than re-deriving the transform.
Benchmarks
Measured by Hadal Research on the 5,722-crop held-out set (IIIT-5K 3,000 / SVT 647 / ICDAR-2015 2,075), greedy CTC, no lexicon, accuracy = exact match after lowercasing and stripping non-alphanumerics. Latency = p50, single x86 core, ONNX Runtime 1.23.2, batch 1.
| Version | Disk | IIIT-5K | SVT | IC15 | All | x86 1t |
|---|---|---|---|---|---|---|
| fp32, 4.49 M (as trained) | 17.19 MB | 81.8 | 77.7 | 57.1 | 72.4 | 16.8 ms |
| fp32, pruned | 11.99 MB | 79.7 | 77.3 | 53.2 | 69.8 | 11.6 ms |
| dynamic int8 (this release) | 7.69 MB | 79.7 | 77.3 | 53.3 | 69.9 | 9.9 ms |
| static int8 / QOperator | 4.05 MB | 79.5 | 76.8 | 52.7 | 69.5* | 11.4 ms |
*Static int8 is platform-dependent: the same 4.05 MB graph measures 69.5–69.8% on aarch64 and 63.9% on the x86 container used for the training report. The fp32 graph reproduces exactly on both, so the difference is in the quantised kernels, not the model. Measure it before deploying it.
How it compares (same crops, same protocol, same decode)
| Recogniser | Params | Disk | IIIT-5K | SVT | IC15 | All | x86 1t |
|---|---|---|---|---|---|---|---|
| Qori-OCR (int8) | 3.13 M | 7.69 MB | 79.7 | 77.3 | 53.3 | 69.9 | 9.9 ms |
| PP-OCRv6_tiny | 1.11 M | 4.46 MB | 88.5 | 81.1 | 62.4 | 78.2 | 5.1 ms |
| PP-OCRv4_mobile_en | 1.90 M | 7.65 MB | 94.4 | 88.4 | 73.3 | 86.1 | 19.0 ms |
| PP-OCRv5_mobile_en | 1.94 M | 7.87 MB | 95.3 | 89.8 | 75.6 | 87.5 | 19.2 ms |
| PP-OCRv4_mobile_multi | 2.69 M | 10.86 MB | 92.0 | 85.9 | 67.7 | 82.5 | 20.9 ms |
| PP-OCRv5_mobile_multi | 4.11 M | 16.63 MB | 88.6 | 81.5 | 62.4 | 78.3 | 21.3 ms |
| PP-OCRv6_small | 5.27 M | 21.16 MB | 96.5 | 92.1 | 78.4 | 89.4 | 25.4 ms |
| EasyOCR english_g2 | 3.78 M | 15.0 MB | 70.4 | 56.4 | 34.2 | 55.7 | — |
Paired on individual crops, Qori-OCR is ahead on 243 and behind on 718 relative to PP-OCRv6_tiny (exact McNemar p < 1e-6). The 69.9% figure is the best case for the model: fp32 scoring, with the pruning penalty and any int8 penalty already paid.
Training
| Item | Value |
|---|---|
| Corpus | 306,106 crops: 300,000 MJSynth + 6,106 real (ICDAR-2015 4,046, IIIT-5K 1,827, SVT 233) |
| Validation | 615 real crops, hash-split (`sha1(seed |
| Input / step | 3×48×320, 8 px per CTC step, T = 40 frames |
| Optimiser | AdamW, wd 0.05 (norms/biases excluded), grad clip 5, EMA 0.999 |
| Stage A | 82,854 steps, lr 7e-4 → 6e-4 cosine, fp16 AMP on one T4, batch 64 × grad-accum 8 |
| Stage B | 8 epochs on real crops only, lr 2e-4, scene-hard augmentation (perspective, blur, JPEG) |
| Best validation | CER 0.1789, 65.5% exact match (case-insensitive) |
| Post-training | structured pruning 30.4% (width 0.85, MLP hidden 0.75), int8 PTQ (dynamic / QDQ / QOperator) |
| Hardware / cost | one Tesla T4, ~1.15 GB peak VRAM, $0.92 billed (Modal) |
| Throughput | 982 crops/s on T4 at batch 64 |
The architecture, the schedule and the optimisation plan are documented in ARCHITECTURE.md and
TRAINING.md in the release bundle.
Limitations
- Accuracy. 69.9% on a clean, lexicon-free protocol is roughly 20 points behind the compact state of the art on the same crops, and 8.3 points behind a model a third of its size. Do not substitute this model for PP-OCR or SVTR in a product.
- ASCII only. 95 printable characters, case-sensitive; accented and non-Latin script are out of vocabulary. Non-ASCII training rows were dropped, so the model never saw them.
- Crops only. There is no detection stage: it recognises a single word or short line that has already been cropped. It has no rotation or perspective correction, so tilted or upside-down text fails, and long lines must be split.
- ≤ 40 characters at 320 px (8 px per CTC step). Longer lines are silently truncated by the frame budget.
- Case convention. 1,314 of its 1,338 case-only errors are uppercase references emitted in mixed
or lower case (
PRIVATE→Private). Uppercasing predictions raises case-sensitive exact match from 45.8% to 69.2%, but that is a post-hoc convention, not a capability. - Static int8 portability. See the note under Benchmarks; the 4 MB graph's accuracy changes by six points between x86 and ARM.
- Small-data training. 306k crops is ~40× less than the PP-OCR series trains on. The model is weak on short, clean words (77.8% on 1–3 character labels vs 85.2% for PP-OCRv6_tiny), which is a data/optimisation signature rather than an architectural one.
Intended use
Research on compact CTC recognisers, English word-level OCR in constrained pipelines, and as an initialisation for distillation. Not intended for production OCR, multilingual text, or anything where a wrong character is expensive. The measured headroom is documented in the report: distillation from PP-OCRv6_small was planned and not run, and 84.2% of current predictions are within one edit of the reference.
Licence
Weights and code: research use. The training corpus is synthetic (MJSynth, research use) plus real crops from ICDAR-2015 (challenge terms), SVT (research use) and IIIT-5K (research use); those terms carry over to models derived from them. No warranty of any kind.
Citation
@misc{hadal2026qoriocr,
title = {Qori-OCR: a 3.13 M-parameter CTC recogniser, benchmarks and error analysis},
author = {Hadal Research},
year = {2026},
note = {https://hadal.run/models},
}