TL;DR
This paper introduces RONIN, a novel post-hoc method for detecting out-of-distribution (OOD) objects in images. By leveraging off-the-shelf text-to-image generative models, RONIN inpaints detected objects based on their predicted class labels and measures the resulting reconstruction error to identify OOD instances, achieving state-of-the-art performance without retraining.
What Problem Does This Paper Address?
Object detection systems are increasingly deployed in real-world scenarios where they encounter objects not seen during training – so-called out-of-distribution (OOD) objects. A critical issue is that these detectors often exhibit overconfidence, misclassifying OOD objects as known categories, leading to unreliable predictions. Existing solutions often require retraining the detector, which is impractical for users relying on pre-trained models. This paper addresses the need for a post-hoc, zero-shot OOD detection method that can be applied to existing object detectors without modification.
Methods
The core of RONIN lies in its innovative use of class-conditioned inpainting. Given an image with detected objects and their predicted in-distribution (ID) class labels, RONIN performs the following:
- Class-Conditioned Inpainting: For each detected object, a portion of the image corresponding to the object's bounding box is masked. A pre-trained text-to-image diffusion model (like Stable Diffusion) is then used to "inpainting" this masked region, conditioned on the predicted ID class label. The hypothesis is that if the object is truly an ID object, the inpainted version will closely resemble the original. If it's an OOD object, the inpainting, guided by the incorrect ID label, will likely result in a significantly different reconstruction.
- Class-wise Inpainting: To improve efficiency, RONIN groups objects with the same predicted label for a single inpainting process, rather than processing each object individually.
- Vision-Language Triplet Measurement: To robustly assess the OOD status, RONIN computes three similarity scores:
- Similarity between the original object and its predicted label.
- Similarity between the inpainted object and its predicted label.
-
Similarity between the original object and the inpainted object. These scores are combined into a "triplet OOD score" that quantifies the alignment. A low score indicates an OOD object.
-
Refined Prompting for Near-OOD: For challenging "near-OOD" cases (objects semantically similar to ID classes), RONIN proposes a "refined" prompting strategy. This involves using knowledge graphs or taxonomies to identify closely related non-ID concepts and explicitly instructing the generative model not to inpaint these concepts, thereby encouraging a more distinct reconstruction.
Datasets
The paper evaluates RONIN on several standard datasets:
- ID Data: Pascal-VOC, BDD-100K
- OOD Data: MS-COCO, OpenImages
For near-OOD detection, a custom small-scale dataset was constructed by pairing visually and semantically similar ID objects from Pascal-VOC with OOD counterparts from MS-COCO and OpenImages.
Key Insights and Ideas
- Generative Models as OOD Detectors: The fundamental insight is that discriminative object detectors and generative models have different training objectives and thus exhibit different behaviors on OOD data. This difference can be exploited for OOD detection.
- Inpainting as a Discrepancy Measure: Using inpainting to reconstruct an object based on its predicted label provides a powerful way to measure the discrepancy between the detector's prediction and the generative model's understanding of that label.
- Post-hoc and Zero-Shot Applicability: The method's ability to work without retraining the object detector or requiring OOD training data makes it highly practical for real-world deployment.
- Triplet Similarity for Robustness: Combining multiple similarity measures (original-label, inpainted-label, original-inpainted) provides a more robust signal for OOD detection than any single measure alone.
- Refined Prompting for Nuance: The "refined prompting" technique demonstrates that generative models, when guided with more context, can effectively distinguish even subtly different near-OOD objects.
Key Results
- State-of-the-Art Performance: RONIN consistently outperforms existing zero-shot and non-zero-shot OOD detection methods across various settings, achieving top AUROC scores. For instance, on MS-COCO with OpenImages as OOD, RONIN (20 steps) achieves an AUROC of 93.10%, significantly better than many baselines.
- Efficiency with Few Steps: Even with as few as 5 denoising steps in the diffusion model, RONIN achieves competitive performance, outperforming training-based methods like VOS and SIREN.
- Near-OOD Success: The refined prompting strategy for near-OOD detection shows improved performance (e.g., AUROC of 98.03% vs. 96.86% for simple prompting), highlighting the model's ability to handle challenging cases.
- Minimal Impact on ID Objects: RONIN demonstrates stable OOD detection without degrading ID accuracy, with high recall (e.g., 96.67% on BDD) and low ID rejection rates.
Limitations and Future Work
- Runtime: The paper acknowledges that diffusion models can be slower than object detectors, impacting real-time applications. However, they show that reducing denoising steps and image size can significantly speed up inference with minimal performance degradation.
- Inpainting Failures: Qualitative results show that RONIN can suffer from inpainting failures, particularly with small, occluded, or poorly lit objects, or when OOD objects are too visually similar to the original, leading to less effective OOD scores.
- Future Work: The authors suggest that advancements in generative modeling, particularly in efficiency (e.g., one-step diffusion), will further benefit RONIN. The flexibility and adaptability of RONIN to different object detectors and its potential for offline post-processing applications are highlighted. The refined prompting technique also opens avenues for more sophisticated OOD detection by leveraging external knowledge.
Summary updated