cs.LGDec 20, 2025

Out-of-Distribution Detection in Molecular Complexes via Diffusion Models for Irregular Graphs

Authors: David GraberVictor ArmegioiuRebecca BullerSiddhartha Mishra

Organizations: Seminar for Applied Mathematics, Department of Mathematics and ETH AI Center, ETH Zurich, 8092 Zurich, Switzerland · Institute for Computational Life Sciences, Zurich University of Applied Sciences, 8820 Waedenswil, Switzerland · Department of Chemistry, Biochemistry and Pharmaceutical Sciences, University of Bern, 3012 Bern, Switzerland

Abstract

Predictive machine learning models generally excel on in-distribution data, but their performance degrades on out-of-distribution (OOD) inputs. Reliable deployment therefore requires robust OOD detection, yet this is particularly challenging for irregular 3D graphs that combine continuous geometry with categorical identities and are unordered by construction. Here, we present a probabilistic OOD detection framework for complex 3D graph data built on a diffusion model that learns a density of the training distribution in a fully unsupervised manner. A key ingredient we introduce is a unified continuous diffusion over both 3D coordinates and discrete features: categorical identities are embedded in a continuous space and trained with cross-entropy, while the corresponding diffusion score is obtained analytically via posterior-mean interpolation from predicted class probabilities. This yields a single self-consistent probability-flow ODE (PF-ODE) that produces per-sample log-likelihoods, providing a principled typicality score for distribution shift. We validate the approach on protein-ligand complexes and construct strict OOD datasets by withholding entire protein families from training. PF-ODE likelihoods identify held-out families as OOD and correlate strongly with prediction errors of an independent binding-affinity model (GEMS), enabling a priori reliability estimates on new complexes. Beyond scalar likelihoods, we show that multi-scale PF-ODE trajectory statistics - including path tortuosity, flow stiffness, and vector-field instability - provide complementary OOD information. Modeling the joint distribution of these trajectory features yields a practical, high-sensitivity detector that improves separation over likelihood-only baselines, offering a label-free OOD quantification workflow for geometric deep learning.

Explore similar work

May 13, 2026cs.LG

What Information Matters? Graph Out-of-Distribution Detection via Tri-Component Information Decomposition

Graph neural networks are widely used for node classification, but they remain vulnerable to out-of-distribution (OOD) shifts in node features and graph structure. Prior work established that methods trained with standard supervised learning (SL) objectives tend to capture spurious signals from either features and/or structure, leaving the model fragile under distributional changes. To address this, we propose TIDE, a novel and effective Tri-Component Information Decomposition framework that explicitly decomposes information into feature-specific, structure-specific and joint components. TIDE aims to preserve only the label-relevant part of the joint information while filtering out spurious feature- and structure-specific information, thereby enhancing the separation between in-distribution (ID) and OOD nodes. Beyond the framework, we provide theoretical and empirical analyses showing that an information bottleneck objective is preferable to standard SL for graph OOD detection, with higher ID confidence and a greater entropy gap between ID and OOD data. Extensive experiments across seven datasets confirm the efficacy of TIDE, achieving up to a 34% improvement in FPR95 over strong baselines while maintaining competitive ID accuracy.
Danny Wang, Ruihong Qiu, Zi Huang
Sep 16, 2024cs.CV

Beyond Perceptual Distance: Discrepancy Assessment on Deep Representation for Out-of-Distribution Detection with Diffusion Model

Out-of-Distribution (OoD) detection aims to justify whether a given sample is from the training distribution of the classifier-under-protection, i.e., In-Distribution (InD), or from an unknown out distribution. Recent researches have leveraged Diffusion Models (DMs) for OoD detection due to their powerful distribution modeling capability. Given an input image, an InD-pretrained DM produces a corresponding InD-aligned counterpart, which serves as a generative reference for comparison. However, existing DM-based methods typically assess this underlying discrepancy through visual-level distances in the raw image space, which may be misaligned with the distributional discrepancy relevant to OoD detection. In this work, we investigate the fundamentals of discrepancy assessment in DM-based OoD detection, asking how the discrepancy between an input and its DM-generated counterpart should be formulated, and in which representation spaces and with which metrics it should be measured. To this end, we propose to assess the discrepancy in a classifier-relative manner by exploiting the representation spaces of the classifier-under-protection, whose training on InD data encodes rich task-relevant InD knowledge. In particular, we quantify two types of discrepancy: feature-level covariate discrepancy in deep feature representations and logit-level concept discrepancy in output logits, enabling effective differentiation between InD and OoD samples. Moreover, a subspace-based strategy is devised to refine representations of the DM generation to promote discrepancy assessment. Together, these designs form our novel detection framework, namely DDR. Extensive experiments on the challenging large-scale ImageNet-1K dataset demonstrate the superior detection performance of DDR over both DM-based and non-DM-based methods.
Kun Fang, Zuopeng Yang, Haibo Hu +3
May 5, 2026cs.AI

Geometry over Density: Few-Shot Cross-Domain OOD Detection

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 \sim100 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 \sim500×\times improvement in sample efficiency. See our code in https://github.com/lili0415/UFCOD.
Shawn Li, You Qin, Jiate Li +4