Deep Variational Bayes Filters: Unsupervised Learning of State Space Models from Raw Data

Maximilian Karl, Maximilian Soelch, Justin Bayer, Patrick van der Smagt

TL;DR

Deep Variational Bayes Filters (DVBF) is a framework for learning the "hidden laws" of a system—like velocity and position—directly from raw, high-dimensional data such as video. By forcing the model to backpropagate through its own transition dynamics, it learns a latent space that respects the laws of physics, enabling far more accurate long-term predictions than previous methods.

The Challenge of Unsupervised System Identification

In fields like robotics and control theory, State Space Models (SSMs) are widely used to describe how a system changes over time. If you know the current state (e.g., position and velocity) and the transition rules (the physics), you can predict the future.

However, when dealing with raw, high-dimensional data like camera images, two major problems arise:

  1. System Identification: How do we figure out the underlying "physics" of the system just by looking at pixels?
  2. Inference: How do we map a blurry image of a swinging pendulum back to its exact physical state variables?
Graphical models for the forward transition and inference processes in DVBF.

Previous deep learning approaches, such as Variational Autoencoders (VAEs) adapted for time series, often focused too heavily on reconstructing the current frame. This led to "lazy" latent spaces that ignored hidden temporal information like velocity. Consequently, these models were great at compression but terrible at long-term prediction because they didn't truly understand the system's dynamics.

Methods: Deep Variational Bayes Filters

The authors introduce Deep Variational Bayes Filters (DVBF) to overcome these limitations. The key innovation is a clever reparametrization of the transition.

In standard models, the "encoder" (recognition model) looks at an image and tries to guess the latent state $z_t$ directly. In DVBF, the encoder instead predicts the stochastic transition parameters $\beta_t$ (which can be thought of as the "nudge" or process noise). The next state $z_{t+1}$ is then calculated as a deterministic function of the previous state $z_t$, the control input $u_t$, and this predicted noise $\beta_t$:

$$z_{t+1} = f(z_t, u_t, \beta_t)$$

General scheme for arbitrary transitions and the specific locally linear transition architecture.

By structuring the model this way, the error in predicting a future frame is forced to flow back through the transition function $f$. This forces the latent space to organize itself in a way that makes the transitions smooth and predictable.

To handle complex, non-linear behavior while remaining computationally efficient, the authors specifically implement a Locally Linear Transition model. Here, the system's physics are represented as a weighted mixture of several linear models, dynamically combined based on the current state and input.

Key Insights and Ideas

  • Transition-Driven Latent Spaces: The most important takeaway is that the transition model should drive the latent space, not the other way around. If you force the model to predict the next state from the current one, it must learn hidden variables like velocity to succeed.
  • Discovery of Physical Quantities: Without being explicitly told what "velocity" is, the model naturally discovers it. In a pendulum experiment, the latent space captured a perfect 2D manifold representing the angle in polar coordinates, alongside a separate dimension for angular velocity.
  • The "Checkerboard" Effect: In a bouncing ball experiment, the model successfully mapped the 2D box into its latent space so accurately that a checkerboard pattern applied to the physical box was perfectly reconstructed in the latent embedding.
  • Annealing is Essential: The authors found that "annealing" the KL-divergence—starting with a small penalty and gradually increasing it—was crucial to prevent the model from getting stuck in local optima where it ignores the dynamics.

Experimental Results

The model was evaluated on simulated physical systems where the "ground truth" is known but hidden from the model, including a dynamic pendulum and bouncing balls.

  • Velocity Recovery: On the pendulum task, DVBF achieved an $R^2$ of 0.916 for predicting angular velocity from the latent state. In contrast, the competing Deep Kalman Filter (DKF) managed only 0.035, proving DKF was essentially "blind" to the pendulum's speed.
  • Long-term Stability: DVBF could generate realistic sequences far beyond the length of its training data. In the bouncing ball task, it maintained stable, physically plausible trajectories even after the "filtering" (observation) phase ended.
  • Superior Compression: DVBF outperformed DKF in terms of the evidence lower bound (ELBO), achieving a higher lower bound (798.56 vs. 784.70) while maintaining a significantly more informative latent space.

Limitations and Future Work

While powerful, the paper focuses on relatively low-dimensional "toy" physics environments. The authors acknowledge that while the methodology scales, the choice of the transition architecture (like the locally linear mixture) is a hyperparameter that users must tune for their specific application.

Future work could involve applying DVBF to more complex, real-world robotic tasks or using the learned latent transitions directly for Model-Based Reinforcement Learning, where an agent "dreams" of future outcomes to plan its actions effectively.

Summary updated

BibTeX
@inproceedings{karl2017deep,
  author = {Maximilian Karl and Maximilian Soelch and Justin Bayer and Patrick van der Smagt},
  title = {{Deep Variational Bayes Filters: Unsupervised Learning of State Space Models from Raw Data}},
  booktitle = {International Conference on Learning Representations},
  year = {2017},
  url = {https://openreview.net/forum?id=HyTqHL5xg},
}
Figure