Content and style disentanglement is an effective way to achieve few-shot font generation. It allows to transfer the style of the font image in a source domain to the style defined with a few reference images in a target domain. However, the content feature extracted using a representative font might not be optimal. In light of this, we propose a content fusion module (CFM) to project the content feature into a linear space defined by the content features of basis fonts, which can take the variation of content features caused by different fonts into consideration. Our method also allows to optimize the style representation vector of reference images through a lightweight iterative style-vector refinement (ISR) strategy. Moreover, we treat the 1D projection of a character image as a probability distribution and leverage the distance between two distributions as the reconstruction loss (namely projected character loss, PCL). Compared to L2 or L1 reconstruction loss, the distribution distance pays more attention to the global shape of characters. We have evaluated our method on a dataset of 300 fonts with 6.5k characters each. Experimental results verify that our method outperforms existing state-of-the-art few-shot font generation methods by a large margin. The source code can be found at https://github.com/wangchi95/CF-Font.
翻译:内容和样式分离是实现少样本字体生成的有效方法。它允许将源域字体图像的样式转移至通过少量参考图像定义的目标域样式。但是,使用代表性字体提取的内容特征可能并不是最优的。为此,我们提出了内容融合模块(CFM),将内容特征投影到由基础字体的内容特征定义的线性空间中,考虑不同字体造成的内容特征变化。我们的方法还通过轻量级迭代样式向量细化(ISR)策略优化参考图像的样式表示向量。此外,我们将字符图像的一维投影视为概率分布,并利用两个分布之间的距离作为重构损失(即投影字符损失 [PCL]),与 L2 或 L1 重构损失相比,分布距离更注重字符的全局形状。我们在包含300种字体,每种字体6500个字符的数据集上评估了方法。实验结果验证了我们的方法在少样本字体生成方面远远优于现有的最先进方法。源代码可以在 https://github.com/wangchi95/CF-Font 找到。