Learning normal dynamics in videos with meta prototype network

Hui Lv, Chen Chen, Zhen Cui, Chunyan Xu, Jian Yang

TL;DR

This paper introduces a novel Dynamic Prototype Unit (DPU) that learns to represent normal video dynamics as "prototypes" in real-time, overcoming the memory and adaptability issues of previous methods. By integrating meta-learning, they create a Meta-Prototype Unit (MPU) that can quickly adapt to new, unseen scenarios with minimal data, achieving state-of-the-art results in unsupervised and few-shot video anomaly detection.

What Problem Does This Paper Address?

Video anomaly detection (VAD) aims to identify unusual events in video footage, crucial for applications like surveillance. A common approach is to train models (like Auto-Encoders) on normal data and flag deviations as anomalies based on reconstruction errors. However, existing methods struggle with:

  • Memory Consumption: Techniques like memory banks to store diverse normal patterns become prohibitively large.
  • Adaptability to New Scenarios: Models trained on one set of normal behaviors may fail when encountering new environments or activities (e.g., a person running in a park is normal, but in a library, it's an anomaly). This "over-generalizing" problem is a significant hurdle for real-world deployment.
  • Few-Shot Learning: Adapting to new scenes with only a few examples (few-shot learning) is challenging.

This paper tackles these limitations by proposing a more efficient and adaptable way to learn and represent "normalcy" in videos.

Methods

The core innovation is the Dynamic Prototype Unit (DPU), which is integrated into an Auto-Encoder (AE) backbone. Here's how it works:

  1. Attention-Based Normalcy Encoding: The DPU uses an attention mechanism to assign "normalcy weights" to different parts of the AE's encoded feature maps. This highlights regions that are characteristic of normal behavior.
  2. Prototype Generation: These normalcy-weighted features are then used to derive a set of "prototypes." These prototypes are essentially compact representations of diverse normal dynamics observed in the video. The DPU generates these prototypes in real-time without needing a separate, large memory bank.
  3. Meta-Learning for Adaptability (Meta-Prototype Unit - MPU): To address the adaptability challenge, the DPU is further enhanced using meta-learning. This creates the Meta-Prototype Unit (MPU), which acts as a "learner of learners." During meta-training, the MPU learns how to quickly adapt to new scenes by learning an initialization that can be fine-tuned with just a few data samples and update iterations. This is crucial for few-shot anomaly detection.
  4. Objective Functions: The model is trained using a combined loss function that includes:
  5. Feature Reconstruction Loss: Encourages prototypes to be compact (representing normal patterns well) and diverse (capturing a range of normal behaviors).
  6. Frame Prediction Loss: Standard AE objective for predicting future frames.

Datasets

The paper evaluates its approach on several standard video anomaly detection datasets:

  • UCSD Ped1 & Ped2: Datasets featuring pedestrian behavior anomalies.
  • CUHK Avenue: Contains abnormal events like running and throwing objects.
  • ShanghaiTech: A larger dataset with 13 scenes, offering more diverse scenarios.
  • UCF-Crime: A dataset of real-world crime videos, used for meta-training and cross-dataset testing.

The authors specifically use the UCF-Crime dataset for meta-training and then test on other datasets to evaluate the cross-dataset and scene-adaptive capabilities.

Key Insights and Ideas

  • Prototypes as Dynamic Normalcy Signatures: Instead of static memory banks, using dynamically generated prototypes allows the model to capture and adapt to evolving normal patterns in real-time.
  • Attention for "What's Normal": The attention mechanism is a clever way to focus on salient features that define normalcy, rather than just relying on reconstruction errors which can be ambiguous.
  • Meta-Learning for Rapid Adaptation: The MPU's ability to learn how to learn normalcy is key. It allows the model to quickly adjust to new environments with minimal data, a significant step towards practical VAD.
  • Efficiency Gains: The DPU avoids large memory banks, and the MPU's meta-learning approach requires fewer parameters and update iterations for adaptation, leading to faster inference.

Key Results

  • State-of-the-Art Performance: The proposed DPU-based AE achieves superior performance (measured by AUC) on multiple unsupervised anomaly detection benchmarks compared to existing methods, including memory-based approaches like MemAE and LMN.
  • Few-Shot Adaptability: In the few-shot setting, the MPU-based AE demonstrates significant gains (4-5% AUC improvement) over models without meta-learning, outperforming or matching other SOTA few-shot learners like rGAN.
  • Speed Advantage: The model boasts a much faster inference speed (166.8 FPS) compared to methods like rGAN (25 FPS) and MemAE. The adaptation step for the MPU is also significantly faster.
  • Ablation Studies: Experiments confirm the effectiveness of the DPU module and show that using 10 prototypes is an optimal choice for balancing performance and diversity. The placement of the DPU within the AE also impacts performance, with higher resolution layers yielding better results.

Limitations and Future Work

  • Ablation on Prototype Quantity: While the paper finds M=10 to be optimal, the exact number of prototypes might still be scene-dependent and could be explored further.
  • Cross-Dataset Generalization: While impressive, the performance on unseen datasets still has room for improvement, especially in the 0-shot setting.
  • Real-time Adaptation: The paper focuses on few-shot adaptation, but further research into truly continuous, real-time adaptation without explicit "episodes" could be beneficial.
  • Complexity of Anomalies: The paper primarily focuses on unsupervised anomaly detection. Handling more complex anomaly types or scenarios where some labeled anomaly data is available could be a future direction.

Summary updated

BibTeX
@inproceedings{lv2021learning,
  author = {Hui Lv and Chen Chen and Zhen Cui and Chunyan Xu and Jian Yang},
  title = {{Learning normal dynamics in videos with meta prototype network}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.01517},
}
Figure