🤖 AI Summary
This work addresses the challenge of out-of-distribution (OOD) detection across arbitrary new domains using only around 100 unlabeled in-distribution samples from the target domain and without any retraining. The authors propose UFCOD, a novel framework that, for the first time, treats the score function of a pre-trained diffusion model as an object in information geometry. By analyzing diffusion trajectories, UFCOD constructs two discriminative features—path energy and dynamic energy—and introduces a discrete Sobolev norm to characterize the interaction between samples and the diffusion process. This approach enables a “train-once, deploy-anywhere” few-shot OOD detection paradigm, achieving an average AUROC of 93.7% across 12 cross-domain benchmarks—matching or surpassing existing methods that require 50,000 to 160,000 samples, while using approximately 500 times fewer samples.
📝 Abstract
Out-of-distribution (OOD) detection identifies test samples that fall outside a model's training distribution, a capability critical for safe deployment in high-stakes applications. Standard OOD detectors are trained on a specific in-distribution (ID) dataset and detect deviations from that single domain. In contrast, we study few-shot cross-domain OOD detection: given a \emph{single} pre-trained model, can we perform OOD detection on \emph{arbitrary} new ID-OOD task pairs using only a handful of ID samples at inference time, with no additional training? We propose \textbf{UFCOD}, a unified framework that achieves this goal through information-geometric analysis of diffusion trajectories. Our key insight is that diffusion noise predictions are score functions (gradients of log-density), and we extract two energy features: \emph{Path Energy} (integrated score magnitude) and \emph{Dynamics Energy} (score smoothness), that form a discrete Sobolev norm capturing how samples interact with the learned diffusion process. The central contribution is a \textbf{train-once, deploy-anywhere} paradigm: a diffusion model trained on a single dataset (e.g., CelebA) serves as a universal feature extractor for OOD detection across semantically unrelated domains (e.g., CIFAR-10, SVHN, Textures). At deployment, each new task requires only $\sim$100 unlabeled ID samples for inference: no retraining, no fine-tuning, no task-specific adaptation. Using 100 ID samples per task, UFCOD achieves 93.7\% average AUROC across 12 cross-domain benchmarks, competitive with methods trained on 50k--163k samples, demonstrating $\sim$500$\times$ improvement in sample efficiency. See our code in https://github.com/lili0415/UFCOD.