Abstract
Recent unsupervised anomaly detection methods often rely on feature extractors pretrained with auxiliary datasets or on well-crafted anomaly-simulated samples. However, this might limit their adaptability to an increasing set of anomaly detection tasks due to the priors in the selection of auxiliary datasets or the strategy of anomaly simulation. To tackle this challenge, we first introduce a prior-less anomaly generation paradigm and subsequently develop an innovative unsupervised anomaly detection framework named GRAD, grounded in this paradigm. GRAD comprises three essential components: (1) a diffusion model (PatchDiff) to generate contrastive patterns by preserving the local structures while disregarding the global structures present in normal images, (2) a self-supervised reweighting mechanism to handle the challenge of long-tailed and unlabeled contrastive patterns generated by PatchDiff, and (3) a lightweight patch-level detector to efficiently distinguish the normal patterns and reweighted contrastive patterns. The generation results of PatchDiff effectively expose various types of anomaly patterns, e.g. structural and logical anomaly patterns. In addition, extensive experiments on both MVTec AD and MVTec LOCO datasets also support the aforementioned observation and demonstrate that GRAD achieves competitive anomaly detection accuracy and superior inference speed.
Introduction
In industrial inspection, anomalies are rare and unpredictable, making unsupervised anomaly detection (AD) the standard approach. Most state-of-the-art methods rely on features from ImageNet-pretrained backbones or manually designed simulations (e.g., CutPaste). However, these "priors" can fail when the target domain is specialized or when anomalies are "logical" (e.g., a missing component) rather than structural (e.g., a scratch). GRAD addresses this by introducing a "prior-less" framework that generates its own training data without human-designed rules or external datasets.
The GRAD Framework
The GRAD framework consists of three main stages designed to move away from heavy, pretrained dependencies.
PatchDiff: Prior-less Anomaly Generation
The core innovation is PatchDiff, which adapts a Diffusion Probabilistic Model (DDPM) to act as an anomaly generator. By employing receptive field control—specifically removing self-attention layers and reducing the U-Net's depth—the model is forced to preserve local textures while disregarding global structures. This results in images that look "locally normal" but "globally wrong," providing high-quality contrastive examples for training.
Self-Supervised Reweighting
Generated images are pixel-unlabeled and can be "long-tailed," meaning some patterns (like background) appear more frequently than others. GRAD uses a feature density-based mechanism to maintain a memory bank of normal features. If a generated anomalous patch is too similar to a normal one, its weight is decreased during training. This filters out noise and ensures the detector focuses on truly discriminative anomalous features.
Lightweight Patch-level Detector
Because PatchDiff provides high-quality training data, GRAD does not require a massive pretrained backbone. Instead, it utilizes a simple 8-layer Fully Convolutional Network (FCN). This architectural choice leads to a massive leap in inference speed, making it viable for real-time deployment.
Key Results
GRAD was evaluated on the MVTec AD and MVTec LOCO benchmarks, the latter of which is specifically designed to test logical anomaly detection.
- Superior Accuracy on Logic: GRAD achieved an image-level AU-ROC of 87.5% on MVTec LOCO, outperforming previous leaders like SINBAD (86.8%) and GCAD (83.3%).
- Competitive Structural Detection: On MVTec AD, it reached 98.7% AU-ROC, matching top-performing methods without using ImageNet priors.
- Blazing Inference Speed: GRAD is exceptionally efficient, achieving 1251.6 FPS (0.799ms per image) on an NVIDIA V100. This is significantly faster than competing high-performance models like GCAD (77.5 FPS).
Conclusion
GRAD demonstrates that high-performance anomaly detection can be achieved without the crutch of pretrained features or manual simulation. By leveraging constrained diffusion for data generation and a density-based reweighting strategy, GRAD provides a scalable and efficient solution for identifying both structural and complex logical anomalies in industrial settings.
Summary updated