Manuscript Offprint
arXiv:2609.08011TaskGuard: Task-Conditioned Restoration Utility for Risk-Aware Object Detection
Abstract
Image restoration is commonly applied before object detection under adverse conditions, yet a visually improved image need not improve the downstream task. We study this mismatch as restoration utility prediction: given a degraded image and its candidate restoration, should the restoration be used or should the original observation be preserved? We introduce TaskGuard, a post-hoc controller for frozen restoration and detection pipelines. TaskGuard characterizes the realized restoration residual through its interaction with detector sensitivity and predicts whether the intervention is task-beneficial. Exact regional counterfactuals reveal substantial within-image utility heterogeneity, while a deployable pseudo-gradient preserves statistically reliable directional information. Feature-group ablation further shows that task-conditioned evidence contributes information beyond detector-response and residual statistics. The TaskGuard utility predictor is trained only on Gaussian degradation and frozen before final evaluation, then transferred to unseen motion blur, rain, and defocus. Across these unseen families, TaskGuard reduces loss-negative interventions by 54.2% (family macro) and practical per-image detection deteriorations by 37.0% (pooled), while preserving 98.8% of the Always-Restore COCO AP. On natural-rain DAWN, it reduces loss-negative interventions by 97.9% while retaining 77.8% of the AP improvement obtained by deraining. These results support restoration utility as a task-conditioned property of the specific intervention rather than image appearance alone.
1. Introduction
Image degradation caused by noise, blur, rain, and other adverse conditions can substantially reduce object-detection accuracy, motivating restoration before recognition [5, 10, 13]. Modern restoration methods can recover considerable aggregate detection performance, but their effects are not uniformly beneficial. A perceptually cleaner image may re-
move, alter, or introduce evidence important to the downstream model [1, 7, 11]. Consequently, unconditional restoration may improve average accuracy while making individual observations worse [2].
For instance, Figure 1(a) shows a clear benefit from restoration: the detector correctly detects all ground-truth objects in the restored image, while missing all of them in the degraded counterpart. However, the effect of restoration can be surprisingly subtle. Figure 1(b) shows a restored image that appears cleaner and remains visually close to its degraded input. Nevertheless, the degraded image yields the correct cow detection, whereas restoration leads to a higher-confidence but incorrect horse prediction. Similarly, in Figure 1(c), restoration introduces a false-positive car detection in the lower-right corner, even though no car is present. Thus, perceptual clarity and detector confidence can improve even when detector correctness deteriorates. This motivates evaluating the effect of the specific restoration intervention on the downstream task rather than relying on visual quality or detector confidence alone.
We therefore consider a post-hoc decision problem: given a degraded image and the particular restoration produced by a frozen restorer, should that candidate restoration actually be accepted? We call this restoration utility prediction. Unlike approaches that modify the enhancement process using downstream supervision [1, 5, 7, 13], we leave both the restorer and detector unchanged. Instead, TaskGuard estimates the task utility of the realized image change and decides whether to restore or preserve the degraded input. Accordingly, it selects restore for Figure 1(a) and preserve for (b) and (c).
The key hypothesis is that restoration utility depends not only on what changed but on whether that change agrees with downstream task sensitivity. TaskGuard therefore couples the realized restoration residual with a detector gradient. We validate this directional mechanism using exact regional counterfactual interventions and additionally test whether its annotation-free pseudo-gradient counterpart preserves the privileged signal used in the analysis.
The TaskGuard utility predictor is trained only on Gauss-

Figure 1. Examples of restoration utility. (a) Gaussian restoration recovers three missed objects. (b) Rain restoration changes a correct cow detection to an incorrect horse; TaskGuard preserves the input. (c) On natural rain, deraining introduces a false-positive car; TaskGuard preserves the input. Dashed boxes denote ground truth and solid boxes detector predictions.
sian degradation and frozen before evaluation on fresh Gaussian data, unseen motion blur, rain, and defocus, and natural-rain DAWN [6]. The same frozen decisions are also evaluated under RT-DETR-L [15]. Our contributions are:
-
We formulate restoration utility as a post-hoc intervention for frozen restoration–detection pipelines and introduce a directional residual–task-sensitivity representation.
-
We validate the proposed mechanism with exact regional counterfactuals, direct pseudo-gradient analysis, and feature-group ablation showing that task-conditioned evidence adds information beyond detector-response and residual statistics.
-
We develop a frozen Restore-or-Preserve policy with a TRAIN-only risk–utility threshold and demonstrate zero-shot degradation-family transfer, natural-rain transfer, practical-risk reduction, and partial cross-detector safety transfer.
Dehazing [10] explicitly couples dehazing with detection. Task-driven restoration further uses recognition supervision to shape the restoration itself, including SR4IR [7], UniRestore [1], EDTR [8], and TaskTok [9]. TaskGuard instead assumes that restoration and detection are frozen and controls whether an already-generated candidate is accepted.
Machine-oriented quality and enhancement selection. Machine-oriented image assessment shows that perceptual quality does not necessarily reflect downstream model preference [11]. Most closely related, LQTARanker [2] predicts detection-performance gain and makes a per-image enhance-or-not decision. TaskGuard instead conditions utility prediction on the interaction between the actual restoration residual and detector sensitivity, and validates this directional mechanism against exact regional counterfactual interventions. In addition, the TaskGuard utility predictor is trained only on Gaussian degradation and evaluated across unseen degradation families, with the decision threshold frozen before final testing. Our focus is therefore not enhancement selection itself, but restoration-specific directional task utility for post-hoc risk control.

TaskGuard TRAIN: Gaussian only | no degradation/severity input to TaskGuard | frozen | no final/DAWN retuning Deployment uses the realized restoration and detector task sensitivity; ground-truth annotations are not required.
Figure 2. TaskGuard overview. A frozen restorer generates ; TaskGuard summarizes task-conditioned, detector-response, and residual evidence to predict utility and restores only when .
3. Method
Figure 2 summarizes the TaskGuard pipeline. A frozen restorer first produces a candidate restoration, after which TaskGuard characterizes the realized image change using task-conditioned, detector-response, and residual evidence to predict if the candidate should be accepted. Let a frozen restorer E produce candidate from degraded input :
where R is the realized restoration intervention.
3.1. Restoration Utility
With detector loss , exact whole-image utility is
Positive values favor restoration; denotes a loss-negative intervention. Detector loss is used as a differentiable per-image utility signal and is not treated as equivalent to AP or per-image F1.
For spatial mask , the exact regional counterfactual and its utility are
A first-order (Taylor) directional estimate is
The residual specifies the actual image-change direction; the gradient specifies local task sensitivity. Equation (4) is directional evidence rather than an exact counterfactual estimator.
3.2. Deployable Task Signal
Ground truth is unavailable at deployment. TaskGuard obtains pseudo-labels from the restored candidate and evaluates the corresponding gradient at the degraded input:
The deployable regional interaction becomes
3.3. Intervention Representation
TaskGuard uses a 43-D representation
The 29 task features summarize 64 regional scores through distribution statistics, positive/negative score mass, signed top-k statistics for , and pseudo-supervised detector loss. The 11 detector-response features contain detection count and confidence statistics for and together with their differences. The 3 residual features are the mean, standard deviation, and maximum of the elementwise absolute residual : mean , std , and max . No degradation family, severity, or restorer identity is provided to the TaskGuard utility predictor. Exact feature definitions are given in the supplementary material.
3.4. Utility Regression and Frozen Decision
A standardized Ridge regressor ( ) predicts restoration utility; its regularization provides a low-capacity fit to the correlated 43-D summary features while limiting overfitting to the training distribution. Each regressor is trained on the Gaussian TRAIN set to predict the exact whole-image utility target . Ten repeated five-fold source-grouped stratified splits produce 50 fold-specific regressors, which constitute the frozen inference ensemble. For each candidate pair, their predictions are averaged to obtain . The policy is
The threshold is selected from Gaussian TRAIN out-of-fold predictions only. Among thresholds retaining at least 98% of Always-Restore mean utility, we choose the one with the lowest loss-negative rate, breaking ties by higher retained utility and then lower preserve rate. This procedure yields . Validation and final-benchmark data are not used to select or retune the threshold.
4. Experimental Setup
Controlled data. All controlled source images come from COCO 2017 (val2017) [12]. The development pool contains 500 sources with Gaussian noise , split by source into 350/50/100 TRAIN/VAL/development-TEST images (1050/150/300 pairs).
After the complete policy is frozen, we evaluate on a separate, source-disjoint set of 200 untouched COCO val2017 images. Each source is evaluated under Gaussian noise, motion blur, synthetic rain, and defocus at three severities, yielding 2400 pairs.
Models and natural data. Candidate restorations use frozen pretrained Restormer specialists [14], with the corresponding specialist used for each controlled degradation family. TaskGuard receives only the resulting degraded/candidate pair and is not given the degradation family, severity, or restorer identity. The primary detector is COCO-pretrained YOLO11s [4] at input size 640. We additionally evaluate frozen TaskGuard decisions with RT-DETR-L [15] on the 600 fresh Gaussian pairs. Natural-domain transfer uses 198 rainy images from DAWN [6]; no DAWN data are used for fitting or tuning. For DAWN, the person, bicycle, car, motorcycle, bus, and truck annotations are mapped directly to the corresponding COCO categories, and COCO-style AP is computed over the 198 rainy images used in our evaluation.
Baselines. We compare TaskGuard against both fixed policies and learned appearance-based utility predictors. Always Preserve uses for every sample and represents the no-restoration reference, while Always Restore uses unconditionally and therefore measures the aggregate benefit and risk of applying every candidate restoration. The learned baselines test whether restoration utility can be predicted from generic visual appearance without the proposed task-conditioned directional signal. Image-only uses frozen ResNet-50 features [3] from and asks whether the degraded observation alone is sufficient to predict whether restoration will help. The stronger Visual-pair baseline observes both images through
and can therefore capture the appearance of the degraded and restored images as well as the magnitude and direction of their feature-space change. However, neither appearance baseline explicitly measures whether the realized restoration change agrees with detector sensitivity. Thus, comparison with Visual-pair is particularly important for isolating the value of TaskGuard's task-conditioned gradient-residual interaction beyond simply observing both images. All learned baselines follow the same Gaussian-only development and freezing protocol, with no fitting or retuning on the unseen degradation families.
Metrics. The reported metrics capture complementary aspects of utility prediction, intervention risk, and downstream detection performance. Spearman correlation measures whether the predicted utility correctly ranks restorations from less to more beneficial, without requiring the predicted and exact utilities to have the same numerical scale. Benefit retention, , measures how much of the mean utility of Always Restore is retained by the selective policy; values above 100% are possible when preserving negative-utility candidates increases mean policy utility. Loss-negative reduction measures the relative decrease, compared with Always Restore, in interventions for which , and therefore directly quantifies avoidance of restoration decisions that worsen detector loss. Preserve rate reports how often the policy rejects the restoration and retains , indicating how conservative the policy is. We additionally report standard COCO bounding-box AP to verify that reducing negative interventions does not come at an excessive cost in aggregate detection accuracy.
Because detector loss is only a differentiable proxy for task quality, we also evaluate an operational notion of deterioration. At detector confidence 0.25 and IoU 0.50, let and . A restoration is practical-negative when or , i.e., when restoration decreases per-image F1 or increases the number of missed ground-truth objects. This provides a task-level complement to the loss-defined negative-intervention measure. All statistical resampling is performed at the source-image level so that degradation variants and regional observations derived from the same clean source remain grouped rather than being treated as independent samples.
5. Results
5.1. Directional Utility Approximation
Regional utility heterogeneity. Across the full 500-source Gaussian development pool, comprising 96,000 regional interventions, 83,088 regions contain an active restoration change. Among active regions, 51.7% have positive utility and 48.3% negative utility, and every image-condition pair contains both signs. Thus, whole-image restoration hides substantial within-image heterogeneity.
Privileged directional estimate. The privileged directional estimate in Eq. (4) is imperfect but informative: Pearson r = 0.314, Spearman , sign agreement 59.3%, and AUROC 0.608 against exact regional counterfactual utility. Figure 3 visualizes both the pronounced within-image utility heterogeneity and the systematic, though imperfect, relationship between directional and exact counterfactual utility.
Pseudo-gradient validation. On the Gaussian TRAIN subset, comprising 58,512 active regions from 350 sources and 1050 degraded/restored pairs, remains positively associated with exact : Pearson (95% CI [0.213, 0.309]), Spearman ([0.129, 0.159]), and AUROC 0.566 ([0.559, 0.572]). It is substantially more aligned with the privileged directional signal : ([0.680, 0.834]), ([0.526, 0.581]), and 71.8% sign agreement ([70.5, 73.0]%). Thus, pseudo-labeling attenuates but does not remove the proposed directional task information, providing development-time evidence that the deployable pseudo-gradient preserves the intended mechanism and remains meaningfully related to exact counterfactual utility.
5.2. Fresh Controlled Evaluation
Table 1 summarizes the performance of the frozen TaskGuard policy across the fresh controlled degradation families. On Gaussian noise, TaskGuard retains 97.0% of loss-defined restoration benefit while reducing the loss-negative rate from 19.5% to 11.0%. Without family-specific retuning, the same policy reduces loss-negative interventions by 38.3%, 76.4%, and 48.0% for motion blur, rain, and defocus, respectively.
Across the three unseen families, TaskGuard retains 93.3% of loss-defined benefit and 98.8% of Always-Restore COCO AP while reducing loss-negative interventions by 54.2%. Always Restore remains best in aggregate AP; TaskGuard therefore controls intervention risk rather than maximizing AP.
5.3. What Information Drives Utility Prediction?
Table 2 compares TaskGuard with the Image-only and Visual-pair representations on the unseen degradation families. Image-only and Visual-pair predictors achieve zero-shot and 0.211, respectively, versus 0.622 for TaskGuard. Relative to Visual-pair, TaskGuard improves benefit retention by 19.5 percentage points (95% CI [14.2, 25.1]), loss-negative reduction by 33.6 points ([25.6, 41.8]), and practical-negative reduction by 15.2 points ([7.7, 22.8]).
A post-freeze feature-group ablation further isolates the proposed task signal. Task-gradient features alone achieve , compared with 0.480 for detector-response and 0.240 for residual-only features. Adding task-gradient features to Detector+Residual raises from 0.470 to 0.622:
while increasing benefit retention by 6.6 points ([2.5, 10.6]). Loss-negative reduction also increases by 6.9 points, although its 95% CI [-0.2, 14.3] includes zero. The complete seven-group ablation is reported in the supplement.
5.4. Frozen Threshold and Risk-Utility Tradeoff
The operating threshold is determined entirely from Gaussian TRAIN OOF predictions. The predefined 98%-retention rule yields , retaining 98.0% of TRAIN Always-Restore utility while reducing loss-negative interventions by 39.6%. Figure 4 shows the TRAIN OOF curve used for this selection together with the post-freeze sensitivity of the same operating points on the unseen degradation families.
Nearby TRAIN-selected operating points exhibit a smooth tradeoff: retention constraints of 99%, 98%, and 97% give TRAIN loss-negative reductions of 33.5%, 39.6%, and 46.7%. Applied unchanged to the unseen families, the same thresholds give benefit-retention/risk-reduction pairs of 93.9/45.5%, 93.3/54.2%, and 91.0/60.3%, respectively. The frozen 98%-retention operating point is therefore one reproducible point along the observed risk-utility tradeoff rather than a test-selected threshold.
5.5. Practical and Cross-Detector Risk
Table 3 summarizes cross-detector transfer and the practical interpretation of loss-defined restoration utility. On the fresh Gaussian set, frozen TaskGuard decisions retain 93.9% of RT-DETR-L loss-defined restoration benefit while reducing RT-DETR-L loss-negative interventions from 28.5% to 19.8%. Utility-score correlation is lower under RT-DETR-L ( ) than YOLO11s (0.726), so we characterize this as partial cross-detector safety transfer, not detector invariance.


Figure 3. Regional restoration utility and its directional approximation. Helpful and harmful regions coexist within every image–condition pair, while the first-order signal is imperfect but systematically associated with exact counterfactual utility.
Table 1. Fresh controlled evaluation of the frozen TaskGuard policy. Gaussian is the training degradation; motion, rain, and defocus are evaluated zero-shot.
| Family | Benefit Ret. | Neg. Restore | Neg. TG | Neg. Red. | AP Ret. | |||
|---|---|---|---|---|---|---|---|---|
| Gaussian | 1.063 | 97.0% | 19.5% | 11.0% | 43.6% | 0.5165 | 0.5096 | 98.7% |
| Motion | 2.003 | 97.6% | 7.8% | 4.8% | 38.3% | 0.5059 | 0.5013 | 99.1% |
| Rain | 0.365 | 89.1% | 32.5% | 7.7% | 76.4% | 0.5456 | 0.5354 | 98.1% |
| Defocus | 0.460 | 93.1% | 24.7% | 12.8% | 48.0% | 0.4863 | 0.4832 | 99.4% |
| Zero-shot macro | 0.942 | 93.3% | 21.7% | 8.4% | 54.2% | 0.5126 | 0.5066 | 98.8% |
: mean detector-loss benefit of Always Restore; Ret.: retention; Neg.: ; Red.: reduction; TG: TaskGuard; AP Ret.: TaskGuard divided by Always-Restore .
Across all controlled families, 21.1% of restorations are loss-negative and 18.1% practical-negative. Loss-defined utility correlates with at , and attains AUROC 0.700 for identifying practical-negative restorations. Across the three unseen families, TaskGuard reduces the practical-negative rate from 18.3% to 11.6%, a 37.0% relative reduction.
5.6. Natural-Rain Transfer
Table 4 summarizes the natural-rain DAWN evaluation and comparison with the frozen appearance-based baselines. On 198 natural-rain DAWN images, original observations achieve COCO-style AP 0.3578 and unconditional deraining reaches 0.3818. TaskGuard restores only 8 images and obtains AP 0.3765, retaining 77.8% of the Always-Derain AP gain while reducing loss-negative interventions by 97.9%. Benefit retention can exceed 100% because preserving selected negative-utility candidates can yield
greater mean policy utility than unconditional deraining.
Visual-pair retains 81.3% of the AP gain but reduces loss-negative interventions by only 80.9%. TaskGuard improves the latter by 17.0 percentage points (95% CI [8.4, 25.8]). The paired TaskGuard–Always-Derain AP difference is (95% CI ); because the interval includes zero, we make no equivalence or non-inferiority claim. Only six Always-Derain cases are practical-negative, so DAWN practical-risk results are descriptive.
Runtime. Runtime was measured on a single NVIDIA RTX A4000 GPU using YOLO11s at input size 640. On 50 Gaussian validation sources at , with 5 warm-up samples, detector-only inference requires 26.7 ms/image. Once a restoration candidate is available, TaskGuard adds 136.1 ms/image, for a complete post-restoration stage of
Table 2. Representation comparison on unseen motion, rain, and defocus, with paired TaskGuard gains over Visual-pair.
A. Representation comparison
| Representation | Benefit Ret. | Neg. | Red. | Prac. | Red. | Preserve | |
|---|---|---|---|---|---|---|---|
| Image-only | 0.091 | 86.1% | 6.9% | 12.4% | 9.3% | ||
| Visual-pair | 0.211 | 79.6% | 30.3% | 21.8% | 23.5% | ||
| TaskGuard | 0.622 | 93.3% | 54.2% | 37.0% | 32.7% |
B. TaskGuard gain over Visual-pair
| Metric | Gain | 95% CI |
|---|---|---|
| Benefit ret. | +19.50 pp | [+14.22, +25.13] |
| Neg. red. | +33.59 pp | [+25.57, +41.75] |
| Prac. red. | +15.15 pp | [+7.71, +22.84] |
, benefit retention, loss-negative reduction, and preserve rate are unweighted family macros; practical-negative reduction is pooled over all 1,800 zero-shot pairs. Part B uses paired source bootstrap. Ret.: retention; Neg.: loss-negative; Prac.: practical-negative; Red.: reduction; CI: confidence interval; pp: percentage points.

(b) Zero-shot final sensitivity
Figure 4. Risk–utility threshold analysis. (a) Gaussian TRAIN OOF selection curve with the predefined 98% benefit-retention constraint. (b) Post-freeze sensitivity on unseen degradations; this panel is descriptive only.
162.9 ms/image. Using the separately measured Restormer directory-run timing, the contextual Restore+Detector and Restore+TaskGuard pipelines require approximately 667 and 803 ms/image, respectively.
6. Discussion
Risk control rather than AP maximization. TaskGuard deliberately trades a small amount of aggregate AP for fewer negative interventions. Its threshold is fixed using a TRAIN-only utility-retention constraint rather than final performance, and applications with different intervention costs can choose another operating point using development data.
Directional evidence is not an oracle. Both the privileged first-order approximation and deployable pseudo-gradient are imperfect. The pseudo-gradient has only modest direct agreement with exact regional counterfactual utility, but its source-bootstrap intervals remain above the corresponding null or chance baselines, and the pseudo sig-
nal remains substantially aligned with its privileged counterpart. Feature-group ablation independently shows that aggregating this task-conditioned evidence improves zero-shot whole-image utility prediction. Because deployment pseudo-labels are obtained from , confident restoration-induced prediction errors can also corrupt the pseudo-gradient. Uncertainty-aware pseudo-labeling or teacher ensembles are natural extensions.
Scope and computational cost. TaskGuard must generate before judging it and therefore does not avoid restoration cost. The gradient computation also adds nontrivial overhead. Our zero-shot claim concerns degradation-family transfer from Gaussian training to motion, rain, and defocus; DAWN provides an additional natural-domain test. The experiments do not establish arbitrary transfer across restorers, detectors, datasets, or tasks.
Loss-defined versus practical utility. Detector loss provides the differentiable per-image signal needed for train-
Table 3. Cross-detector transfer and operational evaluation of the frozen TaskGuard policy.
| A. Cross-detector transfer on fresh Gaussian data | ||||||
|---|---|---|---|---|---|---|
| Utility evaluator | Benefit Ret. | Neg. Restore | Neg. TG | Neg. Red. | Preserve | |
| YOLO11s | 0.726 | 97.0% | 19.5% | 11.0% | 43.6% | 22.2% |
| RT-DETR-L | 0.305 | 93.9% | 28.5% | 19.8% | 30.4% | 22.2% |
| B. Practical meaning of loss-defined utility at confidence 0.25 | ||||||
| Scope | Neg. Rate | Prac. Rate | Prac. Red. | |||
| All four families | 21.1% | 18.1% | 34.3% | 13.7% | 0.601 | 34.1% |
| Zero-shot pooled | 21.7% | 18.3% | 32.3% | 14.5% | 0.587 | 37.0% |
Zero-shot denotes pooled motion, rain, and defocus pairs. Practical-negative means per-image F1 decreases or missed ground-truth objects increase at confidence 0.25 and IoU 0.50. Ret.: retention; Neg.: loss-negative; Prac.: practical-negative; Red.: reduction; TG: TaskGuard.
Table 4. Frozen-policy transfer to 198 natural-rain DAWN images.
| A. Frozen-policy performance on natural-rain DAWN | ||||||
|---|---|---|---|---|---|---|
| Policy | # Restored | AP₅₀:₉₅ | AP Gain Ret. | Benefit Ret. | Neg. Red. | Prac. Red. |
| Original | 0 | 0.3578 | 0.0% | – | – | – |
| Always Derain | 198 | 0.3818 | 100.0% | 100.0% | 0.0% | 0.0% |
| Image-only | 189 | 0.3805 | 94.5% | 99.7% | 6.4% | 16.7% |
| Visual-pair | 41 | 0.3773 | 81.3% | 101.2% | 80.9% | 83.3% |
| TaskGuard | 8 | 0.3765 | 77.8% | 100.4% | 97.9% | 100.0% |
| B. Paired source-bootstrap comparisons | ||||||
| Comparison | Estimate | 95% CI | ||||
| TaskGuard – Visual-pair AP₅₀:₉₅ | -0.0008 | [-0.0028, +0.0010] | ||||
| TaskGuard – Always Derain AP₅₀:₉₅ | -0.0053 | [-0.0133, +0.0021] | ||||
| Neg. Red. gain vs. Visual-pair | +17.0 pp | [+8.4, +25.8] | ||||
AP Gain Ret.: fraction of the Always-Derain AP₅₀:₉₅ improvement over Original retained; Benefit Ret.: detector-loss utility retention. Prac.: practical-negative (per-image F1 decrease or additional false negatives); only six Always-Derain practical-negative cases occur, so Prac. Red. is descriptive. Neg.: loss-negative; Red.: reduction; AP: average precision; pp: percentage points; CI: confidence interval.
ing, but it is not equivalent to AP or per-image F1. The practical-negative analysis demonstrates a meaningful association between loss-defined utility and concrete detection deterioration while also showing that the relationship is not one-to-one. Both levels of evaluation are therefore necessary.
7. Conclusion
TaskGuard treats restoration as a task-conditioned intervention rather than an automatically beneficial preprocessing step. It couples the actual restoration residual with frozen-detector sensitivity and uses the resulting evidence to decide whether a candidate should be accepted. Exact regional counterfactuals, pseudo-gradient validation, and feature-group ablation support the proposed directional mechanism as informative, although not exact. A TaskGuard policy whose utility predictor is trained only on Gaussian degradation and frozen under a TRAIN-only risk–utility criterion transfers to unseen controlled degradations and natural rain while substantially reducing negative interventions and retaining most of the benefit of unconditional restoration. These results motivate restoration systems that explicitly account for the downstream consequences of the particular image changes they introduce.
References
[1] I-Hsiang Chen, Wei-Ting Chen, Yu-Wei Liu, Yuan-Chun Chiang, Sy-Yen Kuo, and Ming-Hsuan Yang. Unire-store: Unified perceptual and task-oriented image restoration model using diffusion prior. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 17969–17979, 2025. 1, 2
[2] Shengyu Fang and Jichang Guo. LQTARanker: A ranking-based task-oriented assessment framework for low-quality images. Neurocomputing, 704:134815, 2026. 1, 2
[3] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 770–778, 2016. 4
[4] Glenn Jocher and Jing Qiu. Ultralytics yolo11, 2024. 4
[5] Sanket Kalwar, Dhruv Patel, Aakash Aanegola, Krishna Reddy Konda, Sourav Garg, and K. Madhava Kr ishna. GDIP: Gated differentiable image processing for object detection in adverse conditions. In 2023 IEEE International Conference on Robotics and Automation (ICRA), pages 7083–7089, 2023. 1, 2
[6] Mourad A. Kenk and Mahmoud Hassaballah. DAWN: Vehicle detection in adverse weather nature dataset. arXiv preprint arXiv:2008.05402, 2020. 2, 4
[7] Jaeha Kim, Junghun Oh, and Kyoung Mu Lee. Beyond image super-resolution for image recognition with task-driven perceptual loss. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2651–2661, 2024. 1, 2
[8] Jaeha Kim, Junghun Oh, and Kyoung Mu Lee. Exploiting diffusion prior for task-driven image restoration. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 10151–10161, 2025. 2
[9] Hongjae Lee, Sojung Kang, Jaeseong Yu, and Seung-Won Jung. Tasktok: Delving into task tokens for task-driven image restoration. In European Conference on Computer Vision, 2026. 2
[10] Chengyang Li, Heng Zhou, Yang Liu, Caidong Yang, Yongqiang Xie, Zhongbo Li, and Liping Zhu. Detection-friendly dehazing: Object detection in real-world hazy scenes. IEEE Transactions on Pattern Analysis and Machine Intelligence, 45(7):8284–8295, 2023. 1, 2
[11] Chunyi Li, Yuan Tian, Xiaoyue Ling, Zicheng Zhang, Haodong Duan, Haoning Wu, Ziheng Jia, Xiaohong Liu, Xiongkuo Min, Guo Lu, Weisi Lin, and Guangtao Zhai. Image quality assessment: From human to machine preference. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7570–7581, 2025. 1, 2
[12] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C. Lawrence Zitnick. Microsoft COCO: Common objects in context. In Computer Vision – ECCV 2014, pages 740–755, 2014. 4
[13] Wenyu Liu, Gaofeng Ren, Runsheng Yu, Shi Guo, Jianke Zhu, and Lei Zhang. Image-adaptive yolo for object detection in adverse weather conditions. In Proceedings of the AAAI Conference on Artificial Intelligence, pages 1792–1800, 2022. 1, 2
[14] Syed Waqas Zamir, Aditya Arora, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, and Ming-Hsuan Yang. Restormer: Efficient transformer for high-resolution image restoration. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5728–5739, 2022. 4
[15] Yian Zhao, Wenyu Lv, Shangliang Xu, Jinman Wei, Guanzhong Wang, Qingqing Dang, Yi Liu, and Jie Chen. DETRs Beat YOLOs on Real-time Object Detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 16965–16974, 2024. 2, 4
TaskGuard: Task-Conditioned Restoration Utility for Risk-Aware Object Detection Supplementary Material
Van Vung Pham
Computer Science Department, Sam Houston State University, Huntsville, Texas, USA
A. Supplement Overview
This supplement provides implementation details and analyses omitted from the main paper for space: (1) the exact 43-D TaskGuard representation; (2) the frozen 50-model inference ensemble and threshold-selection protocol; (3) the complete feature-group ablation; (4) direct pseudo-gradient/counterfactual bootstrap analysis; (5) threshold operating-point sensitivity; and (6) additional representation, DAWN, cross-detector, practical-risk, and runtime details.
B. Exact TaskGuard Representation
TaskGuard represents each degraded/restored pair with
comprising 29 task-gradient, 11 detector-response, and 3 residual features.
The degraded and restored images are letterboxed identically to the detector input resolution before the residual
is formed. TaskGuard uses 64 spatial masks arranged on an grid. The masks use the frozen feathering parameter feather=8; they are therefore spatial masks rather than strictly binary blocks.
Pseudo-labels are obtained from restored-image detections at confidence 0.25. The pseudo-gradient is evaluated at the degraded image,
and the regional directional score is
Regional scores are sorted by descending signed value, not absolute magnitude.
Table 1 lists the complete 43-D representation used by the frozen TaskGuard model.
The task-gradient group can be written more compactly as follows. For regional scores , TaskGuard uses ten global distribution statistics, six sign/mass statistics, and top-k sum/mean pairs:
where and . Together with the pseudo-supervised degraded-image loss, these yield 29 task-gradient features.
No degradation family, severity, or restorer identity appears in the representation.
C. Frozen Training and Inference Protocol
The frozen candidate is all_ridge_reg, implemented as StandardScaler + Ridge(alpha=10). The Gaussian TRAIN set contains 350 source images and 1050 degraded/restored pairs.
The inference predictor is not a single refit on all TRAIN samples. Instead, ten repeated five-fold source-grouped stratified splits produce 50 fold-specific regressors. The stratification label indicates whether whole-image utility is negative, and source image ID is the grouping variable. For evaluation pair x, the frozen score is
These 50 models constitute the frozen inference ensemble.
The implementation uses the frozen seed 2027 and constructs the repeated-fold random states from that record. The final 2400-pair locked benchmark table was generated by reconstructing the frozen 50-regressor ensemble from the recorded seed and fold schedule, predicting each final
Table 1. Exact 43-D TaskGuard feature representation.
| Group | Dim. | Features |
|---|---|---|
| Task-gradient | 29 | score_sum, score_mean, score_std, score_min, score_max, score_q10, score_q25, score_q50, score_q75, score_q90; positive_count, positive_fraction, positive_mass, negative_mass_abs, positive_minus_negative_mass, positive_mass_fraction; for : score_topk_sum, score_topk_mean; and pseudo_loss. |
| Detector response | 11 | degraded_det_count, degraded_conf_mean, degraded_conf_sum, degraded_conf_max, restored_det_count, restored_conf_mean, restored_conf_sum, det_conf_sum_delta, det_conf_mean_delta. |
| Residual | 3 | residual_abs_mean, residual_abs_std, residual_abs_max. |
pair with every regressor, and averaging their predictions. The final decision is
C.1. TRAIN-only threshold selection
The threshold is selected from Gaussian TRAIN out-of-fold scores only. For threshold , let
and let be the policy loss-negative intervention rate. The frozen rule is
Ties are resolved by higher mean benefit and then lower preserve rate. The exact saved TRAIN curve reproduces
to numerical precision.
Validation is used only as confirmation and does not retune the threshold. At the frozen point, the validation policy has utility-ranking , benefit retention 95.9%, loss-negative rate 10.0%, and relative loss-negative reduction 46.4%.
D. Complete Feature-Group Ablation
Table 2 reports all seven feature-group variants evaluated post-freeze on the three unseen controlled degradation families. Each ablation follows the same Gaussian TRAIN protocol, and each threshold is selected by the same TRAIN-only 98%-retention rule.
Task-gradient features provide the strongest individual signal for utility ranking. The full representation is not claimed to maximize every metric: Task-gradient+Residual

Figure 1. Representation comparison on unseen controlled degradation families.
attains slightly higher , while Task-gradient+Detector attains slightly higher loss-negative reduction. The full 43-D representation is the pre-frozen TaskGuard model used for all primary evaluations. Among the post-freeze ablations, it attains the highest practical-negative reduction, while other subsets slightly exceed it on individual metrics.
D.1. Paired source-bootstrap comparisons
Table 3 reports source-level paired bootstrap comparisons for the two most informative contrasts.
These comparisons support the conclusion that task-gradient features provide information not captured by appearance-scale residual statistics or detector response alone, while detector-response and residual features provide complementary information for the final risk-aware policy.
Figure 1 provides a complementary visualization of the representation comparison reported quantitatively in the main paper.
E. Pseudo-Gradient Versus Exact Counterfactual Utility
The direct pseudo-gradient analysis uses the cached Gaussian TRAIN regional scores because 64-region pseudo-gradient vectors were cached for the 350 TRAIN sources
Table 2. Complete zero-shot feature-group ablation on unseen controlled degradations.
| Features | Dim. | Benefit ret. | Neg. red. | Preserve | Practical red. | ||
|---|---|---|---|---|---|---|---|
| Residual | 3 | 0.1549 | 0.240 | 0.882 | 0.195 | 0.154 | 0.209 |
| Detector | 11 | 0.2998 | 0.480 | 0.896 | 0.433 | 0.275 | 0.309 |
| Detector+Residual | 14 | 0.1823 | 0.470 | 0.866 | 0.474 | 0.299 | 0.348 |
| Task-gradient | 29 | 0.0480 | 0.631 | 0.976 | 0.412 | 0.260 | 0.170 |
| Task-gradient+Residual | 32 | 0.0250 | 0.632 | 0.974 | 0.427 | 0.269 | 0.206 |
| Task-gradient+Detector | 40 | 0.1336 | 0.626 | 0.932 | 0.544 | 0.327 | 0.352 |
| All | 43 | 0.1076 | 0.622 | 0.933 | 0.542 | 0.327 | 0.370 |
Ret.: retention; Neg.: loss-negative; Practical: practical-negative. Retention, reduction, and preserve-rate entries are fractions.
Table 3. Paired source-bootstrap differences for feature-group ablations.
| Comparison | Metric | Difference | 95% CI |
|---|---|---|---|
| All – Detector+Residual | Spearman | +0.1519 | [0.1099, 0.1967] |
| Benefit retention | +0.0661 | [0.0248, 0.1058] | |
| Loss-negative reduction | +0.0688 | [-0.0021, 0.1430] | |
| Practical-negative reduction | +0.0212 | [-0.0463, 0.0853] | |
| Preserve rate | +0.0278 | [0.0011, 0.0533] | |
| Task-gradient+Residual – Residual | Spearman | +0.3921 | [0.3312, 0.4491] |
| Benefit retention | +0.0920 | [0.0603, 0.1296] | |
| Loss-negative reduction | +0.2319 | [0.1635, 0.2983] | |
| Practical-negative reduction | -0.0030 | [-0.0612, 0.0581] | |
| Preserve rate | +0.1156 | [0.0806, 0.1500] |
CI: source-bootstrap confidence interval.
only. This diagnostic is therefore explicitly a development-TRAIN mechanism analysis and is not used for model or threshold selection.
The full 500-source Gaussian development reference contains 96,000 regional rows from 1500 image–condition pairs. A region is considered active when both the recorded residual and privileged gradient activity are nonzero:
This reproduces the frozen count of 83,088 active rows. The Gaussian TRAIN subset contains 58,512 active rows across 1050 pairs from 350 sources. For a controlled paired comparison, all three relationships in Table 4 are therefore evaluated on this same Gaussian TRAIN subset.
The pseudo-gradient has weaker direct agreement with the nonlinear exact counterfactual than the privileged gradient, but every source-bootstrap interval remains above the corresponding null or chance baseline. Moreover, remains substantially aligned with , supporting the interpretation that pseudo-labeling attenuates rather than removes the directional task signal.
E.1. Gaussian severity diagnostic
Table 5 further breaks down the deployable pseudo-gradient agreement with exact counterfactual utility by Gaussian severity.
The association becomes stronger at the highest Gaussian severity. We do not treat this monotonic pattern as a primary claim because the analysis is restricted to Gaussian TRAIN data.
F. Threshold Operating-Point Sensitivity
Table 6 reports the family of operating points obtained by applying the same TRAIN-only rule under nearby benefit-retention constraints. The final columns are evaluated only after all thresholds have been selected from TRAIN.
The post-freeze zero-shot sensitivity is descriptive only. It demonstrates that the frozen 98%-retention point lies on a smooth risk–utility tradeoff rather than being an isolated test-selected threshold.
G. Appearance-Baseline Details
The Image-only baseline uses frozen ResNet-50 features from the degraded image. The Visual-pair baseline uses
Both follow the same Gaussian-only fitting and freezing discipline as TaskGuard.
On unseen motion/rain/defocus, Image-only obtains , benefit retention 86.1%, and loss-negative re-
Table 4. Gaussian TRAIN active-region mechanism analysis with 95% source-bootstrap confidence intervals.
| Comparison | Pearson | Spearman | Sign agreement | AUROC |
|---|---|---|---|---|
| vs. | 0.294 [0.249, 0.339] | 0.227 [0.212, 0.242] | 0.594 [0.588, 0.601] | 0.609 [0.602, 0.615] |
| vs. | 0.261 [0.213, 0.309] | 0.144 [0.129, 0.159] | 0.553 [0.548, 0.559] | 0.566 [0.559, 0.572] |
| vs. | 0.767 [0.680, 0.834] | 0.554 [0.526, 0.581] | 0.718 [0.705, 0.730] | 0.752 [0.738, 0.765] |
All comparisons use the same 350 TRAIN sources and 58,512 active regions with 5000 source-bootstrap samples. Null baselines are 0 for correlations and 0.5 for sign agreement and AUROC.
Table 5. versus exact by Gaussian severity on active TRAIN regions.
| Pearson | Spearman | Sign agree. | AUROC | |
|---|---|---|---|---|
| 15 | 0.134 | 0.105 | 0.543 | 0.552 |
| 25 | 0.214 | 0.111 | 0.544 | 0.554 |
| 50 | 0.271 | 0.196 | 0.572 | 0.585 |
Diagnostic only; all rows use active Gaussian TRAIN regions.
duction 6.9%. Visual-pair increases utility-ranking correlation to and loss-negative reduction to 30.3%, while its benefit retention is 79.6%. TaskGuard reaches , benefit retention 93.3%, and loss-negative reduction 54.2%. The source-bootstrap improvements of TaskGuard over Visual-pair are +19.5 percentage points in benefit retention (95% CI [14.2, 25.1]), +33.6 points in loss-negative reduction ([25.6, 41.8]), and +15.2 points in practical-negative reduction ([7.7, 22.8]).
H. Natural-Rain DAWN Details
DAWN contains 198 natural-rain images in the evaluation used here. Original rainy images obtain COCO-style AP 0.357807 and unconditional deraining obtains 0.381787.
The Image-only policy reaches AP 0.380475, restores 189 of 198 images, retains 94.5% of the Always-Derain AP gain, retains 99.7% of loss-defined restoration benefit, and reduces loss-negative interventions by 6.4%.
Visual-pair reaches AP 0.377305, restores 41 images, retains 81.3% of the AP gain, retains 101.2% of loss-defined benefit, and reduces loss-negative interventions by 80.9%.
TaskGuard reaches AP 0.376466, restores only 8 images, retains 77.8% of the AP gain, retains 100.4% of loss-defined benefit, and reduces loss-negative interventions by 97.9%. Benefit retention can exceed 100% because preserving selected negative-utility candidates can yield greater mean policy utility than unconditional deraining. Only six Always-Derain samples are practical-negative, so the corresponding practical-risk comparisons are descriptive.
Table 7 reports paired source-bootstrap AP differences between TaskGuard and the comparison policies.
TaskGuard improves loss-negative reduction over Visual-pair by 17.0 percentage points with paired source-

Figure 2. Natural-rain DAWN risk-accuracy tradeoff.
bootstrap 95% CI [8.4, 25.8].
Figure 2 visualizes the corresponding risk-accuracy tradeoff on natural-rain DAWN.
I. Cross-Detector Safety Transfer
The TaskGuard score and decision are constructed using YOLO11s. To test whether the decision transfers to another detector-specific utility function, we reevaluate the same frozen decisions on RT-DETR-L without retraining, changing features, or returning .
On the 600 fresh Gaussian pairs, the frozen TaskGuard score has with RT-DETR-L restoration utility. The policy retains 93.92% of RT-DETR-L loss-defined benefit and reduces the RT-DETR-L loss-negative rate from 28.50% to 19.83%, a relative reduction of 30.41%.
For comparison, under the YOLO11s utility used to construct TaskGuard, the fresh Gaussian result is , benefit retention 96.98%, and a loss-negative-rate reduction from 19.50% to 11.00%. The weaker RT-DETR result motivates the main-paper wording partial cross-detector safety transfer rather than detector invariance.
Table 6. TRAIN-selected operating points and post-freeze zero-shot sensitivity.
| TRAIN constraint | TRAIN ret. | TRAIN neg. red. | TRAIN preserve | ZS ret. | ZS neg. red. | ZS preserve | |
|---|---|---|---|---|---|---|---|
| 99.5% | 0.0066 | 99.61% | 28.93% | 13.05% | 95.51% | 41.53% | 24.17% |
| 99.0% | 0.0467 | 99.09% | 33.50% | 15.90% | 93.90% | 45.54% | 27.00% |
| 98.0% | 0.1076 | 98.02% | 39.59% | 20.19% | 93.25% | 54.23% | 32.72% |
| 97.0% | 0.1657 | 97.06% | 46.70% | 24.57% | 90.98% | 60.26% | 37.39% |
| 95.0% | 0.2860 | 95.10% | 57.36% | 33.14% | 88.05% | 70.34% | 44.78% |
Ret.: benefit retention; Neg.: relative loss-negative reduction; ZS: pooled zero-shot motion, rain, and defocus.
Table 7. Paired source-bootstrap DAWN AP differences.
| Comparison | AP diff. | 95% CI |
|---|---|---|
| TaskGuard – Visual-pair | -0.00084 | [-0.00277, 0.00098] |
| TaskGuard – Image-only | -0.00401 | [-0.01248, 0.00266] |
| TaskGuard – Always Derain | -0.00532 | [-0.01332, 0.00208] |
All intervals are paired 95% source-bootstrap CIs and include zero; they do not establish equivalence or non-inferiority.
J. Practical Detection-Utility Analysis
For each degraded/restored pair we compute class-aware matches at IoU 0.50 and detector confidence 0.25. Let
A restoration is practical-negative when
Across all controlled final pairs, the loss-negative rate is 21.12% and the practical-negative rate is 18.08%. The association between whole-image loss utility and per-image F1 change is
and identifies practical-negative cases with AUROC 0.700.
A practical deterioration occurs in 34.32% of loss-negative restorations but only 13.73% of non-loss-negative restorations. On the pooled unseen families, Always Restore is practical-negative on 18.33% of pairs and TaskGuard on 11.56%, a relative reduction of 36.97%.
These results support the use of detector loss as a differentiable utility proxy while also showing why it should not be treated as identical to task-level detection quality.
K. Runtime Details
Runtime protocol. Runtime was measured on a single NVIDIA RTX A4000 GPU using YOLO11s at input size 640. The benchmark uses 50 Gaussian validation sources at , with 5 warm-up samples before timing. The benchmark was invoked on cuda:0, and CUDA synchronization
Table 8. Runtime of the frozen TaskGuard decision stage.
| Configuration | Time / image | Increment |
|---|---|---|
| Detector only | 26.7 ms | – |
| TaskGuard post-restoration | 162.9 ms | +136.1 ms |
| Restore + detector | 667 ms | contextual |
| Restore + TaskGuard | 803 ms | contextual |
Core timings are measured after a restored candidate is available. Contextual rows add the saved Restormer directory timing, including startup. TaskGuard adds 136.1 ms/image over detector-only inference, or approximately 20.4% relative to Restore+Detector.
is performed immediately before and after each timed GPU operation. The timing experiment uses development data only and does not access the fresh final benchmark.
Table 8 summarizes the measured TaskGuard decision-stage runtime and the contextual end-to-end pipeline timings.
Timing interpretation. The measured detector-only time is 26.731 ms/image. The complete TaskGuard post-restoration stage requires 162.865 ms/image, corresponding to an incremental TaskGuard cost of 136.134 ms/image.
The separately measured Restormer directory run requires 640.310 ms/image and includes Python process and model-initialization overhead. Using this contextual restoration timing gives approximately 667.041 ms/image for Restore+Detector and 803.175 ms/image for Restore+TaskGuard. Thus, the TaskGuard increment is approximately 20.4% relative to the measured Restore+Detector pipeline. Because the Restormer measurement includes process startup and model initialization, these combined numbers are provided as deployment context rather than optimized persistent-model latency.
L. Reproducibility Checklist
The final evaluation follows the following lock discipline:
-
All controlled source images are drawn from COCO 2017 val2017.
-
Gaussian TRAIN contains 350 sources and 1050 pairs.
-
The frozen TaskGuard representation has exactly 43 features.
-
The frozen candidate is StandardScaler + Ridge (alpha=10).
-
The inference score is the average of 50 fold-specific regressors from ten repeated five-fold source-grouped stratified splits.
-
The frozen threshold is .
-
Threshold selection uses Gaussian TRAIN OOF predictions only.
-
The final controlled benchmark contains 200 untouched, source-disjoint sources and 2400 pairs.
-
Motion blur, rain, and defocus are unseen during Task-Guard fitting.
-
No final controlled, DAWN, or RT-DETR result is used for feature, model, or threshold retuning.
-
Post-freeze feature ablations, pseudo-gradient diagnostics, and threshold-sensitivity analyses do not change the locked TaskGuard policy.