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