NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

AVID: Adversarial Visual Irregularity Detection

Mohammad Sabokrou, Masoud PourReza, Mohsen Fayyaz, Rahim Entezari, Mahmood Fathy, Jürgen Gall, Ehsan Adeli · DOI

Abstract

Detecting anomalies in video surveillance—such as unauthorized vehicles or sudden crowd panics—remains a significant challenge due to the rarity of irregular events and the need for real-time processing. We present AVID (Adversarial Visual Irregularity Detection), a self-supervised framework that learns to identify anomalies by pitting an "Inpainter" network against a "Detector" network. By training exclusively on "normal" data, AVID learns to reconstruct standard scenes while effectively erasing irregularities. At inference, the collaboration between these networks allows for precise, pixel-level localization of anomalies. Our results on the UCSD and UMN benchmarks demonstrate state-of-the-art performance and significant improvements in computational efficiency.

1. Introduction

The detection of visual irregularities is a "needle in a haystack" problem. In real-world surveillance, "normal" behavior is ubiquitous, while "irregular" events are rare, diverse, and difficult to define. Conventional computer vision approaches often struggle with three primary challenges:

  1. Data Scarcity: The lack of labeled examples for every possible anomaly makes training standard classifiers impractical.
  2. The Granularity Trade-off: Pixel-level methods often suffer from high false-positive rates due to noise, while patch-based methods lack the precision required for fine-grained localization.
  3. Computational Speed: Many existing models process video frames patch-by-patch, which is too slow for real-time applications.

AVID addresses these issues by treating anomaly detection as a self-supervised adversarial game, allowing the model to learn the essence of "normal" behavior without ever seeing an anomaly during training.

2. Methodology

AVID utilizes a two-player adversarial architecture inspired by Generative Adversarial Networks (GANs), comprising an Inpainter ($\mathcal{I}$) and a Detector ($\mathcal{D}$).

2.1 The Inpainter ($\mathcal{I}$)

The Inpainter is a U-Net style encoder-decoder network. Its primary function is to "clean" input images. When presented with an irregularity, the Inpainter attempts to replace it with normal textures (e.g., replacing a bicycle on a sidewalk with the background pavement) to fool the Detector.

2.2 The Detector ($\mathcal{D}$)

The Detector is a Fully Convolutional Network (FCN) that assigns scores to different regions of an image based on their perceived "normality."

2.3 Adversarial Training and Inference

During training, $\mathcal{I}$ and $\mathcal{D}$ compete. $\mathcal{I}$ learns to reconstruct normal scenes and remove synthetic Gaussian noise, while $\mathcal{D}$ learns to distinguish between original normal data and the reconstructed versions from $\mathcal{I}$.

At test time, the networks collaborate. When a frame containing an anomaly is processed:

  1. $\mathcal{I}$ attempts to "erase" the anomaly.
  2. The system calculates the pixel-wise difference between the original frame ($X$) and the Inpainter’s output ($\mathcal{I}(X)$).
  3. Simultaneously, $\mathcal{D}$ flags suspicious regions.
  4. The final anomaly map is the intersection of these two outputs, providing a high-confidence, fine-grained localization of the irregularity.

3. Experimental Setup and Datasets

The framework was evaluated on three distinct benchmarks:

  • UCSD (Ped1 & Ped2): Video of pedestrian walkways where anomalies include non-pedestrian objects like bikers and skaters.
  • UMN: A crowd behavior dataset where the anomaly is defined as a sudden "escape" event (people running).
  • IR-MNIST: A synthetic "toy" dataset where the model is trained on all digits except '3'. This serves as a proof-of-concept for the Inpainter’s ability to replace "illegal" concepts with "legal" ones.

4. Results and Discussion

AVID achieved state-of-the-art or highly competitive results across all benchmarks:

  • Localization Accuracy: On UCSD Ped1, AVID achieved a Pixel-Level (PL) error rate of 14.4%, a significant improvement over previous methods which often exceeded 30%.
  • Detection Performance: On the UMN dataset, the model reached an Area Under the Curve (AUC) of 99.6% and an Equal Error Rate (EER) of 2.6%.
  • Efficiency: By utilizing a Fully Convolutional approach, AVID processes entire frames simultaneously, making it significantly faster than patch-based sliding-window models.

The "Inpainting as a Filter" approach proves highly effective. Because the Inpainter is only trained on normal data, it lacks the "vocabulary" to reconstruct anomalies, effectively highlighting them through their absence in the output. Furthermore, the intersection of pixel-level differences and patch-level detection scores successfully mitigates the false-positive problem common in pixel-level methods.

5. Limitations and Future Work

While AVID is highly effective, there are areas for improvement:

  • Temporal Dynamics: The current model uses frame averaging to capture motion. Future iterations could incorporate 3D Convolutional kernels or LSTMs to better handle complex temporal anomalies.
  • Reconstruction Quality: The aggressive noise removal required during training can sometimes degrade the quality of the reconstructed "normal" regions.
  • Optimization: Like most GAN-style architectures, AVID is sensitive to hyperparameters, particularly the noise intensity ($\gamma$), which requires careful tuning to reach a stable equilibrium.

6. Conclusion

AVID provides a robust, end-to-end solution for anomaly detection in video. By leveraging adversarial inpainting and self-supervision, it overcomes the limitations of data scarcity and computational overhead, offering a scalable path for real-time visual surveillance.

Summary updated

BibTeX
@inproceedings{sabokrou2018avid,
  author = {Mohammad Sabokrou and Masoud PourReza and Mohsen Fayyaz and Rahim Entezari and Mahmood Fathy and Jürgen Gall and Ehsan Adeli},
  title = {{AVID: Adversarial Visual Irregularity Detection}},
  booktitle = {ACCV},
  year = {2018},
  doi = {10.1007/978-3-030-20876-9\_31},
}
Figure