Generating accurate glyphs for visual text rendering is essential yet challenging. Existing methods typically enhance text rendering by training on a large amount of high-quality scene text images, but the limited coverage of glyph variations and excessive stylization often compromise glyph accuracy, especially for complex or out-of-domain characters. Some methods leverage reinforcement learning to alleviate this issue, yet their reward models usually depend on text recognition systems that are insensitive to fine-grained glyph errors, so images with incorrect glyphs may still receive high rewards. Inspired by Direct Preference Optimization (DPO), we propose GlyphPrinter, a preference-based text rendering method that eliminates reliance on explicit reward models. However, the standard DPO objective only models overall preference between two samples, which is insufficient for visual text rendering where glyph errors typically occur in localized regions. To address this issue, we construct the GlyphCorrector dataset with region-level glyph preference annotations and propose Region-Grouped DPO (R-GDPO), a region-based objective that optimizes inter- and intra-sample preferences over annotated regions, substantially enhancing glyph accuracy. Furthermore, we introduce Regional Reward Guidance, an inference strategy that samples from an optimal distribution with controllable glyph accuracy. Extensive experiments demonstrate that the proposed GlyphPrinter outperforms existing methods in glyph accuracy while maintaining a favorable balance between stylization and precision.
翻译:生成精确的字形以实现视觉文本渲染至关重要且具有挑战性。现有方法通常通过在海量高质量场景文本图像上进行训练来增强文本渲染效果,但字形变体的有限覆盖和过度风格化往往会损害字形准确性,尤其对于复杂或领域外字符。部分方法利用强化学习缓解此问题,但其奖励模型通常依赖于对细粒度字形错误不敏感的文本识别系统,因此包含错误字形的图像仍可能获得高奖励。受直接偏好优化(DPO)启发,我们提出GlyphPrinter——一种基于偏好的文本渲染方法,该方法消除了对显式奖励模型的依赖。然而,标准DPPO目标仅建模两个样本间的整体偏好,这对于字形错误通常出现在局部区域的视觉文本渲染而言并不充分。为解决此问题,我们构建了具有区域级字形偏好标注的GlyphCorrector数据集,并提出区域分组DPO(R-GDPO)——一种基于区域的目标函数,通过优化标注区域内的样本间与样本内偏好,显著提升字形准确性。此外,我们引入区域奖励引导策略,这是一种从具有可控字形准确性的最优分布中进行采样的推理策略。大量实验表明,所提出的GlyphPrinter在字形准确性上优于现有方法,同时在风格化与精确度之间保持良好平衡。