Introduction
Industrial anomaly detection (AD) is a critical component of automated quality assurance. However, current state-of-the-art systems face two significant hurdles. First, many rely on feature extractors pre-trained on ImageNet. While these features are robust for general object recognition, they often lack the specificity required for niche industrial domains or complex "logical" anomalies—such as a package containing the correct items but in the wrong quantity. Second, existing unsupervised methods frequently depend on hand-crafted anomaly simulations (e.g., CutPaste), which incorporate human bias and may fail to represent the subtle structural or logical violations found in real-world defects.
To address these challenges, we present GRAD, a novel framework that eliminates the need for external pre-trained features and manual anomaly simulations. GRAD introduces a "prior-less" approach to generating diverse anomaly patterns that expose both low-level structural defects and high-level logical inconsistencies.
Methodology: The GRAD Framework
The GRAD framework is built upon three innovative pillars designed for efficiency and accuracy.
PatchDiff: Prior-less Anomaly Generation
At the heart of GRAD is PatchDiff, a modified diffusion model tailored to generate "contrastive patterns." Unlike standard generative models that attempt to reconstruct entire images, PatchDiff is intentionally constrained. By removing self-attention layers and limiting the U-Net's receptive field, the model is forced to preserve local structures while ignoring global context. This architectural choice ensures that generated patches appear realistic at a local level but are placed in ways that violate the global logic of the image, effectively creating "synthetic" anomalies without human intervention.
Self-supervised Reweighting
Not all patterns generated by PatchDiff are equally valuable. Some may inadvertently resemble normal data, while others might be redundant. GRAD employs a density-based reweighting mechanism to refine the training set. This mechanism filters out generated patches that are too similar to the normal training distribution and rebalances the data to ensure that rare, "long-tailed" anomaly patterns receive sufficient attention during the training of the detector.
Lightweight Coordinate-Aware Detector
Rather than utilizing a heavy transformer or ResNet backbone, GRAD employs a simple 8-layer Fully Convolutional Network (FCN). A key innovation here is the inclusion of a 2-channel coordinate map (X and Y positions) as part of the input. This allows the model to learn spatial logic—understanding that a specific component is only "normal" when located in a specific region of the image—without requiring explicit rule-based programming.
Experimental Results
The GRAD framework was rigorously evaluated on the industry-standard MVTec AD dataset and the more challenging MVTec LOCO (Logical Constraints) dataset.
State-of-the-Art Performance
On the MVTec LOCO benchmark, GRAD achieved a state-of-the-art image-level AU-ROC of 87.5%, surpassing the previous leader (SINBAD) and significantly outperforming methods reliant on ImageNet features. On the MVTec AD dataset, it maintained a competitive 98.7% AU-ROC, placing it among the top-tier performers for structural anomaly detection.
Unprecedented Efficiency
One of GRAD's most compelling advantages is its speed. By utilizing a lightweight FCN trained from scratch, GRAD avoids the heavy computational costs of large pre-trained models.
As shown in the figure above, GRAD occupies the ideal top-left corner of the performance-latency trade-off. It achieves a throughput of 1251.6 FPS on an NVIDIA V100 GPU, making it over 16 times faster than the next most accurate model, GCAD (77.5 FPS). This level of efficiency makes GRAD uniquely suited for real-time deployment on factory floors.
Discussion and Limitations
While GRAD sets new benchmarks for speed and logical anomaly detection, there are areas for future refinement. To handle the multi-scale nature of anomalies in the LOCO dataset, the current implementation integrates three detectors with varying receptive fields; a more unified single-model approach could simplify the architecture. Additionally, while GRAD is a leader in image-level detection, its pixel-level localization accuracy is competitive but not yet superior to specialized reconstruction-based models. Finally, the reweighting mechanism's sensitivity to its density kernel parameter suggests that some tuning may be required when applying the framework to vastly different datasets.
Conclusion
GRAD represents a significant step forward in unsupervised anomaly detection. By leveraging constrained diffusion to generate prior-less anomalies and a lightweight, coordinate-aware detector, it overcomes the biases of pre-trained features and the limitations of manual simulations. Its combination of state-of-the-art accuracy on logical anomalies and extreme inference speed offers a highly practical solution for modern industrial applications.
Summary updated