Abstract
Open-set Supervised Anomaly Detection (OSAD) aims to improve anomaly detection by utilizing a small set of labeled anomaly examples. However, current OSAD models typically assume that these labeled examples are representative of all potential anomalies, treating them as a homogeneous group. This "homogeneity trap" limits the model's ability to generalize to unseen anomaly types. We present Anomaly Heterogeneity Learning (AHL), a framework designed to account for the diverse and unbounded nature of anomalies. AHL simulates multiple heterogeneous anomaly distributions through Heterogeneous Anomaly Distribution Generation (HADG) and optimizes a unified detector via Collaborative Differentiable Learning (CDL). Our experiments across nine diverse datasets show that AHL consistently outperforms state-of-the-art methods, particularly in detecting novel anomaly classes.
Introduction
In computer vision, detecting rare anomalies—such as defects in industrial parts or pathological signs in medical imaging—is critical. Traditional anomaly detection (AD) often relies on one-class learning, using only normal data. Open-set Supervised Anomaly Detection (OSAD) has emerged as a more powerful alternative by incorporating a few labeled anomaly samples.
Despite its advantages, OSAD faces a significant hurdle: the "homogeneity trap." Most existing models treat all anomalies as if they originate from a single, uniform distribution. In practice, anomalies are heterogeneous; a model trained to detect "scratches" may fail to identify "dents" if it overfits to the specific patterns of the training set.
Methodology: The AHL Framework
To address anomaly heterogeneity, the AHL framework introduces two primary components that can be integrated into existing OSAD architectures.
Heterogeneous Anomaly Distribution Generation (HADG)
Since diverse anomaly data is often unavailable, AHL simulates it. The HADG module first clusters normal data into $C$ distinct patterns using K-means. It then constructs $T$ simulated "mini-environments" by pairing these normal clusters with either seen anomalies or generated "pseudo-anomalies" (e.g., using CutPaste). This process creates a variety of simulated anomaly distributions, forcing the model to encounter diverse "abnormality" scenarios during training.
Collaborative Differentiable Learning (CDL)
The CDL module manages the learning process across these simulated distributions. Instead of a single training pass, AHL trains $T$ base models, each specialized for one simulated distribution. A unified model is then updated using a meta-learning approach involving support and query sets. This ensures the final model learns features that are robust across different types of anomalies.
Furthermore, AHL incorporates a Self-Supervised Importance Scoring mechanism. Using a Bi-LSTM network, the system tracks the generalization performance of each base model. Distributions that prove less useful for generalization are automatically down-weighted, ensuring that noisy or unrepresentative simulations do not degrade the final model's performance.
Experimental Evaluation
The effectiveness of AHL was evaluated on nine real-world datasets spanning industrial inspection (e.g., MVTec AD, AITEX, solar cells) and medical imaging (e.g., BrainMRI, Hyper-Kvasir). Two testing protocols were used:
- General Protocol: Randomly sampled anomalies for training and testing.
- Hard Protocol: Training on one specific anomaly class and testing on entirely different, unseen classes.
Results and Discussion
AHL demonstrated superior performance over state-of-the-art baselines like DevNet and DRA. Under the General protocol, AHL achieved an AUC improvement of 4% to 9%. More importantly, in the Hard protocol—the true test of open-set generalization—AHL showed a 3.2% AUC boost. These results suggest that by simulating heterogeneity, the model learns the fundamental concept of "abnormality" rather than just memorizing specific defect shapes.
Conclusion
Anomaly Heterogeneity Learning (AHL) provides a robust solution to the homogeneity trap in OSAD. By simulating diverse anomaly distributions and employing a collaborative learning strategy, AHL significantly enhances a model's ability to detect both seen and unseen anomalies. Future research may explore applying these principles to more complex data types, such as video or multi-modal sensor data.
Summary updated