Instance Normalization: The Missing Ingredient for Fast Stylization

Dmitry Ulyanov, Andrea Vedaldi, Victor S. LempitskyarXiv 2016

TL;DR

This paper introduces a simple yet highly effective modification to fast neural style transfer: replacing batch normalization with instance normalization. This change dramatically improves the quality of stylized images, achieving results comparable to slower optimization-based methods while maintaining real-time performance.

What Problem Does This Paper Address?

Neural style transfer, a technique that allows users to render an image in the artistic style of another, has seen significant advancements. While early methods produced impressive results, they were computationally expensive, requiring minutes to stylize a single image. More recent "fast" methods, like those by Ulyanov et al. and Johnson et al., aimed to achieve real-time stylization by training feed-forward generator networks. However, these fast methods, while quick, often produced lower-quality stylized images compared to their slower counterparts, exhibiting artifacts and a loss of detail. This paper addresses the gap in quality for fast neural style transfer, seeking to achieve both speed and high fidelity.

Methods

The core contribution of this paper is the replacement of batch normalization (BN) layers with instance normalization (IN) layers within the generator networks used for fast style transfer.

  • Batch Normalization (BN): Standard in many deep learning architectures, BN normalizes the activations across the entire batch of images. This helps stabilize training by reducing internal covariate shift. However, the authors argue that for style transfer, BN might be too aggressive, removing instance-specific contrast information that is crucial for capturing the style of an image.
  • Instance Normalization (IN): IN, in contrast, normalizes the activations for each individual image and each channel independently. The paper proposes using IN in the generator network and, crucially, keeping it active during both training and testing (inference) phases. This is a departure from how BN is often handled, where it's sometimes frozen or simplified during testing.

The authors hypothesize that IN's instance-specific normalization helps the generator discard the content image's contrast information, allowing it to better learn and apply the style's texture. They applied this change to generator architectures previously proposed by Ulyanov et al. (2016) and Johnson et al. (2016).

Datasets

The paper does not explicitly mention specific datasets used for training or evaluation. However, it refers to the general approach of using content images and style images, implying that standard image datasets would be utilized for training the generator networks. The examples shown in the figures utilize common content images (portraits, cars) and artistic style images (paintings).

Key Insights and Ideas

  • Instance Normalization is Key for Style: The most significant insight is that instance normalization, by normalizing per-instance statistics, is crucial for effectively transferring style. It allows the network to focus on the stylistic features (texture, color palette) without being overly influenced by the content image's inherent contrast.
  • Contrast Invariance is Desirable: The paper highlights that the stylization process should ideally be invariant to the contrast of the content image. Instance normalization naturally achieves this, as it normalizes away instance-specific contrast.
  • IN for Training and Testing: Keeping instance normalization active during both training and testing is vital. This ensures that the learned stylistic features are consistently applied, unlike batch normalization which might be handled differently during inference.
  • Simplicity Yields Quality: A small architectural change (swapping BN for IN) leads to a substantial improvement in qualitative results, bridging the gap between fast and slow stylization methods.

Key Results

  • Qualitative Improvement: The primary result is a dramatic improvement in the visual quality of stylized images. The paper shows that the IN-based generators produce results that are qualitatively comparable to the slower, optimization-based methods of Gatys et al. (2016).
  • Real-Time Performance: The modified generators maintain the fast, single-pass inference capability, allowing for real-time image stylization on standard GPU hardware.
  • Architectural Agnosticism: The benefits of instance normalization were observed across different generator architectures (Ulyanov et al. and Johnson et al.), suggesting its general applicability to fast style transfer.
  • Artifact Reduction: The paper shows that the proposed method significantly reduces artifacts, particularly those observed at image borders in previous fast methods.

Limitations and Future Work

  • Limitations: The paper acknowledges that while the quality is comparable to optimization-based methods, it might not perfectly replicate every nuance. The specific details of the training datasets and hyperparameters are not exhaustively detailed, which could be a limitation for direct reproduction without referring to the cited works.
  • Future Work: The authors suggest that the success of instance normalization in improving image generation tasks is promising and that they are actively experimenting with similar ideas for image discrimination tasks. This hints at a broader applicability of IN beyond just style transfer.

Summary updated

BibTeX
@misc{ulyanov2016instance,
  author = {Dmitry Ulyanov and Andrea Vedaldi and Victor S. Lempitsky},
  title = {{Instance Normalization: The Missing Ingredient for Fast Stylization}},
  year = {2016},
  eprint = {1607.08022},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1607.08022},
}
Figure