Hierarchical Motion Understanding via Motion Programs

Sumith Kulal, Jiayuan Mao, Alex Aiken, Jiajun Wu

Abstract

Traditional computer vision models represent human motion as low-level sequences of coordinates, lacking the semantic structure necessary for long-range reasoning. We present Motion Programs, a neuro-symbolic representation that treats human movement as a structured hierarchy of code-like primitives. By distilling raw video into programs containing loops and geometric subroutines (stationary, linear, circular), our framework enables superior performance in long-range video prediction, sparse interpolation, and semantic exercise analysis. Our results demonstrate that symbolic priors significantly mitigate error accumulation and provide a 6x compression over raw pose sequences.

Introduction

Most contemporary computer vision systems interpret motion at a granular level, either as shifting pixels or as a temporal sequence of 2D/3D joint coordinates. While effective for short-term tracking, these representations lack high-level semantic structure. They fail to recognize that a "jumping jack" is a repetitive loop or that a "golf swing" consists of distinct phases like backswing, pause, and follow-through. Without these structural priors, standard neural networks struggle with long-range prediction—where errors compound over time—and sparse interpolation, which often results in jittery or anatomically impossible movements.

Methodology

We propose a three-level hierarchical framework to bridge the gap between raw pixels and symbolic reasoning. This approach moves from noisy detections to structured, executable code.

Overview of the Motion Program pipeline, from keypoint detection to program synthesis and final video execution.
  1. Level 1: Keypoints. Standard 2D joint locations are extracted from raw video using off-the-shelf pose estimation tools like AlphaPose.
  2. Level 2: Concrete Motion Programs. The motion trajectory of each joint is segmented into "atomic" primitives. We define a Domain Specific Language (DSL) consisting of three primitives: stationary, linear, and circular (parameterized by center, radius, and velocity).
  3. Level 3: Abstract Motion Programs. This level identifies higher-level patterns, specifically repetitive loops. We utilize a probabilistic "for-loop" structure where the loop body is a distribution of primitives, accounting for the natural variation in human movement.
Examples of motion programs for golf swings and squats, illustrating how complex movements are decomposed into geometric primitives and loops.

The synthesis process involves using Dynamic Programming to find optimal segmentation points that minimize the error between raw trajectories and fitted geometric primitives. A sliding window approach identifies repeating sequences to "roll up" into for-loops. Finally, the program can be "executed" to generate dense keypoints, which are rendered into video using a generative model.

Experimental Results

The framework was evaluated on diverse datasets including GolfDB, PoseWarp, and long-form YouTube exercise videos.

  • Video Interpolation: In 8x interpolation tasks (where 7 out of 8 frames are missing), Motion Programs significantly outperformed standard neural baselines like SepConv, maintaining body structural integrity where others failed.
  • Accuracy and Compression: Program-encoded poses maintained high fidelity, with only a 2.44% error relative to ground truth. Furthermore, the representation achieved a 6x compression ratio, reducing the average parameters per video from 1,623 to 253.
  • Long-range Prediction: In predicting 600-900 frames into the future, human evaluators preferred Motion Program outputs over 94% of the time compared to state-of-the-art neural predictors like HierchVid. Unlike recurrent models that drift over time, the symbolic "for-loop" allows for indefinite, stable extrapolation.

Discussion and Limitations

Motion Programs act as a powerful denoising prior. By forcing joints to follow smooth geometric paths, the system naturally smooths the jitter inherent in raw pose detection. This neuro-symbolic synergy uses symbolic programs to provide a structured "skeleton" while neural networks handle the complex "flesh" of pixel rendering.

However, limitations remain. The current DSL is restricted to three primitives, which may struggle with very subtle motions or complex 3D movements (like a person turning around) when projected into 2D space. Future work will focus on expanding the DSL to include more expressive primitives like splines and moving the entire framework into 3D space.

Conclusion

By representing human motion as structured programs, we move beyond pixel-level tracking toward true semantic understanding. This approach provides a robust foundation for complex tasks like automated exercise coaching and long-term behavioral prediction.

Summary updated

BibTeX
@inproceedings{kulal2021hierarchical,
  author = {Sumith Kulal and Jiayuan Mao and Alex Aiken and Jiajun Wu},
  title = {{Hierarchical Motion Understanding via Motion Programs}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.00650},
}
Figure