Probabilistic Robust Autoencoders for Anomaly Detection

Yariv Aizenbud, Ofir Lindenbaum, Yuval KlugerarXiv 2021

Abstract

Standard Autoencoders (AEs) are effective for learning low-dimensional representations but are highly sensitive to outliers, often distorting the learned manifold to accommodate noise. This paper introduces Probabilistic Robust Autoencoders (PRAE), which utilize differentiable stochastic gates to automatically filter outliers during training. By relaxing the combinatorial $\ell_0$ optimization problem into a continuous probabilistic framework, PRAE achieves robust anomaly detection and state-of-the-art performance across synthetic and real-world datasets.

Introduction

Unsupervised anomaly detection assumes that "normal" data resides on a low-dimensional manifold, while anomalies are scattered. Traditional AEs fail in contaminated settings because they minimize reconstruction error for all samples equally. Robust Autoencoders (RAE) attempted to solve this using $\ell_0$ norms to exclude outliers, but the resulting combinatorial optimization is computationally intractable for large-scale data. PRAE addresses this by introducing a probabilistic relaxation that allows for efficient gradient-based optimization.

Methods: Stochastic Gating

The core innovation of PRAE is the Stochastic Gate (STG). Instead of a binary selection, the reconstruction error of each sample $x_i$ is weighted by a continuous gate value $z[i] \in [0, 1]$. These gates are parameterized by a trainable vector $\mu$ and act as differentiable relaxations of binary indicators.

Schematic of the PRAE architecture showing the integration of stochastic gates.

During training, the model simultaneously updates neural network weights to capture the inlier manifold and gate parameters to identify outliers. The authors propose two variants: PRAE-$\ell_0$, which penalizes the probability of a gate being active, and PRAE-$\ell_1$, which penalizes the expected gate value. Mathematically, the authors demonstrate that this relaxation converges to the original combinatorial RAE solution as training progresses.

Key Insights and Results

A critical finding is the existence of a "phase transition" related to the regularization parameter $\lambda$. This parameter controls the sparsity of the gates.

Analysis of the phase transition effect controlled by the regularization parameter $\lambda$.

As shown in the figure above, there is a threshold for $\lambda$ below which the model perfectly identifies inliers (high F1-score). Exceeding this threshold causes the model to overfit to outliers, leading to a significant increase in reconstruction error on unseen normal data. This behavior provides a heuristic for model selection.

In empirical evaluations, PRAE demonstrated remarkable resilience. In Robust Subspace Recovery (RSR) tasks, it maintained near-perfect recovery even when 99% of the data were outliers. On 13 real-world benchmarks, including medical and image datasets (MNIST, Fashion-MNIST), PRAE consistently achieved the highest average AUC and median rank compared to baseline methods like Isolation Forest and One-Class SVM.

Conclusion

PRAE offers a robust, scalable solution for unsupervised anomaly detection by integrating probabilistic gating into the autoencoder framework. By cleaning the dataset during the learning process, it effectively captures the underlying data structure even under extreme contamination. Future work may involve applying these gating mechanisms to more complex architectures like Transformers.

Summary updated

BibTeX
@misc{aizenbud2021probabilistic,
  author = {Yariv Aizenbud and Ofir Lindenbaum and Yuval Kluger},
  title = {{Probabilistic Robust Autoencoders for Anomaly Detection}},
  year = {2021},
  eprint = {2110.00494},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2110.00494},
}
Figure