﹒What's new in v1 (22 November 2026)
- ๙ is read as ๙ on old typewritten scans. OpenThai read the Thai nine as five with 86–92 % confidence on royal decrees of 1953–1977, so years and section numbers looked right but were wrong: "พ.ศ. ๒๔๙๖" came out as "พ.ศ. ๒๔๕๖", "มาตรา ๙๕" as "มาตรา ๕๕". On pages it was never trained on, v1 reads all 8 nines right (OpenThai: 1).
- Nothing else drifts. Accuracy on three hand-typed reference pages goes from 94.44 % to 94.85 %; synthetic Thai pages in four scan conditions stay within 0.07 points; three letterpress gazettes read every year right.
- A drop-in replacement. Same network, input size and character list as OpenThai's
rec.onnx. - Open weights for further training.
pytorch/model.safetensorsloads in transformers. - In HippoCraft th27.10 and later, checked on a 450-page decree book on a Windows PC.
- The story behind it: news on dojojin.tech (Thai).
﹒Known limits
- Trained and measured on one typewritten source. Other typewriters, other scanners and other print may not gain, though the letterpress gazettes above did not lose.
- On one letterpress page a row of tone marks detached from its line reads as stray figures: the original model read it the same way but scored it just under HippoCraft's speck filter (79.4 against 80); this model scores 87.
- Printed text only, like the original: handwriting and scene text are out of scope.
﹒Files
| File | What it is |
|---|---|
hippocraft-thai-rec-v1.onnx | The recognizer (ONNX, opset 17), what HippoCraft loads |
rec_dict.txt | The character list, unchanged from OpenThai |
pytorch/model.safetensors, pytorch/config.json | The same weights for further training (transformers PPOCRV6TinyRecForTextRecognition, 530 classes) |
LICENSE, NOTICE | Apache-2.0, and the notices of OpenThai and PaddlePaddle with what was changed |
SHA256SUMS | Checksums of the files |
README_th.md | This card in Thai |
images/ | The HippoCraft icon and the figure above |
﹒Use
- Input
x: float32[n, 3, 48, w], one text line scaled to 48 pixels tall, dark text on white, each channel normalized as(v − 0.5) / 0.5withvin 0–1. - Output
probs: float32[n, t, 530], a probability per step and class. Decode with CTC (greedy: take each step's best class, merge repeats, drop blanks). Class 0 is the blank, classes 1–528 are the lines ofrec_dict.txtin order, and class 529 is a space.
Text detection is not included: use OpenThai's det.onnx (PP-OCRv6-tiny detection) or any line detector.
﹒How it was made
- Start: OpenThai v2.2.0
pytorch/rec_weights.pt. Its PyTorch form was checked againstrec.onnxon 916 recognition steps: the same best class at every step, probabilities within 0.00001. - Data: text lines from public Royal Gazette scans (royal decrees of 1953–1977, typewritten), cut as HippoCraft cuts them. 198 crops of figures were labelled without the model: the decree's year from the document's bookmarks, and section numbers from their running order (มาตรา ๑, ๒, ๓ …). A Thai reader checked every crop holding ๙ or ๕; all were right. The scans and crops are not distributed.
- Keeping the rest: each step, 32 real lines from the same scans without ๕ or ๙ were read by the original model and the fine-tune was held to its readings (KL divergence, weight 40), so letters and other figures read as before.
- Settings: head and last backbone stage only, 400 steps, AdamW, learning rate 3e-5, batches of 16 crops (half holding a ๙), light augmentation (width ±15 %, thicker ink, ±2 px shift, noise). About two minutes on an Apple laptop GPU.
- What was hard: ten rounds; round 8 is this model. The model is confidently wrong, so its own readings cannot be the labels. One round fixed ๙ but turned ๘ into ๗ on letterpress gazettes (๒๔๘๘ → ๒๔๗๘), caught only by testing documents from another source. Training the last layer alone turned ๕ into ๙ instead.
- Held out: three decrees with hand-typed reference text (pages 1, 180 and 420 of the set) and two more decrees were never trained on.
﹒Evaluation
Read through HippoCraft's full OCR pipeline (detection, line handling, filters), not on crops alone.
| Test | OpenThai v2.2.0 | This model |
|---|---|---|
| 3 hand-typed reference pages (1,923 characters), accuracy | 94.44 % | 94.85 % |
| ๙ read as ๙ on those pages (8 in the text) | 1 | 8 |
| ๕ read where the text has ๙ | 7 | 0 |
| Synthetic Thai test pages, 4 scan conditions (clean 200 dpi, 150 dpi, JPEG, 2° skew), character error | — | within 0.07 points of the original |
| Three letterpress Royal Gazette decrees (1933, 1938, 1945), changes against a reader's transcription | — | 4 better, 3 worse; every year read right |
﹒Licence and thanks
Apache-2.0. Copyright iApp Technology (OpenThai); PP-OCRv6 © PaddlePaddle Authors; modifications © 2026
DOJOJIN.TECH. See NOTICE for what was changed. OpenThai and iApp did not make or review this version.
Thank you to iApp Technology / OpenThai for the original Thai OCR model and for publishing its weights for further training, to PaddlePaddle for PP-OCRv6, and to Hugging Face for hosting it. The HippoCraft icon is DOJOJIN.TECH's own.