Learning Contact Dynamics using Physically Structured Neural Networks

Andreas Hochlehnert, Alexander Terenin, Steindór Saemundsson, Marc Peter Deisenroth

Abstract

Learning physically structured representations of dynamical systems that include contact between different objects is an important problem for learning-based approaches in robotics. Black-box neural networks can learn to approximately represent discontinuous dynamics, but they typically require large quantities of data and often suffer from pathological behaviour when forecasting for longer time horizons. In this work, we use connections between deep neural networks and differential equations to design a family of deep network architectures for representing contact dynamics between objects. We show that these networks can learn discontinuous contact events in a data-efficient manner from noisy observations in settings that are traditionally difficult for black-box approaches and recent physics inspired neural networks. Our results indicate that an idealised form of touch feedback—which is heavily relied upon by biological systems—is a key component of making this learning problem tractable. Together with the inductive biases introduced through the network architectures, our techniques enable accurate learning of contact dynamics from observations.

Introduction

In robotics, "contact" is everywhere—from walking and jumping to complex manipulation tasks. However, modeling these events is notoriously difficult for machine learning. Standard "black-box" neural networks, such as ResNets, struggle with the inherent discontinuities of collisions where velocities change instantaneously. These models often attempt to "round off" these corners, leading to physically unrealistic behavior and requiring vast amounts of data to learn basic principles like energy conservation. While Physics-Informed Neural Networks (PINNs) have succeeded in smooth systems, they generally fail when faced with the non-smooth "clash" of impacting objects.

Methods: The CD-Lagrange Architecture

The proposed CD-Lagrange network addresses these challenges by embedding a specific physics integrator directly into the neural network's structure. Instead of letting the network guess the next state of the system, the authors force the data through a mathematical structure based on Lagrangian mechanics.

The CD-Lagrange approach involves first identifying the contact time $t_c$ (a) and then calculating the true trajectory (b) by accounting for the discontinuous velocity change at the point of impact.

Key components of the architecture include:

  • The Integrator: A Central-Difference (CD) Lagrange scheme that splits state updates into a smooth force (like gravity) and a contact impulse (the bounce).
  • Learned Potential: The network learns a potential energy function $V_\theta$ (represented by an MLP) that describes environmental forces.
  • Idealized Touch Feedback: A "contact network" predicts a binary signal indicating if a collision is occurring. This mimics biological touch sensors and helps the model distinguish between measurement noise and actual physical impacts.

Experimental Results

The model was evaluated on three noisy physical systems: an ideal pendulum, a bouncing ball, and a Newton’s cradle. The CD-Lagrange network outperformed baselines across all tasks in both accuracy and physical realism.

Performance comparison on a smooth pendulum baseline. CD-Lagrange (blue) accurately preserves the system's energy and follows the ground truth orbit, whereas the ResNet baseline (orange) suffers from non-physical energy dissipation, resulting in a spiral trajectory.

In the bouncing ball task, the CD-Lagrange network achieved an RMSE of 0.067, while a standard ResNet lagged behind at 6.778—an improvement of two orders of magnitude. Qualitatively, phase-space diagrams revealed that while ResNets produced incorrect "spirals" suggesting energy loss, the CD-Lagrange model perfectly captured the sharp turns of a bounce. Furthermore, the model successfully learned the complex momentum exchange in a Newton’s cradle, maintaining high accuracy where standard models failed.

Conclusion

By baking the laws of conservation of momentum and Lagrangian mechanics into the network structure, CD-Lagrange networks achieve high data efficiency and physical realism. This work demonstrates that providing networks with structured physical inductive biases and idealized touch feedback makes the learning of complex contact dynamics tractable. Future work will focus on scaling these methods to complex 3D geometries and learning physical parameters directly from raw sensor data.

Summary updated

BibTeX
@inproceedings{hochlehnert2021learning,
  author = {Andreas Hochlehnert and Alexander Terenin and Steindór Saemundsson and Marc Peter Deisenroth},
  title = {{Learning Contact Dynamics using Physically Structured Neural Networks}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2021},
  url = {https://openreview.net/forum?id=22Qlmtb_8Hi},
}
Figure