While Generative Adversarial Networks (GANs) are famous for creating realistic images, the underlying probability distributions they learn are notoriously difficult for humans to interpret. This research reveals that "high probability" in pixel space often corresponds to simple, smooth images rather than "typical" ones. However, the authors demonstrate that we can recover human-like intuition by calculating densities within the GAN’s latent representation instead.
The Problem: High-Dimensional Image Space
Researchers have long sought to use generative models to estimate the Probability Density Function (PDF) of natural images. A known PDF would enable tasks like outlier detection or provide a "prior" for image restoration.
However, high-dimensional image space is mathematically counterintuitive. Standard GANs do not provide explicit probability scores; they only learn to sample. Even when scores are extracted, they often fail to align with human perception. For instance, a model trained on diverse objects might assign higher probability to a simple white line than to a realistic car. This paper investigates this discrepancy and proposes a method to fix it.
Methods: Extracting Explicit Densities
The authors propose a framework to extract explicit probability densities from non-invertible GANs (like DCGAN) using three main components:
- The Jacobian Trick: Since GANs map a low-dimensional latent code ($z$) to a high-dimensional image ($x$), they are not directly reversible. The authors use a modified change-of-variables formula involving the Jacobian of the generator function to calculate density on the low-dimensional manifold where the GAN operates.
- Density Regressors: To avoid the computational cost of calculating the Jacobian for every image, they train a separate neural network—a pixel regressor—to predict the log-probability of an image directly from its pixels.
- Latent Space Estimation: To address interpretability, they perform density estimation on the latent representations of images. Using an InfoGAN-style objective ensures these latent spaces are semantically structured.
Key Insights: Simplicity Bias and the MNIST Paradox
The study identifies several critical phenomena in pixel-space density estimation:
- The "1s" Problem: In pixel space, simple structures like the digit "1" act as "density sinks." Because they are structurally simple and highly aligned, they cluster tightly. A model trained on all digits will incorrectly suggest a "1" is much more likely than an "8," despite equal frequency in training.
- Simplicity Bias: Pixel-space density favors smoothness. In datasets like CIFAR-10 or CUB-200, the most "likely" images are often those with plain backgrounds (e.g., a bird against a solid blue sky). The simplicity of the background correlates so strongly that it outweighs the complexity of the actual object.
- The MNIST-in-CIFAR Paradox: Surprisingly, a pixel-space density estimator trained only on natural images (CIFAR) will assign higher probabilities to handwritten digits (MNIST) than to its own training data. This occurs because MNIST digits are mathematically simpler and closer to the origin of the pixel distribution.
Results: Recovering Semantic Interpretability
By moving density estimation into the latent space, the simplicity bias disappears. In latent space, the distance between points correlates with semantic features (like "has wings") rather than raw pixel values.
Key findings include:
- Consistency: GAN-based density estimates are consistent; histograms of probabilities for training and held-out test data are nearly identical, proving the models are not merely memorizing data.
- Interpretability: Using a latent regressor, the model correctly identifies CIFAR images as "inliers" and MNIST images as "outliers."
- Semantic Outliers: In latent space, "unlikely" images are no longer just complex ones; they are images with unusual semantic configurations, such as an airplane in a green sky.
Conclusion
The primary limitation remains the difficulty of "inverting" arbitrary real-world images back to their GAN latent codes. While regressors mitigate this, accuracy depends on the GAN's ability to capture the true data manifold. Future work may leverage these interpretable latent densities for domain shift detection and improving the robustness of image classifiers.
Summary updated