A Novel Statistical Measure for Out-of-Distribution Detection in Data Quality Assurance

Tinghui Ouyang, Isao Echizen, Yoshiki Seo

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.

Figure 2: The proposed two-stage framework for OOD detection, utilizing an Autoencoder for feature extraction followed by various statistical measures, including the novel LCP.

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).

Figure 6: ROC curves comparing the proposed LCP method ("Ours") against traditional measures (KD, LOF, MD, kNN) for (a) noise outliers and (b) CIFAR10 outliers.

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

Abstract

Data outside the problem domain poses significant threats to the security of AI-based intelligent systems. Aiming to investigate the data domain and out-of-distribution (OOD) data in AI quality management (AIQM) study, this paper proposes to use deep learning techniques for feature representation and develop a novel statistical measure for OOD detection. First, to extract low-dimensional representative features distinguishing normal and OOD data, the proposed research combines the deep auto-encoder (AE) architecture and neuron activation status for feature engineering. Then, using local conditional probability (LCP) in data reconstruction, a novel and superior statistical measure is developed to calculate the score of OOD detection. Experiments and evaluations are conducted on image benchmark datasets and an industrial dataset. Through comparative analysis with other common statistical measures in OOD detection, the proposed research is validated as feasible and effective in OOD and AIQM studies.
BibTeX
@inproceedings{ouyang2023novel,
  author = {Tinghui Ouyang and Isao Echizen and Yoshiki Seo},
  title = {{A Novel Statistical Measure for Out-of-Distribution Detection in Data Quality Assurance}},
  booktitle = {APSEC},
  year = {2023},
  doi = {10.1109/apsec60848.2023.00057},
}
Figure