Hamiltonian Operator Disentanglement of Content and Motion in Image Sequences

Mohammad Asif Khan, Amos J. Storkey

Summary

HALO (HAmiltonian Latent Operators) is a deep generative model designed to disentangle "content" (static attributes) from "motion" (dynamic attributes) in video sequences. By incorporating Hamiltonian dynamics into the latent space of a Variational Autoencoder (VAE), the model ensures physical consistency, prevents identity leakage, and enables stable long-term video generation.

Introduction

A central challenge in video representation learning is disentanglement: separating what is in a scene from how it moves. Traditional Deep Generative Models (DGMs), such as VAEs or GANs paired with Recurrent Neural Networks (RNNs), frequently suffer from "content leakage," where motion variables inadvertently capture static information. This prevents clean motion transfer between objects. Furthermore, these models often exhibit dynamic instability, where errors accumulate over time, causing generated sequences to drift off the manifold and become unrealistic.

Overview of the HALO framework, showing input sequences, latent phase space trajectories, and the underlying graphical model structure.

The authors propose that Hamiltonian mechanics provides a natural inductive bias for these problems. Most real-world motions are reversible and follow implicit conservation laws, which can be mathematically modeled using symplectic transformations.

Methodology: Hamiltonian Latent Operators (HALO)

The HALO framework explicitly splits the latent space into a content space ($z$) and a motion space ($S$). The motion space is treated as a physical "phase space" consisting of position ($q$) and momentum ($p$).

Linear Hamiltonian Operators

Instead of a "black-box" RNN, HALO employs a linear Hamiltonian matrix ($H$). The state of motion at any time $t$ is computed via a matrix exponential: $s(t) = e^{tH}s(0)$. Because $H$ is a Hamiltonian matrix, the resulting transformation is symplectic, meaning it is volume-preserving and reversible. This geometric constraint prevents latent coordinates from diverging or collapsing, ensuring long-term stability.

The generative (left) and inference (right) graphical models of HALO, illustrating the separation of content $z$ and motion states $(q, p)$.

Action Subspaces

For datasets with multiple distinct actions, the motion space is decomposed into unique subspaces. Each subspace is governed by its own Hamiltonian operator, allowing the model to switch between or combine different types of motion (e.g., walking vs. running).

Experimental Results

The model was evaluated on several datasets, including synthetic Rotating Balls, Sprites, MUG Facial Expressions, and Rotating MNIST.

  • Superior Disentanglement: On the MUG dataset, HALO achieved an Inception Score (IS) of 5.312, significantly outperforming baselines like DSVAE (3.607).
  • High-Fidelity Motion Swapping: The model demonstrated near-perfect accuracy (99.8%) in identity preservation when transferring expressions between different individuals.
  • Long-term Stability: Unlike standard linear models or RNNs, HALO maintained structural consistency in long-term sequences, as the symplectic dynamics kept the motion on the learned manifold.

Discussion and Limitations

By forcing latent dynamics to follow Hamiltonian equations, HALO acts as a strong regularizer. Static information is "forbidden" from entering the motion variables, leading to cleaner disentanglement. However, the model currently assumes regular frame sampling and may struggle with irregular frame rates or sudden, non-linear tempo changes not captured by the learned linear operators. Future work may extend this framework to non-image sequential data, such as molecular trajectories.

Summary updated

Abstract

We introduce \textit{HALO} -- a deep generative model utilising HAmiltonian Latent Operators to reliably disentangle content and motion information in image sequences. The \textit{content} represents summary statistics of a sequence, and \textit{motion} is a dynamic process that determines how information is expressed in any part of the sequence. By modelling the dynamics as a Hamiltonian motion, important desiderata are ensured: (1) the motion is reversible, (2) the symplectic, volume-preserving structure in phase space means paths are continuous and are not divergent in the latent space. Consequently, the nearness of sequence frames is realised by the nearness of their coordinates in the phase space, which proves valuable for disentanglement and long-term sequence generation. The sequence space is generally comprised of different types of dynamical motions. To ensure long-term separability and allow controlled generation, we associate every motion with a unique Hamiltonian that acts in its respective subspace. We demonstrate the utility of \textit{HALO} by swapping the motion of a pair of sequences, controlled generation, and image rotations.
BibTeX
@inproceedings{khan2022hamiltonian,
  author = {Mohammad Asif Khan and Amos J. Storkey},
  title = {{Hamiltonian Operator Disentanglement of Content and Motion in Image Sequences}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=83OXtpgeSr},
}
Figure