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种字体的数据集上评估了我们的方法,每种字体包含6.5k个字符。实验结果验证了我们的方法大大优于现有最先进的少样本字体生成方法。源代码可以在https://github.com/wangchi95/CF-Font找到。