Normalizing Flows for Human Pose Anomaly Detection

Or Hirschorn, Shai AvidanICCV 2022

Abstract

Video anomaly detection is an ill-posed problem because it relies on many parameters such as appearance, pose, camera angle, background, and more. We distill the problem to anomaly detection of human pose, thus decreasing the risk of nuisance parameters such as appearance affecting the result. Focusing on pose alone also has the side benefit of reducing bias against distinct minority groups. Our model works directly on human pose graph sequences and is exceptionally lightweight (~1K parameters), capable of running on any machine able to run the pose estimation with negligible additional resources. We leverage the highly compact pose representation in a normalizing flows framework, which we extend to tackle the unique characteristics of spatio-temporal pose data and show its advantages in this use case. The algorithm is quite general and can handle training data of only normal examples as well as a supervised setting that consists of labeled normal and abnormal examples. We report state-of-the-art results on two anomaly detection benchmarks - the unsupervised ShanghaiTech dataset and the recent supervised UBnormal dataset.

Introduction

Video anomaly detection—identifying events like accidents or violence in surveillance footage—is notoriously difficult. Traditional methods often get tripped up by "nuisance parameters": changes in lighting, complex backgrounds, or the specific appearance of individuals. These factors can introduce bias and make models heavy and slow. Furthermore, the industry standard has long been the Autoencoder. These models try to reconstruct or predict video frames; if the reconstruction error is high, it’s labeled an anomaly. However, Autoencoders are often too good at their jobs—they generalize so well that they can sometimes reconstruct abnormal events just as accurately as normal ones, causing them to miss the very thing they were built to find.

Methodology

The proposed approach shifts from reconstruction to density estimation using Normalizing Flows (NF). A Normalizing Flow is a bijective mapping that transforms a complex data distribution (human poses) into a simple, well-understood one, such as a standard Gaussian distribution. During training, the model learns the characteristics of "normal" movement in this Gaussian space. During inference, if a new pose sequence maps to a very low-probability area of the distribution, it is flagged as an anomaly.

The overall pipeline of the proposed method, mapping pose sequences to a Gaussian distribution to evaluate probability.

To adapt this framework for human motion, we introduced Spatio-Temporal Graph Normalizing Flows (STG-NF). Instead of pixels, the human body is treated as a graph of joints. We integrated Spatio-Temporal Graph Convolutional Networks (ST-GCN) into the "Glow" architecture. This allows the model to understand both the spatial relationship between joints (e.g., elbow relative to shoulder) and the temporal flow (how joints move over time).

The internal architecture of the STG-NF block, featuring ActNorm, Permutation, and Affine Coupling with an integrated ST-GCN.

Experimental Results

The model was evaluated on two primary benchmarks:

  1. ShanghaiTech Campus: A large-scale, real-world dataset used in an unsupervised setting (training only on "normal" videos).
  2. UBnormal: A recent synthetic dataset including both normal and abnormal (e.g., falling, fighting) labeled examples, allowing for supervised training.

STG-NF achieved state-of-the-art performance with an AUC (Area Under the Curve) of 85.9% on ShanghaiTech and 79.2% on UBnormal, outperforming much larger, appearance-based models. Notably, the system is extremely efficient; the anomaly detection network itself has only about 1,000 parameters and runs at 189 FPS on a single GPU.

Discussion and Limitations

By stripping away pixels and focusing only on 2D skeletons, the model becomes immune to background clutter and lighting changes, while significantly reducing the risk of racial or gender bias. However, a pose-only approach has inherent "blind spots":

  • Non-Human Anomalies: The model cannot detect anomalies involving objects or vehicles (e.g., a car on a sidewalk) unless a human is involved.
  • Contextual Ambiguity: Some anomalies may look like normal movement from specific angles (e.g., skating vs. walking).
  • Resolution Dependency: The model relies on a pre-trained pose estimator; if video resolution is too low to detect a skeleton, the model cannot function.

Conclusion

STG-NF demonstrates that a highly compact, pose-based model can achieve superior results in video anomaly detection. By leveraging the mathematical grounding of Normalizing Flows for density estimation rather than reconstruction, the system provides a robust and efficient solution for real-time surveillance applications while preserving privacy and reducing bias.

Summary updated

BibTeX
@inproceedings{hirschorn2022normalizing,
  author = {Or Hirschorn and Shai Avidan},
  title = {{Normalizing Flows for Human Pose Anomaly Detection}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2022},
  url = {https://openreview.net/forum?id=ZkeOL1IgyR},
}
Figure