DOI: 10.5061/dryad.4xgxd25hw
title: Data from: Movement-responsive deep brain stimulation for Parkinson’s Disease using a remotely optimized neural decoder

description: Deep brain stimulation (DBS) has garnered widespread use as an effective
 treatment for advanced Parkinson's Disease (PD). Conventional DBS
 (cDBS) provides electrical stimulation to the basal ganglia at fixed
 amplitude and frequency, yet patients’ therapeutic needs are often dynamic
 with residual symptom fluctuations or side-effects. Adaptive DBS (aDBS) is
 an emerging technology that modulates stimulation with respect to
 real-time clinical, physiological, or behavioral states, enabling therapy
 to dynamically align with patient-specific symptoms. Here, we report an
 aDBS algorithm intended to mitigate movement slowness by delivering
 targeted stimulation increases during movement using decoded motor signals
 from the brain. Our approach demonstrated improvements in dominant hand
 movement speeds and patient-reported therapeutic efficacy compared to an
 inverted control, as well as increased typing speed and reduced dyskinesia
 compared to cDBS. Furthermore, we demonstrate proof-of-principle of a
 machine learning pipeline capable of remotely optimizing aDBS parameters
 in a home setting. This work illustrates the potential of
 movement-responsive aDBS as a promising therapeutic approach and
 highlights how machine learning assisted programming can simplify complex
 optimization to facilitate translational scalability.
description: <strong>Neural data sensing configuration and signal
 processing</strong> All neural recordings were
 performed during monopolar stimulation. Bipolar recordings in the STN were
 collected using a “sandwich” configuration (electrodes on either side of
 the stimulating contact) for common-mode rejection of the stimulation
 artifact. Two channels of neural data were recorded along the ECoG array,
 using the first and second electrodes for one channel (postcentral gyrus)
 and the third and fourth electrodes for the other (precentral gyrus).
 Neural time-domain data were recorded at a sampling rate of 500Hz.
 Device-embedded signal processing consisted of short-time Fourier
 transforms (STFT) with an FFT size of 256 pt and an interval of 50
 ms.  <strong>Behavioral data streaming, signal
 processing, and synchronization</strong> Detailed
 descriptions of the behavioral data collection platform can be found in
 Strandquist et al., 2023. Briefly, arm movement data were collected using
 Apple Watches (Apple, Inc) worn on each wrist and uploaded to a remotely
 accessible third-party data repository (Rune Labs, Inc.). These data were
 sampled at 50 Hz, and power was calculated using STFT with an FFT size of
 64 pt and interval of 100 ms. Power was calculated in the 0-5 Hz range for
 movement decoding, 1-4 Hz for quantifying dyskinesia (40), and 4-7 Hz for
 quantifying tremor (41). Increased power in the 4-7 Hz band of the
 accelerometry signals was previously found to indicate tremor for this
 participant when receiving low stimulation (data not shown). Video data
 for participant observation and kinematic pose estimation were recorded on
 three cameras arranged at varied angles in the participant’s home office.
 A custom keylogging application was built to provide statistics regarding
 typing performance without compromising privacy by removing the letter
 identity of each keypress. This application was deployed on the
 participant’s home office computer with patient knowledge and consent. All
 data was securely transferred to remotely accessible databases over a
 virtual private network (VPN). To overcome drift and time discrepancies
 across system clocks and align the data streams, a synchronization event
 was performed at the start of all recordings. The participant tapped each
 side of their chest over the implanted neurostimulator while standing in
 view of the cameras. This movement created identifiable spikes in the
 neurostimulator and Apple Watch accelerometry signals and could be
 discerned on the video, allowing realignment of all data to a common
 time. <strong>Data collection
 protocols</strong> Three different datasets were
 collected remotely for this study. For identifying personalized power band
 candidates, a single two hour session of free behavior was collected
 during monopolar stimulation at 1.6 mA. The participant was instructed to
 go about their regular daily routine while occasionally taking breaks to
 perform hand open-close movements and rest their hands on their lap. Since
 this dataset was only used to identify the most prominent components of
 the neural signals through PCA, there were not firm constraints on the
 participant’s actions during data collection other than ensuring that
 there were periods of both movement and non-movement. Separate datasets
 were used for identifying the personalized power bands and evaluating
 their use in decoding movement to ensure that we avoided any risk of
 overfitting and represented generalizable performance.
 A second dataset was collected for optimizing the movement
 classifier and performing feature selection from the identified power band
 candidates. This dataset included six days of data where the participant
 performed a prescribed set of motor tasks at three different levels of
 monopolar stimulation (1.2 mA, 2.4 mA, 2.6 mA). Each day consisted of
 approximately 25 minutes of total recording time. The participant was
 given an instruction sheet with the list of motor tasks, which included
 standardized movement tasks from the Unified Parkinson’s Disease Rating
 Scale Part III (UPDRS; sections 3.17-3.18 rest tremor, 3.4 finger tapping,
 3.5 hand movements - open-close, 3.6 hand movements -
 pronation-supination) as well as blocks of text for typing that were each
 approximately 100 words long (Figure 2A,B). The participant was a
 proficient typer prior to beginning the study. For
 evaluating the movement responsive aDBS algorithm, 12 days of data were
 collected while the participant performed a similar set of tasks in three
 different stimulation conditions (Movement Responsive, Inverted,
 Constant). Constant stimulation was delivered at 1.9mA, while Movement
 Responsive and Inverted stim toggled between 1.6mA and 2.2mA. The order in
 which the conditions were performed in each session was pseudorandomized
 in balanced fashion and was included as a covariate in all
 across-condition statistical testing. Each day again consisted of
 approximately 25 minutes of total recording time. The open-close hand
 movements (UPDRS section 3.5) from the initial six-day dataset were
 replaced with finger-to-nose movements (repeatedly extending arm out in
 front, then bending at elbow to touch nose), and no movements of the lower
 body were performed. All movements were instructed to last 20 seconds, and
 the rest phase 10 seconds.<br><br>
 <strong>Human subject informed
 consent</strong> The study participant
 acknowledged in the associated manuscript provided written informed
 consent prior to participating in the study, and provided additional
 written informed consent consenting to acknowledgement in the manuscript
 prior to publication.
description: # Data from: Movement-responsive deep brain stimulation for Parkinson’s
 Disease using a remotely optimized neural decoder
 [https://doi.org/10.5061/dryad.4xgxd25hw](https://doi.org/10.5061/dryad.4xgxd25hw) This dataset contains all necessary data for recreating the analyses performed in the manuscript "Movement-responsive deep brain stimulation for Parkinson's Disease using a remotely optimized neural decoder" ## Description of the data and file structure Study data are separated into folders corresponding to each figure. All data for producing the respective figure and associated analyses are contained in that folder. All data are contained in CSV files that may be read into python as dataframes using the *pandas* library or numpy arrays using the *numpy* library. Below is a full list of the files with thorough descriptions of their contents: 1. fig2b_neural_left.csv, fig2b_neural_right.csv - example neural data corresponding to left and right brain hemispheres. Columns: `time` (timestamp, in sec), `beta` (precentral beta power, a.u.), `gamma` (precentral gamma power, a.u.) 2. fig2b_watch_left.csv, fig2b_watch_right.csv - example wrist acceleration corresponding to left and right wrist accelerometers. Columns: `time` (timestamp, in sec), `acceleration` (acceleration magnitude, in g) 3. fig3c_pc_weights.csv - weight vectors for all principal components. Columns: `frequency` (fft frequency bins, in hz), `[left/right]_[stn/postc/prec]_[pc0/pc1/pc2/pc3]` (principal component weights across the frequency spectrum for each respective [hand, brain region, PC#] combination) 4. fig3d_band_edges.csv - extracted power band edges for all candidate power bands. Columns: `canonical[0/1/2/3]` (4 canonical power bands), `[left/right]_[stn/postc/prec]_[pc0/pc1/pc2/pc3]` (principal components for each respective [hand, brain region, PC#] combination). Rows: lower frequency bound, upper frequency bound 5. fig3ef_left_hem_canonical.csv, fig3ef_left_hem_personalized.csv, fig3ef_right_hem_canonical.csv, fig3ef_right_hem_personalized.csv - optimized model parameters and performance outcomes for all models within each candidate pool. Columns: `pb` (power bands used in the model, formatted as [brain region 0-STN 1-PostC 2PreC, [band edges]]), `weights` (linear combination weights applied to the power bands), `update_rate` (update rate parameter), `lag` (lag parameter), `output_mean` (mean of the continuous output), `threshold_demeaned` (threshold parameter, expressed demeaned), `onset` (onset parameter), `termination` (termination parameter), `f1` (f1 score during optimization), `f1_test` (f1 score on held-out test data), `accuracy_test` (accuracy on held-out test data). Rows: individual models 6. fig4a_left_accel_pred.csv, fig4a_left_accel_true.csv, fig4a_left_accel_pred.csv, fig4a_left_accel_true.csv - example data, for each hand, true and offline predicted acceleration. Columns: `time` (timestamp, in sec), `acceleration` (acceleration magnitude, in g, true or predicted depending on file name) 7. fig4a_left_state.csv, fig4a_right_state.csv - example data, for each hand, true and offline predicted movement states. Columns: `time` (timestamp, in sec), `true_state` (true movement state, boolean 0-stationary 1-moving), `predicted_state` (predicted movement state, boolean 0-stationary 1-moving) 8. fig4b_conf_mat_left.csv, fig4b_conf_mat_right.csv - for the left and right hands, confusion matrices indicating offline model performance predicting movement state. Columns: `TP` (true positive counts, movement=positive), `FP` (false positive counts), `TN` (true negative counts), `FN` (false negative counts) 9. fig4c_left_accel_predict_move.csv, fig4c_left_accel_predict_stationary.csv, fig4c_right_accel_predict_move.csv, fig4c_right_accel_predict_stationary.csv - acceleration values (in g) for each hand, separated by when the model predicted movement or stationary. 10. fig4d_stim_x_state.csv - proportion of time predicted to be spent in the low or high stim states when running movement-responsive aDBS, simulated on the offline data. Columns: `[left/right]_[stat/move]` (values for the left or right hand when predicted movement state was stationary or moving). Rows: `low_stim` (proportion of time in the low stim state), `high_stim` (proportion of time in the high stim state) 11. fig5b_left_accel_pred.csv, fig5b_right_accel_pred.csv, - example data, for each hand, online predictions and algorithm outputs. Columns: `time` (timestamp, in sec), `acceleration` (predicted acceleration magnitude, in z-units), `state` (predicted movement state, boolean 0-stationary 1-moving), `stim` (stimulation amplitude, in mA) 12. fig5b_left_accel_true.csv, fig5b_right_accel_true.csv, - example data, for each hand, true movement data. Columns: `time` (timestamp, in sec), `acceleration` (true acceleration magnitude, in g), `state` (true movement state, boolean 0-stationary 1-moving) 13. fig5c_conf_mat_left.csv, fig5c_conf_mat_right.csv - for the left and right hands, confusion matrices indicating online model performance predicting movement state. Columns: `[movement_responsive/inverted/constant]_TP` (true positive counts for each stimulation condition, movement=positive), `[movement_responsive/inverted/constant]_FP` (false positive counts for each stimulation condition), `[movement_responsive/inverted/constant]_TN` (true negative counts for each stimulation condition), `[movement_responsive/inverted/constant]_FN` (false negative counts for each stimulation condition). Rows: individual data collection sessions 14. fig5d_latency_left_finger_tapping_left.csv, fig5d_latency_left_nose_tapping_left.csv, fig5d_latency_left_typing.csv, fig5d_latency_left_wrist_rotation_left.csv, fig5d_latency_right_finger_tapping_right.csv, fig5d_latency_right_nose_tapping_right.csv, fig5d_latency_right_typing.csv, fig5d_latency_right_wrist_rotation_right.csv - movement onset detection latencies for individual movements, with a different file corresponding to each combination of hand and movement type (in sec, positive values indicate movement preceded detection) 15. fig5e_stim_x_state.csv - proportion of time spent in the low or high stim states when running movement-responsive aDBS or the inverted control. Columns: `[left/right]_[stat/move]_[mr/inv]` (values for the left or right hand when the true movement state was stationary or moving). Rows: `low_stim` (proportion of time in the low stim state), `high_stim` (proportion of time in the high stim state) 16. fig6a_self_score.csv - subject-provided scores of each experimental block. Columns: `session_id` (session ID), `config` (stimulation condition, 1=movement-responsive 2=inverted 3=constant), `score` (subject-provided score, 0-10), `is_first` (indicates if the block was the first of the session, boolean), `is_second` (indicates if the block was the second of the session, boolean), `score_adj` (de-meaned score), `score_cov_adjusted` (covariate adjusted score following ANCOVA). Rows: individual data collection blocks 17. fig6b_f1.csv - f1 scores for each session. 18. fig6c_mean_stim.csv - mean stimulation amplitude for each session in the two adaptive conditions. Columns: `movement_responsive` (movement-responsive mean stimulation amplitude, in mA), `inverted` (inverted control mean stimulation amplitude, in mA) 19. fig6d_rep_rates.csv - repetition rates for nose tapping and wrist rotations in each session and block. Columns: `session_id` (session ID), `stim_condition` (stimulation condition, 1=movement-responsive 2=inverted 3=constant), `hand` (left or right hand, string), `is_first` (indicates if the block was the first of the session, boolean), `is_second` (indicates if the block was the second of the session, boolean), `nose_tap_rate` (nose tapping task rate, in Hz), `nose_tap_session_adj` (nose tapping task rate, in Hz, demeaned across sessions), `wrist_rot_rate` (wrist rotation task rate, in Hz), `wrist_rot_session_adj` (wrist rotation task rate, in Hz, demeaned across sessions). Rows: individual data collection blocks 20. fig6e_S3_dk_tremor.csv - dyskinesia and tremor measures in each session and block. Columns: `stim_condition` (stimulation condition, 1=movement-responsive 2=inverted 3=constant), `dk` (dyskinesia, 1-4Hz power), `tremor` (tremor, 4-7Hz power), `is_first` (indicates if the block was the first of the session, boolean), `is_second` (indicates if the block was the second of the session, boolean), `session_id` (session ID), `hand` (left or right hand, string). Rows: individual data collection blocks 21. fig7_typing.csv - typing measures in each session and block. Columns: `epoch` (order of performance, 0-2), `config` (stimulation condition, 1=movement-responsive 2=inverted 3=constant), `mean_duration_[left_alphanum/right_alphanum]` (mean keypress duration overall, on the left side of the keyboard, or the right side of the keyboard, in sec), `backspace_per_press` (backspace rate, backspace/keypress), `mean_typing_speed` (mean typing speed, keypresses/sec), `total_presses` (total keypresses), `total_time` (block duration), `session_id` (session ID), `is_first` (indicates if the block was the first of the session, boolean), `is_second` (indicates if the block was the second of the session, boolean), `kp_duration_session_adjusted` (mean keypress duration, demeaned across sessions), `speed_session_adjusted` (mean typing speed, demeaned across sessions), `bs_rate_session_adjusted` (backspace rate, demeaned across sessions). Rows: individual data collection blocks 22. S1_stability_df.csv - model performance for the movement-responsive algorithm as a function of days since training data were collected. Columns: `day_since_data_collection` (number of days since training data collection completed), `accuracy` (movement classifier accuracy), `f1` (movement classifier f1 score), `mean_stim` (mean stimulation amplitude, in mA). Rows: invididual data collection sessions ## Code/Software All machine learning and data analysis code is available on GitHub at [https://github.com/Weill-Neurohub-OPTiMaL/dixon-2025-move-adbs](https://github.com/Weill-Neurohub-OPTiMaL/dixon-2025-move-adbs). The *rcssim* package is available on GitHub at [https://github.com/Weill-Neurohub-OPTiMaL/rcs-simulation](https://github.com/Weill-Neurohub-OPTiMaL/rcs-simulation). ## Human subjects data The study participant provided written informed consent prior to participating in the study, and consented to release of data in the dataset and information in the associated manuscript. Explicit description of the dataset contents was communicated during the consent process. The dataset does not contain any personal identifiers. Only the processed data directly necessary for reproducing the figures and statistical analyses of the associated manuscript are included.