Abstract
Ensuring the reliability of AI systems in safety-critical applications requires robust mechanisms for identifying data that deviates from the training distribution. This paper introduces a novel framework for Out-of-Distribution (OOD) detection that combines deep learning-based feature extraction with a new neighborhood-based statistical metric called Local Conditional Probability (LCP). By evaluating how well a data point can be reconstructed from its nearest neighbors in a latent space, the proposed method effectively identifies anomalies and "corner cases" that traditional global statistical measures often miss. Experimental results on MNIST, CIFAR-10, and GTSRB datasets demonstrate that our approach significantly outperforms existing state-of-the-art detection methods.
1. Introduction
Modern machine learning models typically operate under a "closed-world" assumption, assuming that inference-time data will mirror the training distribution. However, in real-world scenarios—particularly in safety-critical domains like autonomous driving—models frequently encounter OOD data, such as novel objects or degraded sensor inputs. Failure to identify these instances can lead to overconfident, erroneous predictions with potentially catastrophic consequences.
While traditional statistical tools like Mahalanobis Distance or Kernel Density (KD) estimation are effective for low-dimensional data, they struggle with the "curse of dimensionality" inherent in complex image datasets. There is a critical need for detection methods that can handle high-dimensional features while maintaining the statistical rigor necessary to flag subtle data quality issues.
2. Methodology
The proposed framework utilizes a two-stage process to detect OOD samples, as illustrated in the architecture below.
2.1 Feature Engineering via Deep Autoencoders
To mitigate high dimensionality, the framework employs a deep Autoencoder (AE) to learn compressed, low-dimensional representations. Rather than using raw latent vectors, the authors extract "neuron activation traces"—the binary status of neurons in the latent space. This approach captures the specific behavioral patterns of the network when processing a given input, providing a more discriminative feature set for downstream analysis.
2.2 Local Conditional Probability (LCP)
The core contribution of this work is the Local Conditional Probability (LCP) measure. Unlike global methods that assume a uniform distribution (e.g., Gaussian) across the entire dataset, LCP focuses on local data geometry. For a given test point, the method identifies its $k$-nearest neighbors in the latent feature space and attempts to reconstruct the test point as a linear combination of these neighbors. The weights are assigned via a Gaussian kernel, representing the "local conditional probability." The OOD score is defined as the reconstruction error; a high error indicates that the point cannot be easily "built" from its neighbors, suggesting it is an outlier relative to the local distribution.
3. Experimental Results
The framework was evaluated using MNIST, CIFAR-10, and the German Traffic Sign Recognition Benchmark (GTSRB). OOD scenarios included exposure to random noise and cross-dataset samples (e.g., testing a CIFAR-10 model on MNIST data).
As shown in Figure 6, the LCP method (labeled "Ours") consistently achieves superior performance. On the MNIST dataset, it reached a near-perfect AUC-ROC of 1.0000 for noise detection. Notably, on the industrial GTSRB dataset, LCP maintained an AUC-ROC of 0.9985 when detecting MNIST outliers, whereas traditional Kernel Density estimation dropped to 0.7175. Qualitatively, the model also proved adept at flagging "corner cases"—such as blurred or heavily cropped images—within the original datasets, highlighting its value for data quality assurance.
4. Discussion and Conclusion
The success of LCP stems from its reliance on local rather than global information. By using reconstruction ease as a proxy for normalcy, the method avoids the pitfalls of assuming a single global distribution for complex, multi-modal data. While the neighborhood-based calculation introduces some computational overhead, the use of latent features makes it feasible for many applications. Future work will focus on optimizing hyperparameter selection and exploring the integration of this framework into real-time monitoring systems for autonomous vehicles.
Summary updated