AnomalyNCD: Towards Novel Anomaly Class Discovery in Industrial Scenarios
Ziming Huang, Xurui Li, Haotian Liu, Feng Xue, Yuzhe Wang, Yu Zhou
TL;DR
AnomalyNCD addresses the challenge of discovering novel anomaly classes in industrial settings by learning from isolated anomaly regions rather than whole images. It introduces Main Element Binarization (MEBin) to produce anomaly-centered inputs, Mask-Guided Representation Learning (MGViT) to focus representations on anomalous regions, and a region merging strategy to robustly classify at both region and image levels. The approach is compatible with various anomaly detectors and leverages self-supervised and pseudo-labeled supervision to learn discriminative, region-specific features, achieving state-of-the-art gains on MVTec AD and MTD when combined with zero-shot anomaly detection. These components together enable effective multi-class anomaly discovery with practical robustness to detector quality and complex, combined-type anomalies in industrial data.
Abstract
Recently, multi-class anomaly classification has garnered increasing attention. Previous methods directly cluster anomalies but often struggle due to the lack of anomaly-prior knowledge. Acquiring this knowledge faces two issues: the non-prominent and weak-semantics anomalies. In this paper, we propose AnomalyNCD, a multi-class anomaly classification network compatible with different anomaly detection methods. To address the non-prominence of anomalies, we design main element binarization (MEBin) to obtain anomaly-centered images, ensuring anomalies are learned while avoiding the impact of incorrect detections. Next, to learn anomalies with weak semantics, we design mask-guided representation learning, which focuses on isolated anomalies guided by masks and reduces confusion from erroneous inputs through corrected pseudo labels. Finally, to enable flexible classification at both region and image levels, we develop a region merging strategy that determines the overall image category based on the classified anomaly regions. Our method outperforms the state-of-the-art works on the MVTec AD and MTD datasets. Compared with the current methods, AnomalyNCD combined with zero-shot anomaly detection method achieves a 10.8% $F_1$ gain, 8.8% NMI gain, and 9.5% ARI gain on MVTec AD, and 12.8% $F_1$ gain, 5.7% NMI gain, and 10.8% ARI gain on MTD. Code is available at https://github.com/HUST-SLOW/AnomalyNCD.
