Introduction
One-Class Classification (OCC) is a fundamental challenge in unsupervised machine learning, where the goal is to identify anomalies in data when only "normal" samples are available during training. Generative Adversarial Networks (GANs) have become a popular tool for this task, typically by training a generator to reconstruct normal data and using the reconstruction error or a discriminator's output as an anomaly score. However, GAN-based anomaly detection is often plagued by two significant issues: training instability and a fundamental mismatch between the training objective and the inference task.
In a standard GAN setup, the discriminator learns to distinguish between "real" normal data and "fake" (reconstructed) normal data. At inference, however, the model is expected to distinguish between reconstructions of normal data and reconstructions of anomalous data. This "boundary mismatch" often leads to poor generalization. Furthermore, the adversarial competition between the generator and discriminator causes performance to fluctuate wildly across training epochs, making it difficult to select an optimal model or determine a reliable stopping point.
The Two-Phase Training Framework
To address these challenges, this research proposes a novel two-phase training strategy that redefines the discriminator’s role and introduces synthetic "pseudo-anomalies" to stabilize the learning process.
Phase 1: Adversarial Burn-in
The first phase follows a standard adversarial training protocol. The primary goal here is to allow the generator to learn the distribution of normal data. Crucially, the authors do not simply keep the final model. Instead, they save two distinct versions of the generator: a "less evolved" version ($G_o$) from an early stage of training and a "more evolved" version ($G_n$) from a later stage. The transition between these stages is governed by an automated stopping criterion based on the ratio of reconstruction losses: $\mathcal{L}_R(G_o) / \mathcal{L}_R(G_n) > \eta$.
Phase 2: Discriminator Refinement
In the second phase, the generators are frozen, and the discriminator is retrained with a new objective. Rather than distinguishing "real vs. fake," the discriminator is tasked with distinguishing "good vs. bad" reconstructions:
- Good Reconstructions (Label 0): These include original real images and high-quality reconstructions produced by the evolved generator ($G_n$).
- Bad Reconstructions (Label 1): These include distorted reconstructions from the less-evolved generator ($G_o$) and "Pseudo Anomalies" generated by a specialized module.
By training on this binary classification task, the discriminator learns a decision boundary that more closely aligns with the requirements of anomaly detection at test time.
Generating Pseudo Anomalies
A key innovation of this work is the creation of "Pseudo Anomalies" to simulate out-of-distribution data without requiring actual anomalous samples. The authors investigated three methods for fusing normal samples to create these synthetic outliers:
- Early Fusion: Pixel-level averaging of two different normal images.
- Late Fusion: Averaging the outputs of two separate reconstructions.
- Latent Fusion: Averaging the latent embeddings of two samples within the bottleneck of the autoencoder.
Experimental results identified Latent Fusion as the most effective method. By interpolating in the latent space, the model generates "natural-looking" distortions that are neither obviously fake nor perfectly normal. This forces the discriminator to learn subtle, high-level patterns of abnormality, significantly improving its ability to detect real-world anomalies.
Experimental Evaluation
The proposed method was evaluated across six diverse datasets, including image outlier detection (MNIST, Caltech-256), video anomaly detection (UCSD Ped2), medical imaging (Inbreast, Wisconsin Breast Cancer), and network security (KDDCUP99).
Performance and Stability
The most striking result is the gain in training stability. While standard GANs exhibit high variance in Area Under the Curve (AUC) scores across epochs—often fluctuating by as much as 15%—the proposed framework produces a remarkably stable performance curve. Once the second phase begins, the AUC remains high and consistent, removing the guesswork from model selection.
Key Results
- UCSD Ped2: The model reached 98.3% AUC, surpassing previous benchmarks like OGNet (98.1%) and standard GANs (92.9%).
- KDDCUP99: It achieved an F1 score of 0.9708, a substantial improvement over the 0.9203 baseline.
- Robustness: On the MNIST dataset, the model demonstrated high resilience to increasing outlier ratios, maintaining performance even when anomalies constituted 50% of the test set, where traditional methods like LOF and DEOCC degraded significantly.
Conclusion
This research demonstrates that the "failed" or early states of a generative model are not useless; rather, they can serve as a valuable proxy for anomalous behavior. By redefining the adversarial objective to focus on reconstruction quality and utilizing latent space interpolation for pseudo-anomaly generation, the authors provide a robust solution to the instability of GAN-based anomaly detection. While the approach introduces some computational overhead due to the multi-phase training and the maintenance of multiple generator versions, the gains in reliability and accuracy make it a significant step forward for unsupervised novelty detection.
Summary updated