Abstract
Anomaly detection and localization in automated industrial manufacturing can significantly enhance production efficiency and product quality. Existing methods are capable of detecting surface defects in pre-defined or controlled imaging environments. However, accurately detecting workpiece defects in complex and unstructured industrial environments with varying views, poses and illumination remains challenging. We propose a novel anomaly detection and localization method specifically designed to handle inputs with perturbative patterns. Our approach introduces a new framework based on a collaborative distillation heterogeneous teacher network (HetNet), an adaptive local-global feature fusion module, and a local multivariate Gaussian noise generation module. HetNet can learn to model the complex feature distribution of normal patterns using limited information about local disruptive changes. We conducted extensive experiments on mainstream benchmarks. HetNet demonstrates superior performance with approximately 10% improvement across all evaluation metrics on MSC-AD under industrial conditions, while achieving state-of-the-art results on other datasets, validating its resilience to environmental fluctuations and its capability to enhance the reliability of industrial anomaly detection systems across diverse scenarios. Tests in real-world environments further confirm that HetNet can be effectively integrated into production lines to achieve robust and real-time anomaly detection.
Introduction
In controlled laboratory settings, anomaly detection (AD) is relatively straightforward: lighting is constant, cameras are fixed, and workpieces are consistently positioned. However, modern "flexible manufacturing" increasingly utilizes robotic arms that move cameras around parts, introducing significant environmental variability. These "perturbative patterns"—variations in resolution, perspective, and specular reflections—often cause standard AD models to trigger false positives, mistaking environmental noise for actual defects.
Existing AD methods typically rely on knowledge distillation, where a student network learns to mimic a teacher network's perception of "normal" data. These models often struggle when the definition of "normal" shifts due to varying angles or lighting. To bridge this gap, we present HetNet (Heterogeneous teacher network), a framework designed to remain sensitive to minute defects like cracks or porosities while ignoring the chaotic noise of a real-world factory floor.
Methodology
HetNet achieves robustness through three primary architectural innovations designed to capture a more holistic representation of industrial data.
1. Heterogeneous Teacher Encoders
Unlike traditional distillation methods that use a single teacher architecture, HetNet employs a dual-vision approach. It utilizes a CNN (WideResNet50) to capture fine-grained local textures and a Swin Transformer to capture long-range global dependencies. This hybridization ensures the model understands both the specific surface texture and the overall geometry of the workpiece, compensating for the inductive biases inherent in each architecture.
2. Adaptive Local-Global Feature (ALGF) Fusion
To synthesize the disparate data streams from the CNN and Transformer, we developed the ALGF module. Using cross-structure attention, this module dynamically weighs local details against global context, allowing the model to prioritize the most relevant features for a given scene.
3. Local Multivariate Gaussian Noise (LMGN) Generator
A core component of our approach is the LMGN generator. During training, the system calculates the mean and covariance of features at every pixel across the training set. It then injects noise sampled from this specific distribution into the features. By using noise derived from the actual distribution of normal features rather than random Gaussian noise, we effectively "stretch" the model’s definition of normality, teaching it to expect and ignore natural variations in lighting and pose.
4. Collaborative Distillation
The student network is trained via a dual-task objective: reconstruction (mimicking the teacher's clean features) and denoising (recovering clean features from the noisy LMGN input). This forces the student to learn a robust latent representation that does not overfit to a single "perfect" view of a workpiece.
Experimental Evaluation
We evaluated HetNet against several state-of-the-art (SOTA) methods across multiple benchmarks:
- MSC-AD (Multi-Scene Anomaly Detection): The primary benchmark for complex conditions, featuring variations in illumination, resolution, and positioning.
- MVTec AD & VisA: Industry standards for high-resolution, controlled-environment detection.
- MPDD: A dataset focused on metal parts with complex backgrounds.
Performance Highlights
HetNet demonstrated significant performance gains, particularly in challenging environments. On the MSC-AD dataset, HetNet achieved an 85.81% Image-AUROC, outperforming the previous SOTA (CFA) by over 18%. In stress tests involving low-light and low-resolution scenarios, HetNet maintained high performance (87.62% AUROC in low light) while competing models like RD4AD saw performance drop to as low as 45.35%.
Real-World Deployment
To validate the practical utility of HetNet, we deployed the system on a Flexiv Rizon 7-Axis Robot Arm. The model achieved inference speeds ranging from 0.27s to 0.33s per image on a standard GPU. This performance confirms that HetNet is capable of supporting real-time production lines, providing robust defect inspection without sacrificing throughput.
Conclusion
HetNet represents a significant step toward moving anomaly detection from the laboratory to the factory floor. By combining heterogeneous feature extraction with targeted noise fusion, the framework provides a resilient solution for flexible manufacturing. Future work will explore the application of this noise-fusion approach to deformable objects, such as textiles, and further optimize the architecture for deployment on edge-computing devices.
Summary updated