Learning Non-Linear Invariants for Unsupervised Out-of-Distribution Detection
Lars Doorenbos, Raphael Sznitman, Pablo Márquez-Neila
TL;DR
This work tackles unsupervised out-of-distribution detection by generalizing the invariant-based framework from affine to non-linear invariants. It introduces NL-Invs, a volume-preserving network that learns non-linear invariants to define a zero-level manifold in feature space, with multi-scale invariants learned from pyramidal CNN features. The method scores samples via an invariant-based term augmented by a 2-NN component and is trained with a forward invariant loss plus a backward reconstruction loss to enforce meaningful invariants. Evaluated on large-scale U-OOD benchmarks and shallow tabular datasets, NL-Invs achieves state-of-the-art performance and demonstrates robustness across architectures and hyperparameters, highlighting the practical potential of invariant-based OOD detection.
Abstract
The inability of deep learning models to handle data drawn from unseen distributions has sparked much interest in unsupervised out-of-distribution (U-OOD) detection, as it is crucial for reliable deep learning models. Despite considerable attention, theoretically-motivated approaches are few and far between, with most methods building on top of some form of heuristic. Recently, U-OOD was formalized in the context of data invariants, allowing a clearer understanding of how to characterize U-OOD, and methods leveraging affine invariants have attained state-of-the-art results on large-scale benchmarks. Nevertheless, the restriction to affine invariants hinders the expressiveness of the approach. In this work, we broaden the affine invariants formulation to a more general case and propose a framework consisting of a normalizing flow-like architecture capable of learning non-linear invariants. Our novel approach achieves state-of-the-art results on an extensive U-OOD benchmark, and we demonstrate its further applicability to tabular data. Finally, we show our method has the same desirable properties as those based on affine invariants.
