[Paper Review] XMP-Font: Self-Supervised Cross-Modality Pre-training for Few-Shot Font Generation
XMP-Font proposes a self-supervised cross-modality pre-training framework using a transformer-based encoder conditioned on both glyph images and stroke labels to learn unified, multi-scale style representations for few-shot font generation. By pre-training the encoder without fine-tuning and leveraging stroke-level supervision, it achieves a 28% lower bad-case rate and a record 87.5% success rate on unseen font domains using only one reference glyph.
Generating a new font library is a very labor-intensive and time-consuming job for glyph-rich scripts. Few-shot font generation is thus required, as it requires only a few glyph references without fine-tuning during test. Existing methods follow the style-content disentanglement paradigm and expect novel fonts to be produced by combining the style codes of the reference glyphs and the content representations of the source. However, these few-shot font generation methods either fail to capture content-independent style representations, or employ localized component-wise style representations, which is insufficient to model many Chinese font styles that involve hyper-component features such as inter-component spacing and "connected-stroke". To resolve these drawbacks and make the style representations more reliable, we propose a self-supervised cross-modality pre-training strategy and a cross-modality transformer-based encoder that is conditioned jointly on the glyph image and the corresponding stroke labels. The cross-modality encoder is pre-trained in a self-supervised manner to allow effective capture of cross- and intra-modality correlations, which facilitates the content-style disentanglement and modeling style representations of all scales (stroke-level, component-level and character-level). The pre-trained encoder is then applied to the downstream font generation task without fine-tuning. Experimental comparisons of our method with state-of-the-art methods demonstrate our method successfully transfers styles of all scales. In addition, it only requires one reference glyph and achieves the lowest rate of bad cases in the few-shot font generation task 28% lower than the second best
Motivation & Objective
- To address the limitations of existing few-shot font generation methods that rely on component-wise or universal style representations, which fail to capture multi-scale style features like inter-component spacing and connected-stroke patterns.
- To improve style representation reliability by replacing component-level supervision with stroke-level supervision, which reduces the number of atomic units and enhances generalization to unseen components.
- To enable content-style disentanglement across multiple scales—stroke, component, and character—through a unified, cross-modality transformer encoder trained in a self-supervised manner.
- To eliminate the need for fine-tuning during inference by freezing the pre-trained encoder and directly transferring style representations to downstream font generation.
- To achieve high-fidelity, consistent font generation across diverse source fonts and unseen target styles using only a single reference glyph.
Proposed method
- A cross-modality transformer-based encoder is jointly conditioned on glyph images and corresponding stroke labels to learn cross- and intra-modality correlations across multiple scales.
- The encoder is pre-trained in a self-supervised manner using masked image modeling and masked stroke labeling to capture multi-scale style representations without human-annotated labels.
- The pre-trained encoder is frozen and used as a fixed feature extractor in the downstream font generation task, eliminating the need for fine-tuning.
- A decoupling network with ECA modules is used to separate content and style representations, enhancing disentanglement and preserving structural details.
- A stroke loss is introduced during training to enforce structural consistency and improve sensitivity to stroke order and morphology.
- The generator uses a feature map of size $8\times 8$ to balance fidelity and GPU memory constraints, with a down-sampling layer used in ablation studies to test smaller representations.
Experimental results
Research questions
- RQ1Can a self-supervised cross-modality pre-training strategy improve the reliability of multi-scale style representations in few-shot font generation?
- RQ2Does using stroke-level supervision instead of component-level supervision lead to better generalization to unseen components and styles in Chinese characters?
- RQ3Can a frozen, pre-trained encoder achieve superior few-shot font generation performance without fine-tuning on the downstream task?
- RQ4How effective is the proposed stroke loss in preserving structural details and improving disentanglement of content and style?
- RQ5What is the impact of architectural choices such as feature map size and the decoupling network on generation quality and structural fidelity?
Key findings
- XMP-Font achieves a record 87.5% success rate on unseen font domains in few-shot font generation, significantly outperforming prior methods.
- The method reduces the bad-case rate by 28% compared to the second-best method, demonstrating superior reliability and consistency.
- The ablation study confirms that removing the stroke loss leads to worse structural preservation and lower objective metrics, with FID increasing from 31.14 to 70.56 in the unseen scenario.
- Using a $4\times 4$ feature map instead of $8\times 8$ results in loss of fine-grained structure and style features, reflected in higher L1 and stroke loss and lower PSNR and SSIM.
- Removing the ECA-based decoupling network degrades content-style disentanglement, causing structural artifacts and incorrect style transfer, as shown in qualitative results and metric degradation.
- The pre-training strategy is essential: training the encoder from scratch (no pre-training) fails to converge, while fine-tuning the encoder during downstream training also underperforms the frozen pre-trained version.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.