Abstract
Texture editing in computer graphics often suffers from the entanglement of local geometry and global appearance. We present Compositional Neural Textures, a novel unsupervised framework that decomposes textures into "neural textons"—discrete 2D Gaussians with associated appearance features. By enforcing properties such as reshuffling invariance and spatial compactness, our model enables intuitive, real-time editing tasks including texture transfer, interpolation, and direct manipulation of individual elements without requiring manual supervision.
Introduction
Texture editing is a cornerstone of computer graphics, yet automating precise local control remains difficult. Traditional methods typically rely on global statistical models, which lack local manipulability, or manual patch-based editing, which is labor-intensive. While deep learning has revolutionized image synthesis, standard neural representations often entangle structure and appearance. Modifying a specific element, such as the orientation of a single scale or the color of a specific brick, often results in global artifacts because the model lacks an understanding of the texture's underlying building blocks.
This paper addresses this challenge by automatically discovering and representing these building blocks—termed "textons"—in a human-interpretable and editable format. Our approach requires no supervised data, learning to decompose textures into discrete components through a set of carefully designed architectural constraints.
Methodology
Our framework utilizes an autoencoder architecture that learns a compositional latent space where textures are represented as sets of Latent Gaussians.
Neural Texton Representation
Each texton is defined by its geometric parameters (position, shape, size, and orientation) and a high-dimensional appearance feature vector. An existence weight, learned via the Gumbel-softmax trick, allows the model to learn the appropriate number of active elements for a given texture.
Pipeline and Unsupervised Learning
The pipeline consists of a segmentation-based encoder (Mask2Former) that extracts Gaussian parameters, a splatting layer that projects these onto a feature grid, and a SPADE-based generator that reconstructs the image. To force the network to learn meaningful decompositions without labels, we employ four key principles:
- Discrete Objectness: Encouraged by entropy loss on segmentation masks.
- Spatial Compactness: Ensures each texton is localized rather than dispersed.
- Reshuffling Invariance: A novel training strategy where the model must reconstruct a valid texture even if appearance features are randomly swapped between textons. This effectively decouples "what" an element looks like from "where" it is.
- Transformation Equivariance: Ensures geometric consistency under rotation and scaling.
Results and Applications
The model was trained on a large-scale dataset of 377,000 synthetic images (generated via Adobe Firefly with ChatGPT-derived prompts) and 1,200 real-world stock images.
Performance and Versatility
The feed-forward process for a 256x256 image takes approximately 0.16 seconds on a single NVIDIA A10G GPU, enabling real-time interactive tools. Key capabilities include:
- Texture Transfer and Interpolation: Applying the appearance of one texture to the structure of another or smoothly morphing between distinct types.
- Direct Manipulation: Users can interactively move, scale, or rotate individual textons in the latent space.
- Superior Segmentation: Interestingly, our unsupervised model often identifies repetitive texture elements (like tufts of fur) more accurately than general-purpose segmentors like Meta’s Segment Anything (SAM), which are optimized for semantic objects rather than repeating patterns.
Limitations and Future Work
The current model struggles with elongated, continuous structures (e.g., long hair or wires), which it attempts to decompose into discrete blobs. Additionally, the reliance on Gaussian splatting can lead to the loss of some high-frequency details. Future research will explore multi-level representations to handle hierarchical textures and improve the handling of foreground-background separation.
Summary updated