Dynamical modeling of nonlinear latent factors in multiscale neural activity with real-time inference

Eray Erturk, Maryam M. Shanechi

Abstract

Modern neuroscience relies on integrating diverse neural modalities, such as spiking activity and local field potentials (LFP). However, these signals often operate at different timescales and follow distinct statistical distributions, complicating real-time integration. We present MRINE (Multiscale Real-time Inference of Nonlinear Embeddings), a framework designed to nonlinearly fuse multiscale neural signals using modality-specific dynamical models. By leveraging Kalman filtering for real-time imputation and a smoothness-regularized dynamical backbone, MRINE achieves state-of-the-art decoding accuracy and robustness to data loss, maintaining inference speeds suitable for closed-loop brain-computer interfaces (BCIs).

Introduction

Neurophysiological recordings frequently capture disparate signals simultaneously. Spiking activity provides high-resolution discrete pulses (count-based, Poisson distributions), while local field potentials (LFP) offer a continuous representation of population-level activity (Gaussian distributions). Integrating these "multiscale" signals is challenging due to misaligned sampling rates—where spikes might be binned every 10ms while LFPs are sampled every 50ms—and frequent data dropouts.

Existing nonlinear models often struggle with these misalignments. They typically rely on "zero-padding" (filling gaps with zeros), which introduces significant noise, or they are "non-causal," meaning they require future data points to understand the current state. Such limitations make them unsuitable for real-time applications like Brain-Computer Interfaces (BCIs), where immediate decoding of intent is required for fluid control.

The MRINE Framework

MRINE addresses these challenges through a three-stage pipeline designed for causal, real-time inference:

  1. Multiscale Encoder: Instead of feeding raw, misaligned data into a single network, MRINE employs modality-specific Linear Dynamical Models (LDMs). These models learn the internal "rhythm" of each signal. When a sample is missing—either due to lower sampling rates or sensor failure—the LDM utilizes a Kalman filter to predict the latent state based on historical data. This effectively uses the physics of the signal to "fill in the gaps."
  2. Nonlinear Fusion: The filtered outputs from these encoders are concatenated and passed through a fusion neural network to create a joint "multiscale embedding."
  3. Dynamical Backbone & Decoders: A central LDM tracks how these joint embeddings evolve over time. Finally, modality-specific decoders translate these latent factors back into predictions for spikes, LFP, or behavioral variables (such as hand velocity).

Training Strategy

To ensure the model captures stable physical brain states rather than "lazy" identity transformations, MRINE is trained using a k-step-ahead prediction loss, forcing the model to predict future states. A critical component is the smoothness regularization term, which applies a KL-divergence penalty between consecutive time steps. This constraint forces the latent space to adhere to a smooth manifold, reflecting the biological plausibility of neural state transitions.

Experimental Validation

The authors validated MRINE across four distinct setups:

  • Stochastic Lorenz Attractor: A synthetic chaotic system used to test the recovery of hidden dynamics from noisy Poisson and Gaussian observations.
  • NHP Grid Reaching: Data from a macaque monkey moving a cursor on a 2D grid.
  • NHP Center-Out Reaching: Data from a macaque performing physical reaching tasks.
  • Visual Stimuli Dataset: High-dimensional activity from mouse visual cortex (Neuropixel spikes and calcium imaging).

Key Insights and Results

Dynamics as Imputation

The most powerful innovation in MRINE is the use of dynamics for data imputation. By learning the underlying rhythm of the LFP, the model does not treat a missing 50ms sample as a "hole"; it treats it as a predictable state transition. This approach proved superior to standard interpolation or zero-padding.

Superior Decoding and Robustness

MRINE consistently outperformed both linear (MSID) and nonlinear (mmPLRNN, MMGPVAE) benchmarks. In Non-Human Primate (NHP) datasets, it improved behavior decoding accuracy by up to 47% in scenarios with low channel counts. Furthermore, the model is remarkably resilient: when 80% of spike samples were artificially dropped, MRINE’s performance decreased by only ~20%, whereas baseline models typically collapsed. This suggests a bidirectional information gain, where LFP dynamics can compensate for missing spike data and vice versa.

Real-Time Performance

For BCI applications, latency is a primary constraint. MRINE achieves an inference time of approximately 1.82 ms per step. Given that most BCIs operate on a 10ms to 50ms cycle, MRINE is well within the computational budget for closed-loop medical applications.

Discussion and Future Work

While MRINE represents a significant step forward, several challenges remain. The model currently assumes stationarity, meaning the relationship between neural activity and behavior is fixed. In biological systems, plasticity can cause these relationships to shift over time. Additionally, the smoothness regularization requires careful hyperparameter tuning, which could be improved through automated optimization. Future iterations may also incorporate external sensory stimuli directly into the latent model to further enhance accuracy in complex sensory-motor tasks.

In conclusion, MRINE provides a robust, real-time framework for fusing multiscale neural signals, offering a path toward more accurate and resilient brain-computer interfaces.

Summary updated

BibTeX
@inproceedings{erturk2025dynamical,
  author = {Eray Erturk and Maryam M. Shanechi},
  title = {{Dynamical modeling of nonlinear latent factors in multiscale neural activity with real-time inference}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=jOHgjZaGqd},
}
Figure