TL;DR
This paper introduces a novel method for detecting out-of-distribution (OoD) data in deep learning models by leveraging surjective normalizing flows (SNFs) to quantify epistemic uncertainty. The approach is computationally efficient, requiring only a single forward pass, and demonstrates strong performance in distinguishing between in-distribution and out-of-distribution data in a mobility prediction context.
What Problem Does This Paper Address?
In many real-world applications, deep learning models are trained in one environment but deployed in others, leading to potential performance degradation when encountering data that differs significantly from the training distribution (out-of-distribution data). Accurately quantifying uncertainty, particularly epistemic uncertainty (uncertainty due to limited training data), is crucial for identifying these out-of-distribution samples and ensuring reliable decision-making. Existing methods for uncertainty quantification and OoD detection can be computationally expensive, making them unsuitable for real-time applications. This paper aims to provide an efficient and effective method for OoD detection by integrating uncertainty quantification directly into the model's forward pass.
Methods
The core of the proposed method lies in using surjective normalizing flows (SNFs) to estimate epistemic uncertainty. Normalizing flows are a class of generative models that allow for exact likelihood computation by transforming a simple base distribution into a complex data distribution through a series of invertible transformations. The authors extend this by incorporating surjective layers, which are dimensionality-reducing transformations. This allows the model to project data into a lower-dimensional latent space, which is hypothesized to better capture the underlying data manifold and facilitate more robust uncertainty estimation.
Specifically, the method models the log marginal likelihood of data points using a framework that combines base distributions, Jacobian determinants from bijective flows, and conditional densities from surjective flows. For OoD detection, the authors apply this SNF to the feature representations extracted from a predictive neural network (specifically, the penultimate layer). By analyzing the distribution of epistemic uncertainty estimates for incoming data points, they can identify samples that deviate significantly from the distribution observed during training. This comparison is done using statistical tests, where a significant difference in uncertainty estimates suggests an out-of-distribution sample.
Datasets
The paper uses a synthetic dataset generated from the density transition-EPR (DT-EPR) individual mobility model. This model simulates discrete location trajectories. To evaluate the out-of-distribution detection capabilities, the authors create interventional datasets by modifying the parameters of the DT-EPR model. These interventions include:
- Shift interventions: Modifying the means of the exploration probability ($p$) and the transition probability ($\gamma$) distributions.
- Hard interventions: Setting the exploration probability ($p$) to constant values.
These interventional datasets are designed to simulate various forms of distributional shifts, mimicking real-world scenarios where the deployment environment differs from the training environment.
Key Insights and Ideas
- Surjective flows are key for OoD detection: The paper strongly suggests that the dimensionality-reducing nature of surjective layers in normalizing flows is crucial for effectively distinguishing between in-distribution and out-of-distribution data, outperforming purely bijective flows.
- Epistemic uncertainty as an OoD signal: The method leverages epistemic uncertainty, which is inversely related to data density, as a direct indicator of out-of-distribution samples. This provides a principled way to identify novel or unexpected data.
- Single forward pass for uncertainty: A significant advantage of this approach is that uncertainty estimation can be performed within a single forward pass of the neural network, making it computationally efficient for real-time applications.
- Feature-space analysis is effective: Applying the SNF to the feature representations extracted from a neural network, rather than the raw input, proves to be a powerful strategy for capturing relevant patterns and detecting distributional shifts.
Key Results
The proposed Surjective Normalizing Flow (SNF) model demonstrated competitive performance in terms of negative log-likelihoods compared to a bijective normalizing flow (BNF) and a Dirichlet process Gaussian mixture model (DPGMM) on observational data. More importantly, the SNF was significantly better at detecting out-of-distribution data generated through various interventions.
- Out-of-distribution detection: The SNF model reliably distinguished between observational and interventional (out-of-distribution) datasets, as evidenced by statistical tests (two-sample t-tests and Wasserstein distances) showing significant differences in feature-space likelihood estimates for interventional data.
- Comparison to baselines: The SNF consistently outperformed the BNF and DPGMM in detecting distributional shifts induced by interventions. For instance, in Table 2, the SNF often yields very low p-values for interventional datasets, indicating a strong signal of being out-of-distribution, while the BNF and DPGMM show less clear separation.
- Computational efficiency: The method allows for uncertainty estimation in a single forward pass, a key advantage over more computationally intensive methods.
Limitations and Future Work
- Hyperparameter tuning: The authors note that the architecture of the SNF was chosen somewhat arbitrarily, and no extensive hyperparameter optimization was conducted. This suggests that further tuning could potentially improve performance.
- Real-world data: The experiments were conducted on synthetic data. Applying and validating the method on real-world, privacy-sensitive mobility datasets would be a valuable next step.
- Integration with other UQ methods: The paper suggests future research could focus on integrating ideas from causality and distributional robustness (e.g., invariant prediction, conditional variance penalties) with deep learning models capable of UQ.
- Broader applications: While demonstrated in mobility analysis, the method's applicability to other domains requiring robust uncertainty quantification and OoD detection (e.g., climate science, finance) warrants further investigation.
Summary updated