A Multi-Implicit Neural Representation for Fonts

Pradyumna Reddy, Zhifei Zhang, Zhaowen Wang, Matthew Fisher, Hailin Jin, Niloy J. Mitra

TL;DR

This paper introduces multi-implicits, a novel neural representation for fonts that models complex shapes as a composition of multiple learned implicit functions. By using a permutation-invariant median operator to fuse these functions, the method successfully preserves sharp edges and corners—features typically lost in standard raster or single-implicit neural representations—enabling high-fidelity font reconstruction, interpolation, and synthesis.

The Challenge of Representing Fonts

Fonts are traditionally stored as vector graphics (splines), which are resolution-independent but difficult for deep learning models to process because they lack a fixed-grid structure and canonical form. Alternatively, fonts can be rasterized into images, but this leads to aliasing and loss of detail when upscaling.

Recent "implicit" neural representations (like Signed Distance Fields or SDFs) offer a continuous alternative, but a single implicit function often struggles to represent sharp features. Like a blunt pencil trying to draw a needle-point, standard neural SDFs tend to "round off" corners. The challenge is to create a representation that is both deep-learning-friendly and capable of maintaining the crisp, geometric precision essential to typography.

Multi-Implicit Composition

The authors propose representing a font glyph as a set of $n$ (specifically $n=3$) global implicit functions. The key innovation is how these are combined:

  1. Composition via Median: Instead of one complex function, the model learns three simpler ones. These are fused using a median function, which is permutation-invariant (the order of the functions doesn't matter) and naturally allows for sharp intersections.
  2. Differentiable Rasterization: To train the model using only standard font images (raster data), the authors developed a differentiable rasterizer. This allows gradients to flow from the final rendered image back to the implicit functions.
  3. Local Corner Supervision: Since there's no "ground truth" for how to split a font into three channels, the authors use corner templates. They detect corners in the input and supervise the local neighborhood to ensure it's represented as an intersection of curves.
  4. Training Warm-up: They use a "shrinking" anti-aliasing range. Initially, the model sees a very blurry version of the font to help it find the general shape, and then the "focus" is gradually sharpened to capture fine details.
Comparison of sampling methods on sharp corners.

Key Insights

  • Composition over Complexity: A single neural network has a "spectral bias" toward smooth functions. By representing a corner as the intersection of two smooth curves (via the min, max, or median operators), the model can produce perfectly sharp features without needing infinite network capacity.
  • The Power of the Median: Using the median of three channels is a clever trick. It provides a "majority vote" for whether a pixel is inside or outside the font, making the representation robust and easier to train than simple boolean intersections.
  • Local Supervision for Global Consistency: You don't need a perfect multi-channel dataset to train a multi-channel model. By applying specific "corner losses" only where corners actually exist, the model learns to naturally decompose the rest of the shape.

Results and Performance

The researchers evaluated their method on two primary datasets: a reconstruction/interpolation dataset of 12,505 font images, and a generation dataset of 1,000 font families (52,000 images).

The multi-implicit representation consistently outperformed state-of-the-art baselines like DeepSVG, Im2Vec, and Attr2Font:

  • High-Fidelity Reconstruction: In terms of soft Intersection-over-Union (s-IoU), the proposed method achieved 0.9049 at 1024x1024 resolution, significantly higher than ImageVAE (0.8494) and Im2Vec (0.7294).
  • Sharpness: Qualitative results show that while other methods produce "mushy" or rounded corners, multi-implicits maintain geometric crispness.
  • Glyph Completion: The model can take a single character (e.g., an 'A') in a new style and successfully synthesize the entire rest of the alphabet in that same style, preserving both global shape and local sharp features.
Multi-implicit representation preserves sharp corners compared to standard image-based VAEs.

Limitations and Future Work

While highly effective for fonts, the paper notes some areas for further exploration. The current work is specialized for 2D shapes, making the extension to 3D manifolds with sharp features (like CAD models) a logical next step. Additionally, the choice of $n=3$ channels is empirical; more complex shapes might benefit from more channels, though this increases computational overhead. Future work may involve applying this representation to other 2D vector domains, such as icons, logos, and animations.

Summary updated

BibTeX
@inproceedings{reddy2021multi,
  author = {Pradyumna Reddy and Zhifei Zhang and Zhaowen Wang and Matthew Fisher and Hailin Jin and Niloy J. Mitra},
  title = {{A Multi-Implicit Neural Representation for Fonts}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=5lEF9XhqoAn},
}
Figure