Anomaly detectors are usually trained and calibrated on data assumed to be all "normal." Deployed detectors rarely get that luxury. The logs, sensor streams and inspection images used to fit them already contain undetected anomalies, and so does any held-out slice used to set alarm thresholds. Operators also need more than a good ranking. They need an alarm threshold whose false-alarm rate is actually what was promised, and ideally a per-sample probability that an alarm is real. This note proposes a way to get both using only the contaminated data the detector was trained on. The approach treats the held-out anomaly scores as a mixture of two populations, normal and anomalous. It then imposes one checkable shape assumption: within samples of similar intrinsic difficulty, anomalies tend to score higher than normals. That assumption, combined with an estimate of how much contamination there is, is enough to pull the normal score distribution back out of the mixture.
In two sentences: if contaminating anomalies score higher than normals once you compare like with like, then thresholds computed on contaminated data are provably conservative, and most of the lost sensitivity can be recovered by subtracting an estimated anomaly component from the score distribution. The same subtraction yields a calibrated probability $P(\text{anomaly} \mid \text{score}, \text{difficulty})$ for every sample. No clean reference set is ever required.
Core Claim
The closest existing work splits along exactly the line this proposal crosses.
CADET does three things to reconstruction errors:
- It measures each sample's "hardness" with a cheap null model, for example average pooling for images or a linear autoregression for time series.
- It fits hardness-conditional quantiles of the error with B-splines.
- It wraps the result in conformal prediction, a distribution-free procedure that sets a threshold from held-out scores so that the false-positive rate (FPR) is bounded.
The catch is that CADET explicitly requires the held-out calibration set to be clean.
Split Conformal Prediction under Data Contamination (CRCP) does handle contaminated calibration data. It corrects the conformal quantile with a Kolmogorov–Smirnov bound that depends on a known upper bound on the contamination rate. However, it is built for supervised classification and regression, and the correction is worst-case over where the contaminants fall.
γGMM estimates a calibrated posterior over the dataset-level contamination fraction γ from an ensemble of detectors. It produces no per-sample probabilities.
None of these three uses the structural fact that distinguishes anomaly detection from label noise: contaminants are not placed adversarially. They are the very samples the detector was built to score high.
Write $s$ for the anomaly score and $h$ for hardness. The held-out score distribution is then
$$F(s \mid h) = (1-\gamma)\,F_0(s \mid h) + \gamma\,F_1(s \mid h),$$
where $F_0$ is the normal score distribution, $F_1$ is the anomalous one, and γ is the contamination fraction.
Assume a monotone likelihood ratio within each hardness level. This means the ratio $f_1/f_0$ of the two score densities does not decrease as $s$ increases. Two consequences follow directly.
The first is a guarantee. Under this assumption $F_1(t \mid h) \le F_0(t \mid h)$ at every threshold $t$, so $F(t \mid h) \le F_0(t \mid h)$. Thresholds taken directly from contaminated data therefore never exceed the target FPR; they only waste sensitivity.
The second is a calibrated posterior. Given γ, the shape constraint narrows the possible decompositions of $F$ enough to estimate the per-sample posterior
$$\pi(s,h) = \frac{\gamma f_1(s \mid h)}{f(s \mid h)}.$$
Here $f$, $f_0$ and $f_1$ are the densities of $F$, $F_0$ and $F_1$. We average over γGMM's posterior on γ, so uncertainty in the contamination level is carried into each sample's probability.
Hardness conditioning is not decoration. CADET shows that hard normals score above easy anomalies, which would violate the shape assumption if scores were pooled. Comparing within a hardness level is what makes the assumption plausible.
What is new is the combination of three things: instance-level probability calibration of anomaly scores, false-alarm control conditional on hardness, and no clean anchor set. The candidate gaps in the literature (Gaps 1 and 3 of the research file) are exactly the absence of such an estimator.
Research Program
Detectors and splits. We will train standard detectors on contaminated data and reserve a contaminated split for calibration. The detectors are autoencoders, DenoiserAD, and the contamination-robust ADL and COUTA.
The estimator. The estimator has three stages:
- Compute CADET-style hardness.
- Fit the two-component mixture with a monotone shape constraint on the likelihood ratio, implemented by isotonic regression of the posterior on score within smooth hardness bins.
- Draw γ from γGMM's posterior and average the resulting fits.
Two outputs. The first is a conservative threshold with a proven guarantee under the shape assumption. The second is a power-recovering threshold that targets the estimated $F_0$ quantile and is calibrated in expectation rather than guaranteed. Every result is reported for both, so readers can see what the extra sensitivity costs in validity.
Theory. We will state when the decomposition is identified. Given γ and the monotone ratio, $\pi$ is pinned down up to an interval, and we report its width. We will also quantify how mis-estimating γ propagates into calibration error. This connects to the irreducible error floor that PU-ECE found for calibration without negatives, since here too there are no verified negatives.
Testing the assumption. Because benchmark labels are available for evaluation, we can measure directly how often and how badly the monotone-ratio assumption fails within hardness strata. This is especially relevant for the duplicated-anomaly settings in ADBench, where dense anomaly clusters may receive low scores.
Secondary extension. We will feed $\pi$ back into training as the per-sample weight in robust empirical risk minimization, that is, a loss in which each training sample is weighted by how likely it is to be normal. This tests whether calibrated anomaly probabilities separate hard normals from contaminants better than raw-loss weighting. Angel or devil shows raw-loss weighting fails at that separation. The extension is kept secondary because it adds a training loop on top of the main question.
Baselines
The naive reference applies split conformal thresholds, and Platt or isotonic calibration fitted against γ-thresholded pseudo-labels, directly to the contaminated calibration split. Our own theory predicts its thresholds are valid but conservative, so the comparison is about recovered sensitivity and per-sample calibration error, not validity. It is run on exactly the same split and detector.
The oracle reference is CADET fitted on a clean calibration split of equal size. It bounds what is achievable. CADET reports that the FPR on the hardest 25% of Fashion-MNIST normals falls from nearly 19% to about 5% with a clean set. A contaminated-data method that gets within a small margin of the oracle's conditional FPR and true-positive rate counts as success.
The strongest contaminated-data competitor is CRCP, with its contamination bound set to the upper 95% credible value of γ from γGMM. It is applied per hardness stratum on CADET-normalized scores, so it receives the same hardness information and the same γ as our method. CRCP is a true competitor because it already corrects conformal quantiles under contamination. On CIFAR-10N worst-case noise it reports 91.7% coverage at a 90% target, with average prediction-set size 2.18, against 99% and 5.47 for standard conformal prediction. However, no reported result was found on Lacuna for CRCP, or any method, on anomaly-detection FPR control with a contaminated calibration set. We will therefore produce that number ourselves. Beating CRCP means matching its FPR validity while achieving higher true-positive rate at the target FPR. It also means a lower expected calibration error (ECE) for the per-sample probabilities that CRCP does not output; for that comparison we convert CRCP's p-values to probabilities via γ.
Two ablations isolate the key ingredients. The first removes hardness conditioning, testing whether the shape assumption holds marginally. The second replaces the monotone-ratio decomposition with an unconstrained two-Gaussian mixture, testing whether the shape constraint, rather than mixture modeling as such, does the work.
All methods share the same detectors, splits and γ posterior. Hyperparameters such as spline knots and bin counts receive the same search budget, selected on a separate contaminated split without labels.
Why not just…?
Why not just run conformal prediction on the contaminated data, since you prove it is valid? Under the shape assumption it is valid, and if that were the whole story the proposal would be a remark. The problems are that it gives no per-sample probabilities and that its sensitivity loss grows with γ. The experiments sweep γ from 5% to 20% to measure how much true-positive rate the naive method forfeits and how much the decomposition recovers. If the gap is negligible at realistic γ, we will report that as the finding.
Why not just plug γGMM's upper bound into CRCP? This is the real threat, and it is the main baseline above. Our argument is that CRCP's Kolmogorov–Smirnov correction is worst-case over where contaminants sit. Anomaly contaminants concentrate in the high-score tail, which a shape-aware decomposition can exploit. If CRCP plus γGMM matches us on sensitivity and, once converted, on ECE, the shape constraint adds nothing and the contribution reduces to the hardness-conditional evaluation.
Why not just pseudo-label with the detector and fit isotonic regression? Split conformal classification with unsupervised calibration reports that treating a model's own predictions as calibration labels produces systematic under-coverage. Self-labeling also has no mechanism to keep hard normals from being labeled anomalous. We include this approach in the naive baseline to confirm the failure on anomaly-detection data.
Why not just label a small clean anchor set, as in Deep SAD? Ruff et al. show that minimal supervision stabilizes learning, so this is a legitimate alternative when labeling is possible. We will measure how many verified normals CADET needs to match our method. That number is the honest price of our unsupervised setting.
Proposed Experiments
Datasets.
- ADBench's tabular suite, using its native contamination and duplicated-anomaly variants. ADBench reports a −16.43% median AUCROC drop at sixfold duplication.
- MVTec AD and VisA, under ADL's 5–20% contamination protocol. ADL reports 0.873 AUC-ROC at 20% contamination, against 0.690 for PatchCore.
- Fashion-MNIST in CADET's setup.
- COUTA's ten time-series datasets.
Metrics. Labels are used only for evaluation. We report:
- realized FPR against target, both overall and per hardness quartile;
- true-positive rate at that target;
- ECE and Brier score of $\pi$;
- coverage of the γ-uncertainty intervals;
- the measured violation rate of the monotone-ratio assumption.
Decisive checks. The first is whether realized FPR stays at or below target per hardness quartile at 20% contamination while the true-positive rate exceeds CRCP's. The second is whether ECE of $\pi$ approaches that of isotonic regression fitted on clean labels. The third is whether failures line up with measured assumption violations, which we expect mainly on duplicated anomalies and on subtle-defect categories such as cable, transistor and screw. That last check tells practitioners in advance where the method should not be trusted.
References
- CADET: Calibrated Anomaly Detection for Mitigating Hardness Bias
- Split Conformal Prediction under Data Contamination
- Estimating the Contamination Factor's Distribution in Unsupervised Anomaly Detection
- Denoising without Diffusion: Fixed-Noise Denoiser Anomaly Detection in Tabular Data
- Adaptive Deviation Learning for Visual Anomaly Detection with Data Contamination
- Calibrated One-Class Classification for Unsupervised Time Series Anomaly Detection
- Estimating Expected Calibration Error for Positive-Unlabeled Learning
- ADBench: Anomaly Detection Benchmark
- Angel or devil: Discriminating hard samples and anomaly contaminations for unsupervised time series anomaly detection
- Split conformal classification with unsupervised calibration