Teacher–student anomaly detectors train a small "student" network to copy a large pretrained "teacher" on defect-free images only, then flag a defect wherever the two disagree. They fail in a known way. The student copies too well: it learns the teacher's general input–output behaviour, reproduces the teacher's response to defects it has never seen, and the disagreement signal disappears. This is called normality forgetting. A common fix is cheap fake defects, such as Gaussian noise patches, cut-and-paste, or procedural Simplex noise, which the student is trained to disagree on. These fakes are cheap, but they carry obvious signatures such as sharp patch boundaries, blur, or unusual energy at particular spatial frequencies. A student can learn to react to those signatures instead of to "not normal," and it will still copy the teacher on a real scratch or a subtle weave fault.
We propose to generate fake defects in the frequency domain. Inside a small soft window, we scramble the Fourier phase of the image, which encodes where edges and structures sit, over a chosen frequency band. We keep the local amplitude spectrum, which encodes how much energy each frequency carries. The result looks statistically like the surrounding normal texture in terms of energy, but it is structurally wrong. It costs one forward and one inverse FFT per window, so it stays within the budget of procedural noise and far below diffusion-based generation. Our claim is that cheap synthetic anomalies reduce normality forgetting on real defects only to the extent that their low-level spectral statistics match normal data. Spectrum-matched phase perturbation is a way to get that match at near-zero cost. We make this claim measurable with a spectral "shortcut probe."
Core Claim and What Is New
The closest existing work motivates the claim without testing it. SPot-the-Difference Self-supervised Pre-training for Anomaly Detection and Segmentation shows that networks exploit sharp cut-and-paste edges and softens them with a Gaussian alpha mask (SmoothBlend). Its remedy is spatial smoothing, which shifts energy toward low frequencies and so leaves a signature of its own. Scale-Aware Contrastive Reverse Distillation for Unsupervised Medical Anomaly Detection (SCRD) trains a reverse-distillation student against a "noisy teacher" fed Simplex-noise images. It works entirely in the spatial domain and has no control over the spectrum of the perturbation. Collaborative Discrepancy Optimization for Reliable Image Anomaly Localization (CDO) injects Gaussian noise into square patches and pushes apart the normal and abnormal discrepancy distributions, which produces exactly the edge artifacts SPD warns about.
On the frequency side, AFSC: Adaptive Fourier Space Compression for Anomaly Detection learns amplitude and phase masks that remove lesions for pseudo-healthy reconstruction. It runs in the opposite direction from ours, since it removes anomalies rather than synthesizing them, and it does not involve distillation. Single-Layer Distillation with Fourier Convolutions for Texture Anomaly Detection places Fourier convolutions inside the student and low-passes the anomaly map. That low-pass step suppresses exactly the high-frequency defect evidence that matters on fine random textures, where it reports failing on DAGM. It uses no synthetic anomalies.
Our contribution differs from all of these in three ways. The anomaly generator is defined in the frequency domain with an explicit amplitude-preservation constraint. The student's contrastive objective is resolved per frequency band. And we test the hypothesis that "spectral detectability of the fakes predicts forgetting on real defects" across synthesizers, rather than proposing one more augmentation.
Research Program
The generator works as follows. For a training image $x$, we pick a random window $w$ and a random frequency band $B$ (an annulus in the 2D spectrum). We then replace the windowed patch by
$$ \tilde{x}_w = \mathcal{F}^{-1}\!\left(|\mathcal{F}(x_w)|\, e^{\,i(\angle \mathcal{F}(x_w) + \delta \cdot \mathbb{1}_B)}\right), $$
where $\mathcal{F}$ is the 2D FFT, $|\cdot|$ and $\angle$ are amplitude and phase, $\delta$ is a random phase field, and $\mathbb{1}_B$ restricts the perturbation to band $B$. The patch is blended back with a soft mask whose width is tied to the lowest frequency in $B$. Because the blended regions share the same power spectrum, the boundary does not create the excess high-frequency energy that cut-and-paste does.
Band choice is the lever the spatial methods lack. Low bands produce large-scale structural anomalies such as warps and missing periodicity. High bands produce fine texture faults. Sampling $B$ uniformly over bands, rather than over spatial scales, directly addresses the fixed-cutoff limitation of Frequency Attention for Knowledge Distillation, which uses a rigid 1% high-pass filter.
The student is a reverse-distillation encoder–decoder in the style of Anomaly Detection via Reverse Distillation from One-Class Embedding. It is trained with SCRD's clean/noisy-teacher contrastive objective, with SCRD's Simplex synthesizer swapped out for ours. We add one change to the loss. The teacher–student discrepancy map is decomposed with a Haar wavelet, and the margin between normal and synthetic regions is enforced separately in each sub-band after normalizing each band by its running scale on normal data. This per-band scale normalization follows Joint Sub-bands Learning with Clique Structures for Wavelet Domain Super-Resolution and prevents low-frequency energy from dominating the gradient. The per-band margin serves two purposes. It keeps the student from satisfying the margin through the easiest band only. It also gives a band-resolved readout of where forgetting happens.
The shortcut probe is a small logistic regression trained on local power-spectrum features, plus local mean and variance, to tell synthetic windows from normal windows. Probe accuracy near 50% means the fakes carry no low-level spectral signature. We compute it for every synthesizer we study.
Synthetic data overhead enters as a constraint. We report synthesis wall-clock per training sample and total added GPU time for every method, so that "cheap" is measured rather than asserted. The file documents diffusion-based data generation costing 62 hours on 8 GPUs in Zero-shot Generation of Training Data with Denoising Diffusion Probabilistic Model for Handwritten Chinese Character Recognition. Any method in that cost range is out of scope for online synthesis.
Baselines
The naive reference point is plain reverse distillation with no synthetic anomalies. Anomaly Detection via Reverse Distillation from One-Class Embedding reports 98.5% image AUROC, 97.8% pixel AUROC and 93.9% PRO (per-region overlap) on MVTec AD. We rerun it in the ADer toolbox so every method shares data splits, backbone, image resolution and training schedule.
The most informative controlled competitor is the same RD student with the same contrastive objective and the same soft-window masks, fed each alternative synthesizer in turn. The synthesizers are CDO-style Gaussian patches, cut-and-paste, SmoothBlend, and Simplex noise, the last of which amounts to SCRD. Every arm gets the same number of synthetic windows per batch, the same hyperparameter search budget (an identical grid over perturbation strength and window size), and the same epochs. On medical data, the published SCRD figures are 91.01% AUC on RSNA, 98.88% on Brain Tumor MRI and 83.10% on ISIC 2018. Beating it means exceeding our reproduced SCRD on all three under matched tuning, not only matching the published numbers.
The strongest existing number on MVTec AD is PBAS (Progressive Boundary Guided Anomaly Synthesis for Industrial Anomaly Detection). It synthesizes anomalies as outward shifts in feature space and reports 99.8% image AUROC, 98.6% pixel AUROC and 97.3% PRO. We run it from its official code. MVTec AD image AUROC is near ceiling, so we do not expect to beat PBAS there, and we will not claim to. The target is PRO on MVTec textures and on the texture datasets TILDA, AITEX and DAGM. For those datasets we found no reported result on Lacuna for PBAS, and for SingleNet the file gives latency (3.1 ms) but no AUC or PRO. We therefore run both ourselves.
We also report MemKD (Remembering Normality: Memory-guided Knowledge Distillation for Unsupervised Anomaly Detection, 99.6% image AUROC on MVTec AD) as a non-synthetic capacity-restriction competitor.
Three ablations isolate the key ingredient. The first uses amplitude-perturbed instead of phase-perturbed windows, which deliberately breaks spectral matching. The second uses phase perturbation over the full spectrum instead of a sampled band. The third keeps our synthesizer but replaces the per-band margin with a single spatial margin. The central claim survives only if the spectrum-matched arm beats the amplitude-perturbed arm on real-defect PRO while synthesis cost stays unchanged.
Why not just…?
Why not just use SmoothBlend or Simplex noise, which are already cheap and edge-free? This is the real threat. SPD and SCRD both report that softening or organic noise helps. Our argument is that smoothness does not equal spectral matching: a blurred blend or Simplex field still has an energy profile unlike the surrounding texture, and the probe will show whether that is true. The controlled-swap experiment settles it. If Simplex matches spectrum-matched synthesis on DAGM, AITEX and MVTec textures, the synthesizer adds nothing and the contribution shrinks to the diagnostic.
Why not synthesize in feature space as PBAS does and skip pixels entirely? PBAS is fast and strong on MVTec AD. However, feature-space rays move features away from a normal hypersphere without any tie to image structure. The PBAS authors themselves note that it covers structural defects only. We run PBAS head-to-head on the random-texture sets, where we expect band-controlled pixel perturbations to matter most. We also try pixel-level synthesis feeding PBAS's discriminator, in case the two are complementary rather than competing.
Why not just add a spectral or high-pass distillation loss, with no synthetic anomalies? Overcoming Low Frequency Bias with Spectral Losses and FAM-KD show that spectral losses sharpen what a student copies. On normal-only data, though, sharper copying is exactly the direction that worsens forgetting. The student gets better at reproducing everything, including defects. We include this arm, an RD student with a band-normalized wavelet reconstruction loss and no fakes. The prediction is fewer false positives on complex textures but no gain, or a loss, on anomaly separation.
Why not use a diffusion model for realistic defects? Realism is not the bottleneck we target, and the cost is prohibitive for online synthesis at the scales in the file. We do not run diffusion synthesis. We report the overhead comparison and state openly that logical anomalies, such as missing components, remain outside what any of these cheap synthesizers, including ours, can produce.
Proposed Experiments and Decisive Checks
We train on MVTec AD, VisA, MPDD, the textures TILDA, AITEX and DAGM, and the medical sets RSNA, Brain Tumor MRI and ISIC 2018. We report image AUROC, pixel AUROC, PRO, and synthesis GPU time, with three seeds per arm. We split results into texture categories, object categories, and logical-type defects, because we predict gains concentrated on stochastic textures and near zero on logical defects.
The first decisive check is the cross-synthesizer correlation. For the six or more synthesizers in the controlled swap, we plot probe accuracy against real-defect PRO on each dataset. The central claim predicts a clear negative relationship, with our arm near chance on the probe. If PRO shows no relationship to probe accuracy, the hypothesis is wrong regardless of our method's rank.
The second check is band-resolved forgetting. On real test defects, we compute the ratio of anomaly-region to normal-region discrepancy in each wavelet sub-band for plain RD, RD+Simplex and ours. This shows where forgetting lives. It also tests directly whether SingleNet-style low-passing discards the bands that carry defect evidence on DAGM.
The third check is the amplitude-versus-phase ablation at matched cost. It isolates spectral matching as the causal ingredient rather than frequency-domain synthesis in general.
References
- SPot-the-Difference Self-supervised Pre-training for Anomaly Detection and Segmentation
- Scale-Aware Contrastive Reverse Distillation for Unsupervised Medical Anomaly Detection
- Collaborative Discrepancy Optimization for Reliable Image Anomaly Localization
- AFSC: Adaptive Fourier Space Compression for Anomaly Detection
- Single-Layer Distillation with Fourier Convolutions for Texture Anomaly Detection
- Frequency Attention for Knowledge Distillation
- Anomaly Detection via Reverse Distillation from One-Class Embedding
- Joint Sub-bands Learning with Clique Structures for Wavelet Domain Super-Resolution
- Zero-shot Generation of Training Data with Denoising Diffusion Probabilistic Model for Handwritten Chinese Character Recognition
- Progressive Boundary Guided Anomaly Synthesis for Industrial Anomaly Detection
- Remembering Normality: Memory-guided Knowledge Distillation for Unsupervised Anomaly Detection
- MDPG: Multi-domain Diffusion Prior Guidance for MRI Reconstruction