Abstract: Out-of-Distribution (OOD) detection is essential for the trustworthiness of AI systems. Methods using prior information (i.e., subspace-based methods) have shown effective performance by extracting information geometry to detect OOD data with a more appropriate distance metric. However, these methods fail to address the geometry distorted by ill-distributed samples, due to the limitation of statically extracting information geometry from the training distribution. In this paper, we argue that the influence of ill-distributed samples can be corrected by dynamically adjusting the prior geometry in response to new data. Based on this insight, we propose a novel approach that dynamically updates the prior covariance matrix using real-time input features, refining its information. Specifically, we reduce the covariance along the direction of real-time input features and constrain adjustments to the residual space, thus preserving essential data characteristics and avoiding effects on unintended directions in the principal space. We evaluate our method on two pre-trained models for the CIFAR dataset and five pre-trained models for ImageNet-1k, including the self-supervised DINO model. Extensive experiments demonstrate that our approach significantly enhances OOD detection across various models. The code is released at https://github.com/workerbcd/ooddcc.
Lay Summary: **Problem:** Out-of-distribution (OOD) data, such as novel categories different from the seen classes in the training data, can lead to overconfident or unreliable predictions of AI models. Thus, detecting such data is crucial to make AI more trustworthy and safe. Existing methods rely on well-formed in-distribution (ID), i.e., the training data, which ignores the effect of the outlier points on the performance of detection. Therefore, we propose our research question: How to reduce the effect of outliers in OOD detection.
**Solution:** We address this problem by modifying matrix-induced distances, which is formed as $d(f,a) = \sqrt{(f-a)\top M^{-1}(f-a)}$, where $M$ is a symmetric matrix derived from ID data, $a$ is the anchor point from the ID data and $f$ is from the test data. For every step, we utilize $f$ to adjust $M$ to alleviate the effect of ID outlier points on $M$. Specifically, we project $f$ to the residual space (the SVD space of ID data corresponding to smallest eigenvalues) and shrink the expansion of $M$ aligned with the direction of projected $f$. This process benefits from the property of ID residual space, which tends to capture more information relevant to OOD data. We adopt this strategy to the Mahalanobis distance where $M$ is the covariance matrix of ID data. We theoretically analyse the situation when our method can work solidly.
**Impact:** Our findings provide a strategy to help improve the performance of distance-based score function in finding the performance boundary of AI models, especially on the relatively poor-clustered models.
Application-Driven Machine Learning: This submission is on Application-Driven Machine Learning.
Link To Code: https://github.com/workerbcd/ooddcc.
Primary Area: Social Aspects->Safety
Keywords: Out-of-distribution detection, Mahalanobis distance, Covariance adjustment
Submission Number: 5665
Loading