Abstract
Though the temporal precision of neural computation has been studied intensively, a data-driven determination of this precision remains a fundamental challenge. Reproducible spike time patterns may be obscured on single trials by uncontrolled temporal variability in behavior and cognition, or may not even be time locked to measurable signatures in either behavior or local field potentials (LFP). To overcome these challenges, we describe a general-purpose time warping framework that reveals precise spike-time patterns in an unsupervised manner, even when spiking is decoupled from behavior or is temporally stretched across single trials. We demonstrate this method across diverse systems: cued reaching in nonhuman primates, motor sequence production in rats, and olfaction in mice. This approach flexibly uncovers diverse dynamical firing patterns, including pulsatile responses to behavioral events, LFP-aligned oscillatory spiking, and even unanticipated patterns, like 7 Hz oscillations in rat motor cortex that are not time-locked to measured behaviors or LFP.
Introduction
In systems neuroscience, the trial-average (PSTH) is the standard for visualizing neural responses. However, this method assumes temporal stationarity across trials. In reality, internal cognitive states and varying reaction times create temporal variability. If a neuron fires a precise burst that is slightly shifted in time on every trial, averaging results in a "blurry" smear. While researchers often align data to external markers, many neural patterns are not locked to behavior. The challenge is discovering precise temporal patterns in noisy spike data without prior knowledge of the "ground truth" alignment.
Methods: A Robust Time-Warping Framework
The proposed framework utilizes linear and piecewise linear time warping. Unlike Dynamic Time Warping (DTW), which can overfit to noise, this method uses simpler, interpretable transformations to align neural activity.
The model fits a "response template" and a per-trial "warping function" that shifts or stretches the template to match raw data. Key warping types include:
- Shift-only: Moving the pattern left or right.
- Linear: Shifting and scaling the speed.
- Piecewise linear: Allowing speed changes at specific "knots" during a trial.
Optimization is achieved via coordinate descent, alternating between template updates and warping function updates. The algorithm is highly efficient, processing 1,000 neurons across 1,000 trials in under a minute. To prevent overfitting, a novel "bi-cross-validation" scheme partitions both neurons and trials, ensuring the discovered warps generalize to held-out data.
Results and Validation
The framework was validated across mouse olfaction, primate reaching, and rat motor sequence datasets, as well as synthetic data to benchmark ground-truth recovery.
Key Findings
- Behavioral Discovery: In primate reaching, the unsupervised model discovered movement onset times purely from neural spikes, matching physical hand-tracking data ($R^2 \approx 0.9$).
- Hidden Oscillations: The model revealed oscillations invisible in raw averages, such as ~18 Hz beta oscillations in primate premotor cortex and ~7 Hz oscillations in rat motor cortex that were not time-locked to measured behaviors.
- Reliability: In mouse olfaction, shift-only warping increased trial-to-trial reliability ($R^2$) by an average of 107%.
- Coherent Warping: Spike-level oscillations and LFP signals were found to "co-warp," shifting and stretching together trial-by-trial, suggesting a fundamental property of population dynamics.
Conclusion
Simple linear warps are often sufficient to capture the majority of temporal variability in neural populations. While the current model assumes a shared warping function across all neurons per trial—which may not hold for complex cognitive areas—it provides a scalable, interpretable tool for modern large-scale recordings. Future work may extend this to multiple independent warping factors or integrate it into state-space models to better capture task transitions.
Summary updated