MiSO: Optimizing brain stimulation to create neural population activity states
Authors: Yuki Minai
Joana Soldado-Magraner
Matthew A. Smith
Byron M. Yu
Venue: NeurIPS 2024 poster (2024)
Keywords: closed-loop optimization
microstimulation
neural population activity
dimensionality reduction
latent variable models
reinforcement learning
Primary area: neuroscience_and_cognitive_science
TL;DR: MiSO (MicroStimulation Optimization): a closed-loop stimulation framework to drive neural population activity toward specified states by optimizing over a large stimulation parameter space.

Abstract: Brain stimulation has the potential to create desired neural population activity states. However, it is challenging to search the large space of stimulation parameters, for example, selecting which subset of electrodes to be used for stimulation. In this scenario, creating a model that maps the configuration of stimulation parameters to the brain’s response can be beneficial. Training such an expansive model usually requires more stimulation-response samples than can be collected in a given experimental session. Furthermore, changes in the properties of the recorded activity over time can make it challenging to merge stimulation-response samples across sessions. To address these challenges, we propose MiSO (MicroStimulation Optimization), a closed-loop stimulation framework to drive neural population activity toward specified states by optimizing over a large stimulation parameter space. MiSO consists of three key components: 1) a neural activity alignment method to merge stimulation-response samples across sessions, 2) a statistical model trained on the merged samples to predict the brain's response to untested stimulation parameter configurations, and 3) an online optimization algorithm to adaptively update the stimulation parameter configuration based on the model's predictions. In this study, we implemented MiSO with a factor analysis (FA) based alignment method, a convolutional neural network (CNN), and an epsilon greedy optimization algorithm. We tested MiSO in closed-loop experiments using electrical microstimulation in the prefrontal cortex of a non-human primate. Guided by the CNN predictions, MiSO successfully searched amongst thousands of stimulation parameter configurations to drive the neural population activity toward specified states. More broadly, MiSO increases the clinical viability of neuromodulation technologies by enabling the use of many-fold larger stimulation parameter spaces.

MiSO: Optimizing brain stimulation to create neural population activity states
Yuki Minai .oonna Soldado-Magraner Matthew A. Smith 133,5, Byron M. Yu1.3,455+
"Neuroscience Institute, Carnegie Mellon University
Machine Learning Department, Carnegie Mellon University
Department of Biomedical Engineering, Carnegie Mellon University
*Department of Electrical and Computer Engineering, Carnegie Mellon University
CCenter for the Neural Basis of Cognition {yminai, , jssolddoo, mami th, ppronny)@@nddee cmu edu Denotes equal contribution.
Abstract
Brain stimulation has the potential to create desired neural population activity states. However, it is challenging to search the large space of stimulation parameters, for example, selecting which subset of electrodes to be used for stimulation. In this scenario, creating model that maps the configuration of stimulation parameters to the brain's 's response can be beneficial. Training such an expansive model usually requires more stimulation-responss samples than can be collected in given experi- mental session. Furthermore, changes the properties of the recorded activity over time make it challenging to merge ciimulation-respones samples across sessions. To address these challenges, we propose MiSO (MicroStimulation Optimization), closed-loop stimulation framework to drive neural population activity toward specified states by optimizing over a large stimulation parameter space. MiSO consists of three key components: 1) neural activity alignment method to merge stimulation-respone samples across sessions, 2) a statistical model trained on the merged samples to predict the brain's response untested stimulation parameter configurations, and 3) an online optimization algorithm to adaptively update the stimulation parameter configuration based the model's predictions. In this study, we implemented MiSO with factor analysis (FA) based alignment method, a convolutional neural network (CNN), and an epsilon greedy optimization algorithm. We tested MiSO in closed-loop loop experiments using electrical microstimulation in the prefrontal cortex of non non-human primate. Guided by the CNN predictions, MiSO successfully searched amongst thousands of stimulation parameter configurations to drive the neural population activity toward specified states. More broadly, MiSO increases the clinical viability of neuromodulation technologies by enabling the use many-fold larger stimulation parameter spaces.
Introduction
Brain stimulation is important tool for treating brain disorders 113 and for causally perturbing neural activity states to understand brain function [4. Because complex brain functions are realized through the coordinated activity of populations of neurons, brain stimulation techniques to control neural population activity have the potential to manipulate complex brain function. Most brain stimulation studies date have used electrical microstimulation produce motor response 55 or perceptual experience 6 77]. disrupt neural activity [8] [., or shift cognitive state [10. It has been less common consider the response a population of neurons to microstimulation In principle, different combinations of stimulation parameters make it possible to create diverse
[4]
38th Conference on Neural Information Processing Systems (NcurIPS 2024).

---

neural population activity patterns [15] However, it is challenging to identify specific stimulation parameters that achieve desired activity manipulation for an entire recorded neural population.
Previous studies have developed closed-loop stimulation methods to search the stimulation parameter space 12 21 22 A key challenge for closed-loop stimulation is to widely sample the multi- dimensional stimulation parameter space. It is necessary to collect many diimllation-respnne samples before the closed-loop stimulation procedure can begin to work effectively. A key innovation of our work is to merge stimulation-responee ability to merge data leverages the finding that neural population activity tends to occupy a lower- dimensional space than the number of neurons being recorded, which enables the alignment of oow-dimeniional spaces across sessions. By merging data across multiple previous sessions, is possible for the closed-loop stimulation procedure to work effectively starting from the very outset of the current session.
samples across experimental sessions [2325]] The
In this study, we propose MiSO (MicroStimulation Optimization), a closed-loop stimulation frame- work to drive neural population activity toward specified states by optimizing over a large stimulation parameter space (Section 2.1). MiSO consists of three key components: 1) neural activity alignment
method to merge stimulation-rssponse samples across sessions (Sections 2.2 and 2.3 2) a statistical model trained on the merged samples to predict the brain's 's response to untested stimulation parameter configurations (Section 2.4). and 3) closed-loop optimization algorithm to adaptively update the model's 's predictions and then choose the next stimulation parameter configuration to test (Section (.5) In this study, we implemented MiSO with a factor analysis (FA) based alignment method [23], convolutional neural network (CNN) model [26]. and an epsilon greedy optimization algorithm 27
These methods were chosen to satisfy the fast online computation requirement during the closed-loop
stimulation experiments with predictive model trained on a limited amount of data. However, MiSO
is a general framework and applicable to other design choices.
We tested MiSO using electrical microstimulation (uStim) in a non-human primate implanted with multi-electrode array in the prefrontal cortex (PFC, area 8Ar). MiSO was used to optimize the location of the stimulated electrode(s) on each trial through closed-loop updates, while keeping other parameter values such as current amplitude and frequency fixed. We considered a large uStim parameter space, defined by all possible patterns in which two electrodes out of 96 electrodes are stimulated (4,560 patterns). MiSO's latent alignment method enabled us to merge neural activity across sessions to increase the number of stimulation- model trained on these merged stimulation- respooss samples (Section 3.1. MiSO's ' CNN samples accurately predicted neural responses to untested uStim parameter configurations (Section 3.2). In closed-loop experiments with non-human primate, MiSO successfully searched among 4,560 uStim parameter configurations to drive the neural population activity toward targeted states. By enabling the search of larger stimulation parameter space, MiSO produced novel population activity patterns which were not achievable by searching over smaller stimulation parameter space (Section 3.3).
2 Methods
2.1 MiSO overview
The goal of MiSO is to identify stimulation parameter configurations that produce specified neural population activity states (Fig. (TA). MiSO first identifies a reference low-d latent space of the high-d population activity to which the neural activity from all the other experimental sessions are aligned (Fig. [B, Section 2.2p. MiSO then collects stimulation-responsee samples on multiple experimental sessions, then merges the samples using latent space alignment (Section 2.3). The samples are used to fit a statistical model to predict the brain's 's response to all possible stimulation parameter configurations within the set of parameters defined by the user (Section 2.4). These model predictions obtained prior to the closed-loop experimental session(s) are used to initialize the optimization procedure. At the beginning of each closed-loop experimental session, MiSO identifies the latent space for the session. MiSO then aligns it to the reference latent space, which was used to generate the model predictions (Section 2.5). On each trial, MiSO stimulates using the chosen parameters and updates the predictions based on the responses measured online (Fig. [T). MiSO iteratively runs this optimization over trials produce the specified latent activity state.
In the following sections, we refer to a specific stimulation parameter configuration as a "stimulation pattern" and the induced brain response as the "stimulation response". The stimulation patterns
2

---

A
B
C
Neuron
Ulsb sray
post
Choose parameters
Target activity state1
Targel adtivity
etate
96
usti
Chosen paltem
Fization (50ms x 243ins)
?
Update prediction
2. Perform uStim
Time
Laleni dim
uSti
Neuron
Updated predict
Pre-uStim
Target activity acthvity state1
+ Lalent dim
actvity
Latent dim
Pre-uStim activily
Eroo
Original prediction
Indused activity
Neuron 3
3. Analyze induced activity
Time
Latent dim
Laiant dim
Induced aclivity
Latent
Figure 1: Experimental paradigm and MISO closed-loop framework. (A) MiSO's goal is to optimize brain stimulation parameter configurations to create specified neural population activity states. (B) Experimental setup. Top: Spiking activity was recorded from a multi nulti-electrode array implanted PFC. During fixation, uStim was applied for 150ms (orange bar) to induce a specified neural population activity state in the post uStim period (pink bar). Bottom:
The uStim response was evaluated within a low-d latent space (e.g.. 2D) identified from high-d multi-electrode spiking activity. (C) Closed-loop stimulation framework. Each MiSO iteration involves four steps (Section 2.5
tested in this study consist of all possible patterns in which one of 96 electrodes is stimulated (single electrode stimulation patterns) and/or two of 96 electrodes are stimulated (double electrode stimulation patterns). While the neural activity used in this study consists of spiking responses recorded with planar grid of electrodes implanted in the brain and each stimulation pattern specifies the location of the electrodes used for stimulation within the grid, MiSO can be readily applied to other stimulation/recording protocols (e.g., holographic optogeneties (19)
2.2 Latent space identification
To merge stimulation-respone samples across multiple experimental sessions, MiSO identifies low-d latent space of the high-d population activity in each session. For this study, we used Factor Analysis (FA), which provides computationally fast latent space identification and latent state estimation, compatible with closed-loop experiments. Since MiSO's ultimate goal is to create targeted changes in neural population activity that lead to changes in brain state and in turn behavior, MiSO identifies the intrinsic latent space only using non-stimulation trials.
For the ith session, MiSO extracts a list of n; "usable" electrodes e; RR. where each element of e; is an integer representing one of the electrodes. An electrode is deemed "usable" if it satisfies criteria involving its mean firing rate, Fano factor, and coincident spiking with other electrodes (see Section S For each time bin indexed by k- = 1,..., KnoStim, MiSO then takes spike counts during the fixation period (Fig. 13) on each usable electrode an E model using the EM algorithm:
IR"', MiSO fits the following FA
noSt
.NOO I) noStim + t4, V.) 2 1
noStim ntit x 1,8
iik
where ztom Rmm with m ni is the low-d latent activity for the kth time bin, A; E Ra.x is the loading matrix whose columns define the low-d latent space, μ4 R? contains the mean spike counts for each electrode, and V E IR Xn; is a diagonal matrix capturing the independent variance of the spike counts for each electrode.
2.3 Latent space alignment
To merge neural activity across experimental sessions, we used the latent space alignment method introduced in [23 (termed "FA+Procrustes"". It has been shown to work well in brain-computer
3

---

interface, which like MiSO is closed-loop experimental paradigm. The FA+Procrsstes method solves the Procrustes problem to find an orthogonal transformation matrix to maximize the alignment between two FA loading matrices. First, MiSO runs single experimental session exclusively with non-stimulation trials and extracts a list of usable electrodes eo. which contains Bi electrodes. MiSO uses the data from this session to identify a reference latent space Ao E RR For each subsequent session, MiSO aligns the latent space identified in the ith session A₃ to the reference latent space Ao- Concretely, for the ith session, MiSO identifies an orthogonal transformation matrix Ó₂ E m that fulfillss:
Ó, = argmin [|Ao(ecom:.) :) A.(ecom, :)o 0:00T=I
(2)
where Ecom Co e4 is list of usable electrodes common the reference session and the ith session, and || || is the Frobenius Norm. This optimization can be solved in closed-form (28) The O found is applied to A; to obtain the aligned latent space A; E R=
A, = A,O,"
The latent activity in the post-stimulation period (Fig. [B) is estimated as the posterior mean from the FA model (equation I using the loading matrix Ag:
i,k
where i.k
E I Stim E R and B = AT + v.)-1. By using A, the induced latent i
activity i
Stim resides in common latent space across all sessions.
2.4 Stimulation-response sample collection and CNN model fitting
To predict the stimulation response to untested stimulation patterns, MiSO uses statistical model trained on the merged neural activity across sessions. We used CNN this study to capture the spatial structure of the stimulation-respone
relationship across the multi-electrode array (see Sections 2.7 and 3.2 for model selection). To train the CNN, MiSO runs two phases of experimental sessions to collect diimuationnresponne samples. In the first phase, MiSO applies randomly-sclecte stimulation patterns to train an initial CNN model. In the second phase, MiSO uses the trained CNN to choose stimulation patterns to maximize the diversity of the observed stimulation responses.
2.4.1 Phase Random stimulation pattern selection
In the first phase, we apply random stimulation patterns over R experimental sessions to train the initial CNN model. With planar grid of electrodes of size h x v, the stimulation pattern tested in the kth trial during the ith session S., E Rixe encoded using value of I for stimulated electrodes and for other electrodes. The induced latent activity state Stim E R is computed
Stim corresponding to the user defined t target dimensions using equation 44. The entries of zi,A
within the m dimensional aligned latent space (L < m) are subselected and collected in a new vector 2i,k E RR. All tested stimulation patterns S and corresponding responses =5ttim across sessions are appended to obtain S₃ E hxx" and = z,Stim E R', where k = 1,..., KSStim and K Stim is the total number of stimulation trials across sessions.
The totality of the stimulation-respons samples S& and 2 &Stim are used to train the CNN model, which maps the stimulation patterns Sy to the induced responses & 5,Stim Since the CNN predictions can be variable due to training using a finite number of stimulation-resspnsee samples. MiSO uses bagging to stabilize the CNN predictions [29]. bagging, M CNN models are with bootstrapping and the top C performing models in testing are used to generate predicted simulation responses for all P possible stimulation patterns defined by the user (e.g., P = 4, 560 for double electrode stimulation patterns, computed as "96 choose 2" electrodes) (Section S2 For p 1, 1,.... P. the predicted response ž, E RC to the yth stimulation pattern Sp E RR. xxx is defined as the average prediction of the C CNN models.
2.4.2 Phase 2: Guided stimulation pattern selection
Because the stimulation responses do not uniformly occupy the I-dimensional response space, choosing random stimulation patterns in Phase tends to yield responses primarily in the densest

---

portions of the response distribution. To diversify the stimulation responses for retraining the CNN, MiSO collects dimulation-responss samples using guided sample collection strategy over G experimental sessions in Phase 2. In each session, MiSO uses the CNN-predicted stimulation responses 2p from Phase to select stimulation patterns on the fringes (i.e., sparsely populated regions) of the response distribution. Concretely, for each stimulation pattern p = 1, ,.... P, MiSO computes the distance measure:
KKKE E JEN,
d, =
K 12 2
(5)
where Np is the set of K-nearest neighbors of žn- MiSO chooses the top E.g stimulation patterns that maximize this criterion, corresponding to responses on the fringes of the response distribution. To complement these patterns, MiSO also selects E, stimulation patterns at random (from the / possible stimulation patterns, typically E, < Egg) corresponding to responses in the more densely populated regions of the response distribution. The selected Eg E, patterns are experimentally tested for one session. The resulting stimulation-respon
samples are appended to the samples collected in Phase and thus far in Phase 2, and the CNN is retrained using the same bagging procedure as in Phase 1. The CNN predictions are then updated and used to choose stimulation patterns to test in the next experimental session. MiSO iterates these steps of selecting stimulation patterns, collecting new
samples, and retraining the CNN over G experimental sessions. The CNN predictions ēp for p = I.... obtained during the final session are used to initialize the closed-loop optimization.
2.5 Closed-loop optimization
Each online closed-loop session starts with KnoStim calibration trials, where no stimulation is applied. MiSO extracts list of usable electrodes ec. which includes n. electrodes, using these trials and finds the common electrodes Ccom Ce O eo between this session and the reference session. The observed spike count vectors noStim IR are used to fit the FA parameters Aę E R He E R" and Ve E R" The identified latent space Ag is aligned to the reference latent space Ag using the methods described in Section 2.3 yielding Ae E R
The closed-loop optimization starts by the user defining target state Storg E Rs and loading the predicted stimulation responses 8p for p = I..., P obtained from Section 2.4 MiSO then randomly chooses stimulation pattern S. from the P possible patterns (s 1, P) start the closed- loop optimization procedure. Subsequent stimulation patterns are chosen using the epsilon greedy algorithm, described below. We used the epsilon greedy algorithm due to the need for fast online update to compensate for activity fluctuations during the closed-loop optimization.
On the kth trial during the closed-loop optimization, the selected stimulation pattern S, is applied and Stim
the induced response during the post-stimulation period a.,kk the latent activity c,k
E T is measured. MiSO estimates
SStim E R. in real time as:
Stim = 3e (ar
Stim
me)
where B. = AI, + V.) The entries of z
corresponding to the target dimensions are RR''and and the prediction of the response to stimulation pattern S, is updated as:
Stim E TR.,, subselected as 2c,k
8 2,
=
Stim
2, 2. a,
where 0 < as 1 is the learning rate. This update is essential for ensuring that the CNN predictions (based on data from previous experimental sessions) are adjusted for the current closed-loop session. Although the CNN predictions used to initialize the closed-loop optimization can capture spatial structure in the stimulation-responsee relationship, this update is performed separately for each stimulation pattern and therefore does not leverage spatial structure (see Section 4 MiSO uses time-varying clipped learning rate:
a₂ = max( ((s)
(8)
5

---

where 0 < Celip < 1. and (s) is the number of trials tested with the sth stimulation pattern within the current closed-loop session. The clipped learning rate allows MiSO to make larger updates the beginning of the session, when the framework tries to adapt to stimulation responses in the current session, and smaller updates as the framework becomes more confident about the predictions.
After updating the prediction, MiSO chooses the stimulation pattern to test on the next trial using an epsilon greedy algorithm, which balances exploitation and exploration. With a probability of 1 E. MiSO chooses the stimulation pattern which minimizes the LI distance between the induced activity and the target state
8" argmin |2, -ttrrll1
and applies stimulation pattern S.- on the next trial. With a probability of E, MiSO chooses random stimulation pattern among the P possible patterns. MiSO then iterates until the experimental session is terminated.
2.6 Experiment details
We tested MiSO using electrical microstimulation (uStim) in macaque monkey with a 96 electrode Utah array implanted in prefrontal cortex (PFC, area 8Ar). Experimental procedures were approved by the Institutional Animal Care and Use Committee (LACUC) of Carnegie Mellon University. In each experimental session, the monkey performed a visually-guided saccade task. Each trial began with the monkey fixating on a dot at the center of the screen [Section[S3) On uStim trials, we applied uStim for 150 ms during the fixation period. For each session indexed by i, we identified latent dimensions by applying FA to spike counts taken in 50 ms bins from usable electrodes e, that passed set of criteria (Section STI). Stimulation response samples were collected starting 50 ms after uStim offset (Fig. BB. pink) to avoid uStim artifacts.
The number of random stimulation sessions R and guided stimulation sessions G to collect stimulation-respone samples for CNN training (Section 2.4) were chosen based on the number of trials the animal worked in each session (about 300-500 uStim trials per session). We performed R=3 3 sessions with random uStim pattern sampling and G = 2 sessions with guided uStim pattern sampling. On each guided sampling session, we collected Eg 80 patterns based on CNN predic- tions and E, = 20 random patterns. We used the top C = 10 test performing models among M = 50 CNN models obtain the CNN prediction. To calculate dp. used 3 nearest neighbors of 2p-
Each closed-loop experimental session started with KmoStim = 100 no-uStim trials for latent space calibration. For some sessions, this calibration period also included an additional 96 trials (one per single-electrode stimulation pattern). These observations were used to compare the performance of the "MiSO with single elec., sample avg." " with the "Single elec., same day observation" (Fig. (2.). The latter method uses stimulation- response samples collected in the current session to initialize the predictions (Section S4). We chose = target dimensions among the m = 4 latent dimensions. The latent dimensionalityy m was determined based on the cross-validated data likelihood. We set the learning rate delip as 1, chosen manually by assessing how the latent activity state changed over trials, and as 0.05, chosen by rumning simulations with peeviussy--oollcter stimulation-responss samples.
2.7 Model comparison
To decide which prediction model to use in MiSO, we compared the prediction performance of uStim responses when holding out different percentages of uStim patterns in three models: Multi-Layer Perceptron (MLP) 300. Gaussian Process (GP) 31 and Convolutional Neural Network (CNN) 266 (Fig. For all models, we only encoded the location of the stimulating electrodes as inputs in this study. Other stimulation parameters, such as stimulation amplitude and frequency, were constant across electrodes and trials (see Section S3). The models differed in their ability to capture any spatial structure present in the stimulation- response relationship, whereby stimulating with nearby electrodes could induce similar latent activity states.
Below we describe the input (i.e., stimulation pattern) encoding format for each model. For the ktth trial on the ith session, the MLP model takes as input MMIIP E 10 a one-hot vector representing each uStim pattern. Its entries have a value of for each stimulated electrode and 0 for non-stimulated electrodes. Since the one-hot input does not designate which electrodes are close

---

A
Worse
Tosted electrode FA FAdim1
2
No uSim
Rendom uStim
MISO single elec, sample avg. Target
relative to No uStim baseline (%)
100
uStim baseline
Mean absolute error ratio
N sessians
Single elec
2
same day
observation
60
0
40
96
96
No uStim
Random uSilim
MISO with single elec. sample avg.
Belter
0
50
100
150
200
250
300
350
Trial number in session
Figure 2: Closed-loop performance in a non-human primate of MiSO initialized using merged samples. (A) An example closed-loop experimental session. The top two panels show smoothed (for visualization) FA latent activity in the two target dimensions. Trials for all three methods were interleaved the session. The bottom two panels show the electrode selected for uStim on each trial by "Random uStim" and "MiSO with single elec., sample avg.". (B) Mean LI error relative to the "No uStim" baseline across closed-loop experimental sessions. Error bars indicate standard error across sessions.
to far from each other, this MLP model does not capture spatial structure among the stimulating electrodes. For the kth trial on the ith session, the GP model takes as input 5C² E R where n the number of electrodes used for stimulation. The locations of each stimulating electrode are encoded by pair of values {0, 9) x {0, 1...99,) 9). in ascending order by electrode id. This input encoding format for the GP model captures spatial structure using single Radial Basis Function kernel. Note that this format requires all stimulation patterns to have the same number of stimulating electrodes. For the &th trial on the ith session, the CNN takes grid-format input with the same layout the electrode array Si.k where electrodes being used for stimulation have a value of and all other electrodes have value of The CNN captures spatial structure using multiple 2D convolutional filters applied to this grid input.
9}
with the stimulating electrodes sorted
SCNN {0, 1) 10
3 Results
3.1 Merging stimulation-respone samples across sessions
When the stimulation parameter space large, the number of uStim patterns we can test within an experimental session is much smaller than the total number of possible uStim patterns. This requires merging neural activity across sessions to create a large enough set of stimulation- resspooseee samples to learn their relationship. To develop MiSO, we considered merging neural activity based on aligning latent spaces across sessions (23 To assess the effectiveness of this method for uStim, we empirically measured the uStim response for all possible single-electrode uStim patterns (96 patterns). We ran 5 experimental sessions in which we stimulated with each of the 96 electrodes on the array for 3-7 trials per session. We found that raw uStim responses were inconsistent across sessions due to neural recording instabilities but were more consistent within the aligned latent space (Fig. S1). This opened up the possibility of estimating uStim responses based on merged stimulation-response samples collected in previous sessions.
To test this idea, we ran closed-loop experiments with all single-electrode uStim patterns in which we used the sample average of the merged stimulation-response samples from previous sessions to initialize the predicted stimulation responses ž, in MiSO (Section 2.5 We call this method "MiSO with single elec., sample avg." " (Section (54.. Here, we could use this method instead of the CNN model to generate the predictions 2p. given that for the small parameter space of single electrodes
7

---

Single electrode uStim
B
UStim responsa diff.
== 0.274
uStim response Test MSE
0.55
A
1
Sample avg.
GP
Small uStim pattern diff.
0.50
CNN
0.45
2
3
0%
25%
50%
75%
uStim pattern diff.
% of held-out patterns during training
pettern diff.
Double electrode uStim
D
uSlim response diff.
== 0.143
uStim response
GP
Test Test MSE
0.26
MLP
0.24
CNN
55%
60%
70%
80%
uStim pattern diff..
% of held-out patterns during training
Figure 3: Leveraging spatial smoothness to predict uStim responses untested uStim patterns. (A) uStim pattern difference determined by the physical location(s) of the stimulating electrode(s) on the array (illustrated here for single-electrode patterns). (B) Relationship between uStim pattern difference (horizontal axis, LI distance, Section (5)) and uStim response difference (vertical axis, latent activity difference along FA diml) when stimulating using single electrodes. A positive correlation (r) implies that stimulating using nearby electrodes tended to induce similar responses. (C) uStim response prediction error function of the percentage of held-out uStim patterns during training. Error bars indicate standard error across test datasets. The black square indicates the test MSE achieved using the sample average of the training data. (D, E) Same format as (B) and (C) respectively, but for stimulation using double-electrode patterns. In (E), we experimentally tested 45% of all possible double-electrode patterns (9 sessions, 3301 trials).
we could collect sufficient stimulationressponee samples for all stimulation patterns to compute the average responses. We compared this method two baselines, "No uStim" and "Random uStim" (Section SSj, which allow us to assess whether MiSO induces activity closer to the target state than via natural activity fluctuations or random uStim patterns, respectively. On each trial, we randomly chose one of the three methods. "MiSO with single elec., sample avg." (Fig. A blue lines and dots) drove neural activity closer to the target state than "No uStim" and "Random uStim" (Fig. 22, gray and green lines), Across multiple sessions with a different target state on each session, MiSO achieved significantly smaller errors than the two baseline methods (Fig. 2 N 5 sessions, p < 0.05 for "No uStim" and "Random uStim", one-tailed (-test). These results indicate that MiSO can identify effective stimulation patterns by leveraging merged samples from previous sessions.
To further validate the utility of merging past observations, we compared MiSO's performance with a method where the predictions were initialized using stimulation-responnee samples (one uStim trial for each of 96 electrodes) acquired immediately before starting the closed-loop optimization. We call this method "Single elec., same day observation". This method and MiSO different approaches to initialize the same closed-loop procedure (equations ()) MiSO leverages stimulation-responsee samples collected across multiple previous sessions for initialization. By contrast, "Single elec., same day observation" uses the stimulation-respone for initialization, with the advantage that it gets to observe responses the current session. We found that "MiSO with single elec., sample avg." performed equivalently to "Single elec., same day observation" (Fig. 28, N sessions, p 0.715, two-tailed t-test). This result indicates that the merging of stimulation-respore stimulation procedure to work effectively from the very outset the current session. Furthermore, this result using single-electrode stimulation patterns represents an important building block for optimizing over larger stimulation parameter spaces, where merging cemuulationrrsponns samples across sessions becomes essential.
samples that can be collected in the current session
samples across previous sessions in MiSO enables the closed-loop
8

---

A
B
2
No uSim
Random uStim
Target
Worse
+
FA dim1
single
relative No uStim baseline (%)
100
uSlin
0
Mean absolute error ratio
0.50
FA dim2
Tested electrodes FA dim2
0.00
96
CNN with double slec.
1
-0.50
CNN with single elec.
96
No uStin Random uStin
single elec, CNN
MSO with
MSO with double elec. CNN
Better
0
100
200
300
400
FA dim1
Trial number session
Figure 4: Closed-loop performance in a non-human primate of MiSO initialized using a CNN. (A) Range of activity patterns achievable by single (blue) and double (pink) electrode uStim patterns, as predicted by the CNN. Dashed region: area reachable exclusively by doublc-electrode uStim. Yellow star: target state used in (B). (B) Example closed-loop experimental session. Same format as Fig. AA (C) Mean LI error of different methods relative to "No uStim" baseline, across 3 closed-loop sessions. Error bars indicate standard error across sessions.
3.2 Predicting uStim responses using CNN
When search space is small (e-g., 96 single electrodes), we can measure the responses all uStim patterns to initialize MiSO (as we did with "MiSO with single elec., sample avg.". Section3.]] This method becomes untenable we increase size of the stimulation parameter space (e.g., stimulating two electrodes out of 96 yields 4,560 uStim patterns, which would require more than 30 experimental sessions to collect 3 repeats of each uStim pattern). Thus, to expand the stimulation parameter space with MiSO, we need to reduce the required number of stimulation-responsee samples to learn their relationship.
We asked whether there was spatial structure in the stimulation-response relationship, which could be leveraged to predict the uStim response with a limited number of samples (Fig. (Fi..BA). For this, ran 5 experimental sessions in which we stimulated with each of the 96 electrodes on the array for 3-7 trials per session. With single-electrode uStim, we indeed observed spatial smoothness in the uStim response across physical locations on the array (Fig. BB, Fig. S2A). In other words, stimulating with nearby electrodes tended induce similar responses. We then asked whether we could use this property to predict the response to untested uStim patterns. We found that the GP and CNN models more accurately predicted uStim responses than the MLP model when holding out uStim patterns, indicating that spatial smoothness is a useful property for generalization to untested uStim patterns (Fig. BC).
To increase the size of the stimulation parameter space, we ran 9 experimental sessions in which stimulated with two out of 96 electrodes (4,560 possible patterns). We were only able to test 45 percent of this large number of possible uStim patterns, with most of the uStim patterns tested for one trial each. As with the single-elcctrode uStim patterns, we also observed spatial smoothness in the doublc-electrode uStim patterns (Fig. 3D. Fig. S2B). By leveraging this spatial smoothness, the CNN achieved better generalization performance to untested uStim patterns than the other models (Fig. BE) Although both the GP and CNN capture aspects of spatial smoothness, the CNN outperformed the GP for double-electrode uStim. Whereas the CNN uses multiple convolution filters to capture the spatial structure of uStim patterns, the GP uses just one spatial kernel, likely limiting its performance. Furthermore, there is no natural input encoding format for GP when stimulating using more than one electrode a 2D array. Overall, these results indicate that the CNN model can generalize its predictions even untested uStim patterns, enabling MiSO to perform closed-loop optimization over large stimulation parameter space with a limited number of cotmullationresppnns. samples.

---

3.3 Closed-loop testing of MiSO initialized using CNN
By combining the latent space alignment method (Section 3.1 and the CNN prediction model (Section [.2), we tested MiSO in closed-loop experiments in a non- non-human primate over large uStim parameter space, defined by all possible double-clectrode uStim patterns (4.560 patterns.. To train the CNN model, we ran 2, 2,1 double-electrode uStim trials across 5 sessions (representing -30 percent of the possible patterns) and merged the stimulation-responss samples using latent space alignment. Using the trained CNN model, we predicted the uStim response for all double-electrode uStim patterns. The key motivation of expanding the stimulation parameter space is to expand the range of uStim responses that can be produced. Based on the CNN predictions, we found that the range of activity states achievable by double-clectrode stimulation patterns spanned novel regions of the target space that were not reachable using single-electrode uStim (Fig. 4A, Fig. S3).
To demonstrate the benefit of searching a larger stimulus parameter space, we ran closed-loop experiments in which we set the target states to those exclusively reachable using double-electrode uStim patterns (Fig. yellow star). We implemented "MiSO with double elec., CNN", in which CNN predictions 2p were used to initialize the closed-loop optimization (Section 2.5). We compared the performance of "MiSO with double elec., CNN" with three baselines: "No uStim",, "Random uStim", as well as MiSO optimizing over the 96 single-electrode uStim patterns (termed "MiSO with single elec., CNN"). If the CNN predictions are meaningful and the closed-loop optimization is able to guide the search in the stimulus parameter space, "MiSO with double elec., CNN" would outperform the three baselines. Indeed, "MiSO with double elec., CNN" (Fig. BB, pink lines and dots) successfully identified double-electrod uStim patterns that induced responses closer to the target state than the three baseline methods (gray, green, and blue lines). Across multiple sessions with different target states, "MiSO with double elec., CNN" produced smaller errors than the three baseline methods (Fig. 4C. N = 3 sessions, p < 0.05 for "No uStim" and "Random uStim", and p 0.079 for "MiSO with single elec., CNN",, one-tailed t-test). These results demonstrate the utility of MiSO, which enables searching over a larger stimulation parameter space than previously possible.
4 Discussion
In this work, we proposed MiSO which searches large stimulation parameter space to drive neural population activity toward specified states. MiSO's s closed-loop optimization procedure is guided by predictions of a CNN trained on merged neural activity across sessions. To our knowledge, this is the first study to apply latent space alignment in the field of brain stimulation to merge stimulation- response samples across sessions. This enables MiSO to search larger stimulation parameter spaces than previously possible.
Although we demonstrated MiSO's functionality in a 2D target space (1 = 2), the neural activity corresponding to desired brain state might need to be specified in a higher dimensional space > 2). As the dimensionality of the target space grows, may become necessary to expand the stimulation parameter space in order to achieve a greater variety of target states. Provided that a target state achievable, the epsilon greedy algorithm would require more time to identify appropriate stimulus parameter configurations. The reason is that stimulation pattern that successfully achieves a target in two dimensions would not necessarily produce the desired activity if a third dimension was added to the target specification. In this case, the use of a more efficient online algorithm would be beneficial to reduce the exploration of suboptimal stimulation parameter configurations.
To expand the range of achievable population activity states, one might consider expanding the stimulation parameter space. For example, in the context of electrical microstimulation, we could use stimulation patterns involving larger numbers of electrodes and/or different current amplitudes or frequencies. For the CNN model (or any other predictive model) to retain its prediction accuracy, would likely need to capture additional structure in the stimulation-response relationship (e.g., similar stimulation amplitudes or frequencies lead to similar responses) and require more training data, Furthermore, MiSO's 's closed-loop updates of the predicted responses are performed separately for each stimulation pattern (equation (7). which becomes untenable as the stimulation parameter space grows. In this case, incorporating statistical model in the closed-loop updates to account for spatial (or other) structure could be beneficial, such that observing response to one stimulation pattern leads to updates of the predicted responses for multiple stimulation patterns. These computations would need to be performed fast enough to be used in a closed-loop optimization procedure.
10

---

Acknowledgments
This work was supported by NIH CRCNS ROI MH11 NSF NCS DRL 2124066, Simons Foundation 543065 and CCBB-CULM-00002441 fellowship. We are grateful Samantha Schmitt for assistance with data collection, and Karen McCracken and Mary Ellen Smyth for animal care.
and Japan Student Services Organization
References
[1] Helen S Mayberg, Andres M Lozano, Valerie Voon, Heather E McNeely, David Seminowicz, Clement Hamani, Jason M Schwalb, and Sidney Kennedy. Deep brain stimulation for treasment-resistant depression. Neuron, 45(5):651-666 2005.
[2] Robert S Fisher and Ana Luisa Velasco. Electrical brain stimulation for epilepsy. Nature Reviews Neurology, 10(5):261-21) 2014.
[3] Andres M Lozano, Nir Lipsman, Hagai Bergman, Peter Brown, Stephan Chabardes, Jin Woo Chang, Keith Matthews, Cameron C McIntyre, Thomas E Schlaepfer, Michael Schulder, et al. Deep brain stimulation: current challenges and future directions. Nature Reviews Neurology. 148-)0, 2019.
[4] Marlene R Cohen and William T Newsome. What electrical microstimulation has revealed about the neural basis of cognition. Current opinion in neurobiology, 14(2):169-177, 2004.
[5] Charles J Bruce, Michael E Goldberg, M Catherine Bushnell, and Gregory B Stanton. Pri- mate frontal eye fields. ii physiological and anatomical correlates of electrically evoked eye movements. Journal of neurophysiology, 54(3):714-734, 1985.
[6] Giles S Brindley and Walpole S Lewin. The sensations produced by electrical stimulation of the visual cortex. The Journal of physiology. 196(2):479 493, 1968.
[7] John Choi, Austin Brockmeier, David B McNiel, Lee M Von Kraus, José C Príncipe, and Joseph T Francis. Eliciting naturalistic cortical responses with sensory prosthesis via optimized microstimulation. Journal of neural engineering, 13(5):056007, 2016.
[8] Mark M Churchland and Krishna Shenoy. Delay of movement caused by disruption of cortical preparatory activity. Journal of neurophysiology, 97(1):348-359) 2007.
[9] Nuo Li, Kayvon Daie, Karel Svoboda, and Shaul Druckmann. Robust neuronal dynamics in premotor cortex during motor planning. Nature, 532(76000:459-466 2016.
[10] Tirin Moore and Mazyar Fallah. Microstimulation of the frontal eye field and its effects on covert spatial attention. Journal of neurophysiologg. 91(1):152-162, 2004.
[11] Mark H Histed, Vincent Bonin, and R Clay Reid. Direct activation of sparse, distributed populations of cortical neurons by electrical microstimulation. Neuron, 63(4):508-522, 2009.
[12] Sina Tafazoli, Camden J MacDowell, Zongda Che, Katherine C Letai, Cynthia R Steinhardt, and Timothy J Buschman. Learning to control the brain through adaptive closed-loop patterned stimulation. Journal of Neural Engineering, 17(5):050007, 2020.
[13] Yuxiao Yang, Shaoyu Qiao, Omid G Sani, Isaac Sedillo, Breonna Ferrentino, Bijan Pesaran, and Maryam M Shanechi. Modelling and prediction of the dynamic responses of large-scale brain networks during direct electrical stimulation. Nature biomedical engineering, 5(4):324 345, 2021.
[14] Amin Nejatbakhsh, Francesco Fumarola, Salch Esteki, Taro Toyoizumi, Roozbeh Kiani, and Luca Mazzucato. Predicting the effect of micro-stimulation on macaque prefrontal activity based on spontaneous circuit dynamics. Physical Review Research, 5(4):043211, 2023.
[15] Chieko M Murasugi, C Daniel Salzman, and William T Newsome. Microstimulation in visual area MT: effects of varying pulse amplitude and frequency. Journal of Neuroscience, 1719-197,, 1993.
11

---

[16] Alexis M Kuncel and Warren M Grill. Selection of stimulus parameters for deep brain stimula- tion. Clinical neurophysiology, 115(11):2431-4441 2004.
[17] Meghan Watson, Numa Dancause, and Mohamad Sawan. Intracortical microstimulation param- eters dictate the amplitude and latency of evoked responses. Brain Stimulation, 9(2)2766-244, 2016.
[18] Thierri Callier, Nathan W Brantly, Attilio Caravelli, and Sliman Bensmaia. The frequency of cortical microstimulation shapes artificial touch. Proceedings of the National Academy of 2020.
Sciences, 1
[19] Hillel Adesnik and Lamiae Abdeladim. Probing neural codes with two-photon holographic optogenetics, Nature neuroscience, 24(10):155-1136, 2021.
[20] Marcus Triplett, Marta Gajowa, Hillel Adesnik, and Liam Paninski. Bayesian target optimisation for high-precision holographic optogenetics. Advances in Neural Information Processing Systems, 36, 2024.
[21] Samuel Laferriere, Marco Bonizzato. Sandrine Côté, Numa Dancause, and Guillaume Lajoie. Hierarchical bayesian optimization of spatiotemporal neurostimulations for targeted motor outputs. IEEE Transactions on Neural Systems and Rehabilitation Engineering, 2 28(6):1452- 1460, 2020.
[22] Yuri B Saalmann, Sima Mofakham, Charles B Mikell, and Petar M Djuric. Microscale multicir- cuit brain stimulation: Achieving real-time brain state control for novel applications. Current Research in Neurobiology, 4: 4:100071, 2023.
[23] Alan Degenhart, William E Bishop, Emily Oby, Elizabeth Tyler- Kabara, Steven M Chase, Aaron P Batista, and Byron M Yu. Stabilization of brain brain-computer interface via the alignment of low-dimensional spaces of neural activity. Nature biomedical engineering, 4(7):672-665, 2020.
[24] Brianna M Karpowicz, Yahia H Ali, Lahiru N Wimalasena, Andrew R Sedler, Mohammad Reza Keshtkaran, Kevin Bodkin, Xuan Ma. Lee E Miller, and Chethan Pandarinath. Stabilizing brain-computer interfaces through alignment of latent dynamics. BioRxiv, pages 2022-04, 2022.
[25] Max Dabagia, Konrad Kording, and Eva L Dyer. Aligning latent representations of neural activity. Nature Biomedical Engineering, 7(4):337-34, 2023.
[26] Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436-444 2015.
[27] Richard S Sutton. Reinforcement learning: An introduction. A Bradford Book, 2018.
[28] Peter H Schönemann. A generalized solution of the orthogonal procrustes problem. Psychome- trika, 31(1):1-10, 1966.
[29] Leo Breiman. Bagging predictors. Machine learning, 24:123- 140, 1996.
[30] David E Rumelhart, Geoffrey E Hinton, and Ronald Williams. Learning representations by back-propagating errors. Nature, 323(6883) 1986.
[31] Christopher KI Williams and Carl Edward Rasmussen. Gaussian processes machine learning. volume 2. MIT press Cambridge, MA, 2006.
[32] Jacob R Gardner, Geoff Pleiss, David Bindel, Kilian Q Weinberger, and Andrew Gordon Wilson. Gpytorch: Blackbox matrix-man matrix gaussian process inference with gpu acceleration. In Advances in Neural Information Processing Systems, 2018.
12

---

Supplementary material
S1 Spiking activity preprocessing
To identify the latent dimensions using FA, we computed binned spike counts during the 1.2 fixation period on each no-uStim trial (50 ms bins, yielding 24 bins per trial). Thus, KroStim for the ith session was the number of no-uStim trials 24. These no-uStim trials were also used to extract list of usable electrodes e, for the ith session based on the following three criteria: mean firing rate > Hz, Fano factor <8, and <20% coincident spiking with each of the other electrodes. The latent dimensionality (m = 4) was chosen based on the cross-validated data likelihood across multiple sessions, then used for all sessions. To evaluate the uStim response, we computed binned spike counts starting 50 ms after uStim offset on each uStim trial (Fig. (B) to avoid uStim artifacts. The latent activity was then computed using equation
S2 Models architecture and fitting
The CNN architecture and hyperparameters were determined based on grid search. The following describes the CNN architecture used in this work from input to output: 1. convolutional layer with 32 channels, spatial kernel size 3x3, and stride size 1, followed by ReLU activation, 2. a convolutional layer with 64 channels, spatial kernel size 3x3, and stride size 1, followed by ReLU activation, 3. two linear layers with ReLU activation, and the target dimensionality without any activation. The MLP architecture used in this work includes: an input layer of size 96, 2. a hidden layer of size 10, followed by ReLU activation, and an output layer of size equal to the target dimensionality. The CNN and MLP were implemented in PyTorch and fit using the Adam optimizer with mean squared error loss and learning rate of 0.001. The GP model was fitted using the GPyTorch library [32). We used Radial Basis Function whose length scale hyperparameter was chosen by maximizing the marginal data log likelihood using the Adam optimizer with a learning rate of 0.001. We trained all models on a local computing cluster using 4 NVIDIA GeForce RTX GPUs and 11GB of RAM. We used the same architecture and hyperparameters for all experiments.
linear output layer of size equal to
To train CNN models using bagging (Section 2.4p, the merged stimulation- restionse samples across sessions were split into training, validation, and test sets with ratio of 80: 10:10. Each CNN model was trained on the training data. The validation data was used for hyperparameter tuning. The test data were used to evaluate the ability of the models to generalize to untested uStim patterns, and to choose the top C performing models to generate the uStim response predictions for all possible uStim patterns. These predictions were used to initialize the closed-loop optimization (Section 2.5).
S3 Details of uStim experimental paradigm
In each experimental session, the monkey performed a visually-guided saccade task. In this task, the monkey first fixated on a dot at the center of the screen. Following a random (1.45-1.75s) fixation period, the center dot turned off and one of four peripheral targets (45%. 135%, 225", 315") appeared. The monkey saccaded to that target to receive a liquid reward. There were two types of visually-guided saccade trials: "uStim trials", in which we applied uStim, and "no-uStim trials", in which we did not apply uStim. The experimental system randomly chose which trial type to perform in an interleaved manner. On uStim trials, we applied uStim for 150 ms during the fixation period. The stimulation was biphasic with each square pulse in the biphasic pair being 250 ms in duration. We set the current amplitude low enough not induce any eye movements (current amplitude: 25 uA for single-electrode uStim, 15 uA 15 uA for double-electrode uStim). We changed the location(s) of the stimulated electrode(s) on each trial, while keeping other parameter values such as current amplitude and frequency (350 Hz) fixed. In each closed-loop session, we chose two target dimensions along which we could modulate neural activity and induce diverse latent activity with uStim. These were not necessarily the top FA dimensions that explained the greatest covariance among the neurons.
13

---

S4 Closed-loop performance assessment methods
The table below summarizes the methods used to assess closed-loop performance. The "Prediction model" column indicates the method used to obtain uStim response predictions to initialize the closed-loop optimization. The "Training data" column indicates the stimulation-respon response samples used to train the prediction model. The "uStim patterns" column indicates the number of electrodes used for stimulation, both in the training data and during closed-loop optimization. The "Online algorithm" column indicates the method used to choose the next uStim pattern. All methods that use the epsilon greedy algorithm also perform closed-loop updates the predicted responses (equations (
Method
Pred. model
Training data
uStim patterns
Online algorithm
No uStim
None
None
None
None
Single clec. for Section 5.1
Random uStim
None
None
Double elec. Section
Random selection
Single elec.. same day observation
Sample avg.
Same day
Single elec.
Epsilon greedy
MiSO with single clec., sample avg.
Sample
Multi day
Single clec.
Epsilon greedy
MiSO with single elec.. CNN MISO with double elec.. CNN
CNN
Multi day
Single elec.
Epsilon greedy
CNN
Multi day
Double elec.
Epsilon greedy
S5 Spatial structure of uStim responses
To evaluate the spatial smoothness of uStim responses across the multi-electrode array (Fig. B). measured the spatial similarity between uStim patterns (dpattern) and the similarity in the uStim response elicited by those patterss (dresponse). We computed these metries for every pair of tested uStim patterns.
For single-electrode uStim patterns 61 quantified their spatial similarity using the L1 distance:
[11, /1] and 62
[222, y2] (for x; and yi E (..,,...,))
Apattern
[.] x2l
+
32l
(10)
where 2 and y the spatial coordinates the multi- multi-electrode grid for the first uStim electrode e,, and 22 and are the spatial coordinates for the second uStim electrode e2.
For double-electrode uStim patterns, each pattern involves two electrodes. Let
[x] v1 and
22 [22, 3/21 represent the uStim electrodes used for the first pattern, and 63 = [rg. ys and
e1 [ Y4] represent the uStim electrodes used for the second pattern. To calculate the distance in this case, we computed:
d Guttern = ([x) - Ial + 1yy Val
] + (|12 - x4A + y/2 - 3/4) pattern (|x1 I1 + 1y1 yall + (112 xz)
(11)
+ y/2 yss))
and used min pattern (pattern) as the distance measure. For each pair of uStim patterns, quantified the difference in uStim response using the L1 distance:
dresponse |z 22
(12)
where 21 is the response to the first uStim pattern along a target dimension, and 22 is the uStim response the second uStim pattern along the same target dimension. To focus on local smoothness, we only analyzed the pairs which dpattern was less than 8 in the single-electrode case, and less than 16 in the double-electrode case.
Using the dpattern and dreeponse values, we computed the correlation between them to evaluate spatial structure is present. A positive correlation indicates that uStim electrodes located closer to each other on the array tend to induce more similar response.
14

---

S6 Summary of experimental sessions
The experimental sessions used in this study comprised sessions without uStim (reference sessions), 10 sessions involving ingle-electrode uStim, 19 sessions involving double-electrode uStim, and closed-loop sessions. Each the entries in the tables below uses a subset of the sessions described above.
The table below summarizes the number of sessions used in each closed-loop experimental result:
Reference session
Training sessions
Closed-loop test sessions
Fig.
session
sessions
5 sessions
5 sessions for single elec. CNN
Fig.
session
3 sessions
5 sessions for double elec. CNN
The table below summarizes the number of sessions used in each offline analysis result:
Reference session
Training sessions
Test sessions
Fig. 33, Fig. 3, and Fig. S1A
session
sessions
sessions
Fig. DD Fig. 5E and Fig. S1B
session
sessions
sessions
Fig.
53
session
10 sessions (split into train and test)
S7
Code availability
Python code for MiSO available on GitHub at https//gihhb..ommmuuuiiiaaa/a/ip
15

---

A
C
Inconsistant
Session
Session
Session 3
Session 4
Session
3
Avg. Firing Rale
Normalzzd distance
Avg. Fining
of responee map
Firing Rate
from session!
Rate
Fddm1
B
dim2
Avg. letent activlyy
FA
dim1
3
5
Consistent
Session
Figure S1: uStim response consistency across sessions. (A) Response maps of uStim-induced
mean firing rates. Each panel shows the mean firing rate, averaged across the entire array, induced by stimulating each electrode individually. For example, the color of the cell in (x.y) position (1.2) in a given response map indicates the mean firing rate across the array induced by stimulating this particular electrode. Each column corresponds uStim-induced mean latent activity across trials. Each panel shows the average latent activity induced by stimulating each electrode individually. The latent spaces have been aligned across sessions. diiulation-responss samples from the five sessions shown here are used to compute the sample average- based predictions in Fig. 2 (C) Normalized distance of response maps from session The mean firing rates and latent activity are normalized across sessions using min-max transformation to align their scales. The uStim response more consistent across sessions in the aligned latent space than in the raw firing rate space.
different session. (B) Response maps of
B
r= 0.211
== 0.159
UStmm response diff.
2
uStim response diff.
0
2
12
uStim pattern diff.
uStim pattern diff.
Figure S2: Relationship between uStim pattern spatial similarity and response similarity along the second target dimension. Same format as Fig. 3B and Fig. BD. which were based on the first target dimension. Left, single-electrode uStim, right, double-electrode uStim.
16

---

A
B
Single elec. Test MSF
0.35
Double Test MSE
0.4
0.25
Single elec.
Double elec.
Both
Single
Double
Both
elec.
elec.
uStim patterns used for training
uStim patterns used for training
Figure S3: Generalization to uStim patterns involving different number of electrodes be challenging. (A) Prediction error for different CNN models tested on single-electrode uStim data. Each bar shows the predictive performance of CNNs trained with different merged stimulation- response samples (single-electrode uStim trials, double-electrode uStim trials, and both types of trials). CNN trained single-electrode uStim trials performed better than CNN trained double- electrode uStim trials. Because the single-electrode training trials include all 96 possible patterns, we are not testing here the ability of the CNN to generalize to unseen uStim patterns (see Fig. (3) Instead, we are assessing to what extent the CNN is able to predict the response to double-electrode uStim patterns given only training data from single-electrode uStim patterns. If the responses to double-electrose uStim were simply linear combination of the responses to single-electrode uStim using each constituent electrode, then the performance of the CNN trained double-electrode uStim trials should perform as well as the CNN trained on single- eenleeelectrooe uStim trials. However, this was not the case. These results reveal complex relationship between single-electrode uStim responses and double-electrode uStim responses. Furthermore, training a CNN on both types of uStim trials yielded similar accuracy training only on single-electrode uStim trials. (B) Prediction error for different CNN models tested double-clectrode uStim data. Here the double-electrode uStim trials used to train the CNN comprised 1,031 (of the possible 4,560) uStim patterns, which were partially overlapping with the double-electrode uStim patterns used for testing. Even though this requires some generalization to double-electrode uStim patterns not used in training, the CNN trained on double-electrode uStim trials still outperformed the CNN trained single-electrode uStim trials. This provides further evidence for complex relationship between single-electune uStim responses and double-electrode uStim responses.
17

---

NeurIPS Paper Checklist
1. Claims
Question:
Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?
Answer: [Yes]
Justification: We provide a summary of the current literature and gap, and explain the contributions of our work in the abstract and introduction. Our claims supported by the experimental results.
Guidelines:
The answer NA means that the abstract and introduction do not include the claims made the paper.
The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or
NA answer to this question will not be perceived well by the reviewers.
The claims made should match theoretical and experimental results, and reflect how much the results be expected to generalize other settings.
is fine include aspirational goals as motivation long is clear that these goals are not attained by the paper.
2. Limitations
Question:
Does the paper discuss the limitations of the work performed by the authors?
Answer: [Yes]
Justification: We discuss the limitations this work the second and third paragraphs of the discussion section.
Guidelines:
The answer NA means that the paper has limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.
The authors are encouraged to create separate "Limitations" section in their paper.
The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification. asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.
The authors should reflect the scope of the claims made, e.g., if the approach was only tested on a few datasets or with few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.
The authors should reflect the factors that influence the performance of the approach. For example, facial recognition algorithm may perform poorly when image resolution low or images are taken in low lighting. Or speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon.
The authors should discuss the computational efficiency the proposed algorithms and how they scale with dataset size.
If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness.
While the authors might fear that complete honesty about limitations might used by reviewers as grounds for rejection, worse outcome might be that reviewers discover limitations that aren't 't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play impor- tant role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.
3. Theory Assumptions and Proofs
Question: For each theoretical result, does the paper provide the full of assumptions and complete (and correct) proof?
18

---

Answer:
[NA]
Justification:
This paper does not include theoretical results.
Guidelines:
The answer NA means that the paper does not include theoretical results.
All the theorems, formulas, and proofs in the paper should be numbered and cross- referenced.
All assumptions should be clearly stated or referenced in the statement of any theorems.
The proofs can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide a short proof sketch provide intuition.
Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.
Theorems and Lemmas that the proof relies upon should be properly referenced.
4. Experimental Result Reproducibility
Does the paper fully disclose all the information needed to reproduce the main ex- perimental results of the paper to the extent that it affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided or not)?
Question:
Answer: [Yes]
Justification: We disclose the details of the proposed framework, experiments, data analyses, and modeling approaches needed to reproduce the main results. We have also released the code to replicate our framework at
Guidelines:
The answer NA means that the paper does not include experiments.
If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.
If the contribution is dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.
Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is novel architecture, describing the architecture fully might suffice, or if the contribution a specific model and empirical evaluation, it may be necessary to either make it possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way accomplish this, but reproducibility instructions for how to replicate the results, access to a hosted model (e.g.. in the case of large language model), releasing of a model checkpoint, other means that appropriate to the research performed.
also be provided via detailed
While NeurIPS does not require releasing code, the conference does require all submis- sions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example
(a) If the contribution is primarily a new algorithm, the paper should make it clear how to reproduce that algorithm.
(b) the contribution is primarily new model architecture, the paper should describe the architecture clearly and fully.
(c) If the contribution is a new model (e.g., a large language model), then there should either way to access this model for reproducing the results or way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset).
(d) We recognize that reprodueibility may be tricky in some cases, in which authors are welcome to describe the particular way they provide for reproducibility. In the case of closed-source models, it may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers have some path reproducing or verifying the results.
5. Open access to data and code
19

---

The authors should provide scripts to reproduce all experimental results for the new reproducible, they Does the paper provide open access to the data and code, with sufficient instruc- tions faithfully reproduce the main experimental results, as described in supplemental material?
Question:
Answer: [Yes]
Justification:
The code and sample data needed to replicate the experiments are available at git.
Guidelines:
The answer NA means that paper does not include experiments requiring code.
Please see the NeurIPS code and data submission guidelines (https://nips.co cc/
for more details.
While we encourage the release of code and data, we understand that this might be possible, so "No" is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for new open-source benchmark).
The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines (https
/ httpppscccppullccguuudddeo Coaee//ddeeeSbmmmmma ssi onPolicy) for more details.
The authors should provide instructions data access and preparation, including how to access the raw data, preprocessed data, intermediate data, and generated data, etc.
proposed method and baselines. only subset of experiments should state which ones are omitted from the script and why.
At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).
Providing as much information as possible in supplemental material (appended to the paper) recommended, but including URLs to data and code is permitted.
6. Experimental Setting/Details
Question: Does the paper specify all the training and test details (e.g., data splits, hyper- parameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?
Answer: [Yes]
Justification: The training and test details are provided in Section S2
Guidelines:
The answer NA means that the paper does not include experiments.
The experimental setting should be presented in the core of the paper to level of detail that is necessary appreciate the results and make sense of them.
The full details can provided either with the code, in appendix, or as supplemental material.
7. Experiment Statistical Significance
Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?
Question:
Answer: [Yes]
Justification: We include error bars in all figures and provide the outcomes of statistical tests for the main results.
Guidelines:
The answer NA means that the paper does not include experiments.
The authors should answer "Yes" if the results are accompanied by error bars, confi- dence intervals, or statistical significance tests, least for the experiments that support the main claims of the paper.
The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall with given experimental conditions).
20

---

The method for calculating the error bars should be explained (closed form formula, call a library function, bootstrap, etc.)
The assumptions made should be given (e.g., Normally distributed errors).
It should be clear whether the error bar is the standard deviation or the standard error of the mean.
is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have 96% CI, if the hypothesis of Normality errors is not verified.
For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that out of range (e.g. negative еттоr rates).
If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.
8. Experiments Compute Resources
For each experiment, does the paper provide sufficient information on the com- puter resources (type of compute workers, memory, time of exccution) needed to reproduce the experiments?
Question:
Answer: [Yes]
Justification:
We provide details for the computer resources in Section S2
Guidelines:
The answer NA means that the paper does include experiments.
The paper should indicate the type of compute workers CPU or GPU, internal cluster, cloud provider, including relevant memory and storage.
The paper should provide the amount of compute required for each of the individual experimental rums as well as estimate the total compute.
The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't It make it into the paper).
9. Code Of Ethics
Question: Does the research conducted the paper conform, in every respect, with the NeurlPS Code of Ethics http:///wwwrrpppcccpppppc///eeea
Answer: [Yes]
Justification: We reviewed the NeurIPS Code of Ethics and our work is in compliance. All experimental procedures involved in this work were conducted in accordance with the United States National Research Council's 's Guide for the Care and Use of Laboratory Animals, and were approved by the Institutional Animal Care and Use Committee of Carnegie Mellon University.
Guidelines:
The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.
If the authors answer No, they should explain the special circumstances that require deviation from the Code of Ethics.
The authors should make sure to preserve anonymity (e.g., there a special consid- eration due to laws or regulations in their jurisdictio)..
10. Broader Impacts
Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?
Answer: [Yes]
Justification: We discuss the potential socictal impacts in the first paragraph of the introduc- tion section.
Guidelines:
The answer NA means that there is no societal impact of the work performed.
21

---

If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact.
Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), faimess considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.
The conference expects that many papers will be foundational research and tied to particular applications, let alone deployments. However, if there is direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.
The authors should consider possible harms that could arise when the technology is being used intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional unintentional) misuse of the technology.
If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how system learns from feedback over time, improving the efficiency and accessibility of ML).
11. Safeguards
Does the paper describe safeguards that have been put in place for responsible release of data models that have high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?
Question:
Answer: [NA]
Justification: The data do not pose risk for release it was not acquired from human subjects and does not contain images or identifiable information.
Guidelines:
The answer NA means that the paper poses no such risks.
Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.
Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.
We recognize that providing effective safeguards is challenging. and many papers do not require this, but we encourage authors to take this into account and make best faith effort.
12. Licenses for existing assets
Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?
Answer: [Yes]
Justification:
We cite all assets used in this paper.
Guidelines:
The answer NA means that the paper does existing assets.
The authors should cite the original paper that produced the code package or dataset.
The authors should state which version of the asset used and, possible, include a URL.
The name of the license (e.g., CC-BY 4.0) should be included for each asset.
For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided.
22

---

If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswi thcode. com/dataseta
datasets.papersstt
has curated licenses for some datasets. Their licensing guide can help determine the license of dataset.
For existing datasets that are re-packaged, both the original license and the license of the derived asset (if has changed) should be provided.
this information is not available online, the authors are encouraged to reach out to the asset's s creators.
13. New Assets
Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?
Question:
Answer: [Yes]
Justification:
The methods section provides the detail necessary to reproduce the pro-
posed framework. We also provide code and sample data https//github.com//umiii san/MiSO.ga
Guidelines:
The answer NA means that the paper does release assets.
Researchers should communicate the details the dataset/code/model as part their submissions via structured templates. This includes details about training, license, limitations, etc.
The paper should discuss whether and how consent was obtained from people whose asset used.
At submission time, remember to anonymize your assets (if applicable). You can either create anonymized URL or include anonymized zip file.
14. Crowdsourcing and Research with Human Subjects
Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well details about compensation (if any)?
Answer: [NA]
Justification:
This paper does not involve crowdsourcing nor research with human subjects.
Guidelines:
The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.
Including this information the supplemental material is fine, but if the main contribu- tion of the paper involves human subjects, then as much detail as possible should be included the main paper.
According to the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.
15. Institutional Review Board (IRB) Approvals or Equivalent for Research with Human Subjects
Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?
Answer: [NA]
Justification:
This work did not involve human subjects
Guidelines:
The answer NA means that the paper does not involve crowdsoureing nor research with human subjects.
23

---

Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.
We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution.
For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.
24


Reviews:
[{"review_id": "ZZgIp68PJM", "reviewer": "Reviewer_Yfry", "summary": "The paper presents MiSO (MicroStimulation Optimization), a closed-loop framework designed to drive neural population activity towards specified states by optimizing stimulation parameters over a large parameter space. MiSO addresses the challenge of the large search space by: latent space alignment and a convolutional neural network (CNN) to predict brain responses to unseen stimulation parameters.", "questions": "- L 98: How does MISO identify a reference latent subspace?\n\n- How sensitive is this method to the choice of latent space alignment?\n\n- Other latent space alignment methods such as canonical correlation analyses (CCA), manifold alignment, etc. exist which may be more relevant to integrate data from different sources(e.g., electrodes). Why do the authors use the particular method?\n\n- Model comparisons were done only among MLP, Gaussian Process and Convnets, why not others, e.g., classical ML methods as well as other sequence modeling ones like LSTMN, GRU? \n\n- Is there any time-delay embedding on the inputs?\n\n- What is the computational complexity of the overall method? How does it scale with the number of electrodes? \n\n- How robust are the CNN predictions to variability in neural responses or to potential noise in the data?\n\n- How does the performance of MiSO degrade with increasing complexity of the parameter space or neural dynamics?\n\n- What are the potential impacts of recording instabilities on the latent space alignment and subsequent model predictions?\n\n- Providing a broader outlook and connecting its concepts to other similar areas and discussing its impact would be desirable. For, e.g., in the context of FES, the goal would be to map stimulation parameters to muscle responses rather than neural population activity. \n\n- Please mention the limitations of the work more clearly", "limitations": "Limitations are not stated properly", "rating": 5, "confidence": 3, "soundness": 2, "presentation": 3, "contribution": 2, "strengths": "- Leveraging latent space alignment to address the challenge of a large subspace is an interesting approach. \n- Experimental evaluation on a primate subject enhances credibility to application of the approach in the real world.\n- The paper is structured well.", "weaknesses": "- The work is preliminary with limited subjects, baselines, model comparisons, and latent space alignment methods\n- The applicability is tested on very less data and only on one primate subject, over 5 sessions, hence it is hard to gauge the effectiveness.\n- Baselines are very less and simple.\n- Latent space alignment method chosen is a classical Procrustes method, choice behind this not explained\n- The applicability of this method looks to be in a very specialized field. The broader impact or directions, even in other stimulation protocols, like functional electrical stimulation (FES) in which this method could be applied is not explained. The paper claims to have a social impact, however, the effort in identifying the social impact outside the experimented area is not visible.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "> **Weaknesses**\n\n> - The work is preliminary with limited subjects, baselines, …\n> - The applicability is tested on very less data and …\n\n　The reviewer is correct that we report the results from 5 closed-loop sessions in Fig. 2B. However, this is only a small subset of the data collected for this manuscript. In total, 11 sessions of data were required for Fig. 2B (1 to identify the reference latent space, 5 to calculate the average prediction, and then the 5 shown) and 15 sessions were required for Fig. 4B. In total, 26 sessions of data collection directly informed the results presented here, and hundreds of experimental sessions recorded across 3 different subjects were involved in building the framework and initial analyses for this project.  \n　For model comparisons and latent space alignment method, please see the General Response to Reviewers, “Framework design. 1 and 2.\"\n\n> - Baselines are very less and simple.\n\n　Given the limited number of trials we can carry out each day (~300-500 uStim trials and ~100 no-uStim trials) due to the animals’ satiation, we had to limit the number of baselines to meaningfully compare each approach. Thus, we selected the two baseline (no-uStim and random uStim) comparisons we believed were the most critical for the assessment of MiSO.  \n　The no-uStim baseline is essential to assess that our stimulation method is effective and modulates the brain beyond natural brain activity fluctuations. Furthermore, including no-uStim trials helped to minimize the likelihood of tissue damage due to repeated stimulation. The random uStim baseline was essential to evaluate that our uStim pattern selection algorithm performed better than a random selection. We will test other baselines in future work.\n\n> - Latent space alignment method chosen is a classical Procrustes method, …\n\n　Please see the General Response to Reviewers, “Framework design. 1.\"\n\n> - The applicability of this method looks to be in a very specialized field. …\n> - Providing a broader outlook and connecting its concepts to other similar areas…\n\n　The general framework of MiSO can be utilized with other stimulation modalities such as optogenetics, non-invasive brain stimulation methods, and even peripheral nerve stimulation methods such as FES. For example, FES is a technique used to stimulate nerves and muscles to help restore muscle function. This stimulation technique could be paired with MEG recordings to set specific activation targets for groups of muscles. With MiSO, we could specify such targets and then find the electrodes needed to be stimulated to generate the specified patterns of muscle activation.\n\n> **Questions**\n\n> - L 98: How does MISO identify a reference latent subspace?\n\n　To identify a reference latent subspace, we run one session only with no uStim trials. We collected this dataset to capture the natural covariance structure in the population activity with as many trials as possible (on the contrary, in a typical uStim session, only about 20% of trials were no uStim trials). With this dataset, MiSO used the FA method introduced in Section 2.2 to identify a reference latent subspace. \n\n> - How sensitive is this method to the choice of latent space alignment?\n> - Other latent space alignment methods such as canonical correlation analyses (CCA), …\n> - Model comparisons were done only among MLP, Gaussian Process and Convnets, …\n\n　Please see the General Response to Reviewers, “Framework design. 1 and 2.\"\n\n> - Is there any time-delay embedding on the inputs?\n\n　No, there is no time-delay embedding. With the reported CNN model, we did not take into account the temporal component of the input as well as the evolution of population activity. However, it is a promising direction we are interested in exploring in the future to improve the prediction performance. \n\n> - What is the computational complexity of the overall method? How does it scale with the number of electrodes?\n\n　Please see the General Response to Reviewers, “Scalability of MiSO.\"\n\n> - How robust are the CNN predictions to variability in neural responses or to potential noise in the data?\n\n　The CNN model is sensitive to the training data used and the training process. This is why we decided to use a bagging approach to stabilize the model training.  \n　Also, due to changes in the neural activity produced by the same uStim parameters across sessions, the CNN prediction needs to be adjusted during the closed-loop session. This is where the online closed-loop framework becomes crucial. The epsilon greedy algorithm prioritizes the CNN predicted uStim patterns first. But if they do not produce the target activity patterns, it quickly switches to different uStim patterns.\n\n> - How does the performance of MiSO degrade with increasing complexity of the parameter space or neural dynamics?\n\n　Please see the General Response to Reviewers, “Scalability of MiSO.\"\n\n> - What are the potential impacts of recording instabilities on the latent space alignment and subsequent model predictions?\n\n　The latent space alignment method we used in MiSO is stable under various types of recording instabilities. In the original paper (Ref 16), the authors reported that the performance of BCI decoding with the Procrustes method was stable under recording instabilities such as tuning changes, drop-outs or baseline shifts. We observed similar results in our dataset. The top row of Fig. S1 shows the baseline firing rate shift in uStim induced activity. However, the baseline shift across days was resolved by aligning the latent space. The bottom four rows have similar color scales horizontally, demonstrating the stability across sessions produced by the latent space alignment.\n\n> - Please mention the limitations of the work more clearly\n\n　Please see the General Response to Reviewers, “Limitation of MiSO.\"", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "mNCG9kkLm4", "reviewer": "Reviewer_C2zx", "summary": "In this work, the authors propose MiSO (Microstimulation Optimization), a closed-loop stimulation framework designed to optimally generate microstimulation patterns to drive neural activity towards target states. The use of many electrodes for stimulation presents a challenge due to the curse of dimensionality, leading to an exponential increase in the number of searchable patterns. The authors address this issue with two novel contributions: \n\n1. They use  latent space alignment method to concatenate data across recording days, taking into account the drift in neural states and aligning the neural activity of subsequent days to a reference day.\n\n2. They test multiple neural network architectures, including Multi-Layer Perceptrons(MLP), Gaussian Processes (GP), and Convolutional Neural Networks (CNN), to predict the effect of stimulation for unseen patterns. Additional experiments show that spatially close electrodes can produce similar neural patterns, and CNNs are particularly effective at capturing this feature. \n\nThe authors demonstrate that using MiSO with double electrode stimulation patterns can effectively drive neural activity towards the target state.", "questions": "1. The current paper reports only the L1 error as a metric for convergence. However, the speed of convergence is an important factor in evaluating an algorithm's success. Specifically, from Figure 4B, it is unclear when MiSO with double electrodes achieves convergence close to the target. Can authors show how fast each of the algorithms converge to target?\n\n2. The authors should include an example of a neural target pattern in Figure 4. Similar to Fig S1, a visual representation of target activity is important. \n\n3. Did the authors attempt to show visual stimuli to the monkey and recreate the response pattern using MiSO? If such data exists, it would be beneficial to include it.\n\n4. What are the theoretical limits of control in this setting? Specifically, what is the maximum effective dimensionality of control that can be achieved using 96 channels of stimulation? As shown in Figure 3, the spatial distance affects the pattern differences.\n\n5. What is the limitation of this system to massive state fluctuations of the brain? Can their linear Subspace alignment method capture that or they require a refit? Moreover, when do they decide to refit the CNN or add the current trials to it?", "limitations": "In its current form, it is unclear how this system can advance the state of the art in BCI systems. The authors should discuss the challenges they face when increasing the number of channels. Additionally, given the small current of 25 µA used here, how do the authors think they can induce behavioral changes, especially since FEF saccades typically require currents around 50 µA? Lastly, if they increase the number of stimulation electrodes, what are the potential implications for tissue damage?", "rating": 7, "confidence": 5, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "This is a well-written manuscript with interesting results. The authors tackle a significant challenge in the field of brain-computer interfaces (BCI): how to guide a population of neural activity towards a target neural state using large number of stimulation patterns. The use of a subspace alignment method is particularly noteworthy, as it enables the utilization of data across different days, which is crucial given the experimental and clinical limitations. Although the implementation of neural networks to predict the effect of stimulation in a closed-loop system has been proposed before (Rao, Current Opinion in Neurobiology 2019), and a similar methods have been used in mice (Ref 19) and  non-human primates (NHPs,Ref 20) to my knowledge, this is the first work that applies subspace alignment and CNNs in a closed loop system in NHPs.", "weaknesses": "1. It is unclear why the authors do not fully integrate the CNN into the closed-loop system. From my understanding, the CNN generates predictions expected to produce unique responses to stimulation for unseen patterns. These patterns (Zp) are then used to find the optimal stimulation pattern. Another approach could be to solve the inverse of the CNN to identify the best input pattern that generates the target output pattern(e.g. Bashivan et al, Science, 2019), thus fully integrating the CNN into the closed loop. In the current setup, the CNN is only trained and tested once at the beginning, with the epsilon-greedy algorithm taking over—a method already explored in Ref 19. Can authors discuss why they have chosen this framework?  \n\n2. As mentioned in the discussion, the system is only tested with up to two electrodes at a time, significantly limiting the number of possible patterns to around 4,000. This problem size does not necessarily require a CNN to solve; previous methods, such as in reference 19, have used a larger number of electrodes without CNNs. The authors should discuss how they plan to scale this approach to a higher number of electrodes and the experimental and theoretical challenges involved.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "> **Weaknesses**\n\n> 1. It is unclear why the authors do not fully integrate the CNN into the closed-loop system…\n\n　Please see the General Response to Reviewers, “Framework design. 3.\"\n\n> 2. As mentioned in the discussion, the system is only tested with up to two electrodes…\n\n　Please see the General Response to Reviewers, “Scalability of MiSO\"\n\n> **Questions**\n\n> 1. The current paper reports only the L1 error as a metric for convergence. However, …\n\n　The reviewer is right that the speed of convergence is another important performance measure. MiSO with double electrode stimulation converged around the target activity (a red circle in Fig. R1A of the attached pdf file) in 12.3 trials on average (10, 17, and 10 trials for each session). We did not compute the same measure for MiSO with single electrode stimulation because some targets were intentionally set to be unreachable (cf. Fig. 4A) and therefore the algorithm did not converge.  \n　Note that the convergence to a certain uStim pattern does not necessarily mean good performance. The uStim pattern which was initially best and achieved the target may not achieve the same performance later in the session, for example, due to changes in the uStim effect after repeated stimulation. Thus, the convergence measure we report here is based on the convergence to the target activity pattern rather than the convergence to a specific uStim pattern.\n\n\n> 2. The authors should include an example of a neural target pattern in Figure 4…\n\n　We included a visual representation of neural target activity in the pdf file attached in the general rebuttal section (Fig. R1B). The neural activity shown in the figure is based on the firing activity of neurons during no uStim trials, which can be projected onto the latent target activity space to obtain the latent target value shown in Fig. 4A.\n\n> 3. Did the authors attempt to show visual stimuli to the monkey and...\n\n　This is a great idea.  In fact, this is a key motivation for why we developed MiSO, and our next step. We plan to define our target activity as a pattern related to a certain brain process and achieve that target with MiSO. \n\n> 4. What are the theoretical limits of control in this setting? Specifically, what is …\n\n　The maximum effective dimensionality of control achieved with single electrode uStim was around 5 (Fig. R1C). As we reported in the paper, double electrode uStim produced novel activity (i.e., activity not produced by single electrode uStim), thereby likely increasing the effective dimensionality of control.\n\n> 5. What is the limitation of this system to massive state fluctuations of the brain? Can their…\n\n　Please see the General Response to Reviewers, “Limitation of MiSO. 2.\"\n\n> **Limitations**\n\n> In its current form, it is unclear how this system can advance the state of the art in BCI systems. …\n\n　The reviewer is right that currents above 50uA typically produce saccades in FEF, a brain region immediately adjacent to our array implants. While inducing a monkey’s movement by customizing a stimulation pattern would be an interesting application, we would like to highlight that our ultimate goal is to influence the cognitive state of the animal without overtly driving behavior. Our uStim current range was designed to achieve this. Moore & Armstrong, Nature 2003 induced attentional modulation with FEF uStim by using the range of current we used in this paper. We believe that relatively lower current has the potential to induce diverse behavioral or brain state modulation without directly causing movement.  \n　When using multiple electrodes, we carefully controlled the total current within a safe range (less than 50uA in our experiment) so as to not damage tissue. If the total current remains low, splitting it among more electrodes would not lead to damage (and in fact reduces peak current at any electrode). If the total current is allowed to increase with the number of stimulation electrodes, one way to minimize the potential for damage would be to restrict stimulation on adjacent electrodes (separated by 400 microns) to reduce the peak current at any spatial location and minimize the potential for damage.", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "rZTYYm4WUQ", "reviewer": "Reviewer_5hk3", "summary": "The authors proposed a framework for closed-loop brain stimulation to optimize the search of parameters in order to guide the measured brain responses towards certain predefined states. The proposed work is built on two blocks with the first one in charge of conducting latent space alignment to combine data sets acquired from different sessions. The second block is aimed at performing predictions on the brain responses by using a convolutional neural network.", "questions": "-Could the authors justify the innovations given that 1) conducting latent space alignment and, 2) using a CNN to predict the effects of stimulation parameter combination have been already reported in the literature?\n-It is not clear why 4,500 uStim configurations. Could the authors clarify the figure?\n-The multi-session need mentioned is not supported with evidence. Why longer sessions cannot alleviate the problem?\n-Are there any parameter combinations irrelevant? If not, support why each of the possible 4,500 configurations is relevant and their effects mutually exclusive.", "limitations": "-It is not clear the situations in which the proposed method will fail. The deceptive scenarios in the search space are not mentioned. \n-There are no examples or further information about the massive number of stimulation configurations or the extent of them that might have redundant effects.", "rating": 6, "confidence": 4, "soundness": 2, "presentation": 2, "contribution": 3, "strengths": "-A novel method for applying latent space alignment to merge neural activity across sessions in the field of brain stimulation.\n-In terms of reproducibility, the implementation aspects are well-detailed in the manuscript, except for the source code which was not included.", "weaknesses": "- The stimulation parameters have a large search space that is not defined.\n- The modality to measure brain responses is not specified, and its variability will pose related but different challenges.\n- The limitations are weakly addressed, and it's not clear in which situations the proposed method will fail. \n- The deceptive scenarios in the search space are not mentioned.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "> **Weaknesses**\n\n> - The stimulation parameters have a large search space that is not defined.\n\n　In this work, a large search space means a combination of multiple electrodes among 96 electrodes. We can use any combination of 96 electrodes in theory. The number of possible stimulation patterns (i.e., the size of the search space) increases exponentially with the number of electrodes used in uStim.  \n　In general, a large search space in brain stimulation includes the combination of other uStim parameters. Examples include current amplitude, frequency, duration, waveform (temporal patterns), and timing of stimulation. The combination of these parameters creates a large search space, which requires a strategic method to perform optimization. \n\n> - The modality to measure brain responses is not specified, and its variability will pose related but different challenges.\n\n　We used electrophysiology recordings obtained from a chronically-implanted 96 electrode Utah array. Because the array was implanted 3 months before these experiments were conducted (and therefore had enough time to stabilize), our recorded signals were quite stable from one day to the next.  Thus, the variability in recorded neural activity was in the range that our alignment and closed-loop framework could handle. \n\n> - The limitations are weakly addressed, and it's not clear in which situations the proposed method will fail.\n\n　Please see the General Response to Reviewers, “Limitation of MiSO.\"\n\n> - The deceptive scenarios in the search space are not mentioned.\n\n　Our CNN utilizes the spatial smoothness of the uStim effect over the multi-electrode array (a 10x10 grid of electrodes). Thus, one deceptive scenario in the search space is when there is no spatial structure in the data.  \n　To illustrate this, we created the deceptive scenario by shuffling the spatial location of the electrodes (Fig. R2A: original neural activity dataset, Fig. R2B: shuffled dataset). The CNN model trained on the deceptive dataset resulted in poor generalization performance compared to the CNN trained on the original dataset (Fig. R2C). Because of the smoothness assumption of the CNN model, when holding out electrodes from the training data, the model trained with the deceptive scenarios expects to see the smoothness over the array space and fails to produce predictions with no spatial patterns. However, as shown in the paper, our data does not support the deceptive scenario and the CNN model generalized well to untested patterns.\n\n> **Questions**\n\n> - Could the authors justify the innovations given that 1) conducting latent space alignment and, 2) using a CNN to predict the effects of stimulation parameter combination have been already reported in the literature? \n\n　To our knowledge, this is the first study combining latent space alignment and a CNN model in the field of brain stimulation. While latent space alignment has been largely studied in the field of BCIs, to our knowledge, it has not been used for brain stimulation. We believe that the application of latent space alignment in brain stimulation enables the training of a large neural network model, creating novel approaches to advance the field of brain stimulation.\n\n> - It is not clear why 4,500 uStim configurations. Could the authors clarify the figure? \n\n　The number 4,560 uStim configurations was calculated as “96 choose 2” (i.e., choose 2 among 96 electrodes). \n\n> - Are there any parameter combinations irrelevant? If not, support why each of the possible 4,560 configurations is relevant and their effects mutually exclusive.\n\n　The 4,560 configurations are not mutually exclusive. As we reported in Fig. 3B and C, there is a spatial relationship, i.e. nearby electrodes tend to produce a similar effect. Therefore, there are configurations that produce similar uStim effects. \n\n> - The multi-session need mentioned is not supported with evidence. Why longer sessions cannot alleviate the problem? \n\n　Multiple sessions are needed because of the limited number of trials we can carry out each day (~300-500 uStim trials and ~100 no-uStim trials) due to the animals’ satiation. This is a limitation widely shared by experimental labs performing experiments with behaving animals. Thus, we needed to integrate data across multiple sessions to have enough data to train a CNN model.", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}]

Author rebuttal:
We thank the reviewers for their constructive comments, which helped strengthen our submission. Here, we respond to comments shared by multiple reviewers.

## Limitation of MiSO

All reviewers inquired about the limitations of MiSO. We explain two main limitations of MiSO and how we can potentially address them.

1. **MiSO does not take into account trial-to-trial variance in uStim induced activity.**  
　The CNN model predicts the *average* induced activity by each uStim pattern. However, there is substantial trial-to-trial variance in the induced activity, which our model does not take into account. This limits the prediction performance of the model, thereby affecting the performance of MiSO.  
　One potential solution is to take into account the trial-to-trial variation of the neural activity before stimulation, which can be informative about the trial-to-trial variation of the neural activity after stimulation. This can be done using a dynamical model of the neural population activity with the uStim as inputs. 

2. **MiSO is susceptible to uncontrolled drifts in neural recordings across days.**  
　MiSO defines a reference latent space using one session and uses the same latent space throughout multiple later sessions without recalibration. Its performance could decline as the neural activity drifts across days and becomes difficult to align to the reference latent space.  
　Our alignment method is designed to overcome recording instabilities, allowing MiSO to perform well over several weeks. For Fig. 2, our latent space alignment worked even though the data collection involved a 3-4 week gap between sessions. With even longer periods of time, a recalibration of the reference latent space and update of the CNN prediction may be needed to maintain stable performance.

## Scalability of MiSO

Yfry and C2zx asked about the scalability and computational complexity of MiSO. Here we focus on the two main components of MiSO: the CNN model and the epsilon greedy algorithm.

1. **The CNN model scales up well by leveraging the spatial structure in the uStim effect.**  
　The CNN trained on single and double electrode patterns predicted the effect of untested patterns by leveraging the spatial structure of the uStim effect over the multi-electrode array (a 10x10 grid of electrodes). uStim patterns involving an even larger number of electrodes are likely to also possess spatial structure. This can be leveraged in the same way by the CNN model for generalization, making it scalable to more complex multi-electrode stimulation patterns. 

2. **The epsilon greedy algorithm takes a longer time to converge as the search space expands.**  
　Updates with the epsilon greedy algorithm happen only for online tested uStim patterns. As the total number of possible uStim patterns increases, the time necessary to update the uStim effect of all patterns increases.  
　One potential approach is to remove “redundant” patterns that produce similar CNN predictions and run the closed-loop algorithm with a reduced number of patterns. Another potential approach is to update the weights of the last linear layer of the CNN model online using the recorded online data. This procedure is computationally cheap and can update the predictions of both tested and untested uStim patterns.

## Framework design

We appreciate Yfry and C2zx suggesting alternate (and entirely valid) design choices for MiSO.  We’ll take the opportunity to explain the rationale behind the current MiSO design. 

1. **Latent space alignment with the Procrustes method**  
　Yfry suggested other alignment methods such as canonical correlation analysis (CCA), manifold alignment, etc. We chose the FA+Procrustes method because it is simple (i.e. suitable for fast online computations) and has been shown to work well in BCI applications (Ref 16). Other methods may be more computationally expensive or less established in this domain, except CCA (Gallego JA, et al., 2020). However, CCA is not a natural choice in the context of MiSO because there are not matched observations across days (i.e., trial 1 on day 1 does not necessarily correspond with trial 1 on day 2). 

2. **uStim effect prediction with CNN**  
　Yfry asked about the performance of other models such as classical ML methods and sequence models. Through initial analysis, we identified spatial structure in the uStim effect over the multi-electrode array. Thus, in this project, we focused on models that can be designed to capture the spatial structure present in the data, in particular, GP and CNN.  
　We are also interested in extending this model to predict the temporal dynamics of neural activity. On top of the spatial structure, the CNN model has the potential to be extended along the temporal axis. When assessing this direction, the performance comparison with other sequence models such as LSTM and GRU will be especially fruitful. 

3. **Closed-loop algorithm with epsilon greedy algorithm**  
　C2zx suggested fully integrating the CNN in the closed-loop procedure. We did not choose this approach because of the necessity of a fast online update to compensate for activity fluctuations during the closed-loop session.  
　The effect of the same uStim pattern can change across sessions, and thus the CNN prediction needs to be adjusted during a given closed-loop session. This requires a fast online update process like an epsilon greedy algorithm that refines the CNN prediction to match it to the uStim effects observed during the closed-loop session. Alternatively, one can update the CNN model and invert it at each iteration, but the associated computations cannot currently be performed fast enough for the closed-loop experiment. Eventually, we would like to have the CNN model fully integrated with the online system, but more work is needed to achieve a fast and reliable online integration.

Meta-review: A reviewer recommends Borderline Accept, another reviewer recommends Weak Accept and a third reviewer recommends Accept. After reading the reviews and the rebuttal, I don't find major issues in the reviews that prevent acceptance. I believe the authors have clarified and explained the extension of the experimental evaluation, which was a weakness mentioned by the reviewer recommending Borderline Accept. Therefore, I recommend Accept.
Decision: Accept (poster)