SOM-VAE: Interpretable Discrete Representation Learning on Time Series

Vincent Fortuin, Matthias Hüser, Francesco Locatello, Heiko Strathmann, Gunnar Rätsch

High-dimensional time series data—from the fluctuating vital signs of an ICU patient to the complex trajectories of a chaotic dynamical system—are notoriously difficult for humans to interpret. While deep learning has given us powerful tools like Variational Autoencoders (VAEs) to compress this data, the resulting "latent spaces" are often continuous, abstract, and cryptic.

In their ICLR 2019 paper, SOM-VAE: Interpretable Discrete Representation Learning on Time Series, Fortuin et al. introduce a framework that bridges the gap between deep generative modeling and classical, interpretable dimensionality reduction.

TL;DR

The SOM-VAE combines the representational power of VAEs with the topological interpretability of Self-Organizing Maps (SOMs). By learning a discrete, 2D grid-based representation of time series data, it allows researchers to visualize complex temporal transitions as intuitive "trajectories" on a map, outperforming standard clustering methods in both accuracy and interpretability.

What Problem Does This Paper Address?

Human cognition isn't built for high-dimensional spaces. To make sense of complex data, we need low-dimensional, discrete "concepts."

Existing methods fall short in two ways:

  1. Continuous Latent Spaces: Standard VAEs produce continuous representations. While useful for generation, they don't naturally provide the discrete "states" (e.g., "stable," "crashing," "recovering") that clinicians or engineers need.
  2. Lack of Topology: Discrete methods like Vector-Quantized VAEs (VQ-VAE) or k-means clustering treat clusters as independent entities. They don't capture the relationship between clusters—there’s no guarantee that "Cluster A" is more similar to "Cluster B" than to "Cluster Z."

Furthermore, most clustering algorithms treat time points as independent, ignoring the fact that physical systems usually evolve smoothly over time.

Methods

The authors propose the SOM-VAE, an end-to-end architecture that integrates three core components:

SOM-VAE Architecture
  1. The VAE Backbone: An encoder maps high-dimensional input to a continuous latent space. A decoder then reconstructs the input from a discrete version of this space.
  2. The Self-Organizing Map (SOM) Layer: Instead of a standard codebook, the latent space is organized as a 2D grid of embeddings. Every data point is assigned to its closest "node" on this grid. Crucially, the authors developed a Gradient-Based SOM (GB-SOM). By using a specialized loss function and a "gradient-stopping" operator, they made the traditionally non-differentiable SOM algorithm trainable via backpropagation.
  3. The Markov Model: To handle the "time" in time series, they integrated a Markov transition model directly into the latent space. This model learns the probability of moving from one grid node to another. A "smoothness" loss encourages the model to prefer transitions between neighboring nodes on the grid, effectively acting as a temporal denoiser.

Datasets

The model was rigorously tested across a spectrum of complexity:

  • Static Benchmarks: MNIST and Fashion-MNIST to test basic clustering performance.
  • Synthetic Time Series: Linearly interpolated MNIST images (e.g., a "4" smoothly morphing into a "9" or a "0").
Interpolated MNIST Time Series
  • Chaotic Systems: The Lorenz attractor, a classic mathematical system with two "macro-states" (the butterfly wings) obscured by chaotic noise.
  • Real-World Medical Data: The eICU Collaborative Research Database, containing vital sign measurements from thousands of intensive care patients.

Key Insights and Ideas

  • Topology is the Key to Interpretability: By forcing the discrete states onto a 2D grid, the model creates a "map." If a patient's state moves from the top-left to the bottom-right, that movement has a consistent meaning.
  • Differentiable Discreteness: The authors proved that you don't need "tricks" like gradient copying (used in VQ-VAE) if you provide a fully differentiable path through the continuous encoding. This makes the training more stable and performant.
  • Smoothness as a Prior: In noisy domains like medicine, data points can jump wildly due to sensor error. The latent Markov model acts as a "sanity check," forcing the representation to follow a physically plausible, smooth path.

Key Results

  • Superior Clustering: On MNIST, SOM-VAE achieved a Purity of 0.731, significantly outperforming k-means (0.690) and VQ-VAE (0.538).
  • Uncovering Chaos: In the Lorenz system, SOM-VAE successfully ignored the chaotic "micro-noise" and captured the underlying macro-states. Its entropy distribution closely matched the ground truth, whereas k-means was confused by the noise.
  • Clinical Utility: On the eICU dataset, the model learned a "health map." High-risk phenotypes (like low sodium or high creatinine) clustered into compact, identifiable regions. The authors demonstrated that you could visualize a patient's entire ICU stay as a path on this map, potentially allowing doctors to spot "deterioration trajectories" at a glance.

Limitations and Future Work

While powerful, the authors note several areas for expansion:

  • Model Complexity: The current temporal model is a first-order Markov model. Future versions could use Higher-order Markov Models or Recurrent Neural Networks (RNNs) to capture longer-term dependencies.
  • Fixed Topology: The 2D grid is a strong assumption. Some data might be better represented by a graph structure or a different manifold.
  • Uncertainty: While the Markov model provides some notion of transition probability, more explicit Bayesian uncertainty quantification could be beneficial for high-stakes medical decisions.

Summary updated

BibTeX
@inproceedings{fortuin2019som,
  author = {Vincent Fortuin and Matthias Hüser and Francesco Locatello and Heiko Strathmann and Gunnar Rätsch},
  title = {{SOM-VAE: Interpretable Discrete Representation Learning on Time Series}},
  booktitle = {International Conference on Learning Representations},
  year = {2019},
  url = {https://openreview.net/forum?id=zoHsuzsij9t},
}
Figure