Paper commentary
Deep Learning for Anomaly Detection: A Review
Review sorts deep learning anomaly detection methods into three frameworks and 11 categories
- Problem Anomalies are rare and varied, so labeled examples are hard to collect. Classical detectors also struggle once data has many dimensions or interacting features.
- Method The review sorts deep anomaly detection methods into three high-level categories and 11 fine-grained categories. It explains each category's key intuitions, objective functions, and assumptions.
- Results The review names open challenges that current deep anomaly detection methods only partly address. It also lists future directions such as learning from few labels.
Why classical detectors get stuck
Anomalies are rare, varied and often unknown until they actually occur. Because they are rare, labeled anomalies are hard to collect, and missing an anomaly usually costs more than raising a false alarm. Even current unsupervised methods still often produce many false positives on real datasets, which keeps recall low.
Difficulty grows when the data has many dimensions or when its instances depend on one another. An anomaly that stands out in a small subspace can vanish in the full feature space, and subspace or feature-selection fixes only go so far. Capturing high-order and nonlinear feature interactions is still hard for classical methods.
Anomaly types also differ: point, conditional and group anomalies each need different handling. This gap motivates learning representations with neural networks instead of relying on handcrafted features.
One idea behind the taxonomy
The core idea is to train a network on a surrogate task that forces it to learn the regularities of normal data, then score each instance by how poorly it fits those regularities. Anomalies should fit the learned regularities worse, so they receive higher scores. The review groups these surrogate tasks into data reconstruction, generative modeling, predictability modeling and self-supervised classification.
The mapping \(\phi(x;\Theta)\) projects each instance into a representation space, and the surrogate task \(\psi\) with parameters \(W\) operates on that space. Both parts are learned by minimizing a loss summed over the training set. \[ \{\Theta^*, W^*\} = \arg\min_{\Theta, W} \sum_{x\in X} \ell\big(\psi(\phi(x;\Theta); W)\big) \] At test time the score is \( s_x = f(x, \phi_{\Theta^*}, \psi_{W^*}) \), where \(f\) is a scoring function built on both learned parts.
The taxonomy spreads these ideas over 11 modeling perspectives. The authors note that predictability modeling and self-supervised classification rest on the same self-supervised learning but make different assumptions.
Reconstruction error as the score
An autoencoder pairs an encoder that compresses the input with a decoder that tries to rebuild it from that compressed code. A bottleneck forces the model to keep only what helps rebuild typical inputs. Because normal instances dominate the data, anomalies are rebuilt poorly, so their reconstruction error becomes the anomaly score.
The score is the squared norm of the difference between the input and its reconstruction, computed with the encoder and decoder fixed after training. \[ s_x = \lVert x - \phi_d(\phi_e(x;\Theta_e^*);\Theta_d^*) \rVert_2^2 \] Here \(\phi_e\) and \(\phi_d\) are the encoder and decoder networks with parameters \(\Theta_e\) and \(\Theta_d\).
Variants change the training so the code stays more useful: sparse AEs limit active hidden units, denoising AEs learn from corrupted inputs, and variational AEs put a prior on the latent space. The Replicator network was an early tabular detector built on a feed-forward perceptron with three hidden layers. RandNet then trains an ensemble of such autoencoders, each with randomly selected dropout connections.
For sequences, images and graphs, the authors separate two designs: adapting the autoencoder architecture, or encoding first and predicting the codes with a recurrent network. The weakness is that the representation is built to summarize data, not to separate anomalies. Noise in the training data can be memorized, which leads to overfitting and small reconstruction errors for anomalies.
Adversarial models and the search for normality
GAN-based detectors assume normal data can be generated from the latent space more easily than anomalies can. AnoGAN searches the latent space for a code whose generated instance matches the test instance as closely as possible. Its score mixes a residual loss and a feature matching loss, weighted by \(\alpha\), measured at the last search step \(\gamma^*\).
\[ s_x = (1-\alpha)\,\ell_R(x, z_{\gamma^*}) + \alpha\,\ell_{fm}(x, z_{\gamma^*}) \]
The iterative search is slow, which motivated adding a network that maps data directly to latent codes. ALOCC takes a different path and trains a discriminator to tell normal data from the outputs of a denoising autoencoder that distorts its inputs. Outliers from other datasets are often unavailable, so later methods generate their own fringe instances.
OCAN uses the idea of bad GANs to produce data complementary to the normal training data. Fence GAN instead pushes generated instances onto the boundary of the training distribution, using an encirclement loss and a dispersion loss. These methods can't guarantee that generated fringe samples resemble unknown anomalies. GAN instability also makes detection scores fluctuate across training steps.
Distance, one-class and clustering measures
A second route learns representations tailored to an existing measure, such as a one-class model or a clustering result. Deep SVDD maps data into a sphere and pulls the representations toward a center \(c\). In the semi-supervised setting it minimizes the mean distance of the training representations to \(c\), and \(c\) is fixed to an initial forward-pass mean to avoid trivial solutions.
\[ \min_{\Theta}\ \frac{1}{N}\sum_{i=1}^{N}\lVert \phi(x_i;\Theta)-c\rVert^2 + \frac{\lambda}{2}\lVert\Theta\rVert^2 \]
Deep clustering learns representations for one clustering algorithm, with cluster assignments acting as pseudo labels. Its premise is that normal instances adhere to clusters more strongly than anomalies. One-class models may still work poorly when the normal class has a complex distribution.
What the review's evidence can show
The review's evidence is a structured reading of a large number of studies across several communities. Its dataset table lists sizes and anomaly ratios for video and log data, such as 317,398 frames in ShanghaiTech Campus and 1,900 videos in UCF-Crime. Because the table lists sizes rather than detection scores, it can't rank methods against each other.
The authors also point to publicly available source code and datasets for empirical comparison.
Open problems
Detectors must learn from few labeled anomalies and still generalize to unseen anomaly types. Large-scale pre-training on unlabeled data is promising, but the training data must be free of anomaly contamination, or the methods must tolerate it. Few studies address conditional and group anomalies, and multimodal detection is largely unexplored.
Model-agnostic explanations don't reveal how a given deep model decides, so inherently interpretable detectors remain needed.
Paper info
- Authors
- Guansong Pang, Chunhua Shen, Longbing Cao, Anton van den Hengel
- Venue
- arXiv · Preprint
- First published
- 2020-7-6
- Added
- 2026-11-12
- Updated
- 2020-12-5
- Version
- v3
- arXiv
- 2007.02500
- DOI
- 10.1145/3439950
- Category
- cs.LG · cs.CV · stat.ML
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Guansong Pang, Chunhua Shen, Longbing Cao, Anton van den Hengel (2020). Deep Learning for Anomaly Detection: A Review. arXiv:2007.02500v3. https://doi.org/10.1145/3439950
BibTeX
@article{pang2020deep,
title = {{Deep Learning for Anomaly Detection: A Review}},
author = {Guansong Pang and Chunhua Shen and Longbing Cao and Anton van den Hengel},
year = {2020},
eprint = {2007.02500},
archivePrefix = {arXiv},
doi = {10.1145/3439950},
url = {https://arxiv.org/abs/2007.02500v3}
}