LagNetViP: A Lagrangian Neural Network for Video Prediction

Christine Allen-Blanchette, Sushant Veer, Anirudha Majumdar, Naomi Ehrich LeonardarXiv 2020

Abstract

The dominant paradigms for video prediction rely on opaque transition models where neither the equations of motion nor the underlying physical quantities of the system are easily inferred. In this paper, we introduce a video prediction model where the equations of motion are explicitly constructed from learned representations of the underlying physical quantities. To achieve this, we simultaneously learn a low-dimensional state representation and system Lagrangian. The kinetic and potential energy terms of the Lagrangian are distinctly modelled and the low-dimensional equations of motion are explicitly constructed using the Euler-Lagrange equations. We demonstrate the efficacy of this approach for video prediction on image sequences rendered in modified OpenAI gym Pendulum-v0 and Acrobot environments.

Introduction

Predicting future frames in a video sequence is a fundamental challenge in computer vision. While modern deep learning models can capture complex visual patterns, they often function as "black boxes," lacking an understanding of the underlying physical laws—such as gravity or inertia—that drive motion. This lack of physical grounding leads to two primary issues: poor generalization when predicting beyond the training horizon (extrapolation) and a lack of interpretability, making it nearly impossible to extract meaningful physical quantities from the model.

The authors address these challenges by introducing LagNetViP, a framework that forces the network to learn a "world model" obeying the Euler-Lagrange equations, the foundational language of classical mechanics.

Methodology

LagNetViP consists of two primary components: a Perception Engine and a Physics Engine. The Perception Engine uses a convolutional autoencoder to map high-dimensional video frames into a low-dimensional latent space representing state variables $q$ (position) and $\dot{q}$ (velocity).

The Physics Engine, or LagNet, governs the transitions within this latent space. Instead of using generic recurrent layers, it models the system's Lagrangian ($L = T - V$). Specifically, separate sub-networks learn the inertia tensor ($D$), potential energy ($V$), and generalized forces ($\tau$) like friction.

The Physics Engine in LagNetViP explicitly constructs the equations of motion using learned representations of inertia, potential energy, and generalized forces.

The model calculates acceleration ($\ddot{q}$) using the Euler-Lagrange equations and integrates it over time to predict future states. To ensure the latent space remains physically meaningful, the authors employ a "triple-threat" loss function:

  • $L_{ae}$: Reconstruction loss for visual fidelity.
  • $L_{dyn}$: Physics reconstruction loss, ensuring the physics-predicted path generates correct images.
  • $L_{lat}$: Latent consistency loss between the encoder's output and the physics engine's prediction.

Experimental Results

The model was evaluated on two classic physics benchmarks: the Pendulum and the chaotic Acrobot system. The environments were modified for higher-accuracy integration and clearer visual rendering.

Qualitative comparison of video prediction results across different environments. LagNetViP maintains physical consistency compared to ablation variants.

Key findings include:

  • Superior Extrapolation: LagNetViP successfully predicted sequences significantly longer than those seen during training. In the Pendulum task, it accurately captured "swing back" motions that standard models failed to predict.
  • Ablation Insights: The $L_{dyn}$ term proved critical. Without it, the model's ability to maintain physical consistency collapsed, demonstrating that the physics engine is essential for long-term visual accuracy.
  • Interpretability: By modeling kinetic and potential energy separately, the system allows for the inspection of learned physical properties, such as discovering gravity or mass directly from pixels.

Conclusion

LagNetViP demonstrates that embedding classical mechanics into neural architectures significantly improves the interpretability and extrapolation capabilities of video prediction models. While currently tested on low-dimensional systems, future work will explore scaling this approach to complex 3D environments and incorporating more sophisticated numerical integrators to further enhance energy conservation and accuracy.

Summary updated

BibTeX
@misc{allenblanchette2020lagnetvip,
  author = {Christine Allen-Blanchette and Sushant Veer and Anirudha Majumdar and Naomi Ehrich Leonard},
  title = {{LagNetViP: A Lagrangian Neural Network for Video Prediction}},
  year = {2020},
  eprint = {2010.12932},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2010.12932},
}
Figure