Extraction and Recovery of Spatio-Temporal Structure in Latent Dynamics Alignment with Diffusion Models

Yule Wang, Zijing Wu, Chengrui Li, Anqi Wu

TL;DR

ERDiff is a novel framework that uses diffusion models to align neural population signals across different days and subjects by preserving their intrinsic spatio-temporal structure. By treating entire trial trajectories as samples, it provides a powerful inductive bias that significantly improves the robustness and decoding accuracy of brain-computer interfaces (BCIs).

What Problem Does This Paper Address?

A major hurdle in deploying reliable BCIs is domain shift. Neural signals recorded from the motor cortex are not static; they change significantly over time (cross-day) and vary drastically between individuals (inter-subject). A decoding model trained on Monday might fail by Friday, or a model built for one patient might be useless for another.

While neuroscience suggests these complex signals live on low-dimensional "neural manifolds," existing alignment methods often treat time points or latent dimensions as independent. This neglect of the spatio-temporal structure—how neural patterns evolve over time and how different dimensions correlate—leads to "structure missing" alignments that degrade decoding performance.

Figure 1: Empirical study. Latent dy- namics (3D visualization) of the source domain and the aligned target domain by JSDM on a primary motor cortex dataset.

Methods

The authors propose ERDiff (Extracting and Recovering structure with Diffusion models), which operates in two main phases:

  1. Extraction: In the source domain, a Diffusion Model (DM) is trained to learn the probability density of the latent dynamics. Unlike standard DMs that might process images, ERDiff uses a Spatio-Temporal Transformer Block (STBlock). This architecture features a Spatio Transformer layer to capture correlations across latent dimensions and a Temporal Transformer layer to capture the evolution of the trajectory over time.
  2. Recovery (Alignment): To align a new target domain, the model performs Maximum Likelihood Alignment (MLA). It tunes the target domain's encoder so that the resulting latent dynamics "fit" the structure learned by the source domain's diffusion model.

To make this computationally feasible for real-world applications, the authors derived a tractable upper bound for the MLE objective, simplifying it into a weighted noise residual and a divergence term, avoiding the need for costly ODE solvers during the alignment phase.

Figure 2: A schematic overview of spatio-temporal structure extraction and recovery in ERDiff. (A) The architecture of DM for spatio-temporal structure extraction. (B) A descriptive diagram of structure recovery schematic. The left presents the extracted spatio-temporal structure of the source- domain latent dynamics; the right illustrates the structure-aware maximum likelihood alignment guidance in ERDiff.

Datasets

The researchers evaluated ERDiff across three distinct settings:

  • Synthetic Dataset: Nonlinear latent dynamics following a Continuous Bernoulli distribution, used to validate the model's ability to recover complex phase portraits.
  • NHP Motor Cortex (M1): Neural recordings from two non-human primates performing a center-out reaching task in eight directions. This provided rigorous cross-day and inter-subject benchmarks.
  • Rat Hippocampal CA1: A publicly available dataset of rats navigating a linear track, testing the model's performance on different brain regions and behaviors.

Key Insights and Ideas

  • Trajectories as Samples: By feeding entire trial trajectories into the diffusion model rather than individual time bins, ERDiff captures global dependencies that point-wise methods (like JSDM) or adversarial methods (like Cycle-GAN) often miss.
  • Cooperative Learning: The authors found that training the Variational Autoencoder (which extracts latents) and the Diffusion Model (which learns structure) simultaneously—rather than sequentially—leads to better density estimation. The VAE's stochastic gradient descent effectively adds "beneficial perturbation" to the DM's training data.
  • Structure as a Prior: ERDiff treats the source domain's spatio-temporal structure as a strong inductive bias. This allows the model to remain robust even when target domain data is extremely scarce (few-shot learning).

Key Results

ERDiff consistently outperformed established baselines in both alignment quality and downstream decoding accuracy:

  • Decoding Performance: On the NHP motor cortex dataset, ERDiff achieved a positive $R^2$ (e.g., ~18.8% for cross-day), while many baselines like JSDM and Cycle-GAN resulted in negative $R^2$ values, indicating a total failure to align the task-relevant structure.
  • Robustness to Data Scarcity: ERDiff maintained stable decoding performance even when the sampling density of the target domain was reduced to just 10%, whereas baseline performance plummeted.
  • Qualitative Alignment: Visualizations of the neural manifolds showed that ERDiff successfully recovered the "star-like" reaching patterns of the source domain in the target domain, whereas baselines often collapsed these trajectories into a disorganized cluster.

Limitations and Future Work

  • Single Source Constraint: Currently, ERDiff aligns a target domain to a single source domain. The authors suggest that learning a unified latent space across multiple source domains could further improve generalization.
  • LVM Flexibility: While this study used a canonical VAE, the ERDiff framework is modular. Future work could integrate it with more specialized neuroscience models like LFADS (Latent Factor Analysis via Dynamical Systems).
  • Broader Applications: Beyond neuroscience, the authors believe this structure-aware alignment could be applied to other complex time-series domains, such as weather forecasting or seismology.

Summary updated

BibTeX
@inproceedings{wang2023extraction,
  author = {Yule Wang and Zijing Wu and Chengrui Li and Anqi Wu},
  title = {{Extraction and Recovery of Spatio-Temporal Structure in Latent Dynamics Alignment with Diffusion Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=AuXd54odxm},
}
Figure