TL;DR
This paper presents a unified framework for modeling the uneven probability distributions of images on low-dimensional manifolds using normalizing flows and diffusion models. By introducing a novel "GridVAE" architecture within an emergent language framework, the authors achieve highly disentangled semantic representations that can be used to detect out-of-distribution data and defend against adversarial patch attacks.
What Problem Does This Paper Address?
While it is a common assumption in computer vision that images lie on a lower-dimensional manifold embedded within a high-dimensional pixel space, they are not uniformly distributed across it. Some configurations of pixels are highly probable images, while others are completely unrealistic.
To effectively use these manifolds for downstream tasks, generative models must be able to do two things well: generate high-fidelity samples and compute the exact probability (or log-likelihood) of an unseen sample. Standard generative approaches often struggle to balance both. Furthermore, the latent spaces of these models are typically entangled, making it difficult to interpret or manipulate specific semantic attributes (like hair color or facial expression) without inadvertently altering others. The authors tackle these challenges to improve out-of-distribution (OOD) detection, sampling efficiency, and adversarial robustness.
Methods
The authors approach the problem through three interconnected methodological contributions:
- Hierarchical Normalizing Flows (NFs): To compute exact log-probabilities without sacrificing image quality, the authors design a 4-level hierarchical NF model based on Glow. Each level uses downsampling blocks to reduce resolution, conditioning higher-level spatial features on lower-level reconstructions.
- Diffusion Models with Higher-Order Solvers: The authors derive a method to estimate exact log-probabilities across the forward and backward processes of Diffusion Models (DMs). To combat the instability and bias that occurs when taking large sampling steps during inversion, they introduce an inverse-temporal version of the 4th-order Runge-Kutta (RK4) method.
- GridVAE for Semantic Disentanglement: Inspired by the framework of Emergent Languages (EL)—where multi-agent systems spontaneously develop communication protocols—the authors replace standard sequential LSTM senders with a Variational Autoencoder (VAE) encoder. They introduce GridVAE, which utilizes a Mixture of Gaussians (MoG) prior arranged on a Cartesian grid. This forces the latent space to cluster discrete semantic concepts along orthogonal dimensions.
To protect against $\ell_0$-bounded adversarial patch attacks, the authors implement a test-time purification defense. By optimizing the Evidence Lower Bound (ELBO) loss at test time, they steer corrupted images back toward high-density regions of the clean image manifold before feeding them to a classifier.
Datasets
The methods were trained and evaluated across several standard benchmarks and synthetic datasets:
- CelebA: Used for face attribute learning, super-resolution, and evaluating adversarial defenses on gender classification.
- CIFAR10: Acted as the out-of-distribution (OOD) dataset against CelebA.
- MNIST (Two-digit variant): Used to evaluate the clustering and unsupervised semantic disentanglement capabilities of GridVAE.
- Fashion-MNIST & Point Sets (Swiss roll, circle, moon, S): Used for verifying diffusion log-probability estimations and patch attack defenses.
Key Insights and Ideas
- RK4 Stabilizes Aggressive Sampling: Standard diffusion models like DDIM lose image consistency and introduce severe noise when sampling step sizes ($h$) are increased. Applying the RK4 method allows the model to maintain structural and semantic consistency even at massive step sizes ($h=100$), drastically accelerating inversion speeds.
- Local vs. Global Disentanglement: Scaling up grid-based priors to high-dimensional spaces introduces the curse of dimensionality. By dynamically calculating the KL-divergence using only the closest mixture component, GridVAE sidesteps this issue, providing clean, localized semantic disentanglement.
- Semantic Consistency as a Shield: Adversarial patch attacks succeed because they break the semantic agreement between what a decoder reconstructs and what a classifier sees. Forcing the model back onto high-density manifold regions via test-time ELBO optimization naturally purifies the corrupted pixels.
Key Results
- Out-of-Distribution Detection: The hierarchical NF model demonstrated a clear separation in log-likelihood distributions between in-distribution data (CelebA, mean log $p(x) = 279.59$) and out-of-distribution data (CIFAR10, mean log $p(x) = -4832.21$).
- Adversarial Patch Defense: On the CelebA-Gender classification task using a ResNet-50 backbone, performance collapsed under patch attacks. Incorporating the test-time defense (TTD) restored classification accuracy dramatically:
- Patch-PGD attack: Accuracy jumped from 13.14% (undefended) to 75.75% (purified).
- Patch-NAG attack: Accuracy jumped from 6.83% (undefended) to 76.75% (purified).
Limitations and Future Work
The authors note a key limitation when applying log-probability estimation to high-dimensional images within diffusion models. At early denoising steps (small $t$), the model acts primarily as a denoiser, meaning the differences between consecutive steps ($x_t$ and $x_{t+h}$) are tiny. Conversely, at large steps near $T$, the high proportion of Gaussian noise dominates the signal. Consequently, the accumulated log-probability variance becomes too small relative to the total noise, reducing the model's effectiveness at high-dimensional OOD detection. The authors leave resolving this dynamic as an open problem for future research.
Summary updated