Multi-style Generative Network for Real-Time Transfer

Hang Zhang, Kristin J. Dana · DOI

Abstract

The Multi-style Generative Network (MSG-Net) introduces a novel "CoMatch Layer" to achieve high-quality, real-time style transfer for multiple styles within a single feed-forward network. By matching second-order feature statistics (Gram Matrices) instead of simple 1D embeddings, MSG-Net captures complex textures more effectively and offers unprecedented real-time control over artistic parameters like brush stroke size.

The Challenge of Real-Time Style Transfer

Early style transfer relied on iterative optimization, which produced beautiful results but was too slow for real-time use. Subsequent "feed-forward" networks solved the speed issue but faced three major hurdles:

  1. Quality vs. Flexibility: Most fast networks were limited to a single style. Those that attempted "multi-style" transfer often used 1D style embeddings (adjusting only the mean and variance of features), which failed to capture the complex textures and correlations found in artistic styles.
  2. Visual Artifacts: Standard upsampling techniques (like fractionally-strided convolutions) often created "checkerboard" artifacts in the final image.
  3. Lack of Control: Generative models lacked the ability to adjust artistic parameters, such as brush stroke size, on the fly.
Visual artifacts and texture loss often associated with simple 1D feature matching (Mean & Var).

Methods: The MSG-Net Architecture

The authors propose a new architecture called MSG-Net, characterized by three key technical innovations:

  • The CoMatch Layer: This is the heart of the paper. Instead of a simple 1D style representation, this layer learns to match the second-order feature statistics (the Gram Matrix) of the target style image with the content features. It essentially "warps" the content features to match the distribution of the style features in a differentiable, end-to-end manner.
  • Siamese Architecture: The network uses a Siamese-style encoder. One branch processes the style image to extract its "DNA" (Gram Matrices), while the other processes the content image. These are fused via the CoMatch layers.
  • Upsampled Convolution: To eliminate checkerboard artifacts, the authors avoid standard deconvolution. Instead, they use an "upsampled convolution" strategy—applying an integer stride convolution that outputs an upsampled feature map—which maintains computational efficiency while improving visual smoothness.
  • Upsampling Residual Blocks: They adapted the popular Bottleneck Residual Block into an upsampling version, allowing the network to go deeper and converge faster without losing style versatility.

Key Insights and Results

2D Representation vs. 1D Embeddings

The "aha moment" of the research is that 1D embeddings (mean/variance) are fundamentally too restrictive to represent complex art. By using a 2D representation (matching the Gram Matrix directly in the layer), the network captures the relationships between different features, leading to much richer textures.

Resolution and Brush Size Control

The authors realized that by resizing the style image at runtime, the relative size of the features (and thus the brush strokes) changes. Because MSG-Net matches statistics dynamically, it naturally inherits this control—a first for purely feed-forward networks.

MSG-Net demonstrates high-quality results across a diverse range of content and artistic styles within a single model.

Performance Metrics

  • Speed: MSG-Net-100 runs at over 90 FPS on an NVIDIA Titan Xp for $256 \times 256$ images and ~29 FPS for $512 \times 512$ images.
  • Model Size: The compact version (MSG-Net-100) is only 9.6MB with 2.3M parameters, making it suitable for mobile applications.
  • Scalability: The model scales remarkably well. Moving from 100 styles to 1,000 styles (MSG-Net-1K) showed no obvious degradation in image quality, though it required a larger model (40.3MB).

Conclusion

MSG-Net represents a significant leap in real-time style transfer by bridging the gap between the speed of feed-forward networks and the quality of optimization-based methods. While currently optimized for up to 1,000 styles, the CoMatch layer's ability to match second-order statistics suggests potential applications in other domain-transfer tasks, such as photo-realistic synthesis or weather-condition transfer for autonomous driving simulations.

Summary updated

BibTeX
@inproceedings{zhang2018multi,
  author = {Hang Zhang and Kristin J. Dana},
  title = {{Multi-style Generative Network for Real-Time Transfer}},
  booktitle = {Workshops @ ECCV},
  year = {2018},
  doi = {10.1007/978-3-030-11018-5\_32},
}
Figure