RoSAS: Deep semi-supervised anomaly detection with contamination-resilient continuous supervision

Hongzuo Xu, Yijie Wang, Guansong Pang, Songlei Jian, Ning Liu, Yongjun Wang

TL;DR

RoSAS (Robust deep Semi-supervised Anomaly Scoring) is a new framework that significantly boosts anomaly detection by moving beyond simple binary "normal vs. abnormal" labels. By generating synthetic data with continuous "abnormality scores" and using a contamination-resilient training process, it outperforms current state-of-the-art methods by 20-30% in precision-recall.

What Problem Does This Paper Address?

Anomaly detection is the "needle in a haystack" problem of computer science—finding rare, suspicious events in massive datasets. While unsupervised methods are common, semi-supervised methods (which use a few known examples of anomalies) are much more powerful. However, they face two major hurdles:

  1. Anomaly Contamination: Most models assume all unlabeled data is "normal." In reality, the unlabeled "haystack" often contains hidden "needles" (unlabeled anomalies). Treating these as normal data confuses the model and blurs the boundaries of what is actually okay.
  2. Discrete Supervision: Most models use binary labels (0 for normal, 1 for anomaly). But "abnormality" is a spectrum, not a toggle. Forcing a model to learn binary targets for a continuous phenomenon leads to suboptimal scoring and poor detection of "borderline" cases.

Methods

The authors propose RoSAS, which introduces three clever mechanisms to solve the issues above:

  • Mass Interpolation: Inspired by the "Mixup" technique in computer vision, RoSAS creates new, synthetic training samples by mixing labeled anomalies with unlabeled data. Crucially, it assigns these new samples continuous labels. For example, a mix of 70% normal data and 30% anomaly data gets a label of 0.3. This provides the "continuous supervision" the model needs to learn the nuances of abnormality.
  • Consistency Learning: The model is trained to ensure that the score it gives a synthetic sample matches the weighted average of the scores of the original samples used to create it. This forces the network to produce a smooth, predictable scoring function.
  • Feature Learning Regularizer ($L'$): In the background, a second objective function works in the latent (hidden) representation space. It uses a triplet-style loss to "repulse" known anomalies away from normal data clusters, ensuring that even if the scoring module is uncertain, the underlying data features remain well-separated.
  • Dynamic Weight Averaging: To avoid the headache of manually tuning hyperparameters, the model uses a dynamic system to balance the scoring loss and the feature regularizer based on how fast each one is converging during training.

Datasets

The researchers evaluated RoSAS on 11 real-world datasets spanning three critical domains:

  • Cybersecurity: Intrusion detection datasets like CIC-IDS2017 (WebAttack, PortScan) and UNSW-NB15.
  • Medicine: Thyroid disease diagnosis.
  • Finance: Credit card fraud detection and KDD Cup funding prediction.
  • General Benchmarks: Covertype, Letter recognition, and Pen-digits from the ODDS repository.

They specifically tested the model's limits by "contaminating" the unlabeled training sets with varying ratios of hidden anomalies (up to 8%).

Key Insights and Ideas

  • Diluting the Poison: The "Mass Interpolation" isn't just for creating continuous labels; it's a defense mechanism. When a hidden anomaly in the unlabeled set is mixed with genuine normal data, its misleading signal is "diluted," making the model much more robust to noisy training data.
  • The Spectrum Matters: The "aha moment" here is that treating anomaly detection as a regression problem (predicting a degree of abnormality) rather than a classification problem (predicting a category) yields much more reliable results for human analysts who need to prioritize the most suspicious cases.
  • Latent Space Stability: By enforcing separation in the feature space ($L'$), the model creates a "safety net." Even if the final scoring layer is slightly off, the underlying data organization remains robust against contamination.

Key Results

  • Massive Performance Gains: RoSAS outperformed 10 major competitors (including popular models like DevNet and Deep SAD). On average, it improved the AUC-PR (Area Under the Precision-Recall Curve) by 20% to 30%.
  • Superior Robustness: While other models' performance tanked as the "contamination" in the unlabeled data increased, RoSAS remained remarkably stable.
  • Data Efficiency: The model achieved near-perfect results on some datasets using as few as 30 labeled anomalies, proving it can work in real-world scenarios where labels are expensive or rare.
  • Speed: Despite the extra complexity, RoSAS is highly scalable. It can process over a million data samples in about 20 seconds on a standard workstation.

Limitations and Future Work

  • Manifold Intrusion: The authors acknowledge a risk called "manifold intrusion"—where interpolating between two anomalies might accidentally create a point that looks "normal" but is labeled "abnormal." They mitigate this using a specific probability distribution ($\alpha=0.5$), but it remains a theoretical challenge.
  • Data Types: The current study focuses primarily on tabular data. The authors suggest that future work should involve plugging in more advanced architectures like Transformers or Graph Neural Networks (GNNs) to handle sequential data, images, and complex network graphs.

Summary updated

BibTeX
@article{xu2023rosas,
  author = {Hongzuo Xu and Yijie Wang and Guansong Pang and Songlei Jian and Ning Liu and Yongjun Wang},
  title = {{RoSAS: Deep semi-supervised anomaly detection with contamination-resilient continuous supervision}},
  journal = {Information Processing \& Management},
  year = {2023},
  url = {https://openreview.net/forum?id=6Fa7hZJ_iB},
}
Figure