Maximum entropy methods for texture synthesis: theory and practice

Valentin De Bortoli, Agnès Desolneux, Alain Durmus, Bruno Galerne, Arthur Leclaire

Abstract

Recent advancements in exemplar-based image synthesis have largely relied on convolutional neural networks (CNNs) and variational formulations. While effective, these methods often lack a rigorous statistical foundation and theoretical guarantees regarding convergence in high-dimensional spaces. This paper investigates a framework for texture synthesis based on the Maximum Entropy principle, utilizing an alternate sampling/minimization scheme. By employing the Stochastic Optimization with Unadjusted Langevin (SOUL) algorithm, we demonstrate that this approach yields a probability measure that maximizes entropy under expected constraints. Furthermore, we provide theoretical bounds showing that the error scales polynomially with image dimensions, even in non-convex settings such as those defined by deep neural networks. Our experimental results confirm the framework's efficacy in texture synthesis and its successful extension to style transfer.

Introduction

Texture synthesis aims to generate new, larger images from a small exemplar such that the output is perceptually similar to the original without being a direct copy. While modern CNN-based methods have achieved impressive visual results, they typically treat synthesis as a pure optimization problem. This "variational" approach often lacks a clear probabilistic interpretation and fails to provide guarantees on whether the algorithm will converge to a correct solution as image resolution increases.

This research bridges the gap between classical statistical mechanics and deep learning by adopting the Maximum Entropy principle. By focusing on the macrocanonical model, we define a probability distribution that is as diverse as possible while ensuring its features—extracted via a CNN—match the exemplar's features on average.

The Macrocanonical Framework

In statistical modeling, two primary approaches exist: the microcanonical and the macrocanonical.

  1. Microcanonical Model: Forces the generated image to match the exemplar's features exactly. This is the target of most gradient-descent synthesis methods, but it is often difficult to sample from correctly.
  2. Macrocanonical Model: Requires features to match the exemplar only in expectation.

Using results from information geometry, the authors show that the macrocanonical approach leads to a Gibbs measure. This measure represents the most "unbiased" distribution possible given the constraints, ensuring that the generated textures contain maximum innovation while remaining faithful to the exemplar's underlying structure.

The SOUL Algorithm

To implement this framework, the paper utilizes the Stochastic Optimization with Unadjusted Langevin (SOUL) algorithm. This is a two-level iterative process designed to find the parameters of the Gibbs distribution and sample from it:

  • Sampling Step: The algorithm uses Langevin dynamics—essentially a gradient-guided random walk—to generate a candidate image from the current distribution.
  • Updating Step: The model's internal parameters are adjusted based on the difference between the candidate's features and the exemplar's features.

This approach allows the model to learn the "weights" of different features (such as those from a pretrained VGG19 network) to best represent the target texture.

Theoretical Contributions: Polynomial Scaling

A central challenge in high-dimensional image synthesis is the "curse of dimensionality," where errors can grow exponentially as the number of pixels increases. A major contribution of this work is the proof that the error in the SOUL algorithm is bounded by constants that depend polynomially on the image dimension.

This theoretical safety net suggests that the method is robust for generating very large images (e.g., 4K resolution). Furthermore, the authors demonstrate that these bounds hold even when the constraints are non-convex, which is a critical requirement for any method utilizing deep neural networks.

Experimental Results and Style Transfer

The framework was tested using both classical Gaussian features (autocorrelation) and modern CNN features from the VGG19 architecture. The results indicate:

  • Visual Fidelity: The synthesized textures are visually competitive with state-of-the-art variational methods, such as those by Gatys et al., while maintaining a consistent probabilistic framework.
  • Flexibility: Because the model relies on spatially averaged features, it can synthesize images of any size regardless of the input exemplar's dimensions.
  • Style Transfer: The authors successfully extended the macrocanonical model to style transfer, where the "content" of a target image is preserved while its "style" (texture features) is replaced by those of an exemplar.

Limitations and Future Outlook

Despite its theoretical strengths, the method faces practical challenges. The Markov chains used in the sampling step can be "slowly mixing," meaning the algorithm may take a significant amount of time to explore the full range of possible textures, potentially limiting diversity in a single run. Additionally, like most parametric methods, it struggles with highly regular or periodic textures (e.g., a brick wall), where patch-based methods remain superior.

Future research will focus on improving the mixing time of the sampling chains and investigating the stability of the high-dimensional weight sequences during the optimization process. By providing a rigorous mathematical foundation for CNN-based synthesis, this work opens the door for more predictable and controllable generative models in computer vision.

Summary updated

BibTeX
@article{bortoli2019maximum,
  author = {Valentin De Bortoli and Agnès Desolneux and Alain Durmus and Bruno Galerne and Arthur Leclaire},
  title = {{Maximum entropy methods for texture synthesis: theory and practice}},
  journal = {SIAM J. Math. Data Sci.},
  year = {2019},
  url = {https://openreview.net/forum?id=JJUjxBPaCR},
}
Figure