Hamiltonian GAN

Christine Allen-Blanchette · DOI

Abstract

Generating video sequences that adhere to physical laws remains a significant challenge in computer vision. While Hamiltonian Neural Networks (HNNs) have been integrated into Variational Autoencoders (VAEs) to address this, they often suffer from restrictive latent space priors. This paper introduces Hamiltonian GAN (HGAN), a framework that embeds Hamiltonian mechanics directly into a Generative Adversarial Network. By implicitly learning the phase-space structure and employing a novel cyclic-coordinate loss, HGAN generates physically consistent videos with interpretable latent representations, significantly outperforming existing baselines in complex dynamical systems.

Introduction

Generating realistic video requires more than just pixel-level accuracy; it requires an understanding of the underlying forces—such as gravity or conservation of energy—that govern motion. Most deep learning models treat video frames as a sequence of independent pixels, often leading to temporal incoherence or physically impossible motion.

Previous research attempted to solve this by incorporating Hamiltonian Neural Networks (HNNs) within a VAE framework. However, VAEs require a pre-defined structural prior for the latent space. If this prior does not match the true manifold of the physical system (e.g., a pendulum's motion), the model fails to reconstruct the dynamics accurately. The Hamiltonian GAN (HGAN) addresses this by learning the physical structure of the world directly from video data without needing a pre-defined prior.

The Hamiltonian GAN Framework

The HGAN architecture replaces standard recurrent units with physics-inspired modules across a three-stage pipeline:

  1. Configuration-Space Map ($f$): A multi-layer perceptron maps Gaussian noise to an intermediate configuration space, representing the initial state of the physical system.
  2. HNN Motion Model: This module takes the initial state and integrates Hamilton’s equations forward in time using leapfrog integration. This ensures the learned motion is continuous and conservative.
  3. Image Generator ($G$): A 2D deconvolutional network transforms these physical states into the final video frames.
The HGAN architecture integrates a configuration-space map, an HNN motion model, and an image generator to produce physically consistent video frames.

Cyclic-Coordinate Loss

To ensure the latent space is interpretable, the authors introduced a novel loss function based on "cyclic coordinates." In physics, if a coordinate does not affect the total energy, its corresponding momentum is conserved. By regularizing the change in momentum ($\dot{p}_i$), the model is encouraged to find a minimal representation of the system, effectively disentangling the latent space and ignoring unnecessary dimensions.

Experimental Results

The model was evaluated on the Hamiltonian Dynamics Suite, featuring systems like pendulums and multi-body simulations. The primary metric used was the Fréchet Video Distance (FVD), where lower scores indicate higher quality and consistency.

Quantitative Performance

HGAN significantly outperformed standard baselines. For a simple pendulum, HGAN achieved an FVD of 91.64, compared to MoCoGAN’s 398.12 and the VAE-based HGN’s 688.12. In the chaotic double pendulum task, HGAN reached an FVD of 73.21, while MoCoGAN trailed at 979.80.

Qualitative Analysis and Interpretability

Beyond numerical scores, HGAN demonstrated superior temporal coherence. Because the model integrates differential equations to determine frame sequences, the resulting motion is inherently smooth. Furthermore, t-SNE visualizations revealed that HGAN organizes motion onto low-dimensional manifolds that match true physical structures, whereas baseline models produce unstructured noise.

Qualitative comparison of video generation for a three-body system. HGAN maintains sharper object boundaries and more consistent trajectories compared to blurred or noisy baselines.

Conclusion and Future Work

HGAN demonstrates that generative models can learn the implicit structure of physical systems without explicit priors. While currently limited to conservative systems (those without friction or external forces), the framework provides a foundation for more complex modeling. Future work aims to incorporate Port Hamiltonian formulations to handle non-conservative forces like friction, which would expand HGAN's utility to real-world robotics and physics simulators.

Summary updated

BibTeX
@inproceedings{allenblanchette2024hamiltonian,
  author = {Christine Allen-Blanchette},
  title = {{Hamiltonian GAN}},
  booktitle = {L4DC},
  year = {2024},
}
Figure