In the world of automated industrial inspection, finding defects is often a game of "spot the difference" where the differences are incredibly subtle. While deep learning has made huge strides in anomaly detection, identifying "weak defects"—those tiny scratches or low-contrast blemishes that look almost exactly like normal material—remains a major hurdle.
A new paper, "A Unified Anomaly Synthesis Strategy with Gradient Ascent for Industrial Anomaly Detection and Localization," introduces a framework called GLASS that tackles this head-on by intelligently "dreaming up" the hardest possible defects to train against.
TL;DR
The researchers propose GLASS (Global and Local Anomaly co-Synthesis Strategy), a framework that uses gradient ascent and truncated projection to synthesize realistic, subtle anomalies at the feature level. By combining these "near-in-distribution" synthetic defects with traditional image-level textures, GLASS achieves a near-perfect 99.9% AUROC on the MVTec AD benchmark and sets new records for detecting weak industrial defects.
What Problem Does This Paper Address?
Most industrial anomaly detection is unsupervised because real-world defects are rare and expensive to label. To train models, researchers often synthesize "fake" anomalies. However, current methods have two big flaws:
- Lack of Controllability: Adding random noise to features or pasting random textures onto images creates anomalies that are often "too easy" for the model to spot.
- The "Weak Defect" Gap: They fail to generate anomalies that sit right on the edge of the normal distribution—the subtle, low-contrast defects that are most likely to be missed in a real factory setting.
Methods
The GLASS framework operates through three parallel branches during training:
- Normal Branch: Processes standard, defect-free images through a frozen backbone (like WideResNet50) and a trainable "feature adaptor" to learn the baseline distribution.
- Global Anomaly Synthesis (GAS): This is the core innovation. It operates in the feature space. It takes normal features, adds a tiny bit of Gaussian noise, and then uses gradient ascent to push those features toward the classification boundary. A truncated projection step ensures these synthetic anomalies don't wander too far away, keeping them "weak" and challenging for the model.
- Local Anomaly Synthesis (LAS): This branch works at the image level. It overlays external textures onto normal images using Perlin noise masks to simulate "strong," localized defects like holes or large stains.
The system is trained end-to-end to distinguish normal features from both GAS (subtle/global) and LAS (obvious/local) synthetic features.
Datasets
The authors evaluated GLASS on three standard public benchmarks: MVTec AD, VisA, and MPDD.
To specifically test weak defect detection, they introduced three new benchmarks:
- WFDD (Woven Fabric Defect Detection): A self-built dataset of 4,101 industrial fabric images with real-world defects.
- MAD-man: A subset of MVTec AD where humans manually selected the most difficult, subtle defects.
- MAD-sys: A synthetic test set where the "weakness" of defects is mathematically controlled via transparency.
Key Insights and Ideas
- Gradient Ascent as a "Hard Negative" Generator: Instead of hoping random noise creates a challenging sample, GLASS explicitly uses the model's own loss function to find the most confusing synthetic anomalies. This forces the discriminator to learn a much tighter and more precise classification boundary.
- Distribution Hypotheses: The authors recognize that different industrial objects have different data structures. They implement GAS using two different geometric assumptions: the Manifold Hypothesis (for complex, non-linear textures) and the Hypersphere Hypothesis (for compact, uniform objects). They use image-level spectrogram analysis to automatically choose the best fit for a given category.
- Complementary Synthesis: GAS and LAS work together. GAS handles the "near-in-distribution" anomalies that look like normal features, while LAS ensures the model can still handle "far-from-distribution" anomalies with distinct textures.
Key Results
- State-of-the-Art Performance: GLASS achieved a staggering 99.9% image-level AUROC on MVTec AD, outperforming previous leaders like PatchCore and SimpleNet.
- Weak Defect Mastery: On the challenging MAD-sys dataset, GLASS outperformed the previous best method (SimpleNet) by 11% AUROC (95.6% vs 84.6%).
- Industrial Speed: Despite the sophisticated synthesis, the model maintains a throughput of 1,327 images per second, making it highly practical for high-speed production lines.
Limitations and Future Work
While GLASS excels at structural and textural defects, the authors note it hasn't been extensively tested on logical anomalies (e.g., a machine part that has all the right components but in the wrong order). Additionally, the LAS branch still relies on an external texture dataset (DTD). Future work will look into generating these local textures internally to create a completely self-contained synthesis pipeline.
Paper Citation: Qiyu Chen, Huiyuan Luo, Chengkan Lv, and Zhengtao Zhang. "A Unified Anomaly Synthesis Strategy with Gradient Ascent for Industrial Anomaly Detection and Localization." arXiv:2407.09359v1 [cs.CV] 12 Jul 2024.
Summary updated