[论文解读] AnyText: Multilingual Visual Text Generation And Editing
AnyText 是一个基于扩散的多语言视觉文本生成与编辑框架,利用辅助潜在模块和 OCR 指导的文本嵌入模块在图像中呈现可辨识文本,并引入 AnyWord-3M 数据集与 AnyText 基准评估。
Diffusion model based Text-to-Image has achieved impressive achievements recently. Although current technology for synthesizing images is highly advanced and capable of generating images with high fidelity, it is still possible to give the show away when focusing on the text area in the generated image. To address this issue, we introduce AnyText, a diffusion-based multilingual visual text generation and editing model, that focuses on rendering accurate and coherent text in the image. AnyText comprises a diffusion pipeline with two primary elements: an auxiliary latent module and a text embedding module. The former uses inputs like text glyph, position, and masked image to generate latent features for text generation or editing. The latter employs an OCR model for encoding stroke data as embeddings, which blend with image caption embeddings from the tokenizer to generate texts that seamlessly integrate with the background. We employed text-control diffusion loss and text perceptual loss for training to further enhance writing accuracy. AnyText can write characters in multiple languages, to the best of our knowledge, this is the first work to address multilingual visual text generation. It is worth mentioning that AnyText can be plugged into existing diffusion models from the community for rendering or editing text accurately. After conducting extensive evaluation experiments, our method has outperformed all other approaches by a significant margin. Additionally, we contribute the first large-scale multilingual text images dataset, AnyWord-3M, containing 3 million image-text pairs with OCR annotations in multiple languages. Based on AnyWord-3M dataset, we propose AnyText-benchmark for the evaluation of visual text generation accuracy and quality. Our project will be open-sourced on https://github.com/tyxsspa/AnyText to improve and promote the development of text generation technology.
研究动机与目标
- 解决在跨多语言的扩散式图像生成中呈现清晰、准确文本的挑战。
- 提出一个扩散式流水线,包含辅助潜在模块和 OCR 指导的文本嵌入模块,以在匹配背景风格的同时对图像中的文本进行呈现与编辑。
- 引入大规模多语言文本-图像数据集 AnyWord-3M 与评估基准 AnyText-benchmark。
- 在文本准确性和图像真实感方面展示相对于现有方法的优势,适用于多语言文本生成。
提出的方法
- 提出一个文本控制扩散流水线,包含两个条件组件:一个辅助潜在模块和一个文本嵌入模块。
- 辅助潜在模块通过字形、位置和掩码图像区域的输入,将文本字形、位置和掩码信息编码成潜在特征图。
- 文本嵌入模块呈现字形,使用基于 OCR 的嵌入(PP-OCRv3)编码笔画信息,并通过变换器和跨注意力将其与字幕嵊接嵌入融合。
- 通过文本控制扩散损失和文本感知损失进行训练,以提高目标文本区域的书写准确性。
- 通过绑定一个 TextControlNet,使与现有扩散模型的即插即用兼容性得到实现,专注于文本生成,同时保留基础模型的能力。
- 提出 AnYWord-3M,一个 3.0M 图文多语言数据集,含 OCR 注释,以及 AnyText-benchmark,用于多语言视觉文本生成的标准化评估。
实验结果
研究问题
- RQ1扩散模型是否能够在指定位置和区域(包括弯曲/不规则区域)生成多语言的可辨识文本?
- RQ2在图像中进行文本编辑是否能够在不同语言之间保持一致的字体风格和对齐?
- RQ3引入基于 OCR 的字形嵌入和辅助潜在模块是否能提升多语言文本的准确性和视觉真实感?
- RQ4文本控制扩散损失和文本感知损失如何影响书写准确性及整体图像质量?
主要发现
- AnyText 在 AnyText-benchmark 的英语与中文文本生成方面,在 OCR 准确性(Sen. ACC、NED)与真实感(FID)上均优于竞争方法。
- v1.1 模型实现英语 Sen. ACC 0.7239、中文 Sen. ACC 0.6923,并在 NED 与 FID 上相比先前方法有提升。
- v1.0 模型已超越若干基线,显示生成文本与背景(如石刻、板牌)之间的强整合能力。
- 所提的 OCR 指引文本嵌入与辅助潜在模块支持多行、变形区域及多语言文本的生成与编辑(包括非拉丁字符)。
- 大型数据集 AnyWord-3M(3.0M 图文对并含 OCR 注释)用于训练,AnyText-benchmark 提供多语言视觉文本生成的标准化评估。
- 消融研究表明,基于 OCR 的文本嵌入、显式位置条件以及文本感知损失分别有助于提升中英文文本生成的准确性。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。