Manuscript Offprint

arXiv:2608.28248

Synth-JDoc: Synthesizing a Japanese Document Image Dataset for OCR with Diverse Layouts and Embedded Images

Keito Sasagawa, Shuhei Kurita, Daisuke Kawahara

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Keito Sasagawa 1,3^{1,3}, Shuhei Kurita 2,3^{2,3}, and Daisuke Kawahara 1,3^{1,3}

1^{1} Waseda University, Tokyo, Japan

{kate@fuji.,dkw@}waseda.jp

2^{2} NII, Tokyo, Japan

skurita@nii.ac.jp

3^{3} NII LLMC, Tokyo, Japan

Abstract. The ability of Large Vision Language Models (LVLMs) to read text within document images is crucial, as it enables various applications such as Document Visual Question Answering. To enhance the text-reading capabilities of LVLMs, high-quality OCR datasets are essential. This need is particularly critical for Japanese documents, which often feature vertically written text alongside horizontally written text. Current LVLMs demonstrate considerably lower performance on vertically written Japanese text than on horizontally written text, necessitating specialized OCR datasets to bridge this gap. However, manually constructing OCR datasets is expensive and difficult to scale. Alternatively, constructing datasets by extracting text from existing document images using OCR models introduces challenges, such as text recognition errors and the prerequisite of sourcing document images.

To address these issues, we construct an OCR dataset by synthesizing document images directly from text. Leveraging HTML and CSS, we generate multi-column documents that incorporate both vertical and horizontal writing styles. Furthermore, to ensure the visual realism of the documents, we embed images generated by text-to-image models within the layout. Additionally, to foster model robustness, we apply noise and degradation filters to the synthesized document images. In our experiments, we compared the performance of models fine-tuned on our synthetic dataset against baselines fine-tuned on synthetic datasets from prior work and those generated by a high-performance text-to-image model. Evaluation results demonstrate that our synthetic dataset is the most effective approach for improving LVLM performance on reading vertically written Japanese text. Our dataset and code are publicly available (https://github.com/llm-jp/synth-jdoc).

Keywords: Synthetic Dataset · OCR · LVLM.

1 Introduction

Large Vision Language Models (LVLMs), which can process both images and text to understand visual content and perform visual question answering, have

K. Sasagawa et al.

Figure

Fig. 1. Examples of document images from the Synth-JDoc dataset. The documents feature horizontally or vertically written text in 1- to 4-column layouts, with occasional image insertions. Noise is applied to a subset of the images to enhance model robustness. (Left: Horizontally written, single-column layout with an inserted image. Center: Vertically written, two-column layout without images. Right: Vertically written, three-column layout with inserted images.)

rapidly advanced in recent years [16, 5, 1, 24, 4]. One of the critical downstream tasks for LVLMs is Document Visual Question Answering [14, 22, 13, 21, 15], where the model answers questions based on document images. Performing this task requires comprehending the document's content, which inherently necessitates the ability to read the text within the image. To enhance this capability, OCR datasets for training LVLMs are essential. In particular, alongside horizontally written text, there are also Japanese documents written vertically. In vertically written Japanese documents, characters are read from top to bottom, and lines are read from right to left. Additionally, in multi-column layouts, the reading order progresses sequentially from the uppermost column to the lowest. Because few OCR datasets focus on vertically written Japanese, models currently exhibit relatively low proficiency in reading vertically written text [18]. Therefore, constructing a Japanese document image OCR dataset that includes vertically written text is crucial.

Common approaches for constructing OCR datasets include manual annotation; however, this method incurs prohibitive costs and is difficult to scale. Another approach involves extracting text from document images using existing OCR models, but this method suffers from OCR errors and the prerequisite burden of collecting document images. Synthesizing document images from given text can address these issues, but previous document image synthesis methods fail to support the complex layouts of Japanese documents, such as those containing vertically written text and inserted images.

To tackle these limitations, we propose a novel Japanese document image synthesis method and construct the Synth-JDoc dataset. First, we prepare the text to be rendered within the document images and segment it into paragraphs. For selected paragraphs, we generate corresponding images using a text-to-image model, and subsequently generate captions for these synthesized images using an LVLM. Additionally, an appropriate title is generated from the prepared text using a Large Language Model (LLM). Using these elements, we synthesize document images featuring vertically or horizontally written, multi-column layouts via HTML and CSS. Furthermore, we apply noise to a portion of the images to enhance model robustness.

In our experiments, we validated the effectiveness of the constructed Synth-JDoc using a real-world Japanese document OCR dataset that features vertically written text. We compared the performance of models fine-tuned on Synth-JDoc against several baseline settings. The baselines included the original models without fine-tuning, models fine-tuned on datasets from prior research, and models fine-tuned on synthetic document image datasets generated by a high-performance text-to-image model. The evaluation results demonstrate that training on Synth-JDoc most effectively improves OCR capabilities on Japanese document images.

The dataset and the code used for our experiments are publicly available 4^{4}.

References (20)