Abstract
Adversarially Learned Anomaly Detection (ALAD) is a novel framework that utilizes bi-directional Generative Adversarial Networks (GANs) to identify outliers in high-dimensional data. By training an encoder alongside a generator, ALAD enables efficient mapping from the data space to the latent space, eliminating the need for computationally expensive iterative optimization during inference. This approach achieves state-of-the-art accuracy while operating significantly faster than previous GAN-based anomaly detection methods.
Introduction
Anomaly detection—the identification of data points that deviate significantly from a "normal" distribution—is a critical task in domains ranging from cybersecurity to medical diagnostics. While Generative Adversarial Networks (GANs) are powerful tools for modeling complex distributions, they typically function as one-way mappings from a latent variable ($z$) to a data sample ($x$). This lack of an inverse mapping poses a challenge for anomaly detection, as evaluating a new data point requires finding its corresponding latent representation.
Previous methods, such as AnoGAN, addressed this by using iterative optimization at test time to find the best-fitting latent code. However, this process is prohibitively slow for real-time applications or large-scale datasets. ALAD addresses this bottleneck by learning a bi-directional mapping during the training phase.
Methodology
The core of the ALAD framework is a bi-directional GAN architecture that incorporates an Encoder ($E$) trained simultaneously with the Generator ($G$). This allows for a direct mapping from the data space back to the latent space.
To ensure stable training and accurate reconstructions, ALAD employs several key innovations:
- Symmetric Cycle-Consistency: Three discriminators are used to enforce consistency. $D_{XX}$ ensures data-space consistency ($G(E(x)) \approx x$), $D_{ZZ}$ ensures latent-space consistency ($E(G(z)) \approx z$), and $D_{XZ}$ matches the joint distributions of $(x, E(x))$ and $(G(z), z)$.
- Spectral Normalization: This technique stabilizes GAN training by constraining the Lipschitz constant of the discriminators, preventing gradient issues.
- Feature-Based Anomaly Score: Instead of using raw reconstruction error, ALAD computes an anomaly score based on the $L_1$ distance between the internal feature representations of a sample and its reconstruction within the $D_{XX}$ discriminator. This provides a more robust signal for detection.
Experiments and Datasets
The authors evaluated ALAD across a variety of benchmarks:
- Tabular Data: KDD99 (network intrusion) and Arrhythmia (cardiac conditions).
- Image Data: SVHN (Street View House Numbers) and CIFAR-10 (object recognition).
In each experiment, the model was trained exclusively on "normal" data from specific classes. During testing, it was tasked with identifying samples from previously unseen classes as anomalies.
Results
ALAD demonstrates significant improvements in both efficiency and accuracy.
- Inference Speed: By replacing iterative optimization with a single forward pass through the encoder, ALAD is approximately 1,000 times faster than AnoGAN on the SVHN dataset (10.5 ms vs. 10,496 ms per batch).
- Detection Performance: On the KDD99 tabular dataset, ALAD achieved an F1 score of 0.95, outperforming deep learning baselines like DAGMM (0.93). In image tasks, it consistently matched or exceeded state-of-the-art performance, particularly on complex natural image distributions.
Conclusion
ALAD provides a scalable and effective solution for high-dimensional anomaly detection. By integrating an encoder into the GAN framework and utilizing multi-level discriminators, it achieves high accuracy without the inference-time overhead of previous methods. While the model can occasionally struggle with anomalies that are visually similar to normal data, its speed and robustness make it a compelling choice for real-world applications. Future work may extend this framework to temporal data modalities like speech and sensor streams.
Summary updated