Manuscript Offprint

arXiv:2608.26649

Robust Neural Stimulation Response Modeling Through Meta-Learning and Pretraining

Matthew J Bryan, Daniel C Muir, Felix Schwock, Azadeh Yazdan-Shahmorad, Rajesh P N Rao

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Matthew J Bryan 1,2,3^{1,2,3}, Daniel C Muir 1,2,3^{1,2,3}, Felix Schwock 2,3,5^{2,3,5}, Azadeh Yazdan-Shahmorad 2,3,4,5^{2,3,4,5}, Rajesh P N Rao 1,2,3^{1,2,3}

Abstract—Objective: Model-based closed-loop neural stimulation holds promise for therapeutic applications ranging from Parkinson's disease to sensory restoration, but deployment has been limited by two obstacles: (1) forecasting models for predicting the consequences of stimulation fail catastrophically on a meaningful fraction of sessions, and (2) per-session calibration requirements are often incompatible with clinical constraints. We address both by demonstrating, for the first time, that meta-learning and pretraining can be applied to neural stimulation response modeling. Methods: Temporal basis function models (TBFMs) have previously been used to forecast state-dependent neural responses to stimulation. We extend the application of TBFMs with cross-session pretraining using a novel architecture and algorithm based on model-agnostic meta-learning (MAML), and evaluate the approach on 40 sessions of optogenetic stimulation in primary somatosensory and motor cortex of two non-human primates. Results: Meta-learning substantially reduces catastrophic forecast failure: for a 1k calibration set size, sessions with test R2<0.05R^{2} < 0.05 drop from 16/40 (single-session training) to 1/40 (MAML-pretrained), and prediction intervals become significantly narrower (Brown-Forsythe p < 0.05). Calibration requirements are reduced by 50–90% at matched accuracy, enabling experiments otherwise infeasible within clinical session-time constraints. Conclusion: Our results demonstrate that cross-session structure in stimulation responses is consistent enough to support pretraining, providing the first empirical evidence that meta-learning approaches are viable for neural stimulation. Significance: The robustness and sample efficiency gains directly ad-

dress known obstacles to deploying model-based stimulation controllers. Our results motivate community efforts to assemble standardized multi-site stimulation datasets and to further explore meta-learning for robust closed-loop stimulation.

Index Terms—Brain–computer interfaces, closed-loop stimulation, meta-learning, neural decoding, temporal basis function models, transfer learning

I. INTRODUCTION

CLOSED-loop neural stimulation remains underexplored despite its potential for greater efficacy, higher energy efficiency [1], and reduced side effects [2] compared to open-loop stimulation. It uses sensed brain activity and potentially data from other sensors to adapt stimulation in real time (e.g. [3], [4]), allowing it to take advantage of “state-dependence” [5], i.e., the dependence of the stimulation response on neural or behavioral states. Clinical open-loop systems have been successfully demonstrated for sensory function restoration, symptom alleviation and targeted rehabilitation for a variety of neurological conditions, e.g., cochlear implants for deafness [6] to deep brain stimulation (DBS) for Parkinson’s disease (PD) [1]. Closed-loop stimulation seeks to improve on these, but remains difficult due to myriad technical challenges including controller latency, precise characterization and modeling of neural responses to stimulation, and reliable calibration [18].

Adaptive closed-loop stimulation guided by artificial neural networks (ANN) — often termed neural co-processing [3], [8] - offers a path toward stimulation controllers that adjust dynamically to a patient's neural state, individual differences, and disease-specific features. Realizing such a neural coprocessor for clinical use however will require significant improvements in robust, sample efficient, accurate, and low-latency model-based stimulation controllers.

This work was supported by National Science Foundation (NSF) EFRI grant no. 2223495, a Weill Neurohub Investigator grant, a CJ and Elizabeth Hwang endowed professorship (RPNR), National Institutes of Health grant nos. R01NS119593, R01MH125429 (FS, AYS), and the National Defense Science and Engineering Graduate (NDSEG) Fellowship Program NDSEG10578COMPSCI (MJB). This material is based upon work supported by the Air Force Office of Scientific Research under award number FA9550-23-F-0014 in the amount of $139,900 USD (MJB). Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the funders.

Author emails (respectively): mmattb@cs.washington.edu, danmuir@cs.washington.edu, fschwock@uw.edu, azadehy@uw.edu, rao@cs.washington.edu

Temporal basis function models (TBFMs) [18] seek to address these challenges by providing single-trial, multi-step, spatiotemporal forecasts of the state-dependent neural response to stimulation, while exhibiting high sample efficiency and low latency. They improve on the prior state-of-the-art which, for example, did not consider state-dependence [9], did not operate with low enough latency for control, or offer sufficient sample efficiency for practical use in clinical settings [3]. TBFMs ameliorate these issues: Bryan et al. [18] demonstrated their potential to be used in the span of

1^{1} Neural Systems Laboratory, Paul G. Allen School of Computer Science & Engineering, University of Washington, Seattle, WA, USA

2^{2} Center for Neurotechnology, University of Washington, Seattle, WA, USA

3^{3} Computational Neuroscience Center, University of Washington, Seattle, WA, USA

4^{4} Department of Bioengineering, University of Washington, Seattle, WA, USA

5^{5} Department of Electrical and Computer Engineering, University of Washington, Seattle, WA, USA a 1-2 hour experimental session, including data collection for calibration and model training time.

In this article, we advance TBFMs by showing that pretraining on data from past sessions and using model-agnostic meta-learning (MAML) [10] substantially improves the robustness of stimulation response forecasting. Pretrained TBFMs exhibit significantly fewer sessions where accuracy degrades catastrophically due to noise or other nuisance variables, addressing a known obstacle to deploying model-based stimulation controllers in clinical and experimental settings. The same pretraining approach additionally allows TBFMs to adapt to future sessions with calibration datasets 50 – 90% smaller than those needed for single-session TBFMs, enabling experiments otherwise infeasible within single session-time constraints.

These gains are notable given that TBFMs were previously demonstrated to have sample efficiency comparable to basic linear state-space models while exhibiting significantly higher prediction accuracy [18]. The pretraining and meta-learning approach we introduce here allows experimenters to (1) take advantage of previously collected stimulation data, (2) reduce the frequency of failed experimental sessions and (3) concentrate significantly more experiment time on exploring stimulation parameters in a closed-loop fashion rather than on calibration.

Meta-learning involves the pretraining of models which are easily adapted to unseen tasks [10], in our case stimulation experiment sessions. In the case of MAML specifically, model parameters are pushed into regimes where adaptation to an unseen session can be done with minimal training data. The adaptation process is referred to as “test-time adaptation” (TTA), and involves fine-tuning some part of the model for the unseen session using a small calibration data set. This pretraining improves robustness by biasing per-session models towards patterns identified across many previous sessions, anchoring the learning process and reducing the degenerate effects of nuisance variables. It has been applied recently to brain-computer interfacing (BCI) to minimize calibration data collection [11], but to our knowledge, neither MAML nor meta-learning more generally have previously been shown to be effective for neural stimulation modeling.

Meta-learning works best when there is similarity between sessions which pretraining can leverage. With varying numbers of usable electrodes, differing subjects and electrode placements, and varying stimulation timings and locations, there are many sources of dissimilarity between sessions. Yet local stimulation responses tend to be stereotyped, some spatial autocorrelation statistics may be similar (see example in Fig 1), and similarly for some temporal autocorrelations [19]. We show for the first time that pretraining and meta-learning can take advantage of these similarities, and that its adaptation process can overcome the cross-session dissimilarities, allowing the model to adapt to unseen sessions while exhibiting accuracy and robustness superior to single-session models.

In summary, this article provides:

• A brief introduction to TBFMs, based on prior work;

• A novel machine learning architecture based on TBFMs which allows for cross-session pretraining;

• A meta-learning algorithm for pretraining such models;

• A test-time adaptation algorithm for unseen sessions;

• A free-to-use open source implementation;

• Results demonstrating:

  1. A significant improvement in robustness, defined as the model's accuracy on the highest noise sessions;

  2. Significant savings in calibration data collection; and

  3. Comparable or improved forecast accuracy relative to single-session models across all calibration data set sizes.

References (9)