ThakiOCR-KOENJA-G2M-v1: What Happened When We Taught a Korean-English Line OCR to Read Japanese
Once a small OCR model reads Korean and English documents well, PDFs from Japanese partners start arriving in the same queue. If they are born-digital documents such as Japanese government white papers or technical reports, it is tempting to handle all three languages with one line recognizer. This post is for OCR and model engineers weighing that kind of extension.
In the previous post we only measured what the extension would cost, without training anything. The conclusion was that widening the output head is not enough and the backbone also has to learn the shapes of Japanese characters. This time we trained that extension and released it as ThakiOCR-KOENJA-G2M-v1. It has 10,172,694 parameters, one output head covering 18,133 characters, and it runs on CPU.
The headline result is a single number. On 718 lines from Japan Meteorological Agency (JMA) PDFs that were never used for training, NFKC CER is 0.87%. A control run with the same start, the same steps and the same seed, minus only the new modern Japanese lines, reached 1.11%. We do not, however, claim that it beats PP-OCRv6. Below we go through what we trained, what improved and what the model still cannot do.
ThakiOCR-KOENJA-G2M-v1 reached 0.87% NFKC CER on 718 lines of JMA PDFs. It is a research preview, not a product release.
In plain terms
Let us keep the print-shop analogy from the previous post. The type case is the output character set, and the typesetter’s eye that reads the manuscript is the backbone. Last time we found that the type case held almost no Japanese type, and that even on manuscripts whose type was in the case, the typesetter often misread Japanese because the letter shapes were unfamiliar.
This time we did both things together. We added 3,883 pieces of Japanese type to the back of the case. And we trained the typesetter on Japanese manuscripts in several stages. In the final stage the typesetter read modern Japanese government documents, and we compared the result against a typesetter who went through the same training with those manuscripts swapped for synthetic ones.
The typesetter trained on modern documents read modern documents from an unfamiliar agency more accurately. But we never put full-width digit type into the case. So when a manuscript has full-width digits printed on it, the typesetter sets them in half-width type instead. The meaning is the same, but the form no longer matches the original.
We widened the type case to 18,133 characters and trained the backbone too
ThakiOCR-KOENJA-G2M-v1 is a line recognizer: it takes one cropped horizontal text line and returns one string. Training and decoding use CTC, which maps a whole line to a character sequence in one pass without aligning each character’s position. It does not find text on a page, so it has to be paired with a line detector or a layout model.
One horizontal line image in, one string out. Full-width digits come out as ASCII digits, and a full page gives unusable output.
The output head follows option A from the previous post, the shared-head extension. The 14,250 Korean and English characters of G2M-R3 stay in their original order, and 3,883 characters from the Japanese training labels are appended after them. Most of the new characters are kanji, with some kana and full-width punctuation. Existing rows were kept as they were and the new rows started suppressed, so R3’s 14,250 characters keep their indices. The 10,172,694 parameters we counted from real training-data characters in the previous post match the released model exactly.
The encoder is the same as G2M-R3. The input is a grayscale image resized to height 48. It passes through a convolutional stem (160 channels), is mean-pooled over height and projected to 320 dimensions. It then goes through six blocks of depthwise 1-D convolution (kernel 5) with a gated feed-forward, followed by LayerNorm. The head is a linear layer to 18,134 classes: the 18,133 characters plus one blank. Decoding is greedy CTC with no language model.
Training did not happen in one go. The lineage is shown below, and every stage’s weights were trained by ThakiCloud.
flowchart TB
P["G2M-Preview<br/>random init"] --> R2["G2M-R2"]
R2 --> R3["G2M-R3<br/>14,250 Korean/English chars"]
R3 --> H["Japanese head extension +3,883 chars<br/>13,000 steps"]
H --> N["+6,000 steps<br/>NDL historical Japanese lines"]
N --> S["Start checkpoint<br/>(not released)"]
S --> V1["+6,000 steps<br/>modern Japanese lines<br/>KOENJA-G2M-v1"]
S --> C["+6,000 steps<br/>synthetic Japanese instead<br/>control (not released)"]
This post focuses on the last stage: 6,000 more steps from the start checkpoint. Batch 128, AdamW (head 5e-4, backbone 1e-4, weight decay 0.02), 500 warmup steps, constant until step 1,000, then cosine decay. Seed 42, one B200 GPU. We kept the final step and did not pick a checkpoint on any evaluation. No data augmentation, no new loss, no quantization. The release run and the control run together used 0.51 GPU-hours.
The control differs only in 18% of the data mix
To isolate the effect, we ran a control alongside the release. The release and the control share the start checkpoint, step count and seed. Their training configuration is byte-identical, and the only difference is one entry in the data mix.
The release and the control share the start, steps, seed and the rest of the data. Only one 18% slot of the mix differs.
By positions drawn, the mix was: NVIDIA synthetic Japanese 18%, modern Japanese government lines 18%, NDL historical Japanese lines 18%, other real Japanese lines (NDL classical books, JSSODa) 6%, NVIDIA synthetic Korean 20% and NVIDIA synthetic English 20%. The control filled the modern 18% with NVIDIA synthetic Japanese. The 40% of Korean and English is replay, shown again to protect the existing abilities.
The new modern Japanese lines are 7,596 lines from 90 PDFs: 86 from the Ministry of Health, Labour and Welfare, 3 from the Ministry of Agriculture, Forestry and Fisheries and 1 from the Forestry Agency. Lines were cut from the PDF text layer and rendered at 200 dpi, and each line was seen about 18 times. Lines containing characters outside the fixed 18,133-character set were dropped rather than folded. Full-width digits, full-width Latin letters and some symbols fall into that group. As a result, every digit in the training text is an ASCII digit. That choice leads directly to the full-width digit limitation discussed below.
On PDFs from an unseen agency it was 0.24 pp below the control
The test set is 718 horizontal text lines from 40 PDFs published by the JMA: pamphlets, technical reviews, numerical-forecast explainers and disaster weather reports. The source was frozen before training and was never used for training, development or checkpoint choice in this model line. The training white papers came from other ministries, so the agency is different. The medium (born-digital PDF rendered at 200 dpi) and the era are the same.
Ground truth comes from the PDF text layer. A prediction-blind audit of 60 sampled lines found 2 defects, and those 2 lines were removed for every model before prediction. Even so, about 3% label noise probably remains.
Scoring uses CER, the total edit distance divided by the number of reference characters; lower is better. The main metric is computed after Unicode NFKC normalization and removal of all whitespace. NFKC treats characters that differ only in form, such as full-width and half-width, as the same character. Raw CER uses NFC instead of NFKC, so it counts full-width versus half-width differences as errors.
| Model | Description | CER (NFKC) | Raw CER (NFC) |
|---|---|---|---|
| ThakiOCR-KOENJA-G2M-v1 | this release | 0.87% | 3.28% |
| Control (not released) | same start, steps and seed, no modern Japanese lines | 1.11% | 5.09% |
| Start checkpoint (not released) | the checkpoint both runs continued from | 1.14% | 5.10% |
| PP-OCRv6 small rec (ONNX) | run by us | 0.81% | 3.02% |
| ThakiOCR-JA-v1 | our earlier Japanese VLM-based model | 1.46% | 4.75% |
NFKC CER on the 718 JMA lines. The release is below the control and the start checkpoint; its difference from PP-OCRv6 is not statistically significant.
Differences come with 95% confidence intervals from a paired bootstrap over documents (1,000 resamples).
| Paired difference (CER, NFKC) | Δ | 95% CI | Reading |
|---|---|---|---|
| this release − control | −0.24 pp | [−0.36, −0.10] | better (pre-registered primary test) |
| this release − start checkpoint | −0.27 pp | [−0.38, −0.15] | better |
| this release − PP-OCRv6 | +0.06 pp | [−0.17, +0.34] | no significant difference; equivalence not shown |
| this release − ThakiOCR-JA-v1 | −0.59 pp | [−1.53, +0.13] | no significant difference |
The primary test, fixed before training, is the difference between the release and the control. Its confidence interval does not include 0, so on this test set we judge that adding modern government lines made the model more accurate. Split by genre, the gain comes from the 641 general JMA lines (−0.21 pp, CI [−0.35, −0.08]). On the 77 disaster-report lines the difference was −0.55 pp, but the CI [−1.43, +0.08] includes 0.
We also looked at digits separately. Digit F1 on this set was 0.984, against 0.981 for the start checkpoint. On the 388 lines with no digits at all, the release invented digits on 0 lines. The start checkpoint and the control did so on 2 lines, and PP-OCRv6 on 1 line.
The comparison setup also deserves a caveat. Every model read the same stored 48-px grayscale line image, and that image is this model’s own preprocessing. PP-OCRv6 and ThakiOCR-JA-v1 normally see a larger color crop, so this setup may have put them at a disadvantage. The G2M models and PP-OCRv6 ran on CPU in fp32, and ThakiOCR-JA-v1 ran under vLLM on a GPU with greedy decoding. We ran every model once ourselves rather than copying numbers from other reports.
Raw CER dropped further because of full-width punctuation
The NFKC CER gap was 0.24 pp, but raw CER fell more sharply, from 5.09% to 3.28%. Most of that came from writing full-width punctuation and symbols in their printed form. After the verdict, we aligned predictions with the reference on the same 718 lines and counted by character type. These are descriptive numbers that were not used as a release gate.
| Character type | In reference | This release | Control | PP-OCRv6 |
|---|---|---|---|---|
| small っ | 64 | 64 | 64 | 59 (5 read as つ) |
| long-vowel mark ー | 150 | 149 | 135 | 145 |
| Latin O (not digit 0) | 51 | 46 | 44 | 51 |
| circled numbers ①… | 5 | 3 | 0 | 4 |
| full-width digits 0~9, exact form | 97 | 0 | 0 | 6 |
| symbols and punctuation, exact form | 1,492 | 1,123 | 834 | 1,213 |
Of the 1,492 symbols and punctuation marks in the reference, how many each model wrote in the exact printed form. The release writes 289 more than the control and fewer than PP-OCRv6.
Where the control got 135 long-vowel marks right, the release got 149. Circled numbers went from 0 to 3. After modern government lines were added to training, the model got more of these forms right. Since the per-type counts were taken after the verdict, we did not test the cause separately.
Full-width digits do not come out in their printed form
The row that stands out most in the table is full-width digits. The reference has 97 of them, and neither the release nor the control wrote a single one in its original form. The 18,133-character vocabulary has no full-width digits, so the model writes all 97 as ASCII digits.
After NFKC all 97 count as correct, which is why NFKC CER and digit F1 do not show the loss. But if a task needs the printed form, this model cannot provide it. Examples include exact-string search against the original text or reproducing the layout faithfully. And if you need to keep other full-width forms, do not apply NFKC to whole strings.
Korean, English and historical Japanese stayed within the preset limits
Learning a new language can disturb the existing ones. So we fixed retention limits before training and measured against them.
| Check | Set | This release | Limit | Reference |
|---|---|---|---|---|
| Historical Japanese | 1,125 lines from 90 NDL public-domain books held out of training | 14.80% | ≤ 16.14% | start checkpoint 15.14% |
| Historical digit F1 | same set | 0.711 | drop ≤ 0.02 vs start | start 0.687 |
| Korean | 5,000 NVIDIA synthetic Korean validation lines | 5.64% | ≤ 5.93% | G2M-R3 5.43% |
| English | 5,000 NVIDIA synthetic English validation lines | 4.49% | ≤ 5.14% | G2M-R3 4.64% |
All four checks are within their limits. The Korean and English limits are the G2M-R3 values plus 0.5 pp. Korean and English use the same definition as the R3 card (NFC, no-break space to space, whitespace kept). English improved slightly, from 4.64% to 4.49%.
Korean is a different story. It is 0.21 pp worse than G2M-R3. That is within the limit, but it is a real cost. Both sets are also synthetic, and real Korean documents were not re-measured for this release. On the historical set, PP-OCRv6 scored 17.43%.
What to know before using it
These are the limitations from the model card, carried over as they are.
- It does not beat PP-OCRv6. The difference on the 718 lines is not significant, and equivalence was not shown either.
- One seed. Run-to-run variance was not measured.
- Born-digital PDFs only. Training and test images are rendered PDFs. Scanned, photographed, handwritten or low-contrast text is untested.
- Narrow genre. The new Japanese training lines are government white papers, and the test set is the same era and medium from another agency. Each training line was seen about 18 times.
- Output depends on the batch. White padding at line ends is visible to the depthwise convolution. Running the 718 lines one at a time (
batch_size=1) changed 22 lines and gave 0.97% NFKC CER. Every number in this post comes from batched inference with 64 lines per batch. - No evidence on historical Japanese from new sources. An earlier external test on historical Japanese from sources outside the training archive did not show a reliable gain. The historical number above is a retention check on a held-out part of the same archive.
- Horizontal line input only. Vertical Japanese is out of scope. Lines wider than 2,048 px after resizing to height 48 are rejected. A page or a multi-line block produces unusable output.
- Do not automate critical fields. Keep a human review step for amounts, account or ID numbers, dates and contract terms.
The status is research preview. Production use is NO-GO, and this checkpoint will not be trained further.
In Paxis document workflows, verification sits after line OCR
When Paxis automates document work, OCR is the first step that fills in values. A 10.17M-parameter line OCR runs on CPU, so it is easy to keep inside a customer’s internal network. With this release, one model reads horizontal Korean, English and Japanese lines together. That means born-digital PDFs from overseas partners can be tried in the same flow without a separate model.
Still, as the limitations above show, this model is a research preview. Some characters such as full-width digits lose their form, output changes with batch composition, and critical fields need a human check. So in a Paxis flow, OCR output is not used directly; it is confirmed through a verification step. The Paxis verification post covers how that step is built.
Closing
The previous post concluded that widening the head is not enough and the backbone also has to learn Japanese. This time we released a model with an 18,133-character head and a retrained backbone. On 718 Japanese PDF lines from an unseen agency it reached 0.87% NFKC CER, 0.24 pp below a control that differs in only one entry of the data mix. Korean paid a 0.21 pp cost, we cannot say it beats PP-OCRv6, and full-width digits lose their printed form.
To try it yourself, run a few line images through inference.py from the model repository on CPU. When you check it on your own documents, look at NFKC CER and raw CER together. The gap between the two tells you how much full-width and half-width form you are losing.
pip install torch numpy pillow safetensors
python inference.py line.png # one or more line images
python inference.py --demo # renders an English line and reads it back
Sources and data
- Model: ThakiCloud/ThakiOCR-KOENJA-G2M-v1 (Apache-2.0, research preview, released 2026-11-23). Lineage: ThakiCloud/ThakiOCR-KOEN-G2M-R3.
- Training data: NVIDIA OCR-Synthetic-Multilingual-v1 Korean, English and Japanese training shards (CC BY 4.0), llm-jp/JSSODa (CC BY 4.0), National Diet Library (NDL) OCR datasets (Public Domain Mark), and white papers and reports published on the websites of the Ministry of Health, Labour and Welfare, the Ministry of Agriculture, Forestry and Fisheries and the Forestry Agency (Public Data License 1.0, PDL 1.0). ThakiCloud cut lines from those PDFs and rendered them as images; the publications themselves are not included.
- Earlier G2M stages used the training splits of AI Hub (AI-Hub) OCR data (public) (71299) and financial-domain document OCR data (632) under the AI Hub usage policy. AI Hub data is not redistributed, and neither the model repository nor this post contains any AI Hub data.
- The JMA test PDFs (気象庁, PDL 1.0) were used for evaluation only. Every number in this post is an aggregate from the model card.
- Previous posts: G2M multilingual extension pre-check · G2M-R3: real-document adaptation