Predicting Human Activities Using Stochastic Grammar

Siyuan Qi, Siyuan Huang, Ping Wei, Song-Chun Zhu

Researchers from UCLA and Xi’an Jiaotong University have introduced a sophisticated framework for predicting human behavior by treating activities as a structured language governed by a "grammar." This approach moves beyond traditional frame-by-frame analysis to understand the hierarchical and compositional nature of human intent.

The Challenge of Non-Markovian Activity

Predicting future human actions is a fundamental challenge in computer vision and robotics. Most existing methods rely on the Markov property, assuming the next state depends only on the current one. However, human activity is inherently goal-oriented and non-Markovian. For example, seeing someone close a microwave does not reveal whether they will next "eat food" or "walk away" unless the system knows if they just finished cooking or just finished cleaning.

Furthermore, activities are deeply embedded in their environment. To predict future actions, a system must understand the context: what objects are present, what those objects allow a human to do (affordances), and how those actions compose into a larger task.

The ST-AOG Framework

The core of this research is the Spatial-Temporal And-Or Graph (ST-AOG), a stochastic grammar model that captures the complexity of human behavior through two interconnected components:

  1. Temporal And-Or Graph (T-AOG): This serves as a stochastic context-free grammar (SCFG). "And-nodes" represent the decomposition of a task into a sequence of sub-activities (e.g., Microwaving Food decomposes into Open, Put In, and Close). "Or-nodes" represent alternative choices, such as placing a cup versus a sandwich.
  2. Spatial And-Or Graph (S-AOG): This represents the state of a single frame or segment, linking human actions to specific objects and their functional affordances (e.g., a water cooler provides the affordance of "providing water").
The ST-AOG framework integrates temporal grammar (T-AOG) for task sequencing and spatial context (S-AOG) for object affordances.

Methods and Algorithms

The model learns the structure of activities from training data using a modified version of the ADIOS algorithm to identify significant patterns in sequences. During live video processing, the system employs an Earley parser—a tool borrowed from computational linguistics—to maintain multiple hypotheses about the current activity.

To predict the future, the model symbolically forecasts the next sub-activity via the grammar. It then uses Monte Carlo integration to sample potential future human poses and object positions based on current velocities and learned distributions.

Key Results and Insights

The model was evaluated on the CAD-120 (Cornell Activity Dataset), which contains 120 RGB-D videos of subjects performing long-term activities like making cereal or cleaning. The ST-AOG significantly outperformed traditional Markovian models and LSTMs:

  • Action Detection: Achieved 76.5% micro-accuracy, compared to 70.3% for the baseline.
  • Future Prediction: When predicting three seconds into the future, the model achieved 55.2% accuracy for actions and 73.5% for affordances, substantially higher than the previous state-of-the-art.
3D point cloud visualization showing predicted trajectories and bounding boxes for activities like 'Get water' and 'Use microwave'.

By treating behavior as a grammar, the model can "prune" impossible futures. If the grammar knows that "Opening" must eventually be followed by "Closing," it will not predict a random "Drinking" action in the middle of a microwave task. This functional, affordance-centric reasoning allows for robust qualitative planning, such as generating heatmaps of likely future hand trajectories to help robots proactively assist humans.

Conclusion

While the model currently relies on the accuracy of low-level detectors and focuses on structured indoor tasks, it represents a major step toward functional scene understanding. Future work aims to move toward object-part based affordances—such as identifying that only the handle of a microwave is "pullable"—to enable even more precise robotic interaction in unconstrained environments.

Summary updated

BibTeX
@inproceedings{qi2017predicting,
  author = {Siyuan Qi and Siyuan Huang and Ping Wei and Song-Chun Zhu},
  title = {{Predicting Human Activities Using Stochastic Grammar}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2017},
  doi = {10.1109/iccv.2017.132},
}
Figure