Object detectors used in driving and robotics are trained on one set of conditions and then run in others: new cities, fog, night, sensor noise. Methods that make detectors generalize to unseen conditions all act at training time. None of them tells an operator, at deployment, that the detector has stopped working. We propose a label-free monitor that answers this question by tracking where the evidence for each detection comes from.
For every predicted box we compute a cheap gradient attribution, a map of which pixels pushed the detector toward that box and class. We then summarize the map as a short, fixed-length vector that records three proportions: how much of the evidence lies inside the box, in a ring of nearby context, and in the far background, and within each region how much is fine-grained high-frequency structure versus coarse low-frequency appearance. Our hypothesis is that detectors which fail under domain shift show a measurable change in this makeup. Evidence migrates out of the object and into context and coarse style, and this happens even when confidence stays high. If so, a small set of such vectors can predict both which individual detections are wrong and how much accuracy the detector has lost on a new domain, without any target labels.
Core Claim
Our claim is specific. Summarizing attributions relative to each predicted box predicts harmful domain shift in detectors better than three simpler signals: input statistics, output confidence, and the same box-relative summary computed from plain activations without gradients. This summary also solves a structural problem that has kept attribution monitoring away from detection. Each image produces a variable number of boxes, but each box yields a fixed-length vector, so one image becomes a bag of comparable vectors.
The box-relative summary has a mechanistic motivation. Towards Domain Generalization in Object Detection shows that detectors latch onto contextual backgrounds, for example finding pedestrians through sidewalk texture, and that they fail when that context changes. Decompose and Attribute shows that domain style concentrates in low wavelet frequencies while object geometry sits in high frequencies. Our monitor measures both failure routes directly, for each box, in the detector's own reasoning.
Relation to Prior Work
The nearest neighbours are three kinds of monitoring work, and each stops short of this setting.
The first is explanation-level shift detection. Explanation Shift: How Did the Distribution Shift Impact the Model? and its tabular predecessor Explanation Shift: Detecting distribution shifts on tabular data via the explanation space train a classifier to tell source explanations from deployment explanations (SHAP values, a game-theoretic per-feature importance score). They report a 0.99 Pearson correlation with true shift intensity, compared with 0.01 for input KS tests. We reuse their two-sample test. The difference is that their feature space is a fixed set of tabular columns. Ours is a variable set of detections that we make comparable through box-relative aggregation. We also target predicting performance drop, not only detecting that a shift occurred.
The second is gradient abnormality for out-of-distribution (OOD) detection. GAIA flags OOD images by the loss of gradient sparsity. It assumes one centered object and a background that can be ignored, and it tests only whole-image classification. In driving scenes the background is busy and always carries gradient, so a whole-image sparsity score is exactly the design we expect to break. We include an adapted version as a baseline to test that expectation.
The third is aggregated attributions for dense prediction. Aggregated Attributions for Explanatory Analysis of 3D Segmentation Models pools voxel attributions over predicted organ regions and detects anomalies in-domain. We borrow the aggregation idea but make the regions relative to each predicted box rather than fixed anatomy. We also point it at cross-domain failure. That work's runtime figures (over 10,000 s per scan for KernelSHAP, 200–500 s for SmoothGrad) make one constraint concrete: we must use single-pass gradients taken with respect to an intermediate feature map, not sampling-based explainers.
Two papers constrain the design.
Underwhelming Generalization Improvements From Controlling Feature Attribution found that forcing saliency onto human masks did not improve real-world generalization, because confounders such as site noise and blur sit inside the relevant region. This seems to contradict us, but it bears on training, not monitoring. We do not need attributions to be "right", only to change when the model fails. Its lesson still applies: an inside-versus-outside spatial split alone would miss corruptions that live within the box. That is why we split each region by frequency, and we test whether that split is needed.
Contrastive Domain Generalization via Logit Attribution Matching shows that attribution-level consistency beats representation or output matching for classification. On iWildCam it raises Macro F1 from 30.2% to 41.2%. This is our main motivating evidence that attributions carry domain-relevant information beyond activations. That paper is a training-time regularizer for classifiers, whereas we monitor detectors at inference.
Research Program
The monitor attaches to a frozen detector.
Per-detection vector. For each detection above a confidence threshold, we take the gradient of its class logit with respect to a mid-level backbone feature map and multiply it by the activations. This product is the same kind of quantity LAM matches. Detections are batched so that each image costs one backward pass per group of boxes. We upsample the absolute map and split it into inside-box, context ring (1.5× the box), and far background. A one-level wavelet transform then splits each region into low-frequency and high-frequency energy. The result is a six-dimensional vector of mass fractions, plus box size and confidence.
Two uses of the vectors. First, a two-sample classifier trained on source-validation versus deployment vectors produces a domain-level shift score, which we calibrate on held-out source corruptions into a predicted accuracy drop. Second, a one-class density model fitted on source detections scores each target detection's reliability.
Detectors studied. We run the monitor on a standard Faster R-CNN and on the same detector trained with OA-DG. This tests whether monitoring still adds value once a detector is already trained to generalize. We also run it on a query-based DETR-style detector to address the architecture lock-in noted for proposal-based methods.
Baselines
The naive reference point is to do nothing: predict that target accuracy equals source accuracy and treat every detection as equally reliable. Any useful monitor must correlate with real drops that this reference ignores by construction.
The input-level reference is a kernel two-sample test (maximum mean discrepancy) on downsampled pixels and on wavelet band energies of whole images. It uses the same source and target image pools as our method. The Explanation Shift work shows input tests track operational shift poorly on tabular data. No reported result was found on Lacuna for input tests predicting detector degradation. We therefore run it rather than assume it fails.
The strongest competitor is output-confidence monitoring. For performance prediction it uses the mean maximum class score, the number of detections, and the per-box class entropy. For per-detection reliability it uses the detection's own score and its energy score. We consider it strongest because it is free at inference and in practice often tracks accuracy drop well. No reported result was found on Lacuna for confidence-based accuracy estimation of detectors on Cityscapes-C or DWD. The closest reported number concerns classification OOD rather than detectors: GAIA reduced average FPR95 by 23.10% against ReAct and ASH on CIFAR-10. We will beat this baseline only if, across the 75 corruption-severity domains of Cityscapes-C, our shift score's Spearman correlation with mPC drop exceeds confidence's by a margin larger than the spread across three seeds. Per-detection AUROC must show the same margin.
The two representation-level competitors are a whole-image GAIA-style sparsity score and the original Explanation Shift test run on unaggregated, downsampled attribution maps. They test whether box-relative aggregation, rather than attribution per se, drives any gain.
Two ablations isolate the key ingredients. The first computes the same box-relative, frequency-split fractions from activation magnitude instead of gradient-times-activation. If it matches the full method, gradients are unnecessary and we will say so. The second drops the frequency split to test the concern raised by the Underwhelming paper. All two-sample classifiers use the same gradient-boosted model, the same number of samples, and the same 20-trial tuning budget on source-only held-out corruptions. No method sees target labels during calibration.
Why not just…?
Why not just monitor raw input statistics? Pixel-level tests flag every change in the scene, including changes in sky, lighting on buildings, or road texture that the detector ignores. Detectors trained with OA-DG are explicitly meant to tolerate such changes. The Explanation Shift paper's 0.01-versus-0.99 correlation gap is suggestive but comes from tabular data. The decisive test here is Cityscapes-C, where several corruptions shift pixels strongly yet cost the detector little accuracy. An input test that ranks domains by pixel distance, not by accuracy lost, will show a low rank correlation with mPC drop.
Why not just use detection confidence? This alternative is a real threat. GAIA and prior OOD work document overconfidence on shifted inputs, but that evidence comes from classification. A detector in fog may instead lose confidence gracefully. We expect confidence to capture missed detections, since fewer boxes pass the threshold. We expect it to miss confidently wrong boxes that rest on context, as in the sidewalk-pedestrian failure described by RAPT. Our per-detection evaluation therefore separately reports AUROC for separating correct from incorrect boxes among high-confidence detections (score > 0.7). If confidence matches us overall and there, the attribution claim fails, and we will report the monitor as unnecessary.
Why not just two-sample-test the backbone or RoI features, with no gradients? Feature-space tests are cheaper, and ActDiff-style representation signals were strong in Underwhelming Generalization Improvements From Controlling Feature Attribution (AUC 0.68 versus 0.20). LAM's classification results suggest attributions carry more than features, because they weight features by how the head uses them. Whether this holds for detectors is open. We settle it with two comparisons: an RoI-pooled feature baseline and the activation-only ablation of our own summary. We also report wall-clock overhead per image, so any accuracy gain can be weighed against its cost.
Proposed Experiments
Cityscapes-C experiment. On Cityscapes-C, a Faster R-CNN baseline scores 15.4 mPC and OA-DG scores 21.8 mPC (OA-DG). We fit the monitor on clean Cityscapes validation plus a held-out subset of corruption types. We then predict mPC drop on the remaining corruption types at all severities and report Spearman correlation and mean absolute error in predicted mAP.
Weather and synthetic transfer. On the Diverse Weather Dataset, where OA-DG reaches 31.8 mPC against a 26.2 baseline, we train on daytime-sunny images and monitor rainy, foggy, dusk, and night targets. This tests real rather than synthetic shift. Cityscapes→Foggy Cityscapes and the BDD100k/Cityscapes/KITTI→Sim10k setting from RAPT (0.414 mAP for RAPT) add weather and synthetic-domain transfer.
Per-detection reliability. On every target domain, a detection counts as a failure if it matches no ground-truth box at IoU 0.5. We report AUROC and FPR at 95% true-positive rate, both overall and restricted to high-confidence boxes.
Decisive checks. Three results would decide the proposal. First, whether the full monitor beats the confidence baseline on held-out corruption types and on real weather. Second, whether it beats the activation-only ablation, which justifies computing gradients. Third, whether the frequency split specifically helps on noise and blur corruptions, which is the failure mode predicted by the confounders-inside-the-box finding. A diagnostic check asks whether the context-ring fraction rises before accuracy falls as severity increases. If so, the monitor gives early warning rather than simply restating the loss.
References
- Towards Domain Generalization in Object Detection
- Decompose and Attribute: Boosting Generalizable Open-Set Object Detection via Objectness Score
- Explanation Shift: How Did the Distribution Shift Impact the Model?
- Explanation Shift: Detecting distribution shifts on tabular data via the explanation space
- GAIA: Delving into Gradient-based Attribution Abnormality for Out-of-distribution Detection
- Aggregated Attributions for Explanatory Analysis of 3D Segmentation Models
- Underwhelming Generalization Improvements From Controlling Feature Attribution
- Contrastive Domain Generalization via Logit Attribution Matching
- Object-Aware Domain Generalization for Object Detection