Learning Prompt-Enhanced Context Features for Weakly-Supervised Video Anomaly Detection

Yujiang Pu, Xiaoyu Wu, Lulu Yang, Shengjin Wang

TL;DR

This paper introduces a novel framework for detecting video anomalies using only video-level labels. It features a Temporal Context Aggregation (TCA) module for efficient local-global modeling and a Prompt-Enhanced Learning (PEL) module that injects semantic knowledge from external databases (like ConceptNet) to help the model distinguish between specific types of anomalies, leading to state-of-the-art performance with high efficiency.

What Problem Does This Paper Address?

Video Anomaly Detection (VAD) is the task of automatically identifying unusual events (like accidents or fights) in video streams. Doing this with "weak supervision"—where we only know if a video contains an anomaly, but not when it happens—is highly practical but difficult.

The authors identify two major gaps in current research:

  1. Efficiency vs. Context: Existing models often use complex, multi-branch architectures to capture both local (immediate) and global (long-term) temporal context. This leads to high computational costs and a risk of overfitting.
  2. Semantic Blindness: Most models treat anomaly detection as a simple binary classification (Normal vs. Abnormal). They ignore the rich, distinct visual characteristics of different anomalies (e.g., "shoplifting" looks very different from "arson"). This lack of fine-grained understanding leads to poor interpretability and higher false alarm rates.

Methods

The proposed framework consists of two primary innovations:

1. Temporal Context Aggregation (TCA)

Instead of using separate branches for local and global features, TCA reuses a single similarity matrix. By applying a masking window, it extracts local nuances, while the unmasked matrix provides global context. These are then fused using a learnable factor ($\alpha$) that lets the model dynamically decide the importance of each. To handle videos of varying lengths, they introduce Dynamic Position Encoding (DPE), which uses a Gaussian-like kernel to emphasize closer relationships and suppress distant noise.

2. Prompt-Enhanced Learning (PEL)

This is the "aha" moment of the paper. The authors leverage ConceptNet, an external knowledge base, to build a dictionary of concepts related to specific anomalies. For example, the class "fighting" is linked to concepts like "throw a punch" or "hit." * Prompt Construction: These concepts are converted into text embeddings using a pre-trained CLIP model. * Context Separation: The model uses its own anomaly scores to separate "foreground" (the anomaly) from "background" (normal snippets). * Cross-modal Alignment: The model is trained to align the visual features of the "foreground" with the corresponding semantic text prompts. This forces the model to learn why something is an anomaly, not just that it is one.

Datasets

The model was evaluated on three major benchmarks:

  • UCF-Crime: 1,900 surveillance videos covering 13 real-world anomalies.
  • XD-Violence: A large-scale multimodal dataset (4,754 videos) featuring diverse sources like movies and car cameras.
  • ShanghaiTech: 437 videos from 13 different campus scenes.

Key Insights and Ideas

  • Efficiency through Reuse: By reusing the similarity matrix for both local and global context, the authors achieved SOTA results with significantly fewer parameters than previous multi-branch models.
  • Semantics Matter: Moving beyond binary labels to semantic prompts helps the model navigate "intra-class variance" (where the same anomaly looks different) and "inter-class similarity" (where different anomalies look similar).
  • Dynamic over Fixed: Fixed positional encodings (common in Transformers) struggle with the extreme length variations in video. The learnable DPE provides a more flexible way to model temporal distances.

Key Results

The framework achieved impressive quantitative results across the board:

  • SOTA Performance: It reached 85.59% AP on XD-Violence (a ~4% absolute gain over previous methods) and 98.14% AUC on ShanghaiTech.
  • Low False Alarms: On UCF-Crime, it achieved a False Alarm Rate (FAR) of just 0.43%, significantly lower than many competitors.
  • Fine-Grained Accuracy: The PEL module led to a 10% improvement in detection accuracy for certain specific anomaly sub-classes.
  • Speed: The model is highly efficient, capable of processing anomaly scores at 350 FPS on a single Tesla A40 GPU, making it suitable for real-time applications.

Limitations and Future Work

The authors note that while the PEL module excels in complex scenarios, it lags slightly in detecting very abrupt anomalies, such as "Explosions," suggesting a need for further refinement in capturing sudden temporal changes.

Future directions include exploring more multimodal information (like integrating audio more deeply) and tackling open-set anomaly detection, where the model must identify unusual events it has never seen during training.

Summary updated

BibTeX
@article{pu2024learning,
  author = {Yujiang Pu and Xiaoyu Wu and Lulu Yang and Shengjin Wang},
  title = {{Learning Prompt-Enhanced Context Features for Weakly-Supervised Video Anomaly Detection}},
  journal = {IEEE TIP},
  year = {2024},
  doi = {10.1109/tip.2024.3451935},
}
Figure