Skip to content
AI.info

Research

How Far Can Synthetic Data Take Thai OCR?

Overview Research area: Natural Language Processing / Optical Character Recognition (OCR) for Thai, with a focus on synthetic training data generation and vision–language model adaptation. Technical l

How Far Can Synthetic Data Take Thai OCR?
arXiv
2609.03595
Published
2026-09-03
Authors
Kunat Pipatanakul

AI summary

Overview

  • Research area: Natural Language Processing / Optical Character Recognition (OCR) for Thai, with a focus on synthetic training data generation and vision–language model adaptation.
  • Technical level: Intermediate. The paper assumes familiarity with OCR metrics (character error rate), OCR system architectures (page-level versus crop-level pipelines), and vision–language model fine-tuning, but the core experimental logic is presented without heavy mathematics in the main text.
  • Scope: A controlled study of which synthetic-data properties transfer to real Thai documents, followed by a 0.9B-parameter Thai OCR model trained using only synthetic supervision.

What This Paper Is About

Thai documents are abundant but reliably labeled Thai OCR data is scarce, and Thai's glyph system means OCR models cannot simply transfer from English or Chinese. The paper asks how far synthetic data alone can go by reconstructing real document pages: erasing the original text pixels and re-rendering OCR labels into the same regions, while independently varying source domain, non-text page context, typeface diversity, two-dimensional layout, and handwriting glyph source. The goal is to identify which of these factors actually drive transfer to real Thai documents, then use that recipe to train a Thai OCR model without any real Thai OCR labels.

Key Contributions

  1. A controllable document-reconstruction pipeline. The pipeline replaces source text in place while independently controlling source domain, non-text page context, typeface diversity, two-dimensional layout, and handwriting glyph source. It uses HarfBuzz shaping and fit-constrained type sizing, rejecting pages whose labels overflow at the minimum acceptable type size.

  2. Controlled evidence about synthetic-to-real transfer. Page- and crop-level experiments identify typeface diversity, two-dimensional spatial structure, real handwriting glyph variation, and the interaction between source domain and training granularity as the key determinants of transfer.

  3. A synthetic-supervision Thai OCR model. Wayu-Paxa-OCR-Zero adapts the 0.9B-parameter PaddleOCR-VL-1.6 using 45,723 synthetic pages generated entirely from public English sources, with no real Thai document page as a source image and no OCR label from a real Thai document in training.

  4. A benchmark comparison showing competitiveness. The model reduces median character error rate on all five evaluation sets relative to its base checkpoint and outperforms the 7B Typhoon OCR model on all five, despite using 0.9B parameters.

Main Findings

  • Non-text page context barely matters. Removing backgrounds, figures, rules, and scan artifacts changes median CER by at most 1.62 points across the three evaluation datasets and both training settings.

  • Typeface diversity matters most for handwriting. Removing font diversity increases median CER by 6.70 and 9.48 points under page-level training and by 11.36 and 13.37 points under crop-level training on the two handwriting sets, while the increase on printed Heldout is only 0.56 and 2.15 points.

  • Two-dimensional layout helps. Flattening regions into a vertical stack degrades handwriting further in both settings; under crop-level training it raises the Heldout median from 7.01 to 9.60, while the page-level median stays near 5.07.

  • In-domain reconstruction helps page-level training but reverses under crop-level training. On Heldout, In-Domain Synthetic reaches 1.82% median CER versus 5.07% for Out-of-Domain Synthetic under page-level training, but 15.59% versus 5.52% under crop-level training. The paper states the cause of this reversal remains unclear and warrants further study.

  • Reconstruction approaches real supervision on typical printed pages but not on severe errors. In-Domain Synthetic at 1.82% median CER is only 0.51 points above Real Thai (Print) at 1.31% on Heldout, but the gap widens under mean CER (16.20% versus 9.79%).

  • Printed reconstruction recovers most handwriting transfer from printed supervision, but not as much as real handwriting. In-Domain Synthetic and Real Thai (Print) are nearly identical on Handwriting (36.27% versus 36.14% median CER), yet adding Real Thai (Handwriting) drops median CER to 26.05% on Handwriting and 20.79% on Easy Handwriting.

  • Real handwriting glyphs beat handwriting typefaces. Under page-level training, handwriting typefaces lower Handwriting median CER from 43.99 to 38.65 and Easy Handwriting from 38.90 to 34.84; real glyph instances go further, to 37.91 and 30.66. Under crop-level training, real glyphs reach 39.97 and 35.66, versus 49.15 and 48.26 for the baseline.

  • Wayu-Paxa-OCR-Zero substantially improves its base checkpoint. Median CER falls from 6.64% to 1.24% on Heldout, from 74.87% to 20.55% on Handwriting, and from 73.74% to 14.18% on Easy Handwriting. On ThaiOCRBench the median drops from 38.0 to 15.3, and on the SEA-DocBench 1,148-page clean Thai subset from 8.87 to 4.86.

  • Synthetic-only training is competitive but not uniformly best. Wayu-Paxa-OCR-Zero (0.9B) beats Typhoon OCR (7B) on all five benchmarks, nearly matches Typhoon OCR 1.5 (2B) on Handwriting (20.55% versus 19.36% median CER), and beats it on SEA-DocBench (4.86% versus 5.81%), but trails it on Heldout, Easy Handwriting, and ThaiOCRBench. Gemini 3.7 Flash remains strongest on the three internal sets and ThaiOCRBench.

  • A measured font profile is used to sample typefaces. From 8,000 randomly sampled public Thai PDF pages, the profile contains 693 observed family names, with the ten most frequent accounting for 80.9% of Thai characters; Cordia New (18.6%), Angsana New (15.3%), TH Sarabun PSK (14.7%), and TH Sarabun New (14.2%) lead.

Methodology in Plain English

The researchers start from documents that already exist and already have annotated text regions. Instead of creating pages from scratch, they erase the original text pixels and paint new text into the exact same regions. This "reconstruction" approach lets them hold some things fixed (region geometry, reading order, document element categories) while turning one dial at a time.

For Thai source documents, the new text is the original OCR label, producing "In-Domain Synthetic." For English sources (DocLayNet, Crello, PubTabNet), most labels are translated into Thai, producing "Out-of-Domain Synthetic"; 7.61% of pages keep English labels, approximating the English proportion in the real Thai print collection. Text is shaped with HarfBuzz and the type size is shrunk until the whole label fits, otherwise the page is rejected. Typefaces are sampled from a character-weighted distribution measured from 8,000 public Thai PDF pages, or a single font is forced for ablation. For handwriting, characters are drawn from a bank of 5,953 real glyph instances across 76 character classes, built from the iApp Handwriting Dataset and the Real Thai (Handwriting) training split through detection (5,698,871 candidate boxes), alignment and filtering (534,404 retained), and vision–language verification (12,090 confirmed).

Ablations vary non-text context (original background versus white), font diversity (full distribution versus one typeface), layout (original two-dimensional arrangement versus vertical stacking), and glyph source (handwriting typefaces versus real glyph strokes). Each variant is trained with Qwen3-VL-2B-Instruct under two regimes: page-level (whole page in, full page JSON out) and crop-level (one region in, OCR label out, with PP-DocLayoutV3 supplying regions at inference). Everything is evaluated using a "projected CER" procedure that aligns predictions onto the evaluated reference regions before measuring Levenshtein distance, so that differences in output contract are not charged as recognition errors. Models train for one epoch with AdamW at a learning rate of 3 × 10⁻⁵ and a cosine schedule.

The final system extends the synthetic recipe with 45,723 pages: 39,534 base synthetic pages (including 7,131 handwriting pages that also appear with real glyph instances), 3,999 handwriting-focused pages, and 2,190 reconstructed filled forms. Training covers all 0.9B parameters for one epoch at a learning rate of 3 × 10⁻⁵ with a warmup ratio of 0.03 and effective batch size of 16.

Why This Matters

Impact on research. The paper isolates synthetic-data design choices that prior work varied together, showing that "realism" is not a single property. It also documents a counterintuitive result — that the better synthetic source depends on whether training is page-level or crop-level — which reframes how synthetic OCR datasets should be evaluated. For languages with abundant documents but few labels, this is a practical template.

Real-world applications:

  • Digitizing Thai government documents, forms, scans, and reports at low cost using local models rather than proprietary APIs.
  • Building search and retrieval-augmented generation pipelines over Thai document collections where OCR errors corrupt downstream indexing.
  • Processing filled forms through the reconstructed form templates, which the authors match to real Thai form widget counts.
  • Handwriting transcription of photographed Thai study notebooks, where the model cuts median CER from 74.87% to 20.55% over its base checkpoint.

Industry relevance. The model uses 0.9B parameters and outperforms a 7B system on all five evaluation sets, which matters for on-device or privacy-sensitive deployments where sensitive documents cannot be sent to a hosted service. It also shows that synthetic-only pipelines can be a viable path when licensing or privacy constraints limit access to real labeled document pages, since no real Thai document image enters training as a source page.

Future Directions

  1. Scaling the handwriting glyph bank. The bank contains only 5,953 instances across 76 character classes; the paper explicitly leaves the effect of a larger glyph bank for future study, and real handwriting supervision still reaches 26.05% median CER on Handwriting versus 37.91% for real glyph instances.

  2. Explaining the page-versus-crop reversal. In-domain reconstruction wins under page-level training (1.82% versus 5.07% on Heldout) but loses under crop-level training (15.59% versus 5.52%); the paper states the cause remains unclear.

  3. Closing the remaining gap on severe errors and handwriting. Mean CER stays above median CER on every benchmark for Wayu-Paxa-OCR-Zero, and synthetic supervision still trails real supervision on the character-weighted aggregate.

  4. Broadening document coverage. The authors call for broader coverage of document layouts, typography, and handwriting variation, and hope the work encourages synthetic OCR research for other languages with limited document annotations.

Target Audience

Researchers and engineers working on OCR, document understanding, and vision–language models for low-resource languages will benefit most, particularly those building Thai or Southeast Asian document pipelines. It is also valuable for practitioners who need to decide whether to invest in labeling real pages or in a synthetic generation pipeline, and for teams evaluating small open models against larger proprietary or open alternatives. The controlled ablation design makes the paper useful to anyone designing synthetic data experiments more broadly, not only for Thai.

Authors’ abstract

We investigate what makes synthetic OCR supervision transfer to real Thai documents and use the resulting insights to build Wayu-Paxa-OCR-Zero, a Thai OCR model adapted without OCR labels from real Thai document pages. Synthetic data provide exact labels at scale, but "realism" conflates source domain, page context, typography, spatial structure, and glyph variation. We disentangle these factors with a controlled document-reconstruction pipeline and evaluate each variant under page- and crop-level training on printed and handwritten Thai documents. Non-text context has little consistent effect, whereas typeface diversity, two-dimensional structure, and real handwriting glyphs improve transfer; moreover, source-domain matching depends on training granularity, with in-domain reconstruction approaching real printed supervision under page-level training (1.82% versus 1.31% median character error rate) but underperforming out-of-domain reconstruction under crop-level training (15.59% versus 5.52%). Guided by these findings, we adapt the 0.9B-parameter PaddleOCR-VL-1.6 into Wayu-Paxa-OCR-Zero using 45,723 synthetic pages: relative to its base checkpoint, it reduces median character error rate from 6.64% to 1.24% on printed pages and from 74.87% to 20.55% on handwriting and outperforms Typhoon OCR v1 7B on all five evaluation sets, showing that synthetic-only training can be competitive.

Read the original paper