基于对比学习和田字格变换数据增强的小样本汉字字体生成方法
Few-Shot Chinese Font Generation Based on Contrastive Learning and Square-Block Transformation Data Augmentation
-
摘要: 现有小样本汉字字体生成模型难以通过少量参考汉字有效实现字体风格与内容解耦,导致字体生成效果欠佳.为解决该问题,提出一种基于对比学习和田字格变换数据增强的小样本汉字字体生成方法.利用对比学习思想,对输出图像分别进行风格对比和内容对比,更好地实现字体风格和内容的自适应解耦;为了进一步提高小样本字体生成性能,提出一种基于田字格变化的数据增强方式,通过对田字格区域的几何变换,嵌入字体的全局结构信息,提高字体的风格和内容解耦能力.所提方法的有效性在公开的汉字字体数据集进行多次实验得到验证.实验结果表明,与当前先进的小样本字体生成模型相比,所提方法在生成字体质量上有显著优势,并且FID,SSIM,PSNR,LPIPS等性能指标也均优于对比方法模型.特别地,所提方法嵌入现有小样本字体生成模型,仅使用较少训练数据集训练后,便可显著地提升现有小样本汉字字体生成模型性能.Abstract: Existing few-shot Chinese font generation models struggle to effectively decouple font style and content using a limited number of reference characters, leading to suboptimal font generation results. To address this issue, a novel few-shot Chinese font generation method based on contrastive learning and square-block transformation data augmentation is proposed. Utilizing the concept of contrastive learning, the output images undergo separat e style and content comparisons, achieving better adaptive decoupling of font style and content. To further improve the performance of few-shot font generation, a data augmentation method based on square-block transformations is introduced, embedding the global structural information of the fonts through geometric transformations of the square-block areas, thereby enhancing the ability to decouple font style and content. The effectiveness of the proposed method is validated through extensive experiments on public Chinese font datasets. Experimental results demonstrate that, compared to current state-of-the-art few-shot font generation models, the proposed method significantly improves the quality of generated fonts and outperforms comparative models in performance metrics such as FID, SSIM, PSNR, and LPIPS. Notably, the proposed method can be integrated into existing few-shot font generation models and, with only a small training dataset, can significantly enhance the performance of these models.
下载: