Visual Text Generation in the Wild

Yuanzhi Zhu, Jiawei Liu, Feiyu Gao, Wenyu Liu, Xinggang Wang, Peng Wang, Fei Huang, Cong Yao, Zhibo Yang

Abstract

Generating realistic images with legible, contextually appropriate text remains a significant challenge for modern diffusion models. While these models excel at artistic styles, they often struggle with "visual text generation"—producing gibberish, placing text in nonsensical locations, or failing to render small-scale characters. This paper introduces SceneVTG, a two-stage framework designed to bridge the fidelity, reasonability, and utility gaps in synthetic scene text data.

Introduction

The demand for high-quality synthetic data for Optical Character Recognition (OCR) is growing, yet existing methods fall short. Traditional rendering-based methods like SynthText provide perfect labels but lack photo-realism. Conversely, modern diffusion-based methods like AnyText produce high-fidelity images but often ignore layout constraints or struggle with small text. SceneVTG addresses these issues by treating text placement as a semantic reasoning task and rendering as a local refinement task.

The SceneVTG Framework

SceneVTG adopts a novel "Reason-then-Render" paradigm to ensure that generated text is both visually realistic and contextually logical.

1. Text Region and Content Generator (TRCG)

The "brain" of the operation is the TRCG, a fine-tuned Multimodal Large Language Model (MLLM). Given a background image, the TRCG identifies a reasonable "key point" for text and suggests contextually relevant content (e.g., suggesting "Bakery" for a storefront). It then generates precise bounding boxes, including curved Bezier boxes, based on character count and scene geometry.

SceneVTG ensures text reasonability by placing contextually appropriate content like 'SALE' in a shopping mall environment.

2. Local Visual Text Renderer (LVTR)

To avoid the "latent bottleneck" of global diffusion models, the LVTR operates on cropped local regions. This allows for high-quality rendering of text at arbitrary scales, including tiny characters that global models typically blur. The LVTR is conditioned on the background patch, a line mask, and embedding-level features from a pre-trained OCR recognizer to ensure character precision. Auxiliary losses are employed to ensure text pixels blend seamlessly without altering the surrounding environment.

SceneVTG generates high-fidelity text that blends seamlessly with the background, even for small and curved characters.

Experimental Results

The researchers evaluated SceneVTG across three critical dimensions: fidelity, reasonability, and utility. Using new datasets like SceneVTG-Erase (155k image pairs) and SceneVTG-benchmark, the model demonstrated superior performance:

  • Fidelity: SceneVTG achieved a FID of 26.28, significantly outperforming previous methods like TextDiffuser-2 (FID 88.02) in end-to-end inference.
  • Reasonability: Human-like evaluations (using IoU and CLIPScore) confirmed that SceneVTG’s text placement is far more logical than random placement methods used in traditional synthetic generators.
  • Utility: When used to train an EAST detector, synthetic data from SceneVTG yielded an F-score of 75.36 on IC13, nearly matching the performance of models trained on real-world data (76.34) and far exceeding other synthetic generators.

Conclusion

SceneVTG represents a significant step forward in visual text generation. By combining the reasoning power of MLLMs with the precision of local conditional diffusion, it produces synthetic data that is not only visually stunning but also highly effective for training downstream OCR models. Future work will focus on expanding language support and improving attribute control over fonts and colors.

Summary updated

BibTeX
@inproceedings{zhu2024visual,
  author = {Yuanzhi Zhu and Jiawei Liu and Feiyu Gao and Wenyu Liu and Xinggang Wang and Peng Wang and Fei Huang and Cong Yao and Zhibo Yang},
  title = {{Visual Text Generation in the Wild}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-73668-1\_6},
}
Figure