[Paper Review] Fence GAN: Towards Better Anomaly Detection
Fence GAN (FGAN) proposes a modified GAN loss that trains the generator to produce samples at the boundary of the normal data distribution, rather than overlapping it. This enables the discriminator’s output score to directly serve as an anomaly score, achieving state-of-the-art performance on MNIST, CIFAR10, and KDD99 datasets without architectural changes or reconstruction losses.
Anomaly detection is a classical problem where the aim is to detect anomalous data that do not belong to the normal data distribution. Current state-of-the-art methods for anomaly detection on complex high-dimensional data are based on the generative adversarial network (GAN). However, the traditional GAN loss is not directly aligned with the anomaly detection objective: it encourages the distribution of the generated samples to overlap with the real data and so the resulting discriminator has been found to be ineffective as an anomaly detector. In this paper, we propose simple modifications to the GAN loss such that the generated samples lie at the boundary of the real data distribution. With our modified GAN loss, our anomaly detection method, called Fence GAN (FGAN), directly uses the discriminator score as an anomaly threshold. Our experimental results using the MNIST, CIFAR10 and KDD99 datasets show that Fence GAN yields the best anomaly classification accuracy compared to state-of-the-art methods.
Motivation & Objective
- To address the misalignment between standard GAN training objectives and anomaly detection goals, where overlapping generated samples degrade discriminator effectiveness.
- To improve anomaly detection performance on high-dimensional data by modifying the GAN loss to encourage generation at the boundary of the normal data distribution.
- To enable a simple, plug-and-play anomaly detection method using only the discriminator score, avoiding complex reconstruction or auxiliary losses.
- To validate the method on diverse benchmarks: MNIST, CIFAR10, and the KDD99 network intrusion dataset.
Proposed method
- Introduce a modified GAN loss where the generator is trained to produce samples at the boundary of the real data distribution, not within it.
- Modify the generator’s objective to maximize the distance between generated samples and the real data distribution, using a boundary-encircling loss with hyperparameters α and β.
- Use the discriminator’s real/fake probability score as the anomaly score at inference time, eliminating the need for reconstruction or feature matching.
- Train the GAN in a standard adversarial manner with the modified objective, maintaining the basic GAN architecture and training pipeline.
- Apply a dispersion loss to encourage diversity in generated boundary samples, preventing mode collapse.
- Use a hinge-like loss for the discriminator to improve stability and boundary separation.
Experimental results
Research questions
- RQ1Can modifying the GAN loss to generate samples at the boundary of the normal data distribution improve anomaly detection performance?
- RQ2Does using the discriminator score directly as an anomaly score yield better results than reconstruction-based or feature-matching-based scores?
- RQ3Can a simple modification to the GAN objective outperform complex GAN-based anomaly detection methods like GANomaly or Efficient GAN?
- RQ4How does Fence GAN perform on diverse datasets including image data (MNIST, CIFAR10) and tabular network intrusion data (KDD99)?
Key findings
- On the KDD99 dataset, Fence GAN achieved an F1 score of 0.95 ± 0.02, outperforming Efficient-GAN (0.91 ± 0.07) and other SOTA methods.
- On CIFAR10, Fence GAN achieved the highest average anomaly detection accuracy among all compared methods, with discriminator scores clearly separating anomalous from normal classes.
- On MNIST, Fence GAN demonstrated superior performance in distinguishing anomalous digits from normal ones, with consistent and high discriminator scores for anomalies.
- The discriminator score alone was sufficient for high-accuracy anomaly detection, eliminating the need for additional reconstruction or feature matching losses.
- The method achieved state-of-the-art results without architectural modifications, relying only on loss function changes to the standard GAN framework.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.