Manuscript Offprint

arXiv:2609.08281

SAM3-O2D2: Zero-Shot Object Out-of-Distribution Detection by Object Class Prompting of the SAM3-Image Model

Lucas Görnhardt, Timo Bartels, Tim Fingscheidt

Abstract

Object detectors have shown remarkable performance in various fields, among these medical imaging, surveillance, and autonomous driving. However, they are prone to over-confidence when encountering unseen objects in real-world deployments, causing potential safety issues. To address this, detecting out-of-distribution (OOD) objects is essential for reliable object detection. Modern approaches leverage the broad semantic knowledge of foundation models such as CLIP for post-hoc few- and zero-shot OOD detection. However, these methods typically perform OOD assessment in feature space, which can be sensitive to object detector localization errors and variations in object appearance. Moreover, the current state-of-the-art (SOTA) zero-shot method performs computationally costly diffusion in inference. In this work, for our proposed zero-shot object OOD detection method SAM3-O2D2, we employ the SAM3-image foundation model in an efficient manner. Specifically, we prompt SAM3 only with the object detector's predicted classes and compare the predictions of the object detector and SAM3. An object is in-distribution (ID), if SAM3 also detects an object at the corresponding location. If SAM3 does not detect the prompted object, this indicates a mismatch between the detector's prediction and the image content, suggesting that the object is OOD. Experimental results show that our method significantly surpasses the so-far zero-shot SOTA method. Specifically, we achieve new SOTA AuROC and FPR95 metrics over both ID datasets Pascal-VOC and BDD100K and both OOD datasets MS-COCO and OpenImages.

1. Introduction

Detecting out-of-distribution (OOD) objects is crucial for the safe deployment of object detection systems in the real world. Object detectors are typically trained on a closed set of in-distribution (ID) classes, resulting in overconfidence when encountering unseen objects during deployment. Mo-

Figure

Figure 1. In our zero-shot object OOD detection, we prompt SAM3-image [2] with objects from the object detector for object OOD detection.

tivated by this challenge, extensive research has studied image-level OOD detection [4, 23, 26, 29, 38], where the entire image is treated as a single sample and is classified as either ID or OOD. However, this setting is insufficient for many real-world applications, such as autonomous driving [9], where images contain multiple objects that require independent OOD assessment.

Consequently, object OOD detection has emerged as a more suitable formulation for such object-level requirements [5, 6]. In this task, each detected object must be independently classified as ID (✓) or OOD (X), see Fig. 1. Classical approaches [5, 6] rely on training of additional detection modules alongside the object detector to distinguish between ID and OOD objects. However, these meth-ods require access to full ID training data and need to be retrained for each newly deployed object detector. Moreover, the performance of such small models falls behind the performance of modern vision-language foundation models such as CLIP [31].

Recent few-shot methods [19, 47] address these limitations by leveraging CLIP [31] for object OOD detection. They use pre-trained image and text encoders to extract local and global visual representations and compare them with text embeddings obtained from class prompts. While these approaches achieve strong performance, they still require fine-tuning of additional modules for each ID dataset. In contrast, RONIN [30] proposes a zero-shot approach based on class-conditioned inpainting. Given a predicted object and its class label, RONIN uses a text-conditioned diffusion model to inpaint the object region according to the predicted class and then measures the agreement between the original object, the inpainted object, and the text prompt using vision-language feature similarities. Despite achieving state-of-the-art (SOTA) zero-shot object OOD detection performance, RONIN has two important limitations. First, its reliance on diffusion-based inpainting leads to high computational cost, which limits its practical applicability. Second, its OOD decision is based on similarities in an abstract feature space, which is not necessarily robust and focused, as the embeddings entangle object appearance such as size and lighting and are not robust against detector localization errors, i.e., poorly localized bounding boxes.

We, however, take a different approach. In contrast to the CLIP-based methods [19, 30, 47] we leverage a different foundation model, namely SAM3-image [2] and propose SAM3-O2D2. In contrast to CLIP- and diffusion-based approaches [19, 30, 47], our method performs OOD detection directly at the prediction level. It achieves SOTA zero-shot object OOD detection performance while requiring lower computational cost than diffusion-based inference. The high-level concept is illustrated in Fig. 1. The input image is first processed by some object detector, which produces object predictions such as car and cow. The predicted class labels are used as text prompts for two SAM3-image calls, which returns objects corresponding to each prompted concept. As illustrated in Fig. 1, SAM3-image confirms the detector's car prediction at the same location, but does not detect a cow. This mismatch indicates that the visual content is inconsistent with the predicted class cow and instead corresponds to an OOD object, here an elephant. Thus, our method marks predictions confirmed by SAM3-image as ID (✓) and unmatched predictions as OOD (✗), leveraging its broad semantic knowledge. Moreover, by operating directly in the detection space rather than in an abstract feature space, our method provides a more interpretable OOD decision. This simplifies failure-case analysis, which is important for practical deployment, and improves robustness

to near-OOD objects, as reflected by our empirical results.

Our contributions are as follows. First, we introduce a framework for leveraging off-the-shelf text-promptable foundation detection models, such as SAM3, for object OOD detection and propose SAM3-O2D2, which constantly improves with the rapid developments in the field of foundation models over time. Second, our proposed SAM3-O2D2 requires no retraining and can be paired with arbitrary object detectors. It is straightforward to implement, making it highly suitable for practical deployment. Third, we evaluate our method on two ID datasets and two OOD datasets covering a diverse range of semantic scenes, and finally on one open-world setup, showing that it substantially outperforms the current SOTA zero-shot object OOD detection method RONIN [30], while even requiring lower computational complexity.

The remainder of the paper is structured as follows. Section 2 summarizes the related works. Section 3 details the proposed method for zero-shot object OOD detection. Section 4 describes the experimental setup, including datasets and metrics. Section 5 presents the experimental results. Finally, we conclude in Section 6.

References (49)

  • A Novel Benchmark for Refinement of Noisy Localization Labels in Autolabeled Datasets for Object Detection
  • SAM 3: Segment Anything with Concepts
  • PLOT: Prompt Learning with Optimal Transport for Vision-Language Models
  • Zero-Shot Out-of-Distribution Detection with Outlier Label Exposure
  • SIREN: Shaping Representations for Detecting Out-of-Distribution Objects
  • VOS: Learning What You Don't Know by Virtual Outlier Synthesis
  • Zero-Shot Out-of-Distribution Detection Based on the Pre-trained Model CLIP. In Proc
  • The PASCAL Visual Object Classes (VOC) Challenge
  • Deep Neural Networks and Data for Automated Driving: Robustness, Uncertainty Quantification, and Insights Towards Safety
  • DIFFGUARD: Semantic Mismatch-Guided Out-of-Distribution Detection Using Pre-Trained Diffusion Models
  • Denoising Diffusion Models for Out-of-Distribution Detection
  • A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks
  • Scaling Out-of-Distribution Detection for Real-World Settings
  • Generalized ODIN: Detecting Out-of-Distribution Image Without Learning From Out-of-Distribution Data
  • Negative Label Guided OOD Detection with Pretrained Vision-Language Models
  • The Open Images Dataset V4: Unified Image Classification, Object Detection, and Visual Relationship Detection at Scale
  • A Simple Unified Framework for Detecting Out-of-Distribution Samples and Adversarial Attacks
  • Rethinking Out-of-Distribution (OOD) Detection: Masked Image Modeling Is All You Need
  • UNI-OOD: Unified Object-and Image-level Out-of-Distribution Detection via Cross-Context Attentive Vision-Language Modeling
  • Enhancing the Reliability of Out-Of-Distribution Image Detection in Neural Networks
  • Microsoft COCO: Common Objects in Context
  • Energy-based Out-of-Distribution Detection
  • TAG: Text Prompt Augmentation for Zero-Shot Out-of-Distribution Detection'
  • Unsupervised Out-of-Distribution Detection with Diffusion Inpainting
  • Learning with Mixture of Prototypes for Out-of-Distribution Detection
  • Delving into Out-of-Distribution Detection with Vision-Language Representations
  • How to Exploit Hyperspherical Embeddings for Out-of-Distribution Detection? In Proc
  • LoCoOp: Few-Shot Out-of-Distribution Detection via Prompt Learning
  • GL-MCM: Global and Local Maximum Concept Matching for Zero-Shot Out-of-Distribution Detection
  • Detecting Out-of-Distribution Objects through Class-Conditioned Inpainting
  • Learning Transferable Visual Models From Natural Language Supervision
  • Likelihood Ratios for Out-of-Distribution Detection
  • Interspeech 2025 URGENT Speech Enhancement Challenge
  • Detecting Out-of-Distribution Examples with Gram Matrices
  • Unsupervised anomaly detection with generative adversarial networks to guide marker discovery
  • Out-of-Distribution Detection with Deep Nearest Neighbors
  • CSI: Novelty Detection via Contrastive Learning on Distributionally Shifted Instances
  • CLIPN for Zero-Shot OOD Detection: Teaching CLIP to Say No. In Proc
  • Mitigating Neural Network Overconfidence with Logit Normalization
  • SAFE: Sensitivity-Aware Features for Out-of-Distribution Object Detection
  • Discriminating Known from Unknown Objects via Structure-Enhanced Recurrent Variational AutoEncoder
  • Percept, Memory, and Imagine: World Feature Simulating for Open-Domain Unknown Object Detection
  • Deep Feature Deblurring Diffusion for Detecting Out-of-Distribution Objects
  • Likelihood Regret: An Out-of-Distribution Detection Score For Variational Auto-encoder
  • Do We Really Need to Learn Representations from In-domain Data for Outlier Detection? arXiv:2105.09270, 2021 (opens arXiv in a new tab)
  • BDD100K: A Diverse Driving Video Database With Scalable Annotation Tooling (opens arXiv in a new tab)
  • RUNA: Object-level Out-of-Distribution Detection via Regional Uncertainty Alignment of Multimodal Representations
  • Learning to Prompt for Vision-Language Models
  • Deformable DETR: Deformable Transformers for End-to-End Object Detection