Recorrupted Residuals: Anomaly Maps From Noisy Images With No Clean Reference

A common way to find defects or lesions in images is to train a generative model only on normal examples, ask it to redraw a test image as it "should" look, and flag the pixels where the redrawing differs from the input. This works when the normal training images are clean. In low-field MRI, low-dose CT, or cheap industrial cameras, every image, normal or not, carries sensor noise, and nobody has clean versions to train on. The difference map then fills with noise. A faint lesion or a fine scratch sinks below that noise floor, and there is no principled way to set an alarm threshold.

We propose a simple fix drawn from self-supervised denoising. First, split each noisy test image into two copies by adding and subtracting freshly drawn noise, so that their noise is statistically independent. This is the "recorruption" trick of Recorrupted-to-Recorrupted. Second, redraw the first copy as a normal image using a diffusion model trained only on noisy normal data. Third, measure the difference against the second copy, not against the input. Because the redrawn image cannot see the second copy's noise, the noise contributes a known constant that can be subtracted. What remains is an unbiased local estimate of how far the normal redrawing is from the true, unseen clean image. That quantity is the anomaly, already in calibrated units, so a false-alarm threshold can be set from noisy normal data alone.

Core Claim

Reconstruction-based anomaly detection can be made correct under sensor noise without clean or paired training data. Two existing tools combine to do it. The first is an ambient-trained diffusion prior, which learns a model of clean normal images from noisy samples, as in Score-based Self-supervised MRI Denoising. The second is a recorrupted residual, which compares the reconstruction against an independent noisy copy of the input.

To state the estimator, write the observation as $y = x + n$. Here $x$ is the true clean signal, which includes any anomaly, and $n$ is zero-mean noise with covariance $\Sigma$. Following R2R, we form $\hat{y} = y + Az$ and $\tilde{y} = y - Bz$, where $z$ is fresh standard Gaussian noise and $AB^\top = \Sigma$, so the noise in $\hat{y}$ is independent of the noise in $\tilde{y}$. Let $f(\hat{y})$ be the pseudo-normal reconstruction, meaning the model's guess of what a normal version of the image looks like. Let $W(p)$ be a small window of pixels around location $p$. The anomaly map is

$$r(p) = \frac{1}{|W(p)|}\sum_{i \in W(p)} \Big[\big(f(\hat{y})_i - \tilde{y}_i\big)^2 - \big(\Sigma + BB^\top\big)_{ii}\Big],$$

and its expectation equals $\frac{1}{|W(p)|}\sum_{i\in W(p)} \mathbb{E}\big[(f(\hat{y})_i - x_i)^2\big]$. This identity holds because the cross term vanishes when $f(\hat{y})$ is independent of the noise in $\tilde{y}$.

Away from anomalies, $r$ estimates the model's ordinary reconstruction error. Over an anomaly, $r$ additionally picks up the squared anomaly contrast that the normal prior refused to reproduce. The usual residual $|y - f(y)|$ has neither property. Its expectation contains the noise variance plus a correction term that depends on how strongly $f$ reacts to the noise in its own input, and that term is unknown and varies across pixels. Averaging $r$ over $T$ independent draws of $z$ shrinks the variance of the estimate. Its known variance under the normal hypothesis then supports a standardized score with an explicit false-alarm level, which speaks to the threshold-selection problem raised by MVTec AD.

Positioning Against Prior Work

The closest work fills one half of the problem each.

Score-AD detects anomalies by comparing a diffusion model's pull toward the normal data with its pull toward the query. It assumes clean normal training images, and it compares against the noisy input itself. Two papers build pseudo-healthy medical images with a guided deterministic diffusion sampler and then subtract: Diffusion Models for Medical Anomaly Detection and the review Denoising Diffusion Models for Anomaly Localization in Medical Images. These motivate our work, because they document the "noise paradox": too little added noise preserves the anomaly, and too much erases the patient's anatomy. Neither accounts for noise already present in the scan.

Corruption2Self supplies our training method. It learns a diffusion prior directly from noisy MRI by indexing the noise schedule relative to the scanner's base noise level. It was built for denoising, though, and it faithfully reconstructs whatever structure is present, lesions included. We reuse its training. We do not use its output as the answer; we compare that output against an independent noisy copy.

R2R supplies the recorruption identity, and we apply it in a new role. R2R uses it as a training loss for a denoiser. We use it at test time, as an estimator of distance to the unseen clean image.

How to Reduce Anomaly Detection in Images to Anomaly Detection in Noise shares our goal of turning anomaly detection into a statistical test on a residual. It predicts the background by matching similar patches within the image, and it assumes the noise level is the same everywhere. Our background predictor is a learned prior, and our test uses the known, possibly spatially varying $\Sigma$. That paper is both a constraint and a baseline.

Finally, SoftPatch and MeDS handle "noisy" anomaly detection in a different sense: some defective images have leaked into the normal training set. That problem is orthogonal to pixel-level sensor noise. We treat it as out of scope, apart from one stress test.

Research Program

The work has three parts.

The first is the prior. We train a diffusion model on noisy normal images with C2S-style generalized denoising score matching. Because the noisy data distribution at added level $\sigma_t$ equals the clean distribution smoothed to level $\sqrt{\sigma_0^2+\sigma_t^2}$ (with $\sigma_0$ the base sensor noise), only noise levels at or above $\sigma_0$ are learnable. We do this bookkeeping explicitly. The reconstruction $f(\hat{y})$ partially noises $\hat{y}$ to a chosen total level $L$, runs a deterministic reverse pass, and finishes with a single Tweedie step. Tweedie's formula gives the average clean image consistent with a noisy one using only the learned model, so this final step returns a clean estimate even though the model never saw clean data.

The second is the residual. We implement $r$ with $T$ recorruption draws and choose $A=\alpha\Sigma^{1/2}$ and $B=\alpha^{-1}\Sigma^{1/2}$. The parameter $\alpha$ trades off how heavily the reconstruction's input is corrupted against how noisy the reference copy is. We will sweep it. For a spatially varying $\Sigma$, such as MRI coil sensitivity, we estimate a per-pixel noise map from background regions and propagate that map's estimation error into the threshold.

The third is self-supervised selection of $L$. Because $r$ estimates error against the clean image, we can tune the noise depth without real anomalies. We paste DRÆM-style synthetic defects into noisy normal images, using Perlin-noise masks filled with external textures, and pick the $L$ that maximizes the gap between $r$ inside the pasted regions and $r$ on untouched normals. This moves the trade-off described by Bercea et al. from hand-tuning to a measured criterion.

Baselines

The naive reference point runs the same diffusion architecture, trained on the same noisy normal images with a standard diffusion loss, and uses the plain residual $|y - f(y)|$. Since this is what current diffusion detectors would do if handed noisy data, beating it measures the whole proposal.

The ingredient ablation keeps our trained model and reconstruction fixed and changes only the residual. We compare four forms: against $y$, against $y$ with the noise variance subtracted, against $\tilde{y}$ without subtraction, and the full $r$. This isolates the recorruption-and-debias step from the ambient prior. A second ablation swaps ambient training for naive training while keeping $r$.

The strongest existing competitor is a two-stage pipeline. C2S denoises every training and test image, and Score-AD is then trained and evaluated on the denoised images. This pairs the best reported noisy-data restorer with the best reported clean-data score detector. C2S reports 32.77 dB PSNR on M4Raw T1, against 31.72 dB for Noise2Self (Score-based Self-supervised MRI Denoising). Score-AD reports 98.24% image-level AUC and 97.78% pixel-level AUC on clean MVTec AD (Score-AD). We also run DRÆM on denoised images; on clean MVTec AD it reports 98.0 image AUROC and 68.4 pixel average precision (DRÆM). We found no reported result on Lacuna for any of these methods on noise-corrupted MVTec AD, BTAD, or BraTS, so every noisy-setting number will come from our own runs.

The remaining comparisons are the a contrario patch-matching detector (How to Reduce Anomaly Detection in Images to Anomaly Detection in Noise) and SoftPatch on noisy images. We add a clean-data oracle: the same model trained on the clean originals, which sets the ceiling.

For fairness, all generative methods share one backbone and training-step budget. Each method's free knobs (its $L$, $\alpha$, window size, or a denoiser's settings) receive the same tuning budget on synthetic-defect validation images, never on real anomalies. We report inference cost per image alongside accuracy, since R2R-style averaging multiplies forward passes by $T$. Beating the two-stage pipeline means higher pixel-level average precision at equal or lower compute, with the gap growing as noise increases. A tie on large defects with a clear win on low-contrast small defects would also count.

Why not just…?

Why not just denoise first with C2S or R2R and run a standard detector? This is the real threat, and the two-stage baseline is designed to settle it. Our reason for doubt is that a good denoiser preserves every structure present. R2R is built to do so, and C2S's detail refinement deliberately keeps fine texture. Its errors are also uneven across the image: it oversmooths some regions and leaves residual texture in others. The downstream residual is therefore taken against a reference with unknown, spatially varying bias, which is exactly what corrupts thresholds. Our estimator needs no accurate denoised reference, because the reference copy's noise is known exactly. If the two-stage pipeline matches us on both accuracy and calibrated false-alarm rate across noise levels, then the contribution reduces to the threshold calibration, and we will report it that way.

Why not just blur the ordinary residual map and subtract the noise variance? Blurring averages noise away, but it does not remove bias. The reconstruction $f(y)$ partly copies the noise in its own input, so the expected squared residual against $y$ equals the true error plus the noise variance, minus twice the sum of the per-pixel noise covariances of $f(y)$ with $y$. That correction is unknown and differs from pixel to pixel. A formula called SURE estimates it through Monte Carlo derivative estimates, and we include SURE-corrected residuals as an additional ablation. If SURE matches recorruption, it is the cheaper choice and we will say so. The blurred-residual variant appears directly in the ingredient ablation.

Why not just use patch matching with an a contrario test, or a memory bank of pretrained features? The a contrario method assumes noise of uniform strength and redundant backgrounds. Its authors note that subtle anomalies in smooth regions get masked by noisier neighbors, and patch matching cannot explain anatomical deformations of the kind DeScarGAN targets. Memory-bank detectors depend on ImageNet features, which were never exposed to scanner noise; SoftPatch shows how fragile such banks are to data quality, with PatchCore falling to 0.683 image AUROC at 10% contamination. Both appear as baselines under a noise schedule that varies across the image, which is where we expect them to fail.

Proposed Experiments and Decisive Checks

The industrial setting uses MVTec AD and BTAD. We corrupt both training and test images with Gaussian noise at several levels and with Poisson noise. The clean originals are used only for the oracle and for computing true error. Metrics are image AUROC, pixel AUROC, and pixel average precision, broken down by defect size and contrast.

The medical setting uses BraTS. We add Gaussian noise, and Rician noise at low signal-to-noise ratio where the Gaussian approximation degrades, and score tumor localization with Dice and pixel AUROC. M4Raw provides real 0.3T noise. Its healthy-volunteer scans train the prior, and synthetic lesions inserted into held-out scans serve as test anomalies. The file lists no real pathology on low-field scanners, so this part is honestly semi-synthetic.

Three checks decide the proposal.

The first tests the estimator itself. On M4Raw, where averaged repeat scans give a near-clean reference, we check whether $r$ tracks the measured squared error to that reference with negligible bias. If it is biased, the central claim fails.

The second tests calibration. We set a threshold from noisy normals at a nominal false-alarm rate and check whether the realized rate on held-out normals matches it across noise levels. We also inflate the noise estimate by up to ±50% to measure sensitivity. C2S reports that its denoising moves by less than 0.1 dB under that much estimation error, but our variance subtraction is first-order sensitive to the noise estimate, so its tolerance must be measured separately.

The third tests whether the advantage grows with noise. Our margin over the naive and two-stage baselines should widen as $\sigma_0$ increases and vanish at $\sigma_0 = 0$, where every method reverts to its clean-data behavior. A flat or reversed trend would mean the gain comes from something other than noise handling.