Deep Photo Style Transfer

Fujun Luan, Sylvain Paris, Eli Shechtman, Kavita Bala

Abstract

This paper introduces a deep-learning approach to photographic style transfer that handles a large variety of image content while faithfully transferring the reference style. Our approach builds upon the recent work on painterly transfer that separates style from the content of an image by considering different layers of a neural network. However, as is, this approach is not suitable for photorealistic style transfer. Even when both the input and reference images are photographs, the output still exhibits distortions reminiscent of a painting. Our contribution is to constrain the transformation from the input to the output to be locally affine in colorspace, and to express this constraint as a custom fully differentiable energy term. We show that this approach successfully suppresses distortion and yields satisfying photorealistic style transfers in a broad variety of scenarios, including transfer of the time of day, weather, season, and artistic edits.

Introduction

Since the introduction of Neural Style Transfer (NST) by Gatys et al. in 2015, algorithms have excelled at transforming photographs into artistic renditions of famous paintings. However, applying these techniques to photographic style transfer—such as changing a daytime cityscape into a "blue hour" scene—has remained a significant challenge.

Complex architectural scenes like this church interior present significant challenges for traditional style transfer methods due to intricate geometry and lighting.

Standard NST algorithms typically suffer from two primary failures when applied to photos:

  1. Spatial Distortions: The network often introduces "painterly" textures, making straight architectural lines appear wiggly or textures wavy, which destroys the photorealistic illusion.
  2. Content Spillovers: Global statistics often lead to semantic errors, where the style of the sky might bleed into a building, or the texture of vegetation is incorrectly applied to man-made structures.

Methodology

The proposed method addresses these issues by augmenting the standard NST framework with two critical innovations designed to preserve the structural integrity of the input image.

Photorealism Regularization

To prevent spatial distortions, the authors introduce a penalty term based on the Matting Laplacian. This constraint forces the transformation from input to output to be locally affine in color space. By requiring that the output maintains the local color relationships of the input, the algorithm ensures that edges and fine structures are preserved while the overall color palette is shifted to match the reference style.

Augmented Style Loss with Semantic Segmentation

To eliminate content spillovers, the framework incorporates semantic masks generated via DilatedNet. Instead of a global style loss, the algorithm computes loss per semantic category. For example, the style of the "sky" in the reference image is exclusively applied to the "sky" in the input image. This ensures that the transfer respects the semantic logic of the scene, preventing nonsensical color bleeding between unrelated objects.

Key Results

The effectiveness of this approach is demonstrated through qualitative comparisons and rigorous user studies. The authors identified a "sweet spot" for the photorealism weight ($\\lambda = 10^4$) that balances style faithfulness with structural preservation.

Comparison of standard Neural Style (NS) transfer versus the proposed method (Ours). The insets highlight how the photorealism constraint prevents the 'painterly' distortions seen in the baseline.

In user studies, the proposed method significantly outperformed existing neural approaches in photorealism. Furthermore, users selected the results of this method as the most faithful style match over 80% of the time when compared to simpler global histogram transfer methods. The model successfully handles dramatic environmental shifts, including changes in time of day, weather conditions, and artistic color grading, while maintaining sharp edges and natural textures.

Limitations and Conclusion

While highly effective, the algorithm does have limitations. It can fail when there is an extreme semantic mismatch between the input and reference images. Additionally, the quality of the output is dependent on the accuracy of the semantic segmentation masks. Finally, the optimization-based nature of the process is computationally intensive, requiring several minutes per image on high-end hardware.

In conclusion, Deep Photo Style Transfer represents a major step forward in neural image processing. By constraining neural transformations to be locally affine and semantically aware, the authors have bridged the gap between artistic style transfer and photorealistic image editing.

Summary updated

BibTeX
@inproceedings{luan2017deep,
  author = {Fujun Luan and Sylvain Paris and Eli Shechtman and Kavita Bala},
  title = {{Deep Photo Style Transfer}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2017},
  url = {https://openreview.net/forum?id=BJZCFkM_Wr},
}
Figure