Beyond Isolated Words: Diffusion Brush for Handwritten Text-Line Generation

2508.03256v1 cs.CV 2025-08-09
Авторы:

Gang Dai, Yifan Zhang, Yutao Qin, Qiangya Guo, Shuangping Huang, Shuicheng Yan

Резюме на русском

Одной из основных задач обработки рукописного текста является генерация текстовых строк, которая требует учета не только отдельных слов, но и их взаимоотношений, включая горизонтальное выравнивание и вертикальное расстояние. Несмотря на это, большинство существующих подходов сосредоточены на изолированных словах. В статье предлагается DiffBrush — новая диффузионная модель, решающая эту проблему. DiffBrush использует два ключевых подхода: (1) **content-decoupled style learning**, разделяющий стиль и содержание с помощью маскирования по столбцам и строкам, и (2) **multi-scale content learning**, обеспечивающий локальную точность и глобальную гармонию текста. Эксперименты показали, что DiffBrush применимо для качественной генерации текстовых строк, выдавая результаты с высоким уровнем стилистической импровизации и точности содержания. Этот подход открывает новые возможности в области генерации рукописного текста. Доступен исходный код: https://github.com/dailenson/DiffBrush.

Abstract

Existing handwritten text generation methods primarily focus on isolated words. However, realistic handwritten text demands attention not only to individual words but also to the relationships between them, such as vertical alignment and horizontal spacing. Therefore, generating entire text lines emerges as a more promising and comprehensive task. However, this task poses significant challenges, including the accurate modeling of complex style patterns encompassing both intra- and inter-word relationships, and maintaining content accuracy across numerous characters. To address these challenges, we propose DiffBrush, a novel diffusion-based model for handwritten text-line generation. Unlike existing methods, DiffBrush excels in both style imitation and content accuracy through two key strategies: (1) content-decoupled style learning, which disentangles style from content to better capture intra-word and inter-word style patterns by using column- and row-wise masking; and (2) multi-scale content learning, which employs line and word discriminators to ensure global coherence and local accuracy of textual content. Extensive experiments show that DiffBrush excels in generating high-quality text lines, particularly in style reproduction and content preservation. Code is available at https://github.com/dailenson/DiffBrush.

Ссылки и действия