# G2D: Generate to Detect Anomaly

arXiv: https://arxiv.org/abs/2006.11629 · HTML: https://mlsanity.com/paper/2006.11629/

## Key facts

- Cited by 42 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 20 Jun 2020.

## Built on by (most cited first, 30 of 42)

- [Anomaly Detection via Reverse Distillation from One-Class Embedding](https://mlsanity.com/paper/2201.10703/) (2022)
- [A Unified Model for Multi-class Anomaly Detection](https://mlsanity.com/paper/2206.03687/) (2022)
- [A Unified Survey on Anomaly, Novelty, Open-Set, and Out-of-Distribution Detection: Solutions and Future Challenges](https://mlsanity.com/paper/2110.14051/) (2021)
- [Anomaly Detection under Distribution Shift](https://mlsanity.com/paper/2303.13845/) (2023)
- [Learning Not to Reconstruct Anomalies](https://mlsanity.com/paper/2110.09742/) (2021)
- [Out-of-distribution Detection Learning with Unreliable Out-of-distribution Sources](https://mlsanity.com/paper/2311.03236/) (2023)
- [Deep Learning for Video Anomaly Detection: A Review](https://mlsanity.com/paper/2409.05383/) (2024)
- [Cross-Domain Video Anomaly Detection without Target Domain Adaptation](https://mlsanity.com/paper/2212.07010/) (2022)
- [Contextual Affinity Distillation for Image Anomaly Detection](https://mlsanity.com/paper/2307.03101/) (2023)
- [Applications of Generative Adversarial Networks in Anomaly Detection: A Systematic Literature Review](https://mlsanity.com/paper/2110.12076/) (2021)
- [Teacher-Student Network for 3D Point Cloud Anomaly Detection with Few Normal Samples](https://mlsanity.com/paper/2210.17258/) (2022)
- [Image/Video Deep Anomaly Detection: A Survey](https://mlsanity.com/paper/2103.01739/) (2021)
- [Generative Oversampling for Imbalanced Data via Majority-Guided VAE](https://mlsanity.com/paper/2302.10910/) (2023)
- [Robust One-Class Classification with Signed Distance Function using 1-Lipschitz Neural Networks](https://mlsanity.com/paper/2303.01978/) (2023)
- [Video Anomaly Detection via Spatio-Temporal Pseudo-Anomaly Generation : A Unified Approach](https://mlsanity.com/paper/2311.16514/) (2023)
- [PseudoBound: Limiting the anomaly reconstruction capability of one-class classifiers using pseudo anomalies](https://mlsanity.com/paper/2303.10704/) (2023)
- [LogicAL: Towards logical anomaly synthesis for unsupervised anomaly localization](https://mlsanity.com/paper/2405.06875/) (2024)
- [A Comprehensive Survey on Machine Learning Driven Material Defect Detection](https://mlsanity.com/paper/2406.07880/) (2024)
- [ALGAN: Anomaly Detection by Generating Pseudo Anomalous Data via Latent Variables](https://mlsanity.com/paper/2202.10281/) (2022)
- [Fake It Till You Make It: Towards Accurate Near-Distribution Novelty Detection](https://mlsanity.com/paper/2205.14297/) (2022)
- [Exploiting Autoencoder's Weakness to Generate Pseudo Anomalies](https://mlsanity.com/paper/2405.05886/) (2024)
- [Outlier Synthesis via Hamiltonian Monte Carlo for Out-of-Distribution Detection](https://mlsanity.com/paper/2501.16718/) (2025)
- [The Evolution of Video Anomaly Detection: A Unified Framework from DNN to MLLM](https://mlsanity.com/paper/2507.21649/) (2025)
- [Dissolving Is Amplifying: Towards Fine-Grained Anomaly Detection](https://mlsanity.com/paper/2302.14696/) (2023)
- [OMASGAN: Out-of-Distribution Minimum Anomaly Score GAN for Sample Generation on the Boundary](https://mlsanity.com/paper/2110.15273/) (2021)
- [FROB: Few-shot ROBust Model for Classification and Out-of-Distribution Detection](https://mlsanity.com/paper/2111.15487/) (2021)
- [Unknown Face Presentation Attack Detection via Localised Learning of Multiple Kernels](https://mlsanity.com/paper/2204.10675/) (2022)
- [Whole-slide-imaging Cancer Metastases Detection and Localization with Limited Tumorous Data](https://mlsanity.com/paper/2303.10342/) (2023)
- [MixedTeacher : Knowledge Distillation for fast inference textural anomaly detection](https://mlsanity.com/paper/2306.09859/) (2023)
- [Distillation-based fabric anomaly detection](https://mlsanity.com/paper/2401.02287/) (2024)

## Abstract (arXiv)

In this paper, we propose a novel method for irregularity detection. Previous researches solve this problem as a One-Class Classification (OCC) task where they train a reference model on all of the available samples. Then, they consider a test sample as an anomaly if it has a diversion from the reference model. Generative Adversarial Networks (GANs) have achieved the most promising results for OCC while implementing and training such networks, especially for the OCC task, is a cumbersome and computationally expensive procedure. To cope with the mentioned challenges, we present a simple but effective method to solve the irregularity detection as a binary classification task in order to make the implementation easier along with improving the detection performance. We learn two deep neural networks (generator and discriminator) in a GAN-style setting on merely the normal samples. During training, the generator gradually becomes an expert to generate samples which are similar to the normal ones. In the training phase, when the generator fails to produce normal data (in the early stages of learning and also prior to the complete convergence), it can be considered as an irregularity generator. In this way, we simultaneously generate the irregular samples. Afterward, we train a binary classifier on the generated anomalous samples along with the normal instances in order to be capable of detecting irregularities. The proposed framework applies to different related applications of outlier and anomaly detection in images and videos, respectively. The results confirm that our proposed method is superior to the baseline and state-of-the-art solutions.
