Deep Weakly-supervised Anomaly Detection

Guansong Pang, Chunhua Shen, Huidong Jin, Anton van den Hengel

TL;DR

This paper introduces PReNet, a novel deep learning approach for anomaly detection that excels at identifying both known (seen) and unknown (unseen) anomalies, even with very limited labeled anomaly data. By learning to predict the relationships between pairs of data instances (anomaly-anomaly, anomaly-unlabeled, unlabeled-unlabeled), PReNet effectively leverages large amounts of unlabeled data to build robust and generalizable anomaly detectors.

What Problem Does This Paper Address?

Anomaly detection (AD) is crucial for identifying unusual data points across various domains like cybersecurity, fraud detection, and medical diagnostics. Traditional unsupervised AD methods struggle because they don't know what anomalies look like, often leading to high error rates. Semi-supervised methods use a few labeled anomalies but tend to overfit to these specific examples, failing to detect novel, unseen anomalies. This paper tackles the challenge of weakly-supervised anomaly detection, aiming to build models that can detect both seen and unseen anomalies using a small set of labeled anomalies and a large pool of unlabeled data, which may also contain some anomalies (contamination).

Methods

The core innovation of PReNet lies in its pairwise relation prediction approach. Instead of directly learning to classify anomalies, PReNet trains a neural network to predict the relationship between pairs of data instances. These pairs are categorized into three types:

  • Anomaly-Anomaly (a,a): Both instances are from the labeled anomaly set.
  • Anomaly-Unlabeled (a,u): One instance is labeled anomaly, the other is from the unlabeled set.
  • Unlabeled-Unlabeled (u,u): Both instances are from the unlabeled set.

Since the unlabeled data is predominantly normal, these three pair types implicitly represent anomaly-anomaly, anomaly-normal, and normal-normal relationships. By learning to discriminate these relationships, PReNet learns diverse discriminative patterns, preventing overfitting to seen anomalies and enabling generalization to unseen ones. The model uses a two-stream network to learn representations for each instance in a pair, which are then fed into a scoring function to predict the pairwise relation. This pairwise prediction is framed as an ordinal regression task, where (a,a) pairs are assigned the highest score, followed by (a,u), and then (u,u) pairs. This approach effectively augments the training data, creating a much larger set of "surrogate" labeled data for training.

Datasets

The paper evaluates PReNet on a total of 40 datasets:

  • 12 Seen Anomaly Detection Datasets: These datasets are used to evaluate the detection of anomalies similar to those seen during training. They are sourced from diverse domains like cyber-attack detection, fraud detection, and disease risk assessment.
  • 28 Unseen Anomaly Detection Datasets: These datasets are derived from four intrusion attack datasets (dos, rec, fuz, bac). For evaluation, the anomaly class from one dataset is held out as "unseen," while anomalies from the other three are used as "seen" training data. This setup allows for rigorous testing of generalization to entirely new anomaly types.

Key Insights and Ideas

  • Pairwise Relations as a Generalization Tool: The key insight is that learning relationships between pairs of data points, rather than just individual points, provides a richer signal for anomaly detection. This allows the model to learn broader patterns of normality and abnormality, crucial for detecting unseen anomalies.
  • Leveraging Unlabeled Data Effectively: By treating unlabeled data as predominantly normal, PReNet can create a vast number of "anomaly-unlabeled" and "unlabeled-unlabeled" pairs. This significantly expands the training data, enabling more robust model training even with a small set of labeled anomalies.
  • Robustness to Contamination: The paper theoretically and empirically demonstrates that PReNet is robust to a reasonable level of anomaly contamination in the unlabeled data, a common real-world scenario.
  • Sample Efficiency: PReNet achieves competitive or superior performance with significantly fewer labeled anomaly examples compared to existing methods, highlighting its efficiency.

Key Results

  • Superior Performance on Seen Anomalies: PReNet significantly outperforms nine competing methods (including DevNet, DSAD, FSNet, cFSNet, REPEN, iForest, XGBOD, PUMAD, and FEAWAD) on 12 real-world datasets for detecting seen anomalies, achieving substantial improvements in AUC-PR and AUC-ROC metrics.
  • Exceptional Performance on Unseen Anomalies: PReNet demonstrates remarkable generalization capabilities, significantly outperforming all competing methods on 28 datasets for detecting unseen anomaly classes. It achieves improvements of 10%-30% on average and much larger gains on specific datasets.
  • High Sample Efficiency: PReNet requires 50%-87.5% fewer labeled anomalies to achieve comparable or better performance than the best competing methods.
  • Robustness: The model shows stable performance across different anomaly contamination rates (up to 10%) and is robust to variations in pairwise relation labels and regularization parameters.

Limitations and Future Work

  • Computational Cost: While PReNet is efficient in terms of labeled data, the pairwise approach can increase computational complexity during training due to the generation of numerous pairs.
  • Hyperparameter Sensitivity: Although generally robust, performance can be affected by hyperparameters like the regularization parameter ($\lambda$) and the margin between pairwise relation labels, especially on complex datasets.
  • Future Work: The authors suggest extending the approach to leverage supervision information from different domains for anomaly detection. They also mention that for datasets with millions of features (like news20), more advanced relation learning designs might be needed for optimal robustness.

Summary updated

BibTeX
@inproceedings{pang2023deep,
  author = {Guansong Pang and Chunhua Shen and Huidong Jin and Anton van den Hengel},
  title = {{Deep Weakly-supervised Anomaly Detection}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2023},
  doi = {10.1145/3580305.3599302},
}
Figure