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。