Toward Supervised Anomaly Detection

Nico Görnitz, Marius Kloft, Konrad Rieck, Ulf Brefeld · DOI

Abstract

Anomaly detection is being regarded as an unsupervised learning task as anomalies stem from adversarial or unlikely events with unknown distributions. However, the predictive performance of purely unsupervised anomaly detection often fails to match the required detection rates in many tasks and there exists a need for labeled data to guide the model generation. Our first contribution shows that classical semi-supervised approaches, originating from a supervised classifier, are inappropriate and hardly detect new and unknown anomalies. We argue that semi-supervised anomaly detection needs to ground on the unsupervised learning paradigm and devise a novel algorithm that meets this requirement. Although being intrinsically non-convex, we further show that the optimization problem has a convex equivalent under relatively mild assumptions. Additionally, we propose an active learning strategy to automatically filter candidates for labeling. In an empirical study on network intrusion detection data, we observe that the proposed learning methodology requires much less labeled data than the state-of-the-art, while achieving higher detection accuracies.

Introduction

Anomaly detection is traditionally treated as an unsupervised "find the needle in the haystack" problem. While unsupervised methods are adept at identifying statistically "unlikely" events, they frequently suffer from high false-positive rates because they lack the context to distinguish between benign outliers and malicious anomalies. Conversely, standard supervised classification is highly accurate but fragile; it fails to generalize when encountering novel attack types not present in the training set.

In dynamic environments like network security, where attackers constantly evolve, there is a critical need for systems that can leverage existing labels without losing the ability to flag entirely new threats. This paper introduces Semi-Supervised Anomaly Detection (SSAD), a framework designed to bridge this gap by grounding semi-supervised learning in the unsupervised paradigm of modeling "normality."

Problem Definition: One-Class vs. Two-Class Learning

The authors argue that the fundamental flaw in applying standard semi-supervised classification to anomaly detection is the assumption of a two-class problem. In many real-world scenarios, anomalies do not form a single, well-defined class but are instead a collection of disparate, unknown distributions.

Distinguishing semi-supervised classification from semi-supervised anomaly detection.

As shown in Figure 1, while semi-supervised classification attempts to find a boundary between two known classes using unlabeled data, semi-supervised anomaly detection focuses on defining the boundary of "normal" data (one-class problem). This allows the model to remain robust against "novel" anomalies for which no labels exist.

Methodology

The SSAD framework builds upon Support Vector Data Description (SVDD), which seeks the smallest hypersphere in a high-dimensional feature space that encloses the majority of normal data.

The SSAD Innovation

The authors extend SVDD to incorporate labels:

  • Normal labels: The algorithm is penalized if these points fall outside the hypersphere.
  • Anomaly labels: These points are forced outside the hypersphere.

While this formulation is initially non-convex, the authors prove that for common translation-invariant kernels (such as the RBF kernel), a convex equivalent exists. This ensures that the global optimum can be reliably found using standard solvers.

Active Learning Strategy

To minimize the cost of manual labeling, the paper proposes a dual-criteria active learning strategy:

  1. Margin Strategy: Queries points near the hypersphere boundary where the model is most uncertain.
  2. Cluster Strategy: Queries points in unexplored regions of the feature space to rapidly identify novel anomaly clusters.

Empirical Evaluation

The approach was tested on synthetic "toy" data and real-world HTTP network intrusion data (145,069 connections). The researchers used a "Malicious Pool" of 27 real attack classes and a "Cloaked Pool" where attacks were obfuscated to mimic benign traffic.

Key Results

The empirical results highlight the efficiency and robustness of the SSAD approach.

Performance comparison across different labeling scenarios.

As illustrated in Figure 3, SSAD demonstrates significant advantages:

  • Superior Accuracy: On "cloaked" network attacks, SSAD achieved nearly 30% higher AUC than unsupervised or standard supervised baselines (see right plot in Figure 3).
  • Label Efficiency: The model reached peak performance with very few labels. Using the active learning strategy, near-perfect separation was achieved by labeling only 3% of the data, compared to 25% required by random sampling.
  • Robustness to Novelty: Unlike standard classifiers that collapse when test distributions contain new types of outliers, SSAD maintains its detection power by focusing on the boundary of normality.

Discussion and Future Work

The "aha moment" of this research is that semi-supervised anomaly detection should not start from a classifier; it must start from a model of normality. This shift ensures that the system remains capable of unsupervised discovery while benefiting from expert guidance.

However, there are limitations. The current convex reformulation is tied to specific kernel types, and scaling to massive datasets requires further optimization. Future directions include exploring $\ell_1$-norm regularization for automated feature selection and multi-task learning to handle environments with multiple "normal" states.

Summary updated

BibTeX
@article{gornitz2013toward,
  author = {Nico Görnitz and Marius Kloft and Konrad Rieck and Ulf Brefeld},
  title = {{Toward Supervised Anomaly Detection}},
  journal = {J. Artif. Intell. Res.},
  year = {2013},
  doi = {10.1613/jair.3623},
}
Figure