作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2024, Vol. 50 ›› Issue (12): 306-317. doi: 10.19678/j.issn.1000-3428.0068380

• 图形图像处理 • 上一篇    下一篇

基于字形约束和注意力的艺术字体风格迁移

吕文锐1, 普园媛1,2,*(), 赵征鹏1, 张衡1, 阳秋霞1   

  1. 1. 云南大学信息学院, 云南 昆明 650504
    2. 云南省高校物联网技术及应用重点实验室, 云南 昆明 650504
  • 收稿日期:2023-09-12 出版日期:2024-12-15 发布日期:2024-03-20
  • 通讯作者: 普园媛
  • 基金资助:
    国家自然科学基金(61271361); 国家自然科学基金(61761046); 国家自然科学基金(62162068); 国家自然科学基金(62362070); 云南省科技厅应用基础研究计划重点项目(202001BB050043); 云南省科技重大专项(202302AF080006)

Artistic Font Style Transfer Based on Glyph Constraints and Attention

LÜ Wenrui1, PU Yuanyuan1,2,*(), ZHAO Zhengpeng1, ZHANG Heng1, YANG Qiuxia1   

  1. 1. School of Information, Yunnan University, Kunming 650504, Yunnan, China
    2. Yunnan Province Universities Key Laboratory of Internet of Things Technology and Application, Kunming 650504, Yunnan, China
  • Received:2023-09-12 Online:2024-12-15 Published:2024-03-20
  • Contact: PU Yuanyuan

摘要:

艺术字体的风格迁移是一项非常有趣但又十分具有挑战性的任务, 具体来说就是将目标字体的艺术风格通过某种映射方式迁移到源字体上。现有方法在字形风格迁移方面存在鲁棒性有限的不足, 且当2种不同风格的字形相差较大时不能很好地将风格内容迁移到目标字体上。针对以上问题, 提出一种端到端的通用网络框架模型, 并在模型中引入自注意力机制和自适应实例归一化, 用于实现在给定的多个文本效果域之间进行任意字体的艺术风格迁移。该模型主要包括1个生成器和2个鉴别器, 还有1个额外的风格编码器。为了更好地做到字形约束以及提升网络的性能, 设计几种损失函数来优化生成对抗网络(GAN)的训练。为了验证该模型的有效性, 采用了FET-GAN任务中公开的艺术字体数据集。实验对比了6种先进的方法, 并从定量和定性2个方面进行了比较。实验结果表明, 所提模型能够实现带有字体变换的字形图像风格迁移, 迁移结果能够保持很好的字形结构, 并且FID值为72.355, 低于对比实验中最好的结果91.435。

关键词: 字体风格迁移, 自注意力, 自适应实例归一化, 生成对抗网络, 字形约束

Abstract:

Art font style transfer is an intriguing yet challenging task that involves transferring the art style of a source font to a target font through mapping. This study aims to address the limitations of existing methods, particularly their limited robustness in font style migration and poor performance when there is a significant difference between the styles of the source and target fonts. To tackle these challenges, we proposed an end-to-end general network framework model incorporating a self-attention mechanism and adaptive instance normalization to realize artistic style transfer across multiple-text effect domains. The proposed model comprised a generator, two discriminators, and an additional style encoder. To better preserve the font structure and improve network performance, we designed several custom loss functions to optimize the training of a Generative Adversarial Network(GAN). The model was validated using a publicly available art font dataset for the FET-GAN task. In experiments comparing six state-of-the-art methods, the proposed method demonstrated superior performance both quantitatively and qualitatively. Extensive experimental results showed that the model effectively performs font image style migration while maintaining the glyph structure. The Fréchet Inception Distance(FID) of the proposed method is 72.355, which was notably lower than the best comparative result of 91.435, highlighting the method's effectiveness.

Key words: font style transfer, self-attention, adaptive instance normalization, Generative Adversarial Network(GAN), the glyph constraints