[Paper Review] Watermarking for Out-of-distribution Detection
This paper proposes a novel watermarking method that reprograms well-trained deep models for out-of-distribution (OOD) detection by injecting a learnable, data-level watermark pattern into test inputs. Without modifying model weights, the watermark enhances OOD detection performance by increasing the score gap between in-distribution and OOD data, achieving state-of-the-art results across multiple benchmarks.
Out-of-distribution (OOD) detection aims to identify OOD data based on representations extracted from well-trained deep models. However, existing methods largely ignore the reprogramming property of deep models and thus may not fully unleash their intrinsic strength: without modifying parameters of a well-trained deep model, we can reprogram this model for a new purpose via data-level manipulation (e.g., adding a specific feature perturbation to the data). This property motivates us to reprogram a classification model to excel at OOD detection (a new task), and thus we propose a general methodology named watermarking in this paper. Specifically, we learn a unified pattern that is superimposed onto features of original data, and the model's detection capability is largely boosted after watermarking. Extensive experiments verify the effectiveness of watermarking, demonstrating the significance of the reprogramming property of deep models in OOD detection.
Motivation & Objective
- To address the challenge of out-of-distribution detection in safety-critical deep learning systems where OOD data is rare and model retraining is costly.
- To explore whether the reprogramming property of deep models—where inputs can be transformed to repurpose a model—can be leveraged for OOD detection.
- To develop a data-level watermarking technique that enhances OOD detection scores without modifying model parameters.
- To learn a unified, static watermark pattern that boosts detection performance while preserving semantic content in the input.
Proposed method
- A learnable watermark pattern is superimposed on input features during inference, preserving the original input's semantic structure while embedding a discriminative pattern.
- The watermark is optimized via a differentiable objective that maximizes the score gap between watermarked in-distribution and OOD data under a pre-defined scoring function (e.g., free energy, softmax).
- The optimization ensures the model assigns high confidence to watermarked ID inputs but low confidence to OOD inputs, even when the watermark is not semantically meaningful to the model.
- The method uses a regularization loss to prevent the model from perceiving the watermark as a valid ID pattern, maintaining robustness.
- The framework is general and compatible with various scoring functions (e.g., logit, gradient, embedding-based) and datasets (CIFAR-10, CIFAR-100, SVHN, Places365, iSUN, Texture).
- Hyperparameters are tuned using a validation set (e.g., tiny-ImageNet), and ablation studies verify the contribution of different watermark regions.
Experimental results
Research questions
- RQ1Can the reprogramming property of pre-trained deep models be exploited to enhance out-of-distribution detection without model fine-tuning?
- RQ2Can a learnable, data-level watermark improve the score separation between in-distribution and out-of-distribution inputs?
- RQ3How does the spatial distribution of the watermark (center vs. edge) affect OOD detection performance?
- RQ4Does the watermarking method generalize across different scoring functions and datasets?
- RQ5What is the impact of watermark intensity and sparsity on detection performance?
Key findings
- On CIFAR-10 with free energy scoring, watermarking reduced FPR95 from 55.00% (baseline) to 29.75%, while increasing AUROC from 89.69% to 95.16%.
- On CIFAR-100, the method achieved an average AUROC of 76.47% with watermarking, compared to 73.77% without, demonstrating consistent improvement.
- Masking only 10% of the highest-magnitude watermark components (χ₁=0.10) caused a significant drop in AUROC to 94.41%, indicating that the entire watermark pattern is essential.
- The method outperformed baseline OOD detection methods across multiple benchmarks, including iSUN, SVHN, Places365, and LSUN, with consistent improvements in FPR95, AUROC, and AUPR.
- The performance gain was robust across different scoring functions (free energy, softmax, and others), confirming the method’s generalization capability.
- Ablation studies showed that both central and edge regions of the watermark contribute to detection, with edge patterns encoding hidden knowledge that boosts OOD discrimination.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.