Hidden Markov Nonlinear ICA: Unsupervised Learning from Nonstationary Time Series

Hermanni Hälvä, Aapo Hyvärinen

Abstract

Recent advances in nonlinear Independent Component Analysis (ICA) provide a principled framework for unsupervised feature learning and disentanglement. The central challenge in nonlinear ICA is identifiability: without specific constraints, an infinite number of decompositions can explain the same data. While recent methods have leveraged non-stationarity to achieve identifiability, they typically rely on manually defined auxiliary variables or data segments. This paper introduces Hidden Markov Nonlinear ICA (HM-NLICA), a framework that recovers latent independent components from non-stationary time series by replacing observed auxiliary variables with a latent state governed by a Hidden Markov Model (HMM). This approach enables truly unsupervised representation learning from complex temporal data.

Introduction

Independent Component Analysis (ICA) is a fundamental technique for recovering hidden, independent signals from observed mixtures. In the linear regime, ICA is well-defined and widely used. However, nonlinear ICA is notoriously difficult because it is inherently "unidentifiable"—without additional structure, there is no unique way to decompose a signal into its original components.

Recent breakthroughs, such as Time-Contrastive Learning (TCL), have addressed this by using "auxiliary variables" (like time-segment indices) to provide the necessary structure for identifiability. However, these methods require users to manually segment data into non-stationary chunks. This requirement is a significant bottleneck, as manual segmentation is often impossible, inaccurate, or computationally prohibitive for large-scale datasets. HM-NLICA addresses this by learning the "change points" in the data's distribution automatically alongside the features.

The HM-NLICA Framework

The authors propose a synthesis of Nonlinear ICA and Hidden Markov Models (HMMs) to create a fully unsupervised generative model.

1. The Generative Model

The model assumes that latent independent components ($s$) are generated from an exponential family distribution. Crucially, the parameters of this distribution—such as the mean and variance—are determined by a discrete latent state ($c$). These components are then transformed by a nonlinear mixing function ($f$), implemented as a neural network, to produce the observed data ($x$).

2. Temporal Dynamics

Rather than assuming the state $c$ is known or fixed, HM-NLICA models it as a first-order Markov process. This allows the model to capture the underlying temporal dynamics of the data, such as repeating regimes or cyclical patterns, without human intervention.

3. Estimation via EM

The model is trained using the Expectation-Maximization (EM) algorithm:

  • E-step: The standard forward-backward algorithm is employed to estimate the probability of the system being in a specific latent state at any given time step.
  • M-step: The HMM transition matrix and the parameters of the latent distributions are updated. Simultaneously, the demixing function (the inverse of the neural network $f$) is updated via gradient ascent.

To handle the complex task of calculating the log-determinant of the Jacobian of the demixing function, the authors leverage JAX. This allows them to use general neural network architectures rather than being restricted to specific "normalizing flow" designs, ensuring high expressivity in the mixing function.

Experimental Evaluation

The model was evaluated on synthetic non-stationary datasets to verify the theoretical proofs of identifiability. The data generation involved 100,000 time steps where latent components followed a circular path through five states. The components were mixed using a randomly initialized Multi-Layer Perceptron (MLP) with varying levels of nonlinearity (1, 2, or 4 hidden layers).

Key Results

  • Superior Recovery: HM-NLICA significantly outperformed the TCL baseline in recovering true latent sources. The mean absolute correlation coefficient between true and estimated components remained consistently high across all levels of nonlinearity.
  • Robustness to Segmentation: While TCL's performance degraded when manual segments did not align with true underlying states, HM-NLICA remained robust by learning the correct segments automatically.
  • State Inference: The model successfully performed unsupervised clustering, identifying latent states with approximately 45% accuracy in an 11-state model—far exceeding the 9% chance level.

Discussion and Future Work

HM-NLICA bridges the gap between HMM theory and ICA theory, proving that latent components can be recovered up to a linear transformation even when the conditioning variable is hidden. By recognizing repeating latent states, the model aggregates information more effectively than methods that treat every segment as unique.

However, challenges remain. The forward-backward algorithm scales at $O(T C^2)$, which may be slow for datasets with many latent states. Furthermore, the current theory assumes the number of latent components equals the number of observed variables. Future research will focus on integrating dimension reduction techniques and addressing the potential for local optima inherent in EM-based deep learning approaches.

Summary updated

BibTeX
@inproceedings{halva2020hidden,
  author = {Hermanni Hälvä and Aapo Hyvärinen},
  title = {{Hidden Markov Nonlinear ICA: Unsupervised Learning from Nonstationary Time Series}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2020},
  url = {https://openreview.net/forum?id=StZb3LrFiec},
}
Figure