Arbitrary Style Transfer With Deep Feature Reshuffle

Shuyang Gu, Congliang Chen, Jing Liao, Lu Yuan

Introduction

Neural Style Transfer (NST) has revolutionized how we synthesize artistic imagery, yet it remains a balancing act between capturing global artistic "vibe" and preserving local structural integrity. This paper introduces Deep Feature Reshuffle, a novel technique designed to bridge the gap between global statistical matching and local patch-based methods. By spatially rearranging (reshuffling) style features to align with content while enforcing uniform patch usage, the authors achieve high-quality, semantically aware results that avoid common pitfalls like texture distortion and "wash-out" artifacts.

The Challenge of Neural Style Transfer

Historically, NST research has been divided into two primary approaches:

  1. Parametric Methods: These match global statistics, such as Gram matrices. While effective at capturing overall color and mood, they often distort local textures—for instance, turning a distinct brushstroke into a blurry smudge—and struggle with semantic alignment (e.g., failing to map a style's eye to a content's eye).
  2. Non-Parametric Methods: These utilize patch-matching to find the best local fit. However, they are prone to "wash-out" artifacts because the algorithm may greedily select the same few "perfect" style patches repeatedly, ignoring the diversity of the original style image.

The authors propose a "best of both worlds" solution that maintains global statistical consistency while respecting local semantic structures.

Methodology: The Reshuffle Loss

The core innovation of this work is the Reshuffle Loss. The authors provide a theoretical proof that if you simply permute (reshuffle) the spatial locations of a style feature map, the resulting Gram matrix remains identical to the original. This implies that reshuffling is a mathematical way to satisfy global parametric constraints while preserving the integrity of local patches.

Key Components

  • Constrained Nearest Neighbor (NNC): Unlike standard patch matching, NNC introduces a penalty for over-using specific style patches. This forces the model to utilize the entire distribution of the style image, effectively preventing the wash-out effect.
  • Feature-Domain Optimization: Rather than optimizing pixels directly—which is computationally expensive and prone to local minima—the authors optimize the feature maps themselves using an iterative Expectation-Maximization (EM) like algorithm.
  • Multi-layer Progressive Optimization: The process begins at a coarse layer (VGG layer 4) to establish global structure and progressively refines the result down to finer layers (layer 2).
  • Level-wise Decoder: A symmetrical VGG-19 decoder was trained on the ImageNet dataset to reconstruct the final image. Unlike previous "universal" decoders, this training strategy allows a single network to handle features from various depths.

Key Insights and Ideas

The most profound insight is that a spatial bijection (reshuffling) of features serves as the theoretical bridge between parametric and non-parametric style transfer. It satisfies the global Gram matrix constraint by definition while allowing for local patch integrity.

Semantic Awareness and Uniformity

By treating style transfer as a "resource allocation" problem—where every part of the style image is a resource to be used—the method avoids repetitive, blurry artifacts. Furthermore, because the reshuffling is guided by the content image's features, the model naturally maps "eye-like" style features to "eye-like" content regions, achieving a level of semantic coherence that global statistics cannot reach.

Semantically aware style transfer on a portrait.

Experimental Evaluation

Qualitative and Quantitative Results

The method preserves local patterns (such as the specific geometry of a house) significantly better than the baseline Gatys et al. method, while maintaining a richer style than previous patch-based approaches. In a perceptual user study involving 150 image groups, the proposed method achieved the best average rank of 2.88, outperforming Gatys et al. (3.08) and Li & Wand (4.2).

Qualitative comparison of style transfer results on a house image.

Efficiency

For a 512x512 image, the method takes approximately 114 seconds. While not as fast as real-time feed-forward networks, it is significantly faster than the original Gatys optimization (370s) and offers the flexibility to handle arbitrary styles that feed-forward models cannot.

Limitations and Future Work

Despite its strengths, the method is sensitive to the "soft" constraint parameter ($\lambda$) that controls patch usage. If $\lambda$ is too strict, the model may force "bad" style patches into regions where they do not fit, damaging the content structure. Additionally, failure cases can occur when the style image's composition is drastically different from the content (e.g., a style with one eye mapping to a content image with two). Future research will focus on automatically determining the optimal $\lambda$ for different image pairs.

Summary updated

BibTeX
@inproceedings{gu2018arbitrary,
  author = {Shuyang Gu and Congliang Chen and Jing Liao and Lu Yuan},
  title = {{Arbitrary Style Transfer With Deep Feature Reshuffle}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2018},
  doi = {10.1109/cvpr.2018.00858},
}
Figure