Texture Modelling Using Convolutional Neural Networks

Leon A. Gatys, Alexander S. Ecker, Matthias BethgePurdue 2016

Abstract

We introduce a new model of natural textures based on the feature spaces of convolutional neural networks optimised for object recognition. Samples from the model are of high perceptual quality demonstrating the generative power of neural networks trained in a purely discriminative fashion. Within the model, textures are represented by the correlations between feature maps in several layers of the network. We show that across layers the texture representations increasingly capture the statistical properties of natural images while making object information more and more explicit. Extending this framework to texture transfer, we introduce A Neural Algorithm of Artistic Style that can separate and recombine the image content and style of natural images. The algorithm allows us to produce new artistic imagery that combines the content of an arbitrary photograph with the appearance of numerous well-known artworks, thus offering a path towards an algorithmic understanding of how humans create and perceive artistic imagery.

Introduction

Historically, modeling natural textures has been a significant challenge in computer vision. Traditional methods typically relied on hand-engineered statistical models that often failed to capture the multi-scale complexity and stochastic nature of real-world patterns. This research addresses a fundamental question: Can a deep neural network, trained purely for a discriminative task like object classification, be repurposed to generate complex textures?

The authors propose that the internal representations of Convolutional Neural Networks (CNNs) contain a rich, hierarchical description of visual appearance. By mathematically isolating these representations, it becomes possible to synthesize textures and even separate the "style" of an image from its "content."

Methodology: The Gram Matrix and Optimization

The core of the proposed model lies in the feature spaces of a pre-trained CNN. The process involves three primary stages:

1. Feature Extraction

When an image is processed by the network, it generates activations across various layers. These activations, or feature maps, represent the presence of specific visual filters at different spatial locations.

2. The Gram Matrix

To model texture, the authors argue that spatial arrangement is less important than the relationship between different features. They represent texture using a Gram matrix ($G^l$), which computes the correlations between feature maps within a specific layer. By calculating the inner product between vectorized feature maps, the model captures which features tend to co-occur (e.g., certain colors and edge orientations) while effectively discarding the specific spatial coordinates of those features. This makes the representation "stationary," a key characteristic of texture.

3. Optimization-based Synthesis

Unlike standard generative models that might use a feed-forward pass, this method uses an optimization-based approach. To generate a new texture, the authors start with a white noise image and iteratively update the pixels of that image using gradient descent. The goal is to minimize a loss function that measures the mean-squared distance between the Gram matrices of the original texture and the Gram matrices of the synthesized image. By aggregating losses across multiple layers, the model captures texture at various levels of abstraction, from simple grains to complex organic patterns.

A Neural Algorithm of Artistic Style

Building on the texture model, the authors introduced the "Neural Algorithm of Artistic Style." This algorithm treats the "style" of an artwork as a multi-scale texture representation defined by Gram matrices. By simultaneously minimizing the difference between the feature activations of a "content" photograph and the Gram matrices of a "style" artwork, the network can produce a new image. This image preserves the recognizable structures of the photograph but renders them using the colors, textures, and brushstrokes of the artwork.

Key Insights

  • Generative Power of Discriminative Networks: A surprising finding is that networks trained to recognize objects (like dogs or cars) implicitly learn the statistical structure of the visual world well enough to recreate it.
  • Mathematical Definition of Style: The paper provides a concrete, algorithmic definition of "style" as the correlation between deep features. This allows for the independent manipulation of an image's semantic content and its aesthetic appearance.
  • Hierarchical Representation: The research demonstrates that as information moves deeper into the network, the texture representations capture increasingly complex properties, moving from simple edge-like textures to sophisticated, object-like patterns.

Results and Limitations

The model produces texture samples that are often visually indistinguishable from natural textures. In the context of style transfer, it allows for the creation of high-quality artistic imagery that combines arbitrary photographs with famous paintings (e.g., works by Van Gogh or Picasso).

However, the method has limitations. Because it relies on an iterative optimization process (performing backpropagation to the image pixels), it is computationally expensive compared to feed-forward methods. Additionally, since the Gram matrix discards global spatial information, the model may struggle with textures that require rigid, large-scale global structures.

Conclusion

This work bridges the gap between computer vision and digital art. By demonstrating that style and content can be separated and recombined, the authors provide a new tool for artistic creation and a potential framework for understanding the algorithmic basis of human visual perception.

Summary updated

BibTeX
@inproceedings{gatys2016texture,
  author = {Leon A. Gatys and Alexander S. Ecker and Matthias Bethge},
  title = {{Texture Modelling Using Convolutional Neural Networks}},
  booktitle = {Purdue},
  year = {2016},
}
Figure