Autoencoding Binary Classifiers for Supervised Anomaly Detection

Yuki Yamanaka, Tomoharu Iwata, Hiroshi Takahashi, Masanori Yamada, Sekitoshi Kanai · OpenReview

Abstract

Anomaly detection typically relies on either supervised learning, which excels at identifying known threats but fails on novel ones, or unsupervised learning, which detects outliers but ignores available label information. We present the Autoencoding Binary Classifier (ABC), a framework that integrates these paradigms. By utilizing a stable probabilistic objective based on reconstruction error, ABC effectively identifies both known and unknown anomalies while remaining robust to extreme class imbalance.

Introduction

The field of anomaly detection is traditionally bifurcated into supervised and unsupervised methodologies. Supervised approaches treat detection as binary classification, often suffering from a "blind spot" regarding unknown anomalies and struggling with the inherent class imbalance of real-world datasets. Conversely, unsupervised methods, such as standard autoencoders, model the distribution of normal data but fail to leverage labeled anomalies to sharpen decision boundaries.

Previous attempts to unify these approaches, like Limiting Reconstruction Capability (LRC), often encountered mathematical instability. These models attempted to maximize reconstruction error for anomalies without bounds, leading to training divergence. ABC addresses these issues by framing the problem within a bounded probabilistic context.

Methodology: The ABC Framework

The core innovation of ABC is the transformation of an autoencoder's reconstruction error, $\mathcal{L}(x)$, into a probabilistic binary classifier.

Probabilistic Mapping

The authors define a regression function $\eta(x) = e^{-\mathcal{L}(x)}$. When the reconstruction error is zero, the probability of the sample being "normal" ($y=0$) is maximized. As the error increases, the probability shifts toward the "anomaly" class ($y=1$). This mapping is visualized below, showing how the model transitions between classes based on reconstruction performance.

Probabilistic mapping of reconstruction error to class labels.

Objective Function

Unlike prior methods that directly manipulate error values, ABC minimizes the negative log-likelihood of a Bernoulli distribution. This approach provides a bounded objective function, ensuring training stability. For normal data, the model behaves as a generative autoencoder; for labeled anomalies, it is explicitly penalized for low reconstruction error. Because it remains an autoencoder at its core, it naturally fails to reconstruct unknown anomalies, catching them as well.

Experimental Evaluation

The ABC framework was evaluated across several benchmarks:

  • 2D-Toy Dataset: Visualizing decision boundaries on synthetic data.
  • MNIST & CIFAR-10: Testing performance on image data with varying definitions of "known" and "unknown" anomalies.
  • KDD’99: Assessing performance on network intrusion detection benchmarks.

Key Results and Discussion

ABC consistently outperformed baseline supervised (DNN, SVM) and unsupervised (AE) models in terms of Area Under the Receiver Operating Characteristic (AUROC).

Decision Boundary Visualization

In the 2D-toy task, the differences between paradigms are stark. Supervised models often fail to detect unknown anomalies that fall on the "normal" side of the learned hyperplane. Unsupervised models create a general boundary but may be too loose. ABC creates a tight, closed boundary around normal data, effectively capturing both known and unknown outliers.

Comparison of decision boundaries for supervised, unsupervised, and the ABC approach.

Robustness to Data Scarcity

A significant finding is ABC's resilience to class imbalance. On the MNIST dataset, ABC maintained high detection accuracy even when the number of labeled anomalies was reduced by three orders of magnitude (from 10,000 to just 10), a scenario where traditional supervised methods typically fail.

Conclusion

The Autoencoding Binary Classifier provides a mathematically grounded bridge between supervised and unsupervised anomaly detection. By wrapping reconstruction error in a probabilistic framework, it achieves superior stability and performance, particularly in real-world scenarios characterized by rare labeled anomalies and the threat of novel, unseen outliers. Future work will explore its application in high-stakes domains like cybersecurity and its integration with more complex generative architectures.

Summary updated

BibTeX
@inproceedings{yamanaka2019autoencoding,
  author = {Yuki Yamanaka and Tomoharu Iwata and Hiroshi Takahashi and Masanori Yamada and Sekitoshi Kanai},
  title = {{Autoencoding Binary Classifiers for Supervised Anomaly Detection}},
  booktitle = {PRICAI},
  year = {2019},
  doi = {10.1007/978-3-030-29911-8\_50},
}
Figure