Abstract
Industrial defect detection is commonly addressed with anomaly detection (AD) methods where no or only incomplete data of potentially occurring defects is available. This work discovers previously unknown problems of student-teacher approaches for AD and proposes a solution, where two neural networks are trained to produce the same output for the defect-free training examples. The core assumption of student-teacher networks is that the distance between the outputs of both networks is larger for anomalies since they are absent in training. However, previous methods suffer from the similarity of student and teacher architecture, such that the distance is undesirably small for anomalies. For this reason, we propose asymmetric student-teacher networks (AST). We train a normalizing flow for density estimation as a teacher and a conventional feed-forward network as a student to trigger large distances for anomalies: The bijectivity of the normalizing flow enforces a divergence of teacher outputs for anomalies compared to normal data. Outside the training distribution the student cannot imitate this divergence due to its fundamentally different architecture. Our AST network compensates for wrongly estimated likelihoods by a normalizing flow, which was alternatively used for anomaly detection in previous work. We show that our method produces state-of-the-art results on the two currently most relevant defect detection datasets MVTec AD and MVTec 3D-AD regarding image-level anomaly detection on RGB and 3D data.
Introduction
In industrial manufacturing, identifying defects is a "needle in a haystack" problem. Because defects are rare and unpredictable, engineers typically rely on semi-supervised anomaly detection, training models exclusively on "normal" (defect-free) samples. A popular framework for this task is the Student-Teacher (S-T) approach, where a student model is trained to mimic the feature extraction of a pre-trained teacher model. Ideally, the student learns to match the teacher on normal data but fails to do so on anomalous data, creating a measurable "anomaly score" based on the distance between their outputs.
The Generalization Problem in S-T Networks
A critical flaw in traditional S-T frameworks is that if the student and teacher share similar architectures (e.g., both are standard CNNs), the student generalizes too well. It unintentionally learns to predict what the teacher would output even for defective inputs it has never seen. This leads to dangerously low anomaly scores for actual defects, as the student successfully mimics the teacher's out-of-distribution behavior.
Proposed Method: Asymmetric Student-Teacher (AST)
To overcome this generalization gap, we introduce Asymmetric Student-Teacher (AST) networks. The core innovation lies in pairing two fundamentally different architectures that react differently to out-of-distribution data:
- The Teacher (Normalizing Flow): We utilize a bijective (invertible) Normalizing Flow (NF) based on Real-NVP. The teacher is trained to map the distribution of normal image features to a standard Gaussian distribution. Due to its bijective nature, any anomalous input forces the teacher's output to diverge significantly from the expected distribution.
- The Student (Standard CNN): The student is a conventional feed-forward network. It is trained to regress the teacher's output on normal data.
- The Asymmetric Advantage: Because the CNN student lacks the bijective properties of the NF teacher, it physically cannot replicate the teacher's divergent behavior when encountering a defect. This architectural mismatch ensures a large distance between their outputs on anomalies, providing a robust detection signal.
Multimodal Fusion and 3D Integration
Industrial defects are not always visible in 2D images. Subtle indentations or structural misplacements often require 3D data for detection. AST incorporates multimodal fusion by combining RGB features with 3D depth maps. We employ "pixel-unshuffling" to align the resolution of depth maps with high-level image features and utilize positional encoding to provide the model with spatial context, which is vital for detecting misplaced components.
Experimental Results
The AST model was evaluated on the two most rigorous benchmarks in the field: MVTec AD (2D) and MVTec 3D-AD.
- MVTec AD: AST achieved a mean AUROC of 99.2%, setting a new state-of-the-art and outperforming previous leading methods like PatchCore and CS-Flow.
- MVTec 3D-AD: By effectively fusing RGB and 3D data, AST reached a mean AUROC of 93.7%, a significant improvement over previous 3D-capable methods which typically averaged around 86.5%.
Conclusion
By introducing architectural asymmetry, AST solves the generalization problem inherent in traditional student-teacher networks. The combination of a bijective teacher and a non-bijective student ensures that anomalies are clearly distinguished by a large output distance. This approach, coupled with effective multimodal fusion, provides a highly accurate and efficient solution for modern industrial quality assurance.
Summary updated