One email each morning — yesterday's AI, sortedGet it in your inbox

METAL LAB

SPK: Eliciting Structured Prior Knowledge for Interpretable Out-of-Distribution Detection in Real-Time Object Detection

arXiv:2608.190802026-08-18

Pulling out five simple numbers already hidden inside an object detector to catch its confident mistakes on unknown objects

Object detectors used in self-driving cars and robots often give confident but wrong predictions when they see objects outside their training categories, a problem called OoD hallucination. This paper introduces SPK, a method that extracts semantic, geometric, and contextual clues already latent inside a pretrained detector and compresses them into a compact five-number representation. Using only this compact representation, SPK detects these hallucinations more accurately than prior methods while also explaining why a detection was rejected.

What they did

  1. Instead of building ever more complex scoring rules on top of a detector's high-dimensional features, or retraining the detector itself, SPK explicitly digs out knowledge the detector already encodes internally.
  2. It uses two kinds of diagnostic data as supervision: visually similar 'proximal OoD' objects and background-only images, with part names (like wing, beak) generated by GPT-5 and automatically localized using OWLv2 and SAM 2 to train part-level semantic response heads for each detector region.
  3. This produces three semantic responses (similarity to in-distribution parts, to proximal-OoD parts, and to background), combined with a geometric prior (relative object size) and a contextual prior (similarity of the surrounding image to training images), forming the five-dimensional SPK representation.
  4. Across YOLO, Faster R-CNN, and RT-DETR detectors trained on PASCAL-VOC and BDD-100K, feeding SPK into the same OoD detection algorithms (KNN, Isolation Forest, etc.) consistently lowered FPR95 (false positive rate at 95% true positive rate) compared to using raw detector features, and removed more hallucinations than the previous best method, Proximal-OoD.
  5. All of this was achieved without modifying or fine-tuning the underlying detector, and on YOLO the added SPK computation only raised per-image inference time from 10.15ms to 12.65ms, keeping it practical for real-time use.
Figure 1: The proposed SPK framework, a proactive OoD hallucination mitigation framework, further reduces OoD-induced hallucinations beyond previous state-of-the-art methods (48), achieving additional improvements in challenging high-performance regimes.
Figure 1: The proposed SPK framework, a proactive OoD hallucination mitigation framework, further reduces OoD-induced hallucinations beyond previous state-of-the-art methods (48), achieving additional improvements in challenging high-performance regimes.
Table 1: Comparison of OoD detection performance using FPR95 across different detector architectures trained on PASCAL-VOC and BDD-100K. Lower is better.
MethodYOLOFaster R-CNNRT-DETR
PASCAL-VOCBDD-100KPASCAL-VOCBDD-100KPASCAL-VOCBDD-100K
Near-OoDFar-OoDNear-OoDFar-OoDNear-OoDFar-OoDNear-OoDFar-OoDNear-OoDFar-OoDNear-OoDFar-OoD
MSP67.4867.1872.9374.1268.3678.6977.4674.4170.4467.8177.4674.41
EBO90.4990.8487.2287.0660.6256.2194.8394.3798.0396.6994.8394.37
MLS89.8890.0886.4787.0659.6257.8992.5591.0892.8489.7592.5591.08
SCALE80.6780.9277.4470.5992.3480.7086.3584.9881.1276.9286.3584.98
MDS57.6769.4768.4282.3549.9656.3878.9079.3448.6552.9078.9079.34
BAM45.3643.7249.6352.1865.4442.1665.7361.3475.6165.2775.4868.44
KNN48.2039.5041.9545.2461.9537.5350.5449.7677.1063.0062.1058.00
iForest70.2767.8260.4265.2375.4352.3863.2562.7879.5265.9268.2362.30
SPK-MDS14.9917.2823.356.4621.0323.5042.4242.7318.4317.8341.7716.48
SPK-BAM21.9621.7316.753.0718.9818.179.076.1823.1225.1918.7616.84
SPK-KNN19.6417.9913.471.1715.5013.694.703.0918.2620.4316.9713.74
SPK-iForest14.2511.849.860.7013.9210.522.311.5215.4817.3211.429.25
Figure 2: Overview of the proposed SPK framework. SPK elicits semantic, geometric, and contextual priors from a pretrained object detector and organizes them into a compact five-dimensional representation for OoD hallucination detection.
Figure 2: Overview of the proposed SPK framework. SPK elicits semantic, geometric, and contextual priors from a pretrained object detector and organizes them into a compact five-dimensional representation for OoD hallucination detection.
Table 2: OoD detection counts (Near-OoD/Far-OoD) across different detector architectures. Lower is better.
ModelMethodVOC (N/F)BDD (N/F)
YOLOOriginal946 / 440701 / 666
Proximal-OoD134 / 6080 / 47
SPK135 / 5269 / 5
Faster R-CNNOriginal2150 / 13352576 / 1634
Proximal-OoD710 / 253207 / 167
SPK299 / 14060 / 25
RT-DETROriginal2311 / 15893145 / 1220
Proximal-OoD386 / 470525 / 240
SPK358 / 275359 / 113
Figure 3: Automated part-level annotation pipeline. Given an RoI crop and its object category, OWLv2 grounds the corresponding GPT-5-generated concept vocabulary into part bounding boxes. Each box prompts SAM 2 to produce a refined pixel-level part mask. Masks satisfying the object-mask coverage threshold are projected into detector-RoI coordinates and rasterized as binary 7×7 targets. Concepts without a retained mask receive an all-zero target.
Figure 3: Automated part-level annotation pipeline. Given an RoI crop and its object category, OWLv2 grounds the corresponding GPT-5-generated concept vocabulary into part bounding boxes. Each box prompts SAM 2 to produce a refined pixel-level part mask. Masks satisfying the object-mask coverage threshold are projected into detector-RoI coordinates and rasterized as binary 7×7 targets. Concepts without a retained mask receive an all-zero target.
Table 3: Ablation study of the SPK loss components on YOLO trained on PASCAL-VOC and BDD-100K. Results are reported as Near-OoD / Far-OoD FPR95. The average is computed over all four results. Lower is better.
ℒdiceℒsuppressℒgroupVOCBDDAverage
Near / FarNear / FarFPR95 ↓
25.80 / 21.3017.85 / 18.2620.80
22.10 / 16.4015.29 / 15.9717.44
20.50 / 15.8014.18 / 12.9315.85
14.25 / 11.849.86 / 0.709.16
Figure 4: Part-Level Concept Annotation Example. We use a bird RoI crop to illustrate the step-by-step annotation process for the concepts wing, head, beak, and torso. Step 1: OWLv2 grounds each concept within the detector RoI and generates a bounding-box proposal (a). Step 2: SAM 2 refines each proposal into a pixel-level part mask, which is retained only if at least 70% of its pixels overlap with the corresponding SAM 2 object mask (b). Step 3: Each retained mask is projected into detector-RoI coordinates and converted into a binary 7×7 supervision target (c). Step 4: The binary target is overlaid on the RoI crop for visualization (d).
Figure 4: Part-Level Concept Annotation Example. We use a bird RoI crop to illustrate the step-by-step annotation process for the concepts wing, head, beak, and torso. Step 1: OWLv2 grounds each concept within the detector RoI and generates a bounding-box proposal (a). Step 2: SAM 2 refines each proposal into a pixel-level part mask, which is retained only if at least 70% of its pixels overlap with the corresponding SAM 2 object mask (b). Step 3: Each retained mask is projected into detector-RoI coordinates and converted into a binary 7×7 supervision target (c). Step 4: The binary target is overlaid on the RoI crop for visualization (d).
Table 4: Ablation study of different prior components on YOLO trained on PASCAL-VOC and BDD-100K. Each dataset column reports Near-OoD / Far-OoD FPR95. The average is computed over all four results. Lower is better.
Prior componentsVOCBDDAverage
Near / FarNear / FarFPR95 ↓
Semantic15.43 / 13.2830.37 / 25.5821.17
Semantic + Geometric13.23 / 11.5020.88 / 3.8412.36
Semantic + Geometric + Contextual14.25 / 11.849.86 / 0.709.16
Figure 5: Qualitative visualization of part-level semantic responses. The learned concept maps are well aligned with the corresponding regions, demonstrating that the semantic elicitation head successfully decodes spatially grounded semantic evidence from detector RoI features.
Figure 5: Qualitative visualization of part-level semantic responses. The learned concept maps are well aligned with the corresponding regions, demonstrating that the semantic elicitation head successfully decodes spatially grounded semantic evidence from detector RoI features.
Table 5: Quality of the automated part-level annotations. We report the overall concept-mIoU, Recall@0.5, number of covered concepts, and per-class concept-mIoU. All values except concept coverage are percentages. Best results are shown in bold.
MethodOverallPer-class concept-mIoU
concept-mIoURecall@0.5# Conceptsbirdbuscarcatcowdoghorse
Ours40.838.42546.537.943.940.437.441.838.2
VLPart (37)37.036.82535.632.832.538.136.844.136.5
Grounded SAM (31)32.330.72532.131.731.333.029.538.329.4
(b) Prediction: wing
(b) Prediction: wing
Table 6: RoI feature sources and dimensions for each detector. YOLO and RT-DETR concatenate RoI-aligned features from three feature scales, whereas Faster R-CNN uses the Detectron2 box_pooler.
DetectorFeature sourceChannelsRoI feature 𝐅i
YOLODetect neck128+256+512896×7×7
RT-DETRHybrid-encoder neck256+256+256768×7×7
Faster R-CNNResNet-FPN256256×7×7
(c) Prediction: torso
(c) Prediction: torso
Table 7: Hyperparameters of the Semantic Elicitation Head.
Semantic Elicitation HeadHyperparameterValue
ArchitectureHidden channels256
Dropout0.1
NormalizationGroupNorm
ActivationGELU
Residual blocks2
Output head1×1 conv → num_concepts
Inference activationSigmoid
RoI spatial size7×7
Inference poolingLogSumExp, τ=0.5
TrainingTraining epochs80
Batch size2000
OptimizerAdamW
Learning rate2×10−4
Weight decay5×10−4
Random seed42
Validation split10%
Training samplerWeightedRandomSampler
Suppress loss weight0.25
Group loss weight0.75
Early-stopping patience10 epochs
(d) Prediction: foot
(d) Prediction: foot
Table 8: Image-level embedding sources and dimensions for each detector. We globally pool each selected feature map by its spatial mean and standard deviation, then concatenate the resulting statistics. YOLO and RT-DETR use their deepest selected backbone stage, whereas Faster R-CNN aggregates all four ResNet-FPN levels.
DetectorFeature sourceChannelsEmbedding dimension
YOLOBackbone L6 (stride 16)256mean+std:512
RT-DETRHGBlock L9 backbone (stride 32)2048mean+std:4096
Faster R-CNNResNet-FPN P2–P54×256mean+std:2048
Figure 6: Distributions of the learned semantic group responses. Samples from different data sources predominantly activate their corresponding semantic groups, validating the effectiveness of the proposed group objective.
Figure 6: Distributions of the learned semantic group responses. Samples from different data sources predominantly activate their corresponding semantic groups, validating the effectiveness of the proposed group objective.
Table 9: Semantic-head group-classification accuracy. Computed by applying arg⁡max to concept activations for YOLO on PASCAL-VOC.
Data splitAccuracy (%)
ID training set96.5
Proximal OoD81.0
Background77.0
Figure 7: UMAP visualization of representation spaces for detections from the dog, sheep, and cat categories. The visualizations are obtained using YOLO trained on PASCAL-VOC. We compare detector classification logits (left) with the proposed SPK representations (right), using the same ID-validation, Near-OoD, and Far-OoD samples. SPK yields a more structured representation space with clearer distributional differences between ID and OoD samples.
Figure 7: UMAP visualization of representation spaces for detections from the dog, sheep, and cat categories. The visualizations are obtained using YOLO trained on PASCAL-VOC. We compare detector classification logits (left) with the proposed SPK representations (right), using the same ID-validation, Near-OoD, and Far-OoD samples. SPK yields a more structured representation space with clearer distributional differences between ID and OoD samples.
Table 10: AUROC comparison across detector architectures on PASCAL-VOC and BDD-100K. Higher is better.
MethodYOLOFaster R-CNNRT-DETR
PASCAL-VOCBDD-100KPASCAL-VOCBDD-100KPASCAL-VOCBDD-100K
Near-OoDFar-OoDNear-OoDFar-OoDNear-OoDFar-OoDNear-OoDFar-OoDNear-OoDFar-OoDNear-OoDFar-OoD
MSP81.2479.4777.6375.1278.7173.8472.4876.3979.1678.7274.3175.06
EBO60.7357.9265.4162.8682.5886.1452.0750.8340.1243.3149.6852.74
MLS59.4161.2663.7865.0284.7683.5854.8259.4656.3759.7454.9157.43
SCALE69.8471.7372.4679.3157.4969.7264.1867.8269.3775.1666.4265.73
MDS85.6277.8180.3468.4688.3984.4173.6870.9487.4385.7173.2771.18
BAM90.1489.3889.5786.9480.9691.5680.7583.6575.7581.6576.5080.45
KNN89.5290.3191.2688.4781.7392.5888.4386.7275.1281.4683.6885.29
iForest77.3880.7182.4680.1976.3185.6481.3783.2970.8281.9478.4683.57
SPK-MDS96.1293.5595.8098.6596.1094.2092.1091.8094.3595.5489.1099.21
SPK-BAM94.5592.5096.9099.3596.4595.4098.3098.8593.7593.9093.4599.18
SPK-KNN94.9193.3197.4099.7197.0796.4699.0699.3694.4094.8793.9499.36
SPK-iForest96.3195.4398.1099.8197.3897.2599.5099.6595.2395.6795.7899.60
(b) sheep
(b) sheep
Table 11: Ablation of SPK loss components. Evaluated across Faster R-CNN and RT-DETR on PASCAL-VOC and BDD-100K. Lower FPR95 is better.
ℒdiceℒsuppressℒgroupFaster R-CNNRT-DETR
PASCAL-VOCBDD-100KPASCAL-VOCBDD-100K
Near-OoDFar-OoDNear-OoDFar-OoDNear-OoDFar-OoDNear-OoDFar-OoD
27.8719.9818.3618.7432.3127.0825.3529.14
24.4215.4214.1516.1127.8622.5320.7124.36
22.1914.7311.3413.2724.8621.6418.1520.81
13.9210.522.311.5215.4817.3211.429.25
(c) cat
(c) cat
Table 12: Ablation of SPK prior components. Evaluated across Faster R-CNN and RT-DETR on PASCAL-VOC and BDD-100K. Lower FPR95 is better.
Prior componentsFaster R-CNNRT-DETR
PASCAL-VOCBDD-100KPASCAL-VOCBDD-100K
Near-OoDFar-OoDNear-OoDFar-OoDNear-OoDFar-OoDNear-OoDFar-OoD
Semantic18.1718.9123.9225.2118.3429.1733.3634.75
Semantic + Geometric15.7816.4314.5215.7115.8525.3526.5126.82
Semantic + Geometric + Contextual13.9210.522.311.5215.4817.3211.429.25
Table 13: Comparison with competitive OoD detection methods for Deformable-DETR. Results are reported on PASCAL-VOC and BDD-100K as ID datasets, with MS-COCO and OpenImages as OoD datasets. Higher AUROC and lower FPR95 indicate better OoD detection performance. Methods marked with † employ an external DINO ViT encoder to extract additional visual representations for OoD detection, rather than relying solely on Deformable-DETR features. SPK (DINO ViT) is included to provide a fair comparison with UNO-Adapter, as both methods operate under this setting. The best results are highlighted in bold.
MethodID: PASCAL-VOCID: BDD-100K
OoD: MS-COCOOoD: OpenImagesOoD: MS-COCOOoD: OpenImages
FPR95↓AUROC↑FPR95↓AUROC↑FPR95↓AUROC↑FPR95↓AUROC↑
MDS (18)97.3950.2897.8849.0870.8676.8371.4377.98
Gram matrices (32)94.1643.9795.2938.8173.8160.1371.5657.14
KNN (38)91.8062.1591.3659.6464.7580.9061.1379.64
CSI (39)84.0055.0779.1651.3770.2777.9371.3076.42
VOS (8)97.4654.4097.0752.7776.4477.3372.5876.62
OW-DETR (11)93.0955.7093.8257.8080.7870.2977.3773.78
DisMax (25)82.0575.2176.3770.6677.6272.1481.2367.18
SIREN-vMF (7)75.4976.1078.3671.0567.5480.0666.3179.77
SIREN-KNN (7)64.7778.2365.9974.9353.9786.5647.2889.00
SAFE (42)48.8878.888.9996.7339.1885.9521.1094.31
InfoBound (52)44.8889.7643.8988.0044.8889.7643.8988.00
UNO-Adapter† (28)32.6191.6819.9095.409.8897.613.8099.04
SPK52.3275.8424.3890.201.6899.420.3799.93
SPK (DINO ViT)†28.5592.3814.8596.250.0099.800.0099.97
Table 14: Comparison with competitive OoD detection methods for Faster R-CNN. Results are reported on PASCAL-VOC as the ID dataset, with MS COCO and OpenImages as OoD datasets. Higher AUROC and lower FPR95 indicate better OoD detection performance. Methods marked with † employ an external DINO ViT encoder to extract additional visual representations for OoD detection, rather than relying solely on Faster R-CNN features. SPK (DINO ViT) is included to provide a fair comparison with UNO-Adapter, as both methods operate under this setting. The best results are highlighted in bold.
MethodMS-COCOOpenImages
AUROC↑FPR95↓AUROC↑FPR95↓
CSI (39)82.9557.4181.8359.91
GAN-Synthesis (17)82.6759.9783.6760.93
VOS (8)85.2351.3388.7047.53
SIREN (7)85.3664.6882.7868.53
TIB (44)90.3641.5588.0947.19
DFDD (43)90.7941.3488.6544.52
WFS (45)89.0140.0590.3539.17
UNO-Adapter† (28)91.2538.7392.4035.74
SPK91.5841.2095.5025.61
SPK (DINO ViT)†95.4826.2898.1610.97
Table 15: Per-image runtime of the complete SPK inference pipeline. Reported for a YOLO model pretrained on PASCAL-VOC. The complete SPK pipeline introduces an additional 2.72 ms latency per image, corresponding to a 26.8% runtime overhead over the original detector inference. *SPK inference obtains detection outputs, image-level contextual embeddings, and RoI features within the same forward pass.
ComponentCost (ms)
Original inference10.15
SPK inference*12.65
Semantic prior elicitation0.17
Isolation Forest0.05

Why it matters

When a self-driving car or robot confidently misidentifies an object it has never seen during training, the consequences can be serious, and this method offers a lightweight, plug-in way to catch such errors without retraining the detector, while also explaining the reason behind each rejection. It also suggests that building a better feature representation may matter more than designing increasingly complex detection algorithms.

Terms in this paper

  • OoD hallucination · when a detector confidently misidentifies objects or background it was never trained on as a known category
  • FPR95 · the false positive rate measured when 95% of normal (in-distribution) samples are correctly passed through; lower is better
  • RoI feature · a feature vector extracted from the region of a predicted bounding box
  • Isolation Forest · a lightweight anomaly detection algorithm that isolates outliers through repeated random data splits
  • Proximal OoD · objects outside the training categories that visually resemble known categories and confuse the detector

Original abstract (English)

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

Authors · Changshun Wu

Read on arXiv

Latest papers

All papers →

Latest from METAL LAB

Figures: Changshun Wu et al., arXiv:2608.19080, cc-by-nc-nd-4.0