Delving into CLIP latent space for Video Anomaly Recognition

Luca Zanella, Benedetta Liberatori, Willi Menapace, Fabio Poiesi, Yiming Wang, Elisa Ricci · DOI

Overview

AnomalyCLIP is a pioneering framework that leverages Large Language and Vision (LLV) models, specifically CLIP, to address the dual challenges of Video Anomaly Detection (VAD) and Video Anomaly Recognition (VAR). While traditional VAD focuses on binary classification (normal vs. abnormal), AnomalyCLIP identifies the specific nature of the anomaly (e.g., fighting, arson, or robbery). By re-centering the CLIP latent space around a "normality prototype," the model effectively separates abnormal events from background noise, achieving state-of-the-art results across major benchmarks.

The Challenge of Video Anomaly Recognition

Video Anomaly Recognition is critical for real-world applications like smart surveillance, yet it faces significant hurdles. Anomalies are rare and sporadic, leading to extreme data imbalance. Furthermore, most datasets provide only "weak supervision," where labels are available at the video level rather than the frame level.

While foundation models like CLIP excel at general image understanding, they often struggle with VAD/VAR out of the box. In a standard CLIP latent space, the visual difference between a "normal" frame and an "abnormal" one in the same environment is frequently too subtle to distinguish. AnomalyCLIP addresses this by fundamentally restructuring how these features are interpreted.

The AnomalyCLIP Framework

AnomalyCLIP architecture: (a) illustrates the latent space re-centering where the origin represents normality; (b) shows the overall framework including the Selector and Temporal models.

The authors introduce three primary innovations to bridge the gap between general vision models and specific anomaly tasks:

1. Latent Space Re-centering

The core innovation of AnomalyCLIP is the re-centering of the feature space. The authors observed that in standard CLIP space, normal and abnormal features cluster too closely. By calculating a "normality prototype"—the average feature vector of normal frames—and subtracting it from every frame, the origin of the space is shifted to represent "normal." In this re-centered space, the magnitude of a vector represents the degree of anomaly, while its direction corresponds to the specific anomaly type.

2. Learnable Prompt Directions

Instead of relying on static text prompts (e.g., "a video of a fight"), the model utilizes learnable context (CoOp). This allows the system to find optimal directions in the latent space that correspond to specific anomaly classes like "abuse," "explosion," or "vandalism," improving the alignment between visual features and textual labels.

3. Dual-Model Architecture

The framework employs a two-stage processing pipeline:

  • Selector Model: This component uses the re-centered space and Multiple Instance Learning (MIL) to identify which video segments are most likely to be anomalous.
  • Temporal Model: An Axial Transformer captures both short-term dependencies between adjacent frames and long-term dependencies across the entire video. This architecture is more efficient than standard transformers and less prone to overfitting on weakly-supervised data.

Experimental Results

Comparative performance of AnomalyCLIP against baselines on ShanghaiTech, UCF-Crime, and XD-Violence benchmarks.

AnomalyCLIP was evaluated on three diverse benchmarks, setting new state-of-the-art (SOTA) records for both detection and recognition:

  • ShanghaiTech: Achieved 98.07% AUC for detection and 96.46% mAUC for recognition, representing a massive improvement over zero-shot CLIP (+45.44%).
  • UCF-Crime: Reached 90.66% mAUC for recognition, outperforming the previous best method (SSRL) by nearly 2%.
  • XD-Violence: Achieved 49.41% mAP for recognition, significantly higher than the 43.04% achieved by previous baselines.

Qualitatively, the model demonstrates a robust ability to maintain high anomaly scores throughout the duration of an event, such as tracking the smoke following a car accident, rather than just flickering during the moment of impact.

Conclusion and Future Work

AnomalyCLIP proves that re-centering foundation model latent spaces can unlock significant performance in specialized tasks like VAR. While highly effective, the authors note that the model still faces challenges with subtle anomalies (e.g., shoplifting) and currently operates in a closed-set environment. Future research will likely explore open-set recognition to identify novel anomaly types and incorporate multi-modal data, such as audio, to further enhance accuracy.

Summary updated

BibTeX
@article{zanella2024delving,
  author = {Luca Zanella and Benedetta Liberatori and Willi Menapace and Fabio Poiesi and Yiming Wang and Elisa Ricci},
  title = {{Delving into CLIP latent space for Video Anomaly Recognition}},
  journal = {Comput. Vis. Image Underst.},
  year = {2024},
  url = {https://openreview.net/forum?id=FMUdXn1b2q},
}
Figure