TL;DR
This paper introduces a novel approach to Out-of-Distribution (OoD) detection using Neural Rendering Models (NRMs). By leveraging the NRM's ability to unify likelihood and reconstruction-based methods, they propose a new metric: the joint likelihood of latent variables. This metric effectively distinguishes between in-distribution and out-of-distribution data, particularly in challenging cases where OoD samples have lower variance than training data.
What Problem Does This Paper Address?
Detecting out-of-distribution (OoD) data is crucial for the safe deployment of machine learning models in real-world applications like medical diagnosis or fraud detection. When a model encounters data it wasn't trained on (OoD data), it can make incorrect predictions with high confidence, a phenomenon exacerbated by the "calibration issues" in deep neural networks. Existing methods for OoD detection using deep generative models typically fall into two categories: likelihood-based and reconstruction-based. However, both have limitations. Likelihood-based methods can be fooled by OoD samples that have lower variance than training data, leading to higher likelihoods for these "easier" OoD samples. Reconstruction-based methods also struggle with this, as generative models can often reconstruct even out-of-distribution images due to their high capacity. This paper aims to address these shortcomings by proposing a more robust OoD detection metric.
Methods
The core of this paper's contribution lies in its use of the Neural Rendering Model (NRM), a generative model that mirrors the architecture of Convolutional Neural Networks (CNNs). The NRM's key innovation is its ability to unify likelihood and reconstruction-based approaches. The paper shows that the NRM's likelihood can be decomposed into a reconstruction loss term and a joint likelihood of latent variables term. This decomposition allows for a flexible choice of metrics.
The authors propose and evaluate three metrics derived from the NRM:
- Data likelihood
log p(x): The standard likelihood of the input data. - Reconstruction loss: The loss incurred when reconstructing images, analyzed at different layers of the NRM.
- Joint likelihood of latent variables
p({z*(l)}l=1:L|y*): This is the paper's proposed novel metric. It leverages the optimal latent variables obtained from the feed-forward CNN inference process within the NRM. This metric captures the "rendering path" of an image, reflecting its underlying structure rather than just pixel values.
Datasets
- In-distribution dataset: CIFAR-10
- Out-of-distribution datasets:
- SVHN
- CIFAR-100
- CelebA (with modified variance to be lower than CIFAR-10)
Key Insights and Ideas
- NRM unifies likelihood and reconstruction: The NRM's architecture naturally bridges the gap between likelihood-based and reconstruction-based OoD detection methods, offering a more holistic approach.
- Latent variable likelihood is key for structure: Unlike standard data likelihood, which can be misled by pixel variance, the joint likelihood of latent variables in NRM captures the underlying image structure. This makes it more robust to variations in image content and less sensitive to simple pixel statistics.
- Lower variance OoD is a hard problem: The paper highlights that existing deep generative models struggle when OoD samples have lower variance than training data. Their proposed metric shows promise in overcoming this specific challenge.
- Overlaps in latent variable distributions indicate similarity: The degree of overlap in the latent variable likelihood histograms between different datasets can serve as a measure of their visual similarity.
Key Results
- The proposed metric, joint likelihood of latent variables
p({z*(l)}l=1:L|y*), consistently assigns lower likelihoods to OoD samples (specifically SVHN and CelebA) when trained on CIFAR-10, outperforming standard data likelihood. - Figure 1(a) shows a clear separation between in-distribution (CIFAR-10 train/test) and OoD (SVHN, CelebA) data using the proposed metric, whereas Figure 1(b) shows significant overlap for the Glow model.
- The paper demonstrates that reconstruction loss at certain intermediate layers (e.g., layer 6) can also show separation for OoD data, but this layer is dataset-dependent and thus less reliable in practice.
- The authors claim this is the first likelihood-based metric for OoD detection in deep generative models that consistently assigns lower likelihood to lower-variance OoD images.
Limitations and Future Work
- Overlap still exists: While improved, the histograms for the proposed metric still show some overlap between in-distribution and OoD samples.
- Future Work:
- Weighting the metric: The authors suggest weighting the joint latent variable likelihood term more heavily during training to further reduce uncertainty and improve separation.
- Hybrid metrics: Exploring hybrid metrics, such as combining their latent variable likelihood with existing methods like WAIC, could lead to even better OoD detection performance.
- Easier variance cases: The paper focused on the difficult scenario of lower-variance OoD data. Future work could investigate performance in cases where OoD variance is similar or higher, potentially on datasets like MNIST.
Summary updated