Rethinking and Improving the Robustness of Image Style Transfer

Pei Wang, Yijun Li, Nuno Vasconcelos

Introduction

Neural Style Transfer (NST) has been a cornerstone of computer vision since the seminal work of Gatys et al. in 2015. However, the field has remained largely dependent on the aging VGG-19 architecture. While modern architectures like ResNet and Inception have revolutionized tasks such as image classification, they perform surprisingly poorly in style transfer, often producing noisy or insufficiently stylized results. This "VGG dependency" is so pronounced that a VGG network with random weights can outperform a pre-trained ResNet in capturing artistic style.

Comparison of style transfer quality across VGG and ResNet architectures using pre-trained (p-) and random (r-) weights. Note the failure of ResNet models to capture the style effectively compared to VGG.

The Problem: Residual Connections and Activation Entropy

Through extensive ablation studies, researchers identified residual (skip) connections as the primary architectural feature hindering style transfer performance. In residual networks, activations tend to grow across layers. To maintain stability, the network generates large negative residuals to counteract large positive ones, resulting in "peaky," low-entropy activation maps.

In these maps, a few channels dominate while many others are zeroed out. Because standard style loss (the L2 distance between Gram matrices) is highly sensitive to outliers, the optimization process fixates on matching these few dominant peaks. Consequently, the model ignores the subtle textures, strokes, and nuances that constitute a complete artistic style, leading to the observed "un-stylized" appearance in modern architectures.

Proposed Solution: SWAG

To resolve this without altering the underlying architecture—which would compromise the model's utility for other tasks—the authors propose SWAG (Stylization With Activation smoothinG).

SWAG introduces a simple softmax transformation applied to feature maps specifically during the loss calculation. This transformation acts as a smoothing function that suppresses extreme activation peaks and boosts smaller values, effectively restoring a more uniform, high-entropy distribution. Crucially, this modification is only used to compute the Gram matrix for the style loss and is not integrated into the network's forward pass during inference.

Key Results and Insights

Experimental results demonstrate that SWAG successfully "rescues" stylization across diverse modern architectures, including ResNet, WideResNet, and Inception-v3.

  • User Preference: In a large-scale study on Amazon Mechanical Turk, SWAG-enhanced ResNets were preferred over standard ResNets by a significant margin (83% vs. 17%).
  • Surpassing VGG: Pre-trained modern models using SWAG actually outperformed the traditional VGG-19 gold standard in user preference tests.
  • Structure over Weights: The success of SWAG even with random weights reinforces the theory that the structural properties of a network (and the resulting activation entropy) are more critical for style transfer than the specific learned weights.

Conclusion and Future Work

By identifying and mitigating the negative impact of residual connections on style loss optimization, SWAG breaks the long-standing VGG dependency in NST. This work paves the way for utilizing more efficient, mobile-friendly architectures like MobileNet or ShuffleNet for high-quality style transfer. Future research may further explore the optimization challenges inherent in complex branching structures like Inception-v3, where SWAG showed more modest improvements compared to its performance on ResNet.

Summary updated

BibTeX
@inproceedings{wang2021rethinking,
  author = {Pei Wang and Yijun Li and Nuno Vasconcelos},
  title = {{Rethinking and Improving the Robustness of Image Style Transfer}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.00019},
}
Figure