Few shot font generation via transferring similarity guided global style and quantization local style

Wei Pan, Anna Zhu, Xinyu Zhou, Brian Kenji Iwana, Shilin Li

Introduction

Automatic Few-Shot Font Generation (AFFG) aims to create a complete font library from a limited set of reference characters. This is particularly valuable for scripts like Chinese, which contain thousands of unique glyphs. Traditional methods often struggle between capturing global stylistic consistency and fine-grained local details. Moreover, many existing "component-based" models require labor-intensive manual labeling of radicals or strokes. This paper presents VQ-Font, a novel architecture that eliminates manual labeling by combining similarity-guided global style aggregation with self-learned local style quantization.

Methodology

The core of VQ-Font is a hybrid architecture designed to capture style at multiple scales without human intervention.

Overview of the VQ-Font architecture, featuring the Local Style Aggregator (LSA), Global Style Aggregator (GSA), and the multi-task discriminator.

Self-Learned Local Components

Instead of relying on predefined radicals, the model utilizes a Vector Quantization-based Variational Autoencoder (VQ-VAE). During a pre-training phase, the VQ-VAE learns a discrete "codebook" of latent features. These features represent recurring visual patterns—essentially "emergent components"—discovered automatically from the data.

Style Aggregation

The model employs two distinct pathways for style transfer:

  1. Local Style Aggregator (LSA): Using a cross-attention mechanism, the LSA treats the self-learned components as "queries" and the reference font images as "keys" and "values." This allows the model to map specific stylistic nuances from the references onto the structural building blocks of the target character.
  2. Global Style Aggregator (GSA): To ensure overall consistency (e.g., stroke thickness, character size), the GSA calculates content similarity between the target and reference characters. It weights global style features based on this similarity, ensuring the model "borrows" style from structurally relevant references.

Key Insights

  • Emergent Structural Knowledge: The VQ-VAE successfully identifies fundamental strokes (e.g., horizontal vs. vertical) without explicit supervision. This makes the model highly adaptable to different languages and complex scripts.
  • Similarity-Guided Transfer: By weighting references based on content similarity, the model avoids "style pollution," where irrelevant structural features from a reference might otherwise distort the target character.
  • Inference Efficiency: Style representations are independent of the target content and can be pre-computed, significantly speeding up the generation of large font sets.

Results and Evaluation

VQ-Font was evaluated against state-of-the-art (SOTA) models like MX-Font and FS-Font on Chinese and Japanese datasets.

Quantitative performance metrics (SSIM, RMSE, LPIP, FID) as a function of the number of reference images.

Quantitative Performance

On the challenging "Unseen Font Unseen Character" (UFUC) test set, VQ-Font achieved an SSIM of 0.566 and an FID of 110.1, outperforming all baseline models. As shown in the performance analysis, the model's accuracy improves steadily as the number of reference characters increases, reaching a plateau around 8-12 references.

User Study and Cross-Lingual Generalization

In blind tests, human volunteers preferred VQ-Font's outputs over 50% of the time compared to competitors. Furthermore, the model demonstrated robust "zero-shot" cross-lingual capabilities, successfully transferring styles from Chinese references to Japanese and Korean characters.

Conclusion

VQ-Font represents a significant step forward in AFFG by removing the bottleneck of manual component labeling. By leveraging self-learned quantization for local details and similarity-guided aggregation for global style, it produces high-fidelity results across diverse scripts. While performance remains sensitive to extremely low-shot scenarios and highly decorative artistic fonts, the framework provides a scalable and efficient solution for automated font design.

Summary updated

BibTeX
@inproceedings{pan2023few,
  author = {Wei Pan and Anna Zhu and Xinyu Zhou and Brian Kenji Iwana and Shilin Li},
  title = {{Few shot font generation via transferring similarity guided global style and quantization local style}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
}
Figure