Hierarchical Motion Understanding via Motion Programs

Sumith Kulal, Jiayuan Mao, Alex Aiken, Jiajun Wu

Abstract

Researchers have developed a "neuro-symbolic" approach to video analysis that represents human movement as structured computer programs. By decomposing motion into a hierarchy of geometric primitives (like lines and circles) and programmatic structures (like for-loops), this method significantly improves long-range video prediction and high-factor frame interpolation compared to traditional deep learning models.

Introduction

Most current computer vision systems perceive human motion as a series of independent frame-by-frame transitions of pixels or skeletal keypoints. While effective for short-term actions, these models often struggle with the "big picture." They fail to capture the high-level logic of movement—such as the distinct phases of a golfer’s swing or the repetitive nature of jumping jacks.

Without this structural understanding, standard models suffer from "drift" during long-term predictions and produce blurry or anatomically impossible results when trying to fill in large gaps between video frames (interpolation). This paper introduces a representation that treats motion not just as data, but as an executable program, bridging the gap between low-level perception and high-level reasoning.

Methods: A Hierarchical Framework

The core of this research is a hierarchical motion understanding framework that operates across three distinct levels of abstraction:

  1. Level 1: Keypoints. The system begins by extracting standard 2D coordinates of body joints from raw video using off-the-shelf tools like AlphaPose.
  2. Level 2: Concrete Motion Programs. The keypoint data is segmented into "primitives" using a Domain Specific Language (DSL). These primitives include stationary, linear, and circular movements. For instance, a wrist moving in an arc is represented as a circular_motion with specific spatial parameters (center, radius) and temporal parameters (velocity, duration).
  3. Level 3: Abstract Motion Programs. This level aggregates sequences of concrete primitives into higher-level structures, specifically for-loops. If the system detects a repeating pattern of "squat down" and "stand up," it synthesizes a loop that captures the statistical distribution of those movements.
The hierarchical pipeline from raw video to abstract motion programs and subsequent manipulation.

To convert raw video into these programs, the authors utilize dynamic programming to identify optimal segmentation points and Gaussian fitting to detect repetitive patterns suitable for loop conversion.

Key Insights: Motion as Code

The fundamental innovation of this approach is treating repetition as a programmatic loop rather than a sequence of similar frames. This "Motion as Code" philosophy offers several advantages:

  • Infinite Extrapolation: Once the "code" for a specific motion (like a jumping jack) is synthesized, it can be executed indefinitely without the model "forgetting" the correct form, unlike standard recursive models that accumulate error over time.
  • Programs as Regularizers: Raw keypoint data is often noisy due to camera shake or lighting issues. Because the motion programs must fit strict geometric primitives (like a perfect circle), they naturally smooth out this noise, leading to more stable and realistic video synthesis.
  • Drastic Compression: A motion program requires significantly fewer parameters (average of 253 per video) compared to raw pose sequences (1,623 parameters), representing a massive gain in representational efficiency.
Examples of motion programs synthesized for complex (golf) and repetitive (squat) movements.

Experimental Results

The researchers evaluated their framework on diverse datasets, including GolfDB (complex swings), PoseWarp (general interpolation), and long-form exercise videos (repetitive cardio and Taichi).

  • Superior Interpolation: When filling in large gaps (8x interpolation), the motion program approach significantly outperformed standard CNN-based models like SepConv. Human evaluators preferred the program-based results in over 90% of cases for the cardio dataset.
  • Long-Range Prediction: In video prediction tasks, standard deep learning models (like LSTMs) began to diverge and fail after a few frames. Motion programs maintained high accuracy over hundreds of frames by simply executing the synthesized loop.
  • Fidelity: Despite the high level of abstraction, the programs remained faithful to the original data, with an average keypoint error of only 6.25 pixels (approximately 2.44% error).

Limitations and Future Work

While promising, the system has limitations. It struggles with very fine-grained movements where the signal-to-noise ratio is low, and occlusions can break the program synthesis by disrupting keypoint detection. Furthermore, the current DSL is limited to 2D geometric primitives (lines and circles). Future work aims to extend the language to 3D keypoints and more complex primitives, such as splines, to capture more nuanced human movements.

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