Targeted Collapse Regularized Autoencoder for Anomaly Detection: Black Hole at the Center

Amin Ghafourian, Huanyi Shui, Devesh Upadhyay, Rajesh Gupta, Dimitar P. Filev, Iman SoltaniIEEE TNNLS 2023

In unsupervised learning, autoencoders (AEs) are a standard tool for anomaly detection. The underlying logic is intuitive: a model trained to compress and reconstruct "normal" data should fail when encountering "abnormal" samples. However, deep learning models often generalize too well, reconstructing anomalies with high fidelity and obscuring the distinction between normal and outlier data.

The paper "Targeted collapse regularized autoencoder for anomaly detection: black hole at the center" introduces Toll (Targeted collapse), a regularization technique that addresses this generalization gap by pulling normal data toward a "black hole" at the center of the latent space.

The Challenge: The Generalization Gap

The fundamental hurdle in AE-based anomaly detection is that networks often learn generic features (like edges or textures) that allow them to reconstruct unseen anomalous classes with low error. To counter this, existing methods often resort to complex additions like memory modules, GAN-based adversarial training, or attention mechanisms. These "bells and whistles" increase computational costs and training instability. Toll asks whether a simpler modification to the loss function can achieve superior results.

The Toll Method: Creating a Latent "Black Hole"

Toll adds a computationally light regularization term to the standard reconstruction loss. During training, the model minimizes: $$\mathcal{L} = \| \hat{x} - x \|_2 + \beta \| z \|_2$$ where $\| \hat{x} - x \|$ is the reconstruction error, and $\| z \|$ is the norm of the latent representation. The hyperparameter $\beta$ controls the strength of the "pull" toward the origin.

The Toll architecture: Normal data (green) is pulled toward the origin in the latent space, while anomalies (red) remain distant.

By forcing normal data to cluster at the origin (the "black hole"), the model creates a sharper distinction. Anomaly detection at inference time uses this same loss: an image is flagged if it reconstructs poorly or if its latent representation is far from the origin.

Decision Boundaries and Anomaly Scores

The effect of the $\beta$ parameter is visible in the resulting anomaly score landscapes. Without regularization ($\beta=0$), the model may only focus on a subset of features, leading to "flat" decision boundaries that fail to capture the full distribution of normal data. With Toll ($\beta > 0$), the decision boundary becomes centered and more compact.

Anomaly score landscapes for (a) standard AE ($\beta=0$) and (b) Toll regularized AE ($\beta=0.95$), showing how the 'black hole' creates a centered decision boundary.

Theoretical analysis suggests this norm minimization prevents the model from greedily discarding low-variance dimensions, forcing it to attend to subtle features that define "normalcy" which a standard AE might ignore.

Key Results

Toll was evaluated on visual benchmarks (MNIST, Fashion-MNIST, CIFAR-10/100) and tabular data (Arrhythmia). In a "one-vs-rest" protocol, it consistently outperformed more complex state-of-the-art models:

  • MNIST: Achieved an average AUC of 98.4%, surpassing MEMGAN (96.5%).
  • CIFAR-10: Reached an average AUC of 69.6%, leading over DSVDD (64.8%) and ALAD (59.3%).
  • Arrhythmia: Achieved an $F_1$ score of 60.00, significantly higher than MEMGAN's 55.72.

Ablation studies confirmed the importance of the regularization: removing it ($\beta=0$) dropped the MNIST AUC from 98.4% to 94.7%.

Conclusion

Toll demonstrates that simplicity can be a significant strength in anomaly detection. By adding a single term to the loss function, it achieves state-of-the-art performance without the need for extra architectural components or high inference overhead. While hyperparameter tuning for $\beta$ remains necessary, the "black hole" approach provides a robust and elegant solution to the generalization gap in autoencoders.

Paper Citation: Ghafourian, A., et al. (2024). Targeted collapse regularized autoencoder for anomaly detection: black hole at the center. arXiv:2306.12627v2 [cs.LG].

Summary updated

BibTeX
@article{ghafourian2023targeted,
  author = {Amin Ghafourian and Huanyi Shui and Devesh Upadhyay and Rajesh Gupta and Dimitar P. Filev and Iman Soltani},
  title = {{Targeted Collapse Regularized Autoencoder for Anomaly Detection: Black Hole at the Center}},
  journal = {IEEE TNNLS},
  year = {2023},
}
Figure