Abstract
To facilitate reliable deployments of autonomous robots in the real world, Out-of-Distribution (OOD) detection capabilities are often required. A powerful approach for OOD detection is based on density estimation with Normalizing Flows (NFs). However, we find that prior work with NFs attempts to match the complex target distribution topologically with naive base distributions, leading to adverse implications. In this work, we circumvent this topological mismatch using an expressive class-conditional base distribution trained with an information-theoretic objective to match the required topology. The proposed method enjoys the merits of wide compatibility with existing learned models without any performance degradation and minimum computation overhead while enhancing OOD detection capabilities. We demonstrate superior results in density estimation and 2D object detection benchmarks in comparison with extensive baselines. Moreover, we showcase the applicability of the method with a real-robot deployment.
Introduction
For autonomous robots—such as self-driving cars or industrial delivery drones—the ability to identify unknown or novel scenarios is a fundamental safety requirement. This capability, known as Out-of-Distribution (OOD) detection, ensures that a robot can recognize when it encounters an object or environment it was not trained to handle. For instance, a robot trained to inspect industrial valves must be able to flag a stray animal as "unknown" rather than overconfidently misclassifying it as a known component.
Normalizing Flows (NFs) have emerged as a popular tool for this task. By learning a bijective mapping between a simple "base" distribution (typically a standard Gaussian) and the complex distribution of the training data, NFs allow for precise density estimation. During inference, any observation with a low probability under the model can be flagged as OOD. However, standard NFs face a significant mathematical hurdle: topological mismatch.
The Challenge: Topological Mismatch and "Filaments"
Real-world data is often multimodal, consisting of several disconnected clusters in the feature space. Conversely, the standard base distribution used in NFs is a single, continuous Gaussian "blob." Because NFs rely on continuous, invertible transformations, the model is forced to "stretch" the base distribution to cover all data clusters.
This stretching creates "filaments"—regions of high probability mass that bridge the gaps between valid data clusters. Unfortunately, OOD objects frequently fall into these filaments. Because the model assigns high probability to these empty spaces, it fails to detect the OOD objects, leading to dangerous false positives.
Proposed Methodology: Topology-Matching NFs
To address this, we introduce Topology-Matching Normalizing Flows. Instead of increasing the complexity of the transformation layers, we focus on making the base distribution itself more expressive. Our approach consists of two primary innovations:
1. Conditional Resampled Base Distributions (cRSB)
Rather than forcing the NF to start with a simple Gaussian, we utilize a flexible, class-conditional base distribution. This base distribution is designed to "shape-shift" to match the number of modes (clusters) present in the target data. By making the distribution aware of object labels, the base distribution learns the underlying topology of the data, effectively unburdening the flow layers from having to bridge disconnected components.
2. Information Bottleneck (IB) Training
Simply introducing class labels into NFs can lead to optimization issues where the model ignores the global density in favor of local classification. We adapt an Information Bottleneck objective to balance two competing goals: modeling the specific characteristics of each class ($p(u|y)$) and maintaining a high-quality estimate of the overall data density ($p(u)$). This ensures that the flexible base distribution properly assimilates the topological structure of the target data without sacrificing OOD detection performance.
Experimental Evaluation
We evaluated the proposed method across three distinct tiers of complexity:
- Synthetic Benchmarks: Using datasets like "Two Moons" and "Circle of Gaussians," we verified that the model could handle disconnected components without creating high-probability filaments between them.
- Standard Vision Benchmarks: We tested the method on Open Set versions of popular object detection datasets, specifically Pascal-VOC-OS and MS-COCO-OS. These benchmarks require the model to detect objects from classes it never saw during training.
- Real-Robot Deployment: To test the "sim-to-real" gap, we trained a model on synthetic images of industrial parts (valves and crawler robots) and deployed it on an aerial manipulation robot tasked with detecting real-world objects in a laboratory setting.
Key Results and Insights
Our findings suggest that focusing on the base distribution is a highly efficient path toward robust OOD detection:
- State-of-the-Art Performance: On the Pascal-VOC-OS benchmark, our method achieved an AUROC of 0.946, significantly outperforming standard Gaussian Flows (0.915) and competitive baselines like GMMDet (0.931).
- Safety-Critical Reliability: The model demonstrated a much higher True Positive Rate (TPR) at low False Positive Rates (FPR). This is vital for robotics, where even a small number of false "In-Distribution" classifications can result in catastrophic failures.
- Computational Efficiency: When deployed on an NVIDIA Jetson Orin, the method added negligible latency and memory overhead compared to standard object detectors. This makes it highly practical for power-constrained hardware common in autonomous systems.
Conclusion and Future Work
Topology-Matching Normalizing Flows provide a mathematically sound and computationally efficient solution to the problem of topological mismatch in density estimation. By ensuring the base distribution matches the target data's structure, we eliminate the "filaments" that lead to OOD detection failures.
While the current method is highly effective, its performance remains dependent on the quality of the features provided by the underlying object detector's backbone. Future research will explore incorporating temporal consistency—analyzing sequences of frames rather than independent images—to further enhance the robustness of OOD detection in dynamic, real-world environments.
Summary updated