Elucidating the representation of images within an unconditional diffusion model denoiser
Zahra Kadkhodaie, Stéphane Mallat, Eero P. Simoncelli · 2025
Read Elucidating the representation of images within an unconditional diffusion model denoiser by Zahra Kadkhodaie, Stéphane Mallat, Eero P. Simoncelli (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2506-01912.txt.
Introduction
Zahra Kadkhodaie, Stéphane Mallat, and Eero P Simoncelli look inside an image-making neural network to see how it sorts what it sees, in a 2025 paper. Networks of this kind learn to clean noise from images, and in doing so they learn to generate new ones. What they store inside has been poorly understood.
The team found that the middle layer of the network lights up only a small set of channels for each image. Averaging those channels gives a compact code for the image, and codes for alike images sit close together, even though the network was never taught labels. They also built a method to rebuild images from a code alone. The work shows that a sense of image meaning can grow out of noise removal by itself.
Catalog record
| CREATOR | Zahra Kadkhodaie, Stéphane Mallat, Eero P. Simoncelli |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 38 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2506-01912
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Elucidating the representation of images within an unconditional diffusion model denoiser Zahra Kadkhodaie, Stéphane Mallat, Eero P. Simoncelli Abstract Generative diffusion models learn probability densities over diverse image datasets by estimating the score with a neural network trained to remove noise. Despite their remarkable success in generating high-quality images, the internal mechanisms of the underlying score networks are not well understood. Here, we examine a UNet trained for denoising on the ImageNet dataset, to better understand its internal representation and computation of the score. We show that the middle block of the UNet decomposes individual images into sparse subsets of active channels, and that the vector of spatial averages of these channels can provide a nonlinear representation of the underlying clean images. We develop a novel algorithm for stochastic reconstruction of images from this representation and demonstrate that it recovers a sample from a set of images defined by a target image representation. We then study the properties of the representation and demonstrate that Euclidean distances in the latent space correspond to distances between conditional densities induced by representations as well as semantic similarities in the image space. Applying a clustering algorithm in the representation space yields groups of images that share both fine details (e.g., specialized features, textured regions, small objects), as well as global structure, but are only partially aligned with object identities. Thus, we show for the first time that a network trained solely on denoising contains a rich and accessible sparse representation of images. 1 Introduction Generative diffusion methods provide a powerful framework for sampling from probability densities learned from complex high-dimensional data such as images [ 1 , 2 , 3 ] . The key to their success lies in deep neural networks trained to estimate the score (the gradient of the log of the noisy image distribution), which is achieved by optimization on a denoising task. Training and sampling algorithms for these models have been extensively studied [ 4 ] , but the score estimation properties that enable their spectacular image generation capabilities are not understood. Since denoising generally relies on distinguishing signal from noise, these score networks must somehow learn to identify and isolate patterns and structures found in their training data, so as to preserve them while eliminating noise. Here, we open the “black box” of a score network to study this internal representation. We examine a UNet [ 5 ] trained (unconditionally) for image denoising on the ImageNet dataset. Prior work [ 6 , 7 , 8 , 9 , 10 ] has shown that activations from such a model can be extracted to perform downstream tasks – such as classification and segmentation – with considerable success. We aim instead to understand what features arise in the internal space of the network. We find that the network computes a low dimensional sparse set of activations in the output channels of the middle (innermost) network block. This may be summarized with a vector comprised of the spatial averages of these channels, which provides a representation of the underlying clean image. We verify that this representation is stable when computed on an image contaminated with noise over a broad range of amplitudes, consistent with the denoising objective on which it is trained. We develop an algorithm for stochastic reconstruction, using a reverse diffusion algorithm conditioned on this representation vector. This decoding procedure recovers a sample from a set of images whose representation is the same as that of the target image. Visually, the reconstructed images are similar in terms of both local and global patterns, revealing both the commonality and diversity of attributes encoded in the representation. This representation exhibits a number of intriguing properties. Roughly, the channels summarized by the representation vector fall into two categories: non-selective channels, which capture common features present in many images; and selective channels, which are specialized for patterns that occur in only a small subset of images. As a consequence, the representation vectors of images lie within a union of low-dimensional subspaces, each of which is spanned by many of the common channels and a small subset of the specialized channels. We demonstrate that distances in the representation space are meaningful: The Euclidean distance between two representations predicts the symmetrized KL divergence between the two conditional distributions induced by the representations. Images whose representation vectors are similar are also semantically similar. Finally, we partition the images in the ImageNet validation set by applying a clustering algorithm to their representation vectors. The emergent clusters capture the general visual appearance of the images, sharing both fine details as well as global structure, but are only partially aligned with object category labels. Thus, the denoising objective alone, without any external conditioning, engenders learning of high level features that carry semantic information, albeit not necessarily object identities. 2 Implicit sparse image representation Diffusion models learn image densities from data using a network that is trained for denoising. Specifically, given a noisy image x_{\sigma}=x+\sigma z , with z\in\mathcal{N}(0,{\rm Id}) a sample of white Gaussian noise, one trains a network s_{\theta}(x_{\sigma}) to minimize the squared error: \ell(\theta)=\mathbb{E}_{x,\sigma,z}\|x-\hat{x}({x_{\sigma})}\|^{2}=\mathbb{E}_{x,\sigma,z}\|{s}_{\theta}(x_{\sigma})-\sigma z\|^{2}. (1) The optimal solution is the conditional mean, which can be directly related to the score of the underlying noisy distributions using a relationship published in [ 11 ] , but generally referred to as "Tweedie’s formula" [ 12 , 13 ] : \hat{x}(x_{\sigma})=\mathbb{E}[x|x_{\sigma}]=x_{\sigma}+\sigma^{2}\nabla_{x_{\sigma}}\log p_{\sigma}(x_{\sigma}). (2) Thus, the trained network provides an approximation of the family of score functions for all \sigma . Reverse diffusion methods draw samples through iterative partial application of the learned denoiser, thereby using this approximate score to ascend the probability landscape [ 1 , 2 , 14 , 3 ] . 2.1 Spatial averages of activations We adopt a convolutional UNet architecture [ 5 ] , commonly used in diffusion models. The model consists of three main components: a set of encoder blocks (the downsampling path), a middle block, and a set of decoder blocks (the upsampling path) (see Fig 9 and Appendix A for more details). Our goal is to examine the activations of these hidden layers to understand how the noisy image is transformed to produce the score. To reduce the dimensionality, we examine the simplest summary of channel activations, a_{j}(x_{\sigma}) , consisting of the spatial averages of all channels at the output layer of each block, notated by \bar{a}_{j}(x_{\sigma})\in\mathbb{R}^{d_{j}} . The components of the vector \bar{a}_{j} , which are always nonnegative due to half-wave rectification (ReLU) nonlinearities, carry information about the features encoded by the corresponding channels. Because of the convolutional nature of the network, the activations within each channel indicate the presence or absence of a feature in different spatial locations. Thus if a feature associated with channel i\in(0,d_{j}) is present somewhere in the input image, \bar{a}_{j}(x_{\sigma})[i] will be positive, otherwise zero. It is worth noting that the structure of the UNet architecture imposes certain properties on \bar{a}_{j} . Idealized convolutions are translation equivariant, hence the spatial averages of their activations are translation invariant w.r.t to the extracted features and do not carry information about location. For ergodic processes, these averages are approximations of statistical moments (expected value of nonlinear functions), and such measurements have been used for representation of visual texture [ 15 ,