Source-linked AI summary
SPK: Eliciting Structured Prior Knowledge for Interpretable Out-of-Distribution Detection in Real-Time Object Detection
Changshun Wu, Weicheng He, Xiaowei Huang, Saddek Bensalem
TL;DR
Object detectors can confidently hallucinate detections for objects outside their training categories, while existing methods score opaque representations or modify the detector without explicitly decoding its latent priors. SPK elicits semantic, geometric, and contextual priors from pretrained detectors into a compact five-dimensional representation and achieves state-of-the-art OoD detection across diverse architectures and benchmarks.
Problem
Object detectors produce over-confident OoD hallucinations, but the latent priors in their representations remain largely unexplored for OoD detection.
Method
SPK uses in-distribution and hallucination-inducing samples as diagnostic supervision to elicit part-level semantic concepts and combine them with geometric and contextual priors.
Results
SPK achieves state-of-the-art OoD detection across diverse detector architectures and multiple OoD benchmarks, while a lightweight iForest surpasses Proximal-OoD.
Takeaways & Limitations
Pretrained object detectors encode rich latent knowledge that can be explicitly organized into a compact, structured, interpretable space for prediction reliability analysis.
Abstract
from arXiv · showhide
Object detectors often produce over-confident predictions for objects outside their training categories, leading to so-called out-of-distribution (OoD) hallucinations. Existing approaches for detecting or mitigating such hallucinations typically either construct scoring functions directly over learned object detector representations or modify the object detector itself to suppress hallucination emergence. However, the latent priors implicitly encoded in these representations remain largely unexplored and have not been explicitly decoded for OoD detection. To uncover and exploit these latent priors, we propose Structured Prior Knowledge (SPK), a hallucination-oriented framework that explicitly elicits OoD-relevant priors from pretrained object detectors. Specifically, SPK leverages in-distribution data and hallucination-inducing samples as diagnostic supervision to elicit part-level semantic concepts underlying object detector decision-making, rather than using them merely for rejection or object detector adaptation. The elicited semantic priors are further integrated with geometric and contextual priors to form a compact five-dimensional SPK representation for OoD detection. Extensive experiments across diverse object detector architectures and multiple OoD benchmarks demonstrate that SPK achieves state-of-the-art OoD detection. Our findings reveal that pretrained object detectors already encode substantially richer latent knowledge than is typically exploited for OoD detection. More importantly, this knowledge can be explicitly elicited and organized into a compact, structured, and interpretable knowledge space for prediction reliability analysis. This suggests a promising proactive route for improving object detector reliability by explicitly uncovering and leveraging latent priors. Code and data are available at: https://gricad-gitlab.univ-grenoble-alpes.fr/dnn-safety/spk
Introduction
SPK explicitly elicits latent, hallucination-relevant priors from pretrained object detectors and organizes them into a compact, interpretable representation for OoD detection. Across diverse architectures and benchmarks, it improves OoD hallucination mitigation and achieves state-of-the-art detection performance.
- OoD hallucinations arise when detectors confidently classify objects outside their predefined training categories, threatening downstream vision-system reliability and safety.
- Existing methods either reactively score detector outputs and representations or proactively adapt detectors to reduce hallucination occurrence.
- SPK elicits latent priors from pretrained detectors using hallucination-inducing samples as diagnostic supervision rather than for outlier exposure or detector adaptation.
- SPK combines part-level semantic, geometric, and contextual priors into a compact five-dimensional representation for OoD detection.The representation includes three semantic priors, one geometric prior, and one contextual prior.
- A lightweight iForest operating on SPK surpasses Proximal-OoD, the strongest existing mitigation strategy, across diverse detector architectures.
- SPK achieves state-of-the-art OoD detection while enabling lightweight, interpretable deployment and revealing rich latent knowledge in pretrained detectors.
Related Work
Prior work has established that deep-network representations contain interpretable semantic information, while OoD detection in object detectors has developed reactive and proactive approaches. SPK builds on these lines by eliciting class-wise semantic knowledge from pretrained detectors.
- Object-detector OoD methods are commonly divided into reactive approaches that detect hallucinations and proactive approaches that intervene in detector behavior.
- SPK elicits class-wise semantic prototypes from pretrained detectors, providing an interpretable view of evidence used in predictions and supporting OoD hallucination detection.
- Feature decoding and concept-based representation learning show that intermediate deep-network representations can encode human-interpretable semantic information.
Problem Formulation
The problem formulation models object detection as predictions over an in-distribution category set and defines OoD detection as rejecting hallucination-inducing predictions from disjoint OoD inputs. Hallucinations may arise from OoD objects or background regions.
- A detector trained on an in-distribution dataset produces predictions consisting of bounding boxes and categories from a predefined category set.
- OoD detection uses a binary decision function to reject predictions generated on inputs whose object categories are disjoint from the in-distribution categories.
- OoD-induced hallucinations can originate from objects outside the training categories or background regions that spuriously activate detector responses.
Structured Prior Knowledge Framework
SPK explicitly elicits semantic, geometric, and contextual priors from pretrained object detectors and organizes them into a compact five-dimensional representation for OoD hallucination detection. Its semantic module decodes part-level concepts using hallucination-oriented supervision, while geometric and contextual descriptors capture object-scale regularities and image similarity to ID data.
- Framework overview: SPK elicits semantic, geometric, and contextual priors through hallucination-oriented supervision rather than directly operating on high-dimensional detector representations.The framework is designed to uncover factors contributing to detector decisions while retaining the priors already encoded by pretrained detectors.
- Framework overview: Hallucination-inducing data comprise proximal OoD objects and background-only images, used with ID data to elicit semantic priors.The pipeline retrieves semantically or visually similar non-ID categories and collects filtered background-only samples for supervision.
- Semantic prior elicitation: The semantic head represents category-specific concepts as spatial activation channels and decodes interpretable part-level responses from detector features without pixel-level segmentation.Concept vocabularies include ID parts, proximal-OoD concepts, and background concepts; predictions are trained on fixed RoI grids and cell-level concept masks.
- Semantic prior elicitation: Three complementary semantic objectives reconstruct part concepts, suppress absent concepts, and align dominant responses with the underlying semantic source.The objectives include Dice reconstruction, spurious concept suppression, and a group-level objective over ID, proximal-OoD, and background groups.
- Geometric and contextual priors: The geometric prior is a resolution-invariant relative-area statistic, while the contextual prior measures similarity between a prediction’s image and ID training images.Together with three semantic priors, these descriptors form an interpretable five-dimensional SPK vector.
Experiments
SPK is evaluated across detector architectures, datasets, OoD types, and both detection and hallucination-mitigation settings. Results indicate that its structured representation improves existing detectors and mitigates hallucinations without modifying the underlying detector.
- Evaluation setting: The evaluation spans YOLO, Faster R-CNN, and RT-DETR on PASCAL-VOC and BDD-100K, with Near-OoD and Far-OoD samples.The study uses AUROC, FPR95, and reductions in OoD-induced hallucinations.
- Evaluation setting: SPK constructs a structured prior representation for existing OoD detectors rather than introducing a new OoD detector or modifying the object detector.The evaluation tests both discriminability improvements and hallucination mitigation.
- OoD detection: Replacing raw detector features with SPK consistently improves MDS, BAM, KNN, and iForest across architectures and benchmarks.The same OoD detection algorithms are used, so the reported gains primarily reflect the learned representation space.
- Hallucination mitigation: SPK removes substantially more OoD-induced hallucinations than Proximal-OoD-based fine-tuning across three detector architectures without modifying or fine-tuning the detector.This comparison evaluates practical mitigation beyond standard OoD detection metrics.
- Ablations: Removing any semantic-elicitation loss degrades performance, while jointly optimizing Dice, group discrimination, and spatial consistency losses achieves the best results.The losses provide complementary part-level supervision, semantic grouping, and spatial regularization.
- Ablations: Semantic, geometric, and contextual priors provide complementary cues, with contextual priors improving performance particularly on the more complex BDD-100K benchmark.The added contextual benefit is relatively limited on PASCAL-VOC.
Conclusion
The paper presents SPK as a proactive framework for eliciting latent priors from pretrained object detectors into a compact, interpretable representation. Its scope is limited to two representative hallucination sources, while future work targets broader sources and richer priors.
- Conclusion: SPK explicitly elicits latent priors from pretrained object detectors and organizes them into a compact, interpretable knowledge space for OoD detection.The framework enables OoD detection and hallucination mitigation without modifying the underlying detector.
- Conclusion: Experiments across diverse detector architectures and benchmark settings demonstrate SPK’s effectiveness and generality.The results also indicate that pretrained detectors encode richer latent knowledge than is typically exploited for OoD detection.
- Conclusion: The framework focuses on proximal OoD objects and background-induced false predictions, with extensions to additional hallucination sources and broader reliability challenges left for future work.Future work will investigate richer latent priors and improved use of elicited knowledge to prevent hallucination generation.
Proximal mining
Proximal OoD mining targets categories visually or semantically similar to each in-distribution category. The pipeline uses generated candidate categories that remain disjoint from the in-distribution categories.
- Proximal mining: Proximal OoD categories are curated because their semantic or visual similarity to in-distribution categories can induce detector hallucinations.The categories are intended to be disjoint from the in-distribution label set while remaining similar to the corresponding category.
Background mining
Background mining probes hallucinations caused by textures or local cues that resemble in-distribution objects. Background-only texture samples are filtered for in-distribution objects and support automated part-level semantic supervision.
- Background mining: Background-only samples from the Describable Textures Dataset are used to capture hallucinations triggered by object-like textures or local cues.The dataset provides diverse real-world texture patterns for probing background-induced detector responses.
- Background mining: Because texture images may contain in-distribution objects, YOLOE-11-L is used to filter out images containing them.The filtering addresses the dataset’s lack of object-level annotations.
- Background mining: The automated part-level annotation tool generates semantic supervision for training the semantic elicitation head without relying on labor-intensive manual annotation.The tool is designed to scale concept annotation for detector predictions.
- Background mining: The annotation tool improves mIoU by 3.8 percentage points and Recall@0.5 by 1.6 percentage points over VLPart, with the best Concept-mIoU on six of seven classes.These results support the accuracy of its automatically generated part-level semantic annotations.
Multi-Scale RoI Feature Extraction
SPK combines multi-scale RoI features with semantic, geometric, and contextual priors to represent detector predictions. This structured representation supports interpretable OoD analysis and improves detection across architectures and benchmarks.
- Multi-Scale RoI Feature Extraction: YOLO and RT-DETR concatenate RoI-aligned features from three spatial scales, while Faster R-CNN uses Detectron2’s box_pooler output.The resulting features combine fine-grained spatial evidence with coarser semantic context.
- Semantic Prior Elicitation: YOLOv10 processes 896 × 7 × 7 RoI features through a lightweight head that outputs spatial concept logits for semantic elicitation.The head projects 896 channels to 256, applies two residual convolutional blocks, and predicts a C × 7 × 7 concept-logit tensor.
- Semantic Prior Elicitation: Class-specific semantic heads aggregate spatial concept logits with log-sum-exp to produce semantic-prior vectors for each predicted category.Part vocabularies reflect category-specific concepts such as wings for birds and caps for bottles.
- Contextual Prior: Contextual priors compare normalized image-level multi-scale feature statistics with the five nearest class-specific training references using cosine similarity.A small contextual distance indicates an ID-like context, whereas a large distance indicates an atypical context.
- Experimental Results: SPK variants achieve the best performance in ten of twelve uncalibrated evaluation cases and rank second in the remaining case.The evaluations cover Deformable-DETR and Faster R-CNN across PASCAL-VOC, BDD-100K, MS-COCO, and OpenImages.
- Efficiency: 12.65 ms per image is the reported SPK inference time on an NVIDIA A4000-8GB GPU, with semantic elicitation and Isolation Forest adding only marginal latency.Detection outputs, contextual embeddings, and RoI features are extracted within the same forward pass.