ComPhy: Compositional Physical Reasoning of Objects and Events from Videos

Zhenfang Chen, Kexin Yi, Yunzhu Li, Mingyu Ding, Antonio Torralba, Joshua B. Tenenbaum, Chuang Gan

TL;DR

The ComPhy paper introduces a new benchmark and a neuro-symbolic model (CPL) designed to infer hidden physical properties—like mass and electric charge—from object interactions in videos. By moving beyond simple visual recognition to true physical reasoning, the authors demonstrate that while current state-of-the-art models struggle with these "invisible" attributes, a modular approach combining perception with symbolic physics can bridge the gap.

What Problem Does This Paper Address?

Most existing video reasoning benchmarks (like CLEVRER or PHYRE) focus on what is immediately visible: an object's color, its shape, or the moment two things collide. However, the real world is governed by intrinsic properties that aren't visible in a static frame. You cannot tell if a sphere is heavy or light, or if a cube is electrically charged, simply by looking at it. You only discover these properties when you see how the objects interact—how they attract, repel, or how much their trajectory changes after a collision.

Examples of hidden physical properties revealed through interactions: (a) electric charge dictates attraction or repulsion, and (b) mass dictates collision outcomes.

The authors identify a significant gap: AI models are currently great at "visual" reasoning but poor at "physical" reasoning. They often rely on shortcuts (e.g., memorizing that all red objects are heavy) rather than understanding the underlying causal laws. ComPhy aims to force models to perform compositional physical reasoning: identifying hidden properties from a few "reference" videos and using that knowledge to predict future or counterfactual events in a new "target" video.

Methods

The authors propose the Compositional Physics Learner (CPL), an oracle neuro-symbolic framework that factorizes reasoning into four distinct stages:

  1. Perception: A Mask R-CNN detects objects and extracts visual attributes (color, shape, material) as well as motion trajectories.
  2. Physical Property Inference (PPL): This is the core innovation. Using a Graph Neural Network (GNN), the model looks at "reference videos" where objects interact. It treats objects as nodes (to infer mass) and their relationships as edges (to infer relative charge: same, opposite, or neutral).
  3. Dynamic Prediction: Armed with the inferred properties, another GNN-based simulator predicts future positions. Because it is modular, the model can perform "counterfactual imagination" by simply swapping a property (e.g., "What if this cube were heavier?") and re-running the simulation.
  4. Symbolic Execution: A program parser converts natural language questions into functional programs (e.g., filter_heavy -> count). These programs are executed against the predicted trajectories to produce a final answer.

Datasets

The paper introduces the ComPhy dataset, which consists of:

  • 8,000 training, 2,000 validation, and 2,000 test sets.
  • Each set contains 4 reference videos (showing interactions to reveal properties) and 1 target video (the subject of the questions).
  • Properties: Two mass values (heavy/light) and three charge types (positive, negative, uncharged).
  • Question Types:
    • Factual: "How many moving objects are uncharged?"
    • Predictive: "Which event will happen next?"
    • Counterfactual: "What would happen if the purple object were heavier?"

This "meta-learning" setup ensures models cannot rely on visual biases, as properties are randomized across different sets.

Key Insights and Ideas

  • Hidden Properties are Relational: Charge isn't an isolated attribute; it's defined by how it affects other objects. The use of edge features in a GNN to represent charge relations is a clever way to capture this physical reality.
  • The Power of Modularity: By separating property inference from dynamics, CPL can handle counterfactuals much better than "end-to-end" black-box models. To answer a "what if" question, it doesn't need to see a similar video; it just changes a variable in its internal physics engine.
  • Decorrelating Appearance and Physics: The few-shot setting is crucial. By forcing the model to learn properties from reference videos for every new scene, the authors prevent the model from learning "cheats" like "metal spheres are always magnetic."

Key Results

  • Human Baseline: Humans achieve high accuracy (~90% on factual, ~76% on predictive), though they find counterfactual questions challenging (~53% per-question accuracy).
  • SOTA Failure: Existing high-performing models like ALOE and MAC struggle significantly. For example, ALOE only managed 22.2% accuracy on counterfactual questions, showing it fails to capture the underlying physical laws.
  • CPL Superiority: The proposed CPL model significantly outperformed baselines, particularly in predictive and counterfactual tasks, though it still trails behind human performance.
  • Property Accuracy: CPL’s Physical Property Learner (PPL) was highly effective, identifying mass and charge with over 90% accuracy from just a few seconds of video.

Limitations and Future Work

Despite its success, CPL has clear limitations:

  • Long-term Dynamics: The dynamic predictor's accuracy decays over time, making long-range predictions difficult.
  • Complexity Scaling: When tested on more complex scenes (6-8 objects), performance dropped sharply for both CPL and baselines, suggesting the models struggle with high-density interactions.
  • Simplified Physics: The current environment is a controlled 2D-plane simulation. Real-world physics involves friction, air resistance, and continuous property values, which are not yet addressed.

The authors suggest that future work should focus on more robust dynamic predictors and better generalization to cluttered, complex environments.

Summary updated

BibTeX
@inproceedings{chen2022comphy,
  author = {Zhenfang Chen and Kexin Yi and Yunzhu Li and Mingyu Ding and Antonio Torralba and Joshua B. Tenenbaum and Chuang Gan},
  title = {{ComPhy: Compositional Physical Reasoning of Objects and Events from Videos}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=PgNEYaIc81Q},
}
Figure