Leveraging Generative Models for Unsupervised Alignment of Neural Time Series Data

Ayesha Vermani, Il Memming Park, Josue Nassar

Overview

In neuroscience, recording the activity of large populations of neurons is now standard practice. To make sense of this high-dimensional data, researchers frequently use latent variable models—such as Variational Autoencoders (VAEs)—to extract the underlying "dynamics," which are the low-dimensional patterns of neural activity that drive behavior.

However, a major bottleneck exists: every time a researcher records from a new animal, or even a new session with the same animal, the specific set of recorded neurons changes. Because of this statistical heterogeneity, models are typically trained from scratch for every single dataset. This process is computationally expensive, data-hungry, and prevents the field from benefiting from large-scale pre-trained models—a practice that has revolutionized fields like computer vision and natural language processing.

This paper introduces a "source-free" unsupervised method to align neural time series data across different experimental sessions or subjects. By leveraging the fact that task-related latent dynamics are often consistent even when the recorded neurons differ, the authors enable the reuse of pre-trained generative models without needing access to the original training data.

Unsupervised Alignment Methodology

The authors propose an unsupervised alignment scheme that allows a pre-trained sequential VAE (seqVAE) to be applied to a new, unseen dataset.

The core idea is to keep the most complex parts of the pre-trained model—the encoder and the latent dynamics—fixed. For a new dataset, the model learns a relatively simple alignment function ($g$) that transforms the new observations so they "fit" into the pre-trained encoder's expected input space.

Schematic of the unsupervised alignment scheme showing how new observations are mapped through an alignment function to a fixed pre-trained encoder and dynamics.

Key technical components of this approach include:

  • Unsupervised Objective: The alignment function is trained by maximizing the Evidence Lower Bound (ELBO) on the new data. This forces the transformed data to produce latent states that are consistent with the pre-trained model's fixed dynamics.
  • K-step Ahead Regularization: Standard one-step prediction is often insufficient for alignment. To ensure the alignment respects global temporal structure rather than just matching local transitions, the authors use a $K$-step prediction loss. This prevents the model from converging to suboptimal local minima where the dynamics "drift" over time.

Experimental Validation

The method was validated on three distinct types of data to test basic alignment capabilities, handling of complex trajectories, and real-world applicability:

  1. Van der Pol Oscillator: A synthetic 2D nonlinear dynamical system.
  2. Lorenz Attractor: A 3D chaotic system used to evaluate the model's ability to handle complex, non-periodic trajectories.
  3. Monkey Motor Cortex (M1): Real-world electrophysiological recordings from two monkeys performing a "center-out" reaching task. This tested the model's ability to align data across different sessions and subjects.

Key Insights and Results

The most powerful insight of this work is using dynamics as an anchor. While individual neurons might change between recordings, the underlying dynamical "rules" of a specific task (like reaching for a target) are remarkably stable across subjects. This stability is what makes unsupervised alignment possible.

Furthermore, unlike previous methods, this approach is source-free. It does not require access to the original "source" data used to train the initial model, which is crucial for data privacy and for sharing models across different laboratories.

Forecasting and few-shot performance comparisons demonstrating the proposed method's superiority over baselines like ERDiff and NoMAD.

In empirical evaluations, the proposed method consistently outperformed existing unsupervised alignment baselines (like NoMAD and ERDiff), particularly in forecasting—the ability to predict future neural activity based on the current state.

  • Lorenz Attractor: The model achieved a 5-step ahead prediction $r^2$ of 0.99, matching a model trained from scratch, while baselines like NoMAD and ERDiff failed to produce meaningful forecasts ($r^2$ near zero).
  • Motor Cortex: The model successfully aligned data across sessions and subjects. For cross-subject alignment, it achieved a reconstruction $r^2$ of 0.66 and a forecasting $r^2$ of 0.39, significantly higher than competing unsupervised methods.

Limitations and Future Work

The authors acknowledge a few key limitations. First, the current model assumes the underlying latent dynamics are exactly the same across datasets. In reality, behavioral variability or different cognitive strategies might introduce subtle differences. Second, the alignment is currently tied to a specific task. A true "foundation model" for neuroscience would likely need to handle multiple tasks or more naturalistic, unconstrained behaviors.

A promising future direction is incorporating fine-tuning, where the latent dynamics are slightly adjusted after the initial alignment to better capture subject-specific nuances without requiring a full retraining from scratch.

Summary updated

BibTeX
@inproceedings{vermani2024leveraging,
  author = {Ayesha Vermani and Il Memming Park and Josue Nassar},
  title = {{Leveraging Generative Models for Unsupervised Alignment of Neural Time Series Data}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=9zhHVyLY4K},
}
Figure