Source-linked AI summary

How Far Can Synthetic Data Take Thai OCR?

Kunat Pipatanakul

arXiv:2609.03595v1cs.CLcs.AIcs.CV

TL;DR

Thai OCR lacks reliable real-document labels, and it is unclear which aspects of synthetic document realism enable transfer. The paper disentangles source domain, context, typography, layout, and glyph variation through controlled reconstruction experiments, then uses the findings to train Wayu-Paxa-OCR-Zero. Synthetic-only training produces competitive Thai OCR, while transfer depends on typography, spatial structure, handwriting variation, and training granularity.

  • Problem

    Thai has limited reliable OCR labels, while prior synthetic OCR studies confound source domain, page context, typography, spatial structure, and glyph variation.

  • Method

    The paper controls reconstruction properties and compares page-level and crop-level transfer before training Wayu-Paxa-OCR-Zero on synthetic supervision only.

  • Results

    Synthetic reconstruction yields competitive Thai OCR: Wayu-Paxa-OCR-Zero outperforms Typhoon OCR 7B on all five benchmarks, while transfer improves with typeface diversity, two-dimensional structure, and real handwriting glyphs.

  • Takeaways & Limitations

    Synthetic data can produce competitive Thai OCR without page-level OCR labels from real Thai documents, but source-domain value depends on training granularity.

  • Takeaways & Limitations

    Synthetic supervision still trails real supervision on severe failures and handwriting, and broader layout, typography, and handwriting coverage remains needed for generalization.

Abstract

from arXiv · show

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.

1 Introduction

Thai OCR lacks reliable labels, and existing synthetic approaches do not isolate which document properties drive transfer. This paper answers that question through controlled reconstruction experiments and uses the findings to train a synthetic-supervision Thai OCR model.

  • Motivation: Thai documents have limited reliable labels, while English- and Chinese-centered resources do not transfer directly because Thai uses a distinct glyph system.PDF extraction and OCR pseudo-labels can also omit characters, reorder combining marks, and corrupt reading order.
  • Research gap: Prior synthetic OCR studies vary layout, context, fonts, and other factors together, leaving their contributions to transfer unclear.The paper also identifies training granularity as important because page-level and crop-level systems expose different document context.
  • Approach: The study varies source domain, non-text context, typeface distribution, two-dimensional layout, and handwriting glyph source in controlled reconstructions.It compares page-level and crop-level training on printed and handwritten Thai documents, including reconstruction against real Thai supervision.
  • Contributions: The paper introduces a controllable reconstruction pipeline that independently manipulates source domain, page context, typography, spatial structure, and handwriting glyph source.These controls support direct evidence about which properties affect synthetic-to-real transfer.
  • Contributions: Wayu-Paxa-OCR-Zero is a synthetic-supervision Thai OCR model trained from 45,723 pages and outperforms Typhoon OCR 7B on all five evaluation sets.The model substantially improves its base checkpoint while using synthetic data generated from reconstructed documents.

2 Synthetic OCR from Reconstructed Documents

The reconstruction pipeline replaces source text in existing documents while preserving selected document structure and independently controlling context, layout, typography, and glyph rendering. These controls create Thai OCR supervision from both Thai and non-Thai sources for transfer experiments.

  • Source and labels: Thai and non-Thai source documents provide OCR labels for in-domain and out-of-domain reconstruction, respectively.Non-Thai labels can be translated into Thai or retained in English before rendering.
  • Reconstruction pipeline: The pipeline erases or inpaints source text, fits the OCR label to its original region, and renders it with sampled typefaces or real handwriting glyphs.It controls source domain, layout, background, non-text context, typeface distribution, and glyph source.
  • Page context: Page context is controlled by retaining source background and non-text pixels or replacing them with white while keeping text regions fixed.This isolates the effect of non-text page context from the text-region supervision.
  • Spatial structure: Layout is controlled by preserving the original two-dimensional arrangement or stacking text regions vertically.The same text regions can therefore be rendered with or without their original spatial structure.
  • Text fitting: Thai labels are shaped with HarfBuzz, and type size is reduced until the complete region-level label fits the original region.Pages are rejected when labels still overflow at the minimum acceptable size.
  • Typography and glyphs: Typeface rendering samples each shaped label from a specified distribution, while real-glyph rendering samples supported Thai characters independently from handwriting banks.Real-glyph rendering permits repeated characters to use different strokes while preserving labels, annotations, ink height, and ink color.

3 What Makes Synthetic Data Transfer to Real Thai Documents?

Controlled experiments show that typography diversity, two-dimensional layout, and real handwriting glyphs drive synthetic-to-real transfer more consistently than non-text context. Source-domain matching helps page-level training but reverses under crop-level training, while reconstruction approaches real supervision for printed Thai yet leaves a handwriting-variation gap.

  • Source-document properties: Non-text context has little consistent effect, while font diversity and two-dimensional layout progressively improve transfer to handwriting.Removing non-text context changes median CER by at most 1.62 points; removing font diversity and flattening layout degrade handwriting in both training settings.
  • Source-domain matching: 1.82% versus 5.07% median CER shows that in-domain reconstruction beats out-of-domain reconstruction under page-level training on Heldout pages.The page-level comparison also improves Handwriting median CER from 43.99% to 36.27%.
  • Source-domain matching: 15.59% versus 5.52% median CER shows that in-domain reconstruction underperforms out-of-domain reconstruction under crop-level training on Heldout pages.The same reversal appears on Handwriting and Easy Handwriting, so the preferred source domain depends on training granularity.
  • Synthetic versus real supervision: In-domain reconstruction approaches real printed supervision, with 1.82% median CER versus 1.31% for Real Thai (Print) on Heldout pages.The gap is larger under mean CER, where In-Domain Synthetic reaches 16.20% versus 9.79% for real supervision.
  • Synthetic versus real supervision: Printed reconstruction does not capture real handwriting variation: Real Thai (Handwriting) reduces Handwriting median CER to 26.05% versus 36.27% for In-Domain Synthetic.Real glyph instances improve synthetic handwriting transfer beyond rendered handwriting typefaces, reaching 37.91% and 30.66% under page-level training and 39.97% and 35.66% under crop-level training.
  • Handwriting rendering: Handwriting typefaces improve both handwriting sets, and real glyph instances provide additional gains beyond typeface choice.Under page-level training, handwriting typefaces reduce median CER from 43.99% to 38.65% on Handwriting and from 38.90% to 34.84% on Easy Handwriting.

4 From Controlled Findings to Wayu-Paxa-OCR-Zero

The authors use controlled reconstruction findings to train Wayu-Paxa-OCR-Zero entirely on synthetic pages, then evaluate its gains and competitiveness against existing Thai OCR systems.

  • 45,723 generated pages support Wayu-Paxa-OCR-Zero, including handwriting-typeface and real-glyph renderings, handwriting-focused pages, pasted handwriting crops, and reconstructed forms.No OCR label from a real Thai document enters training.
  • Synthetic-only training improves the fixed 0.9B-parameter base checkpoint across five benchmarks, reducing median CER from 6.64% to 1.24% on Heldout and from 74.87% to 20.55% on Handwriting.The handwriting reductions indicate gains on typical pages, not only a few severe failures.
  • Wayu-Paxa-OCR-Zero outperforms the 7B Typhoon OCR model on all five benchmarks despite using 0.9B parameters.It nearly matches Typhoon OCR 1.5 on Handwriting and performs better on SEA-DocBench.
  • The comparisons establish competitiveness rather than intrinsic superiority of synthetic data because systems differ in scale, pretraining, and supervision.The evaluation also includes ThaiOCRBench and SEA-DocBench to test generalization beyond internal sets.
  • Synthetic reconstruction approaches real printed supervision under matched conditions but does not fully close the gap, while generalization remains dependent on coverage of layouts, typography, and handwriting variation.Transfer also depends on typeface diversity, two-dimensional structure, glyph variation, and training granularity.

5 Discussion, Limitations, and Conclusion

The paper concludes that synthetic reconstruction can yield competitive Thai OCR without real Thai page-level OCR labels, while transfer remains limited by handwriting and severe failures.

  • Synthetic reconstruction produces competitive Thai OCR without page-level OCR labels from real Thai documents.
  • Typeface diversity, two-dimensional structure, and real handwriting glyphs improve transfer, whereas non-text page context has little consistent effect.
  • Synthetic supervision still trails real supervision on severe failures and handwriting, and in-domain reconstruction depends on training granularity.
  • The authors encourage further research on synthetic OCR for Thai and other languages with limited document annotations.

Ethics Statement

The ethics statement describes privacy benefits and robustness risks of reconstructing synthetic OCR data from publicly available materials.

  • Replacing original text with generated content can reduce exposure of personal information, but synthetic-trained models may be less robust on unseen document types, typefaces, and handwriting styles.
  • Released artifacts should document their sources, intended uses, limitations, and privacy safeguards.

A Training and Inference Formats

The appendix contrasts page-level and crop-level training formats, their targets, and projected CER evaluation across document regions.

  • Page-level format: Page-level training uses a complete document page as input and predicts one JSON object containing the page layout and content.
  • Page-level format: The page-level target encodes blocks in reading order with normalized bounding boxes, categories, and formatted text.
  • Page-level format: A single page-level decode predicts geometry, categories, reading order, and text, so malformed output affects the complete page prediction.
  • Crop-level format: Crop-level training uses one annotated document region per example and predicts that region’s OCR label after preprocessing and category-specific prompting.
  • Crop-level format: Qwen3-VL retains HTML table targets, whereas PaddleOCR-VL converts tables to OTSL and removes spans that OTSL cannot represent faithfully.
  • Real Thai OCR Label Construction: Real Thai reference labels are produced by Azure OCR followed by VLM normalization, with separate training and evaluation normalization models.
  • Projected CER: Projected CER removes non-target page elements before scoring while retaining errors and missing regions within evaluated text-bearing regions.

D Handwriting Glyph Bank Construction

The handwriting glyph bank is built by detecting, aligning, verifying, and sampling character instances from Thai handwriting line images. It contains 5,953 instances across 76 character classes, with 96.3% coverage of Thai character instances in redrawn pages.

  • The bank combines line images from the iApp Handwriting Dataset and the Real Thai Handwriting training split, excluding the handwriting evaluation split.
  • Glyph detection produces 5.70M candidates with tight ink masks, vertical bands, and normalized line-text heights.
  • OCR-label alignment and filtering map candidates to characters while removing duplicate, spurious, and merged boxes, using classifier or OCR confirmation.
  • Vision–language verification confirms 12,090 retained instances before bank assembly.
  • The final bank contains 5,953 instances across 76 character classes, with at most 60 instances per class selected across writers.
  • Real-glyph rendering samples each supported character occurrence independently, covering 96.3% of Thai character instances while falling back to page-typeface rendering for absent characters.

E Source-Property Ablation Examples

The source-property examples hold Thai labels, region boxes, and reading order fixed while removing non-text context, font diversity, and two-dimensional layout one at a time.

  • All four synthetic panels use identical Thai OCR labels, region boxes, and reading order, so adjacent variants differ only in the removed property.
  • Out-of-Domain Synthetic preserves the English source layout and non-text pixels while replacing the English text with Thai.
  • White-layout removes non-text context while retaining every text region.
  • White-single-font renders every line in TH Sarabun New while preserving ink height, isolating font diversity.
  • Linear-white-single-font stacks regions vertically in reading order, removing the two-dimensional layout.

F Source-Domain Examples

The source-domain examples compare out-of-domain reconstruction, real Thai printed pages, and in-domain reconstruction of those same Thai pages.

  • In-Domain Synthetic reconstructs each Real Thai (Print) page beside its original while preserving non-target page elements.
  • Out-of-Domain Synthetic uses separate English source documents, whereas Real Thai (Print) retains each crawled Thai page with its original OCR labels.
  • All displayed examples have the same height and retain their source pages’ aspect ratios.

G Handwriting Rendering Examples

The handwriting examples compare printed-typeface rendering, handwriting-typeface rendering, and real-glyph rendering while holding Thai labels and region structure constant.

  • The real-glyph variant redraws 7,131 handwriting-typeface pages, while all other pages remain unchanged.
  • Across redrawn pages, 96.3% of Thai characters use glyph-bank instances and the remainder use typeface rendering.
  • The figure sequence compares out-of-domain synthetic pages, real Thai printed pages, and reconstructed center pages using matched page examples.
  • Real-glyph rendering introduces independent repeated-character variation in stroke weight, slant, proportion, and local deformation.
  • The handwriting-typeface variant repeats one outline for each character, while the real-glyph variant samples separate glyph instances.
Loading 2609.03595v1…