Online decoding of rat self-paced locomotion speed from EEG using recurrent neural networks
Authors: Alejandro de Miguel, Nelson Totah, Uri Maoz
Organizations: Schmid College of Science and Technology, Chapman University, Orange, California, USA · LUCID-AI, Chapman University, Orange, California, USA · Helsinki Institute of Life Science, University of Helsinki, Finland · Neuroscience Center, University of Helsinki, Finland · Faculty of Pharmacy, University of Helsinki, Finland · Crean College of Health and Behavioral Sciences, Chapman University, Orange, California, USA · Department of Biology and Bioengineering, California Institute of Technology, Pasadena, California, USA · Anderson School of Management, University of California Los Angeles, Los Angeles, California, USA
Objective. Accurate neural decoding of locomotion holds promise for advancing rehabilitation, prosthetic control, and understanding neural correlates of action. Recent studies have demonstrated decoding of locomotion kinematics across species on motorized treadmills. However, efforts to decode locomotion speed in more natural contexts−where pace is self-selected rather than externally imposed−are scarce, generally achieve only modest accuracy, and require intracranial implants. Here, we aim to decode self-paced locomotion speed non-invasively and continuously using cortex-wide EEG recordings from rats. Approach. We introduce an asynchronous brain−computer interface (BCI) that processes a stream of 32-electrode skull-surface EEG (0.01−45 Hz) to decode instantaneous speed from a non-motorized treadmill during self-paced locomotion in head-fixed rats. Using recurrent neural networks and a dataset of over 133 h of recordings, we trained decoders to map ongoing EEG activity to treadmill speed. Main results. Our decoding achieves a correlation of 0.88 (R2 = 0.78) for speed, primarily driven by visual cortex electrodes and low-frequency (<8 Hz) oscillations. Moreover, pre-training on a single session permitted decoding on other sessions from the same rat, suggesting uniform neural signatures that generalize across sessions but fail to transfer across animals. Finally, we found that cortical states not only carry information about current speed, but also about future and past dynamics, extending up to 1000 ms. Significance. These findings demonstrate that self-paced locomotion speed can be decoded accurately and continuously from non-invasive, cortex-wide EEG. Our approach provides a framework for developing high-performing, non-invasive BCI systems and contributes to understanding distributed neural representations of action dynamics.
Table 1: Summary of relevant literature directly addressing decoding of locomotion speed or related locomotor variables from neural signals, across species. Each study listed includes speed decoding as a primary or secondary objective.
Figure 1: Conceptual diagram of the decoding strategy. This schematic is provided for visualization purposes only.
Figure 2: Schematic of training strategies and data splits for assessing generalization of locomotion-related neural signatures across sessions and animals. Models were evaluated under three strategies: single-session training, where decoders were trained from scratch on either 80% or 10% of the target session; zero-shot generalization, where a model trained on a different session with the same animal (cross-session) or a different subject (cross-subject) was directly applied to the target session without further training; and transfer learning, where pre-trained cross-session or cross-subject models were fine-tuned using only 10% of the target session. Each bar represents a data partition: training (TR), validation (V), and test (TS), with numbers indicating the proportion of session data used.
Figure 3: Recurrent neural networks with LSTM units achieve high-precision decoding of treadmill speed on a sample-by-sample basis. A) Decoding performance distribution across sessions for different machine- and deep-learning models. Each histogram represents the performance of individual sessions, measured by correlation (r, left) and coefficient of determination (R², right). The red horizontal lines indicate the median performance across sessions. B) Scatter plot of actual vs. decoded treadmill speeds (at 10ms intervals) on test data for one of the top 5% best-performing sessions. Speeds are decoded using the RNN, which achieved the highest overall performance across sessions. C) Example speed trace from a 20-second segment of the session shown in panel B, comparing actual (in black) and decoded (in red) treadmill speeds over time.
Figure 4: Neural signatures of locomotion are conserved across sessions on multiple days within a single subject. Decoding performance distribution for different RNN models across three training strategies: single-session from scratch (80% training in dark green, 10% training in pink); zero-shot—i.e., using a model trained on another session of the same animal (cross session, in light green) or from another animal (cross animal, in yellow) and fine-tuning (i.e., transfer learning) a pre-trained model (cross-session in orange, cross-subject in blue). Performance is shown for correlation (r, left) and coefficient of determination (R², right). The numbers inside the boxes show the median value of that metric. The top section displays boxplots without outliers, while the bottom section shows violin plots of the outliers separately to improve the visualization of the overall data distribution. (The cross-subject zero-shot strategy, in yellow, did not exhibit outliers in the correlation measurements.)
Figure 5: Visual cortex is the predominant contributor to locomotion decoding. Decoding performance across sessions for RNN models trained and tested on five specific brain regions (diagonal elements) and on all pairs of regions (off-diagonal elements); measured by the median correlation (r, left) and coefficient of determination (R², right).
Figure 6: Decoding performance is primarely driven by low-frequency ( < 8 Hz) oscillations . A) Decoding performance distributions across sessions for RNN models trained and tested on isolated frequency bands. Each histogram represents the performance of individual sessions, measured by correlation (r, left) and coefficient of determination (R², right). The red horizontal lines indicate the median performance across sessions. B) Mean EEG spectra conditioned on speed percentile. Within each session, speed samples were binned into deciles and Welch PSDs were computed from EEG segments corresponding to each bin ( f∈[0,45] Hz). PSDs were averaged across channels, transformed to a frequency-normalized representation ( f⋅P(f) ) to flatten the 1/f slope, and then averaged across sessions (shaded areas: SEM).
Figure 7: EEG encodes information about previous and future treadmill speeds beyond what can be estimated from treadmill readouts alone . Decoding performance across sessions for EEG-based (red), speed-based (blue) and autocorrelation (gray) models estimating previous speeds (left) and future speeds (right). Models were evaluated at discrete time horizons (0, ± 100, ± 200, ± 500, and ± 1000 ms), with 95% confidence intervals computed from bootstrapped medians across sessions. To aid visualization and analysis, a second-order polynomial was fit to these points, resulting in the smooth curves shown (see Supplementary Tables 13-14 for the actual performance on discrete time horizons). The signal autocorrelation was calculated for all lags, in 10 ms increments, up to ± 1000 ms without polynomial approximation.
Decoding continuous three-dimensional (3D) motor imagery (MI) using non-invasive electroencephalography (EEG)-based brain--computer interfaces (BCIs) remains challenging due to signal variability and residual decoding errors. Deep learning architectures such as convolutional neural network--long short-term memory (CNN--LSTM) models can capture spatial and temporal dynamics for continuous kinematic decoding; however, systematic residual errors persist in predicted trajectories. We propose a two-stage decoding framework that applies reinforcement learning (RL) to perform residual kinematic correction on the outputs of a CNN--LSTM decoder (CNN--LSTM--RL). The RL agent is trained offline without direct EEG input and instead operates on predicted kinematic trajectories to optimize movement accuracy relative to target trajectories. Decoding performance was quantified using Pearson correlation coefficients (r) and Root Mean Square Errors (RMSE) along the x,y, and z axes. Compared to CNN--LSTM applied alone, CNN--LSTM--RL improved the mean correlation from 0.5076 to 0.7181 (p=0.0005) in 2D and from 0.6420 to 0.7780 (p=0.0059) in VR, with relative gains of 41.5% and 21.2%, respectively. Correspondingly, RMSE was reduced from 0.0890 to 0.0532 (2D, p<0.0001) and from 0.0714 to 0.0441 (VR, p<0.0001), representing relative reductions of 40.2% and 38.2%. These findings demonstrate that this scalable framework enhances 3D BCI MI decoding by correcting kinematic errors via offline residual RL without extra neural data, advancing neurorehabilitation, prosthetics, and virtual interaction.
Jiamian Li, Niall McShane, Attila Korik +6
Department of Computer Science, University of Bath, Bath, BA2 7AY · Intelligent Systems Research Centre, University of Ulster, BT48 7JL · Bath Institute for the Augmented Human, University of Bath, Bath, BA2 7AY +1
Brain-machine interfaces (BMIs) can assist individuals with limited mobility, such as stroke survivors or amputees. One of the key challenges in developing BMIs is expanding their usability and control, which can be achieved by accurately decoding multiple kinematic and kinetic parameters. To address this, we propose three regression models: partial least squares regressor, multilayered perceptron, and attention based regressor, to decode multiple movement parameters from EEG signals. We evaluated these models on the WAY EEG GAL dataset, focusing on their performance under subject specific and subject independent conditions with two strategies: a single model for all parameters and a baseline with separate models for each parameter. Among all regressors, the attention based regressor achieved the best performance, with an R2 of 0.8 and a latency of 29.2 milliseconds, demonstrating significant improvement in simultaneous multi parameter decoding. However, its performance dropped for single parameter decoding. The multi layered perceptron showed more consistent but lower accuracy across both decoding types (R2 = 0.49). These findings highlight the potential of attention based models for real time multi command BMI systems and contribute to the development of more intuitive control devices.
Parth G. Dangi, Yogesh Kumar Meena
Human-AI Interaction (HAIx) Lab, IIT Gandhinagar, India
EEG analysis and decoding underpin brain-computer interfaces, cognitive assessment, and sleep monitoring. Fixed pipelines and reward-driven search do not explicitly determine how signal structure, representations, predictor behavior, and training dynamics contribute to performance or generalization gaps, leaving intervention choice underdetermined. We introduce NeuroAct, an autonomous research agent framework for EEG analysis and decoding. NeuroAct implements dual-loop autonomous research across EEG foundation models, task-specific predictors, and model combinations. In an inner loop, research, development, and review roles use evidence on signal structure, representations, predictor behavior, and training dynamics to test hypotheses, select analyses or interventions, and refine candidates using performance, stability, and cost feedback. An outer loop distills outcomes into conditional, testable recommendations with task and model conditions, then validates and revises them on subsequent tasks.We evaluate four settings: (A) EEG General Analysis, (B) Cross-task Model Optimization, (C) Single-task Open Research, and (D) Collaborative Prediction. In Setting A, NeuroAct's 80.88 macro-average exceeds BrainAgent's 63.13 by 17.75 points. In Setting B, NeuroAct raises EEGPT's mean balanced accuracy (BA) by 7.34 points and HBN Pearson's (r) from 0.6894 to 0.7362; in Setting C, it improves ADFTD BA by 16.33 points; and in Setting D, it raises Workload BA from 79.69% to 85.02%. Experience reuse raises BCIC-IV-2a BA from 34.66% to 50.81% while reducing LLM tokens by 64.02%, indicating recommendations improve cross-task performance. NeuroAct enables evidence-guided EEG research improved by cross-task experience.
Wei Xiong, Jiangtong Li, Han Zhao +3
Tongji University · Ant Group · Shanghai Jiao Tong University +1