This paper, "Perfect Density Models Cannot Guarantee Anomaly Detection," presents a sobering theoretical challenge to a common practice in machine learning: using probability density as a proxy for "regularity" to detect anomalies.
TL;DR
Even with a mathematically "perfect" model of a data distribution, density-based anomaly detection can fail because probability density is not invariant to how you represent your data. The authors prove that by simply changing coordinate systems, you can make any point appear as either a high-density "inlier" or a low-density "outlier," rendering off-the-shelf density methods fundamentally unreliable without explicit prior assumptions.
What Problem Does This Paper Address?
Deep generative models (like VAEs or Normalizing Flows) are often used for anomaly detection under the intuitive assumption that anomalies—being rare—will have low probability density ($p(x)$). However, researchers have observed strange empirical failures, such as models trained on CIFAR-10 assigning higher likelihoods to images from the completely different SVHN dataset.
While others have blamed these failures on estimation errors or the "curse of dimensionality," Le Lan and Dinh tackle a deeper, more fundamental problem: reparametrization. In physics and mathematics, a meaningful property should ideally remain the same regardless of the coordinate system used to measure it. The authors argue that "anomalousness" should be a property of the underlying event, not the arbitrary way we choose to represent that event (e.g., bitmap pixels vs. JPEG vs. polar coordinates).
Methods
The authors use the change of variables formula to demonstrate that probability density is highly sensitive to invertible transformations. If you transform your data $x$ into a new representation $z = f(x)$, the new density $p(z)$ is scaled by the inverse of the Jacobian determinant of $f$.
To prove that this makes density-based detection arbitrary, they provide three key theoretical constructions:
- Uniformization: Using a Knothe-Rosenblatt rearrangement, they show that any continuous distribution can be mapped to a uniform distribution. In this new space, every point has the exact same density, making density-based detection impossible.
- Arbitrary Scoring: They prove that for any distribution, one can construct a transformation that imposes any desired density ranking on the points (Proposition 1).
- Canonical Swapping: They show that even within a fixed, well-behaved distribution like a Gaussian, one can use a local, volume-preserving rotation to swap the densities of a known inlier and a known outlier without changing the overall distribution (Proposition 2).
Datasets
The paper is primarily a theoretical work supported by synthetic examples rather than a large-scale empirical benchmark study. They reference standard datasets like CIFAR-10 and SVHN to ground their discussion in known community failures. They also describe a synthetic RGB bitmap image construction (Figure 10 in the text) to show how density-based methods can be "tricked" into seeing a specific shade of gray as an anomaly while ignoring visually obvious white-pixel outliers.
Key Insights and Ideas
- Density is not "Truth": Density is a relative quantity that depends on the "denominator" (the base measure). Changing the coordinate system effectively changes this denominator.
- The "Map is not the Territory": The authors invoke Magritte’s famous "Ceci n'est pas une pipe" to remind us that our data features are just arbitrary representations. A robust anomaly detector should be invariant to invertible changes in these representations.
- Typicality vs. Scoring: The paper examines both simple density scoring (is $p(x) > \lambda$?) and typicality tests (is $\log p(x)$ near the average entropy?). They show that both are vulnerable to reparametrization.
Key Results
- Mathematical Proof of Non-Invariance: The authors demonstrate that density-based methods violate a core principle: that anomaly detection should be invariant to continuous invertible reparametrization.
- Adversarial Reparametrization: They show it is possible to build "adversarial" coordinate systems that intentionally mislead density-based detectors, even when the model itself is "perfect" ($p_{model} = p_{true}$).
- Failure in Pixel Space: They provide a constructive proof that even in standard pixel spaces, density-based definitions of anomalies can conflict violently with human visual intuition.
Limitations and Future Work
- Discrete Spaces: The specific reparametrization tricks used here apply to continuous inputs. While discrete spaces (like text) face similar issues regarding how we tokenize or categorize data, the mathematical proofs don't translate directly.
- The Path Forward: The authors suggest that instead of relying on raw density, we should use density ratios ($p(x) / q(x)$). By comparing the data distribution to an explicit "background" or "noise" distribution, the resulting score becomes invariant to reparametrization.
- Explicit Priors: The core takeaway is a call for transparency. Researchers must explicitly state their assumptions about what constitutes an anomaly rather than hoping that raw likelihood values will magically reveal them.
Summary updated