Abstract
Traditional defect localization in industrial automation often relies on "modeling normality," a paradigm that is frequently fragile to environmental shifts and computationally expensive. We present a novel one-stage framework that shifts the focus from reconstruction to direct pattern recognition. By leveraging a Generative Adversarial Network (GAN) trained on unaligned distributions and a unique "invisible pattern" loss, our method achieves superior robustness and a significant speedup in inference. Experimental results on the MVTec AD benchmark demonstrate a 10.7% improvement in F1-score and an inference speed nearly 9,000 times faster than current state-of-the-art techniques.
The Problem with Reconstruction-Based Paradigms
In industrial settings, detecting minute defects like scratches or tears in textures is critical. Most existing methods utilize reconstruction-based models: they learn the distribution of "normal" samples and attempt to reconstruct inputs as perfect versions of themselves, flagging discrepancies as defects.
However, this approach suffers from two major flaws. First, it is environmentally fragile; slight variations in lighting or camera angles between training and deployment often lead to false positives. Second, these models tend to overfit to the specific definition of normality for a single product, limiting their generalizability across diverse texture types.
Proposed Methodology
To address these limitations, we propose a framework that identifies defective patterns directly from samples without a reference normal model. The architecture is built on four key innovations:
- Unpaired Transition: The model utilizes a GAN where input defective images and target annotation masks are intentionally unaligned. This prevents simple mapping memorization and forces the network to discern the underlying relationship between defective areas and mask regions.
- Scaled Pattern (SP) Loss: To stabilize training, we introduce an "Invisible Pattern"—a linearly scaled version of the normal sample. While imperceptible to humans, it provides a pixel-wise bidirectional mapping that prevents the generator from producing random noise.
- Dynamic Correction Mechanism (DMCC): Inspired by cycle-consistent GANs, this module allows for self-correction. The network attempts to recover the original image from the predicted mask; failure to do so generates a loss signal that refines localization accuracy without requiring external ground truth.
- Progressive Opacity Strategy ($Pos$): We employ curriculum learning by gradually increasing the transparency of synthetic defects during training. This helps the model master obvious defects before transitioning to subtle, near-invisible anomalies.
Experimental Results
Accuracy and Robustness
The proposed method was evaluated on prominent benchmarks, including MVTec AD (texture classes), DTD-Synthetic, and Woven Fabric Textures. Our approach outperformed previous state-of-the-art (SOTA) models by 10.7% in F1-score on MVTec textures. Furthermore, in "Hard Settings" involving simulated environmental changes in brightness and hue, our model maintained high performance while traditional methods like PatchCore experienced significant degradation.
Efficiency
By eliminating the need for complex multi-stage comparisons or reconstructions during deployment, the framework achieves an average inference time of just 0.006 seconds per image. Compared to competing methods like PNI, which can take up to 55 seconds, our approach is approximately 9,000 times faster, making it highly suitable for real-time industrial applications.
Conclusion
This research demonstrates that for texture-based anomalies, "normality" is not a prerequisite for effective localization. By focusing on the universal characteristics of defects rather than product-specific perfection, we achieve a more robust and efficient solution. While currently optimized for texture classes, future work will explore extending this direct localization logic to complex object geometries where the standard of normality is more geometrically constrained.
Summary updated