{'fraction_non_alphanumeric': 0.03079691828604938, 'fraction_numerical': 0.019938123066345823, 'mean_word_length': 5.160956770898219, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Acute effects of brain-responsive neurostimulation in drug-resistant partial onset epilepsy

OBJECTIVE
Understanding the acute effects of responsive stimulation (AERS) based on intracranial EEG (iEEG) recordings in ambulatory patients with drug-resistant partial epilepsy, and correlating these with changes in clinical seizure frequency, may help clinicians more efficiently optimize responsive stimulation settings.


METHODS
In patients implanted with the NeuroPace® RNS® System, acute changes in iEEG spectral power following active and sham stimulation periods were quantified and compared within individual iEEG channels. Additionally, acute stimulation-induced acute iEEG changes were compared within iEEG channels before and after patients experienced substantial reductions in clinical seizure frequency.


RESULTS
Responsive stimulation resulted in a 20.7% relative decrease in spectral power in the 2-4 second window following active stimulation, compared to sham stimulation. On several detection channels, the AERS features changed when clinical outcomes improved but were relatively stable otherwise. AERS change direction associated with clinical improvement was generally consistent within detection channels.


CONCLUSIONS
In this retrospective analysis, patients with drug-resistant partial epilepsy treated with direct brain-responsive neurostimulation showed an acute stimulation related reduction in iEEG spectral power that was associated with reductions in clinical seizure frequency.


SIGNIFICANCE
Identifying favorable stimulation related changes in iEEG activity could help physicians to more rapidly optimize stimulation settings for each patient.


Introduction
Direct brain-responsive neurostimulation is a treatment option for patients with drug-resistant partial epilepsy (Morrell and RNS System in Epilepsy Study Group, 2011;Nair and Morrell, 2018). A closed loop direct brain-responsive neurostimulation device (RNS Ò System) provides targeted stimulation to one or two seizure onset regions in response to detection of abnormal electrographic activity. Safety and effectiveness were demonstrated in a prospective randomized double-blinded sham stimulation controlled pivotal trial (Bergey et al., 2015;Heck et al., 2014;Morrell and RNS System in Epilepsy Study Group, 2011), as well as open-label prospective studies, with a 75% median seizure frequency reduction at 9 years of treatment (Nair and Morrell, 2018). Stimulation settings were selected empirically in these trials, usually replicating parameters found successful for thalamic stimulation for treatment of movement disorders. Whether this stimulation approach is the best for any or all patients is not known.
Responsive stimulation reduces seizures acutely, with continued clinical improvement over time in a significant majority of patients, suggesting there are acute (within seconds after stimulation) as well as longer-term effects (Desai et al., 2019;Kossoff, 2004;Heck et al., 2014). Prior studies suggest that the acute effects of neurostimulation are related to neuronal desynchronization. In 1954, Penfield and Jasper observed that in some cases focal electrical stimulation could depress ongoing electrical activity of the cortex at that site, which they called Extinction. They also reported that normal and epileptiform activity could be suppressed together, both locally and at a distance from the stimulated site, and noted that this could be associated with a sensation similar to a spontaneous seizure (Penfield and Jasper, 1954). These findings have been replicated and advanced by other groups (Lesser et al., 1999;Motamedi et al., 2002;Kossoff, 2004). A previous study from our group quantified the acute effects of high frequency (>100 Hz) responsive stimulation after detection of epileptiform activity and found that phase synchrony in the 35-100 Hz range was significantly reduced for 1 to 2 seconds (Sohal and Sun, 2011). Other studies have used non-human models to examine the effects of responsive stimulation on brain activity. Psatta et al. (1983) applied electrical stimulation to interictal spikes in the caudate nucleus of epileptic cats and observed spike depression (Psatta, 1983). Wagenaar et al. (2005) showed that responsive stimulation of high density neuronal cultures completely stopped culture-wide bursting events similar to electrographic seizures (Wagenaar et al., 2005).
Overall, these findings suggest that responsive stimulation may have an acute suppressive effect on abnormal neural activity. A large intracranial EEG (iEEG) data set from ambulatory adults with partial epilepsy treated with direct brain-responsive neurostimulation provides the opportunity to examine the acute electrographic effects of responsive stimulation (AERS) and to assess whether specific electrographic changes correlate with a favorable clinical response. This information could simplify navigation through a large space of potential stimulation settings to efficiently optimize clinical results.

Materials and methods
All analyses were performed on intracranial EEG (iEEG) and clinical seizure data captured from a subset of the 256 patients (n = 70 total patients; 35 in analysis 1 and 35 in analysis 2; see below) who participated in the RNS System clinical trials (Neuro-Pace, Inc.) (Morrell and RNS System in Epilepsy Study Group, 2011;Bergey et al., 2015;Nair and Morrell, 2018). All study protocols were approved by the Food and Drug Administration (FDA) and the institutional review boards of participating investigation sites. The patients were not considered to be surgery candidates by expert physicians. All subjects gave written informed consent. The RNS System clinical trials are registered on www.clinicaltrials .gov (NCT00079781, NCT00264810, NCT00572195).
Details about the RNS System are available in previous publications (Morrell and RNS System in Epilepsy Study Group, 2011;Bergey et al., 2015;Heck et al., 2014;Sun et al., 2018). The device continuously monitors intracranial EEG (iEEG) with one or two cranially implanted quadripolar cortical strip or depth leads, and delivers stimulation when patient-specific abnormal brain patterns are detected. The physician programs the device to capture short recordings of iEEG that may be triggered by time of day (scheduled), by epileptiform abnormalities, or by detection of long abnormal epileptiform events (long episodes).

IEEG data
Intracranial EEG (iEEG) records were typically 90 seconds long, containing 4 channels of iEEG activity. Each channel represents the output of a differential amplifier measuring the potential difference between two adjacent electrodes on a lead (Bergey et al., 2015;Morrell and RNS System in Epilepsy Study Group, 2011). Two leads are connected to the neurostimulator and each lead contributed 2 channels of data in an iEEG record. Intracranial EEG activity was sampled at 250 Hz per channel and digitized by a 10-bit ADC. All strip electrodes and the majority of the depth electrodes have a 10 mm center-to-center spacing, while a fraction of depth electrodes have 3.5 mm center-to-center spacing. At > 1 year, the mean monopolar impedance of depth and strip leads were 570 O and 901 O respectively (Sillay et al., 2013). The duration and type of iEEG activity recorded by the neurostimulator was determined by the treating physician and could vary from patient to patient and over time within patients. Some iEEG records were captured according to a prespecified time of day, in order to provide baseline data for that patient, and others were captured because they were 'long episode'(LE) iEEG records that typically contained > 30 second runs of abnormal brain activity. LE and scheduled iEEG records were used in Analysis 1, while only LE iEEG records were evaluated in Analysis 2. Fig. 1 shows examples of LE and scheduled iEEG records captured with the RNS System.
The neurostimulator delivers up to 5 consecutive stimulations if there are ongoing detections of epileptiform activity. To control for any effect of the first stimulation on subsequent iEEG activity, only iEEG activity following the first detection was analyzed (Fig. 1). The first stimulation accounts for 45% of all stimulated events. Because of transient effects of the implant procedure on iEEG activity (Sun et al., 2018;Ung et al., 2017), only iEEG records captured ! 12 weeks after implant of the neurostimulator and leads were included.
Spectral power features extracted from intracranial EEG (iEEG) activity in 2-second windows before detection (pre-event window, À2 to 0 seconds), and after detection (post-event window, +2 to + 4 seconds) were compared ( Fig. 2A). A previous study by our group (Sohal and Sun, 2011), which found changes in high-frequency coherence across iEEG channels following stimulation, excluded only a 1-second post-detection window. Since spectral power measures (especially in lower frequency bands) can be sensitive to any residual stimulation artifact, the present study selected a window that ensured that all stimulation and amplifier recovery artifact was completely excluded. Also, a longer exclusion window negated the need for manual examination, which would have been difficult given the large dataset analyzed in this study. Intracranial EEG records that contained a second detection within the post-event window (+2 to + 4 seconds window) were also excluded.

Acute Effect of responsive stimulation (AERS)
Welch periodograms (MATLAB function pwelch) were used to extract spectral power features in 120 frequency bins ranging from 1-120 Hz (Welch, 1967) from the pre-and post-event windows. Spectral power was computed with a moving window length of 64 samples, 50% overlap, and a 250 point fast Fourier transform (FFT). The Acute Effect of Responsive Stimulation (AERS) is calculated as (Eq. (1)): where: f = frequency bin number n = peri-detection iEEG segment number preSP = spectral power in the pre event window postSP = spectral power in the post event window

Average acute Effect of responsive stimulation (aAERS)
The average Acute Effect of Responsive Stimulation (aAERS) was calculated using a two-step averaging method. First, AERS values were averaged across the 120 frequency bins to derive one value for the difference in spectral power in the pre-and post-event window for each peri-detection iEEG segment. Next, the values from multiple iEEG segments within specific time windows were averaged (Eq. (2)): Average Acute Effect of Responsive Stimulation ðaAERSÞ where: f = frequency bin number n = peri-detection iEEG segment number F = total number of frequency bins N = total number of peri-detection IEEG segments in a given dataset 2.4. Analysis 1: AERS on iEEG activity Analysis 1 characterized iEEG records after active and sham stimulation in order to differentiate stimulation induced changes from changes that would ordinarily occur following epileptiform discharges. Spectral power features and the AERS were compared.
In each patient randomized to the sham stimulation arm of the pivotal trial, the number of days in the sham period (stimulation OFF) and an equal number of days with active stimulation (stimulation ON) immediately following the blinded period were selected. To limit the analysis to a window during which antiepileptic drugs (AEDs) and device detection programming was held constant, all days preceding changes in AEDs or detection settings were excluded in the sham period. Similarly, all days following changes in AEDs or detection settings were excluded in the stimulation period. For a patient to be included in Analysis 1, a minimum of 20 peri-detection iEEG segments during sham and active stimulation periods was required. Note that a single iEEG record could contain multiple peri-detection iEEG segments. Twenty (out of 94) in the sham stimulation group of the pivotal trial had long episode (LE) iEEG records that met the inclusion criteria, and 15 (out of 94) in the sham group had scheduled iEEG records that met the inclusion criteria.
The average AERS (aAERS) during sham and active stimulation periods was calculated for each iEEG channel in each patient. Wilcoxon signed rank test was used to compare aAERS in sham and active stimulation periods across all channels. Analysis was done separately on iEEG segments from LE and scheduled iEEG records. Analysis 2 characterized the AERS that was associated with a favorable clinical seizure outcome. Only data from periods during which patients received active stimulation were used. AEDs, device detection, and stimulation settings could vary within the analysis window. Spectral power features and AERS were compared in the iEEG records of all patients before and after a substantial decrease in the clinical seizure rate, defined as ! 80% reduction in the median 28-day average patient-reported clinical seizure rate compared to pre-implant baseline (Examples shown in Fig. 2B). The point at which there was maximal change in the clinical seizure rate (''point of clinical change") was identified (using MATLAB function findchangepts) and the median 28-day average seizure rate was calculated for the period before and after this point. Only iEEG channels in which there was a detection of epileptiform events (detection channel) were included in Analysis 2. A minimum of 50 peri-detection iEEG segments before and after the clinical change point was required for the detection channel to be included. Thirty-five patients met the inclusion criteria for analysis 2. aAERS values were compared before and after the clinical change in seizures and within periods where seizure frequency was stable. Fig. 2B shows three example patients. Bin width is determined by dividing the periods before and after the clinical change into two equally long periods, respectively. B1 and B2 are two equal bins before the clinical change (red vertical line) and B3 and B4 are two equal bins after the clinical change. Since the amount of time before and after the clinical change varied from patient to patient, bin widths were different in each patient. Spectral power features and aAERS were computed in each bin and differences in these values between subsequent bins were computed.
Supervised machine learning analysis (support vector machine or SVM; MATLAB function fitcsvm) was additionally performed to investigate if AERS values computed before the clinical change (bins B1 and B2) were different from AERS values computed after the clinical change (bins B3 and B4). Eighty percent of the peridetection iEEG segments were randomly selected for training the detection-channel-specific SVM models; the remaining 20% were used for testing. Balancing of the training datasets from the two periods was performed by up-sampling the minority class with the well-established ADASYN technique (Haibo et al., 2008;Fig. 2. Intracranial EEG (iEEG) segments and average clinically reported seizure rate (28-day moving average) over time for example patients. A. iEEG segments captured from one patient during sham and active stimulation. The red arrow indicates detection of epileptiform activity. Note that the pre-event window is defined as À2 to 0 seconds before detection and the post-event window is defined as + 2 to + 4 seconds following detection. Together, iEEG data in the 2 second pre-event window and the 2 second postevent window are called the peri-detection iEEG segment. The window 0 to + 2 seconds after detection contains stimulation artifact and is not included in the sham or active stimulation conditions. The upper trace shows sham stimulation and the lower trace shows amplifier blanking during active stimulation followed by amplifier recovery artifact. B. Average clinically reported seizure rate (28-day moving average) over time for three example patients. The red vertical line represents the point of clinical change (i.e. the point at which there was maximal change in the clinical seizure rate, identified using MATLAB function findchangepts). The duration of time before the point of clinical change was divided equally into two bins (B1 and B2; blue vertical line shows division point), and the duration of time after the point of clinical change was divided equally into two periods (B3 and B4). Red horizontal dotted line shows the median seizure rate (seizure per month) before and after the point of clinical change. Average Acute Effect of Stimulation (aAERS), pre and post event spectral power were compared between subsequent periods (i.e., between B2 and B1; between B3 and B2 and between B4 and B3). In the 28 days before the clinical change, the example patients shown in this figure experienced a change in an antiepileptic drug (AED) (top patient), a combined change in stimulation settings and AEDs (middle patient), and a detection change (bottom patient). Only patients who had at least an 80% reduction in median seizure rate after the clinical change point were included in Analysis 2.
Clinical Neurophysiology 132 (2021) 1209-1220 Siedhof, 2015), which uses k-nearest neighbors to synthesize data points that fit the data distribution of the minority class. For example, if 900 and 1,000 peri-detection iEEG segments were captured respectively before and after the clinical change point in a detection channel, 80% of these were randomly selected for training (720 and 800 IEEG segments, respectively) and ADASYN was applied to synthetically add 80 data points to the minority class, so that both periods contributed 800 data points to training. After class-balancing, the median number of EEG segments in the train dataset was 646, and the median number of EEG segments in the test dataset was 127. Class balancing using ADASYN was not performed on the test dataset.
SVM models were trained and tested individually on each detection channel and optimization of SVM hyperparameters (box constraint, kernel type and scale) was performed with Bayesian optimization (MATLAB function bayesopt) with 10-fold cross validation within the training dataset. Since the test dataset was not balanced, test accuracy was reported as the average test accuracy of the two classes by calculating (test accuracy of the 'period before clinical change point' class + test accuracy of the 'period after clinical change point' class)/2. To test the classification performance of AERS features alone, and AERS features in combination with pre and post-event features, training and testing was performed on six different combinations of pre-event spectral power features, post-event spectral power features, and AERS features as predictors. This process was repeated 10 times using a shuffle split technique across all detection channels, and the average accuracy across all repetitions and all detection channels was reported for each feature set. To minimize potential confounding effects of changes to device detection settings, supervised machine learning analysis was repeated on detection channels with no changes to detection settings throughout the analysis period.
To investigate what may have caused the substantial decrease in seizure frequency for each patient, changes in detection parameters, stimulation parameters, and times at which a new AED was started or stopped were identified in the 1-28 day window before the clinical change.
Cross-patient relationships between stimulation induced iEEG changes and clinical seizure outcomes were studied. On each detection channel, the average seizure rate, spectral power features, and aAERS were calculated in a 28-day moving window, where the window was moved by 14 days. The median number of data points across all detection channels was calculated, and data points on channels with more than the median number of data points were randomly downsampled to the median number to balance the dataset. Correlation between monthly seizure rate and monthly average pre-event power, post-event power, and aAERS was computed using the Spearman correlation coefficient (rho) (MATLAB function corr). The analysis was repeated in subgroups of patients with either mesial temporal or neocortical seizure onsets.

Findings in long episode iEEG records
Demographic and clinical characteristics for each of the 20 patients who met the inclusion criteria for analysis 1 based on LE iEEG records are shown in Supplementary Table 1A. Eight patients had seizure onsets in the mesial temporal lobe (MTL) region, 9 patients had onsets in the neocortical region, and 3 patients had one onset in the MTL and one onset in the neocortical region. Every patient had 4 channels of iEEG data; hence the 20 patients contributed a total of 80 channels of iEEG data. In LE iEEG records, the average number of peri-detection iEEG segments captured from each channel was 282 (range: 40-616) for the blinded sham period and 145 (range: 20-382) for the open-label active stimulation period. Intracranial EEG records were captured over an average of 3.4 months (median: 3.6, range: 1.2-4.9).
In LE iEEG records in which detections were followed by stimulation, there was a greater reduction in spectral power in the postdetection window compared to detections with no stimulation (Fig. 3A). The power reduction was largest (>10%) at frequencies between 11 and 71 Hz (Fig. 3B). Fig. 3C shows the difference in aAERS values between the sham and active stimulation periods for each channel. As shown in Fig. 3C, 83.8% (67/80) of all channels, and 95% (19/20) of the channels with the greatest difference in aAERS between sham and stimulation periods within each patient (maximal difference channels; gray bars in Fig. 3C) had a decrease in spectral power with active stimulation compared to sham.
The aAERS during stimulation and sham periods was À14.25% and À1.85% respectively (p < 10 À10 , Wilcoxon signed rank test) across all LE iEEG channels, and -22.03 % and À1.36 % respectively (relative decrease = 20.7%; p = 0.00014) on maximum difference channels in LE iEEG records. Within each patient, the maximum difference channel was predominantly the channel on which there was a detection of epileptiform activity (15/20 patients). Additionally, in 86% of cases (30/35), the direction of aAERS difference was the same on most channels and matched the direction on the detection channel (Fig. 3C). Hence, detection channels' AERS generally represented the maximum magnitude and direction of the acute response in the patient, and for the sake of simplicity, were the only type of channels included in Analysis 2 in order to study the relationship between clinical outcomes and AERS. Further, in 100% of the iEEG records included in Analysis 1, the detection channels received stimulation. All stimulation burst durations were 200 ms long. The magnitude and direction of aAERS difference was not associated with the stimulation charge density (Table 1; Spearman correlation coefficient: À0.0461; p-value: 0.8469). aAERS differences in different patient subgroups are shown in Table 2. All except the three patients with one seizure onset zone in the mesial temporal lobe and another in neocortex had significant reduction in aAERS during active stimulation compared to sham (p < 0.05 Wilcoxon signed rank test).

Findings in scheduled iEEG records.
The above analysis was repeated for scheduled iEEG records, and no significant differences in aAERS during stimulation and sham periods were observed.
Each of the 15 patients who met the inclusion criteria for analysis 1 based on scheduled iEEG records had 4 channels of ECoG data; hence 60 channels of iEEG data were analyzed. The average number of peri-detection ECoG segments captured from each channel was 101 (range: 26-337) for the blinded sham period and 85 (range: 20-245) for the open-label active stimulation period. iEEG records were captured over an average of 3.4 months (median: 3.8, range: 1.6-4.3). When stimulation followed detection, there was a non-significant reduction in spectral power in the post-detection window compared to detections with no stimulation (Fig. 3D). Fig. 3E shows the difference in aAERS values between the sham and active stimulation periods for each channel. aAERS during stimulation and sham periods was À20.26 % and À17.74 % respectively (p = 0.4543, Wilcoxon signed rank test) on the maximum difference channels. Since a patient could have more than one detection channel, the 15 patients contributed a total of 28 detection channels. Two patients had one detection channel, and thirteen had two detection channels. In 54% of cases (15/28), the direction of aAERS difference was the same on most channels and matched the direction on the detection channel (Fig. 3F).
Søren N Rønborg, R. Esteller, Thomas K Tcheng et al. Clinical Neurophysiology 132 (2021) 1209-1220 Since significant differences in aAERS were observed in LE iEEG records but not in scheduled iEEG records, only LE iEEG records were included in Analysis 2.

Analysis 2: Association between AERS and clinical outcomes
Forty-seven detection channels from 35 patients met the criteria for Analysis 2; 23 patients contributed 1 detection channel and 12 patients contributed 2 detection channels. Demographic and clinical characteristics for each of these patients are shown in Supplementary Table 1B. Fifteen and 18 patients had onsets in the MTL and neocortical regions respectively, and 2 patients had one onset in the MTL region and one onset in the neocortical region. In 98.6% of all included iEEG records, stimulation was delivered on the detection channel. Stimulation burst duration was 233 ms on average (range: 100-800 ms). A median of 230 (range: 52-5694) peri-detection iEEG segments before and 404 (range: 65-8690) after the clinical change were captured. The iEEG data spanned 123.4 months (range: 19.0-170.6).
Patients were subject to several changes in detection settings, stimulation settings, and AEDs during the analysis period. Changes to detection, stimulation, or both were more frequent in the period before the clinical change compared to the period after, whereas AED changes were equally likely before and after the clinical change. The median number of detection changes before and after the clinical change was 10 (range: 3-30) and 8 (range: 0-33) (p = 0.005, Wilcoxon signed rank), the median number of stimulation changes was 11 (range: 3-21) and 6 (range: 0-15) (p = 0.003), and the median number of AED changes was 1 (range: 0-39) and 2 (range: 0-15) (p = 0.093). Changes in treatment 1 to 28 days before the clinical change included changes in detection parameters (7/35 patients), changes in stimulation parameters (5), changes in AEDs (8), combined changes in detection and stimulation parameters (4), combined changes in detection parameters and AEDs (1), combined changes in stimulation parameters and AEDs (2), and no changes in treatment (8).

Detection-channel-specific association between AERS and clinical-outcomes
Several detection channels had changes in pre-event power, post-event power, and stimulation-evoked responses after patients experienced a substantial decrease in clinical seizure rate. Changes in aAERS, pre-, and post-event power in 2 equal-sized bins before the clinical change (bins B1 and B2), in 2 equal-sized bins after (2)) from the sham and active stimulation conditions for each channel. AERS values were averaged over the 120 frequency bins for each iEEG segment. The resulting values were averaged over all iEEG channels during the sham and active stimulation periods (resulting in aAERS for the sham and active stimulation periods respectively). The difference in aAERS values during the two periods was computed and is represented in the bar graphs. Each set of four bars corresponds to the four iEEG channels within one patient. Gray bars correspond to the channel with the maximum change within each patient, and white bars correspond to the remaining channels. Negative values indicate a greater reduction in power with active compared to sham stimulation. * indicates detection channels. the clinical change (B3 and B4), and in bins spanning either side of the clinical change (B2 and B3) are shown Fig. 4. The relatively wider spread of red histogram curves (which correspond to differences between bins B2 and B3) compared to blue and green histogram curves indicate that in several detection channels, changes in stimulation evoked responses were associated with changes in clinical seizure outcomes. Additionally, the red histogram curves for pre-and post-event spectral power features are slightly skewed towards negative values, compared to the green and blue histogram curves, indicating that pre-and postevent power tends to decrease when patients' clinical outcomes improve. The mean and standard deviation of the histogram plots are summarized in Table 3. Channel-specific support vector machine classifiers further demonstrated that stimulation-evoked response patterns were different before and after the clinical change. Details about the trained channel-specific SVM models' kernels, hyperparameters, class-balanced classification accuracies, and F1 scores are shown in Table 4. In over half of all detection channels, AERS values predicted whether the iEEG segment was captured before or after the clinical change with > 75% classification accuracy (median average accuracy: 0.75; median F1 score: 0.83). Further, in over a quarter (26%) detection channels, the classification accuracy was > 86%. All except one detection channel had above chance-level (50%) classification accuracies. When SVM model training and testing experiments were repeated on a subset of detection channels (n = 16 detection channels from 13 patients) with constant detection settings, average classification accuracy of 66.3% (median: 63.2%, range: 0.49-0.94) was observed based on AERS features. The 16 channels contributed a median of 230 (range: 103-1445) peri-detection iEEG segments in the period before the clinical change and 116 peri-detection (range: 54-5576) iEEG segments in the period after, with the iEEG data spanning a median of 23 months (range: 5-64).

Cross-channel associations between AERS and clinical outcomes
Even though the direction of AERS change was generally consistent within detection channels (as demonstrated by SVM classification performance), no consistent patterns were observed across the various detection channels. In 57% (27/47) of the detection channels, there was a greater reduction in stimulation evoked spectral power following improvements in clinical seizure frequency (negative bars in Fig. 5B), whereas in 43% of the channels the opposite trend was observed. AERS changes in twelve example detection Table 1 Average Acute Effect of Responsive Stimulation (aAERS) difference and average charge density in maximum difference channels included in the analysis of long episode iEEG records in Analysis 1.
aAERS difference (%) on the maximum difference channel (the maximum difference channel in a patient is the channel with the largest different in aAERS value between stim and sham periods)  Søren N Rønborg, R. Esteller, Thomas K Tcheng et al. Clinical Neurophysiology 132 (2021) 1209-1220 channels are shown in Fig. 5A. Further, no cross-patient associations were observed between treatment changes (i.e., AED or device-settings) in the 28-day window preceding the clinical change, and the direction of the aAERS difference ( Fig. 5B; A, D, S, N adjacent to gray bars). Cross-channel correlation analyses between patient reported clinical seizures and features in peri-detection iEEG segments produced similar results. Data from all forty-seven detection channels were included and spanned a median of 83.5 months (range 18.5-119.6), with a median of 115 data points (range 16-274) on each detection channel. As described in the methods section, data points on detections channels with more than the median number of data points (115) were randomly down sampled to the median number, so that every channel contributed at most 115 data points for the correlation analysis. Overall, in both the MTL and neocortical patient populations, slight negative correlations between AERS and the patients' reported seizure outcomes were observed. This is in accord with the mostly mixed AERS change directions (57% greater reduction in spectral power following clinical change and 43% lesser reduction in spectral power following clinical change) observed across detection channels. Modest positive correlations were observed between higher pre-event and post-event power and worse clinical outcomes (Fig. 6), with the trends being slightly stronger in the MTL patient population compared to the neocortical group. This is indicated by the higher correlation coefficient numbers for the MTL group compared to the neocortical group.

Discussion
A better understanding of the acute electrographic effects of stimulation could lead to more rapid optimization of stimulation settings for brain stimulation therapies, such as direct brainresponsive neurostimulation. In this retrospective analysis of an ambulatory iEEG dataset, acute reductions in spectral power following early stimulation in long epileptiform events were observed. Further, this is the first study to show that within individual detection-channels, the amount of stimulation induced reduction in spectral power consistently changed when patients' clinical outcomes improved. Defining the acute iEEG changes associated with a favorable clinical response could permit in-clinic testing of a range of stimulation parameters while collecting Fig. 4. Changes in pre-and post-event power and average Acute Effect of Responsive Stimulation (aAERS) between different bins. Histogram plots of changes in aAERS, preand post-event power features between subsequent bins (see Fig. 2 for details on bins). Blue dotted lines show changes between bins B1 and B2, red lines show changes between bins B2 and B3, and green dotted line shows changes between bins B3 and B4. Refer to Table 3 for mean and standard deviation of the histogram plots.

Table 3
Mean and standard deviation of histogram plots (Fig. 4)  Bold indicates bins that span both sides of the clinical change point (i.e. the point at which there was maximal change in the clinical seizure rate, see Fig. 2B). Bin width is determined by dividing the periods before and after the clinical change into two equally long periods, respectively. B1 and B2 are two equal bins before the clinical change and B3 and B4 are two equal bins after the clinical change. real-time iEEG data in order to optimize the patient's stimulation settings. The work in this paper significantly adds to the literature on the effects of electrical brain stimulation. Analyses benefit from a large data set of years of chronic iEEG recordings in patients with medically intractable partial epilepsy. Both long-episode and scheduled iEEG records were used in these analyses. LE iEEG records capture sustained and organized epileptiform activity that exceeds a preset duration (usually 10 seconds), while scheduled iEEG records capture baseline iEEG that may contain isolated epileptiform activity (Fig. 1).
In LE iEEG records (i.e., iEEG records with long trains of epileptiform events), a 20.7% relative reduction in spectral power following stimulation was observed following early stimulations (i.e., therapy 1), which was not observed with sham stimulation. This agrees with previous studies suggesting that stimulation has an acute suppressive effect (Penfield and Jasper, 1954;Kossoff, 2004;Lesser et al., 1999;Motamedi et al., 2002;Psatta, 1983;Wagenaar et al., 2005). In LE iEEG records, the AERS was robust and easily quantified by measuring the difference in spectral power before and after stimulation. Nineteen of 20 patients had a greater reduction in total spectral power when detection was followed by active compared to sham stimulation. Across the 20 patients, in those iEEG channels that had the maximal acute responses to stimulation, spectral power decreased by 22.0% on average, compared to an average 1.4% decrease after detections with no stimulation (difference statistically significant at p = 0.00014, Wilcoxon signed rank test). Across all iEEG channels, spectral power decreased by an average 14.3% with stimulation, compared to a 1.9% decrease without stimulation (p < 10 À10 ). The power reduction following active stimulation was most pronounced (>10%) between 11 and 71 Hz, possibly because these frequencies are commonly associated with epileptiform activity and seizure onsets (Medvedev et al., 2011;Bartolomei et al., 2008;Wendling et al., 2003;Pan et al., 2009).
AERS difference between active and sham stimulation was not observed in scheduled iEEG records. In the sham stimulation period, the percentage reduction in post-event compared to preevent power was higher in scheduled iEEG records compared to LE iEEG (red plot lines in Fig. 3 panels B and E). This is presumably because interictal epileptiform events (captured in scheduled IEEGs) are brief and self-limited.
Several underlying neuronal mechanisms have been proposed to explain the inhibitory effect of responsive neurostimulation (Osorio et al., 2005). One hypothesis is that stimulation induces inhibition through local GABA-mediated hyperpolarization. Repetitive electrical stimulation of CA3 hippocampal neurons in vitro has been shown to increase intracellular chloride (Thompson et al., 1989a, Thompson et al., 1989b, Thompson et al., 1989c, and high frequency stimulation (>100 Hz) administered in-vivo to rat cerebral cortex down-regulates calmodulin-dependent protein kinase II, while upregulating glutamic acid decarboxylase (Liang et al., 1996). Another hypothesis is that stimulation causes an acute disruption of synchronicity in brain activity by creating transient local postsynaptic potentials opposing the extracellular fields created by epileptogenic neurons (Durand, 1986). Both of these mechanisms may explain the acute decrease in spectral power following stimulation that was observed in this study. A previous study by our group showed that stimulationinduced desynchronization was observed at high frequencies  (2)) differences (i.e., larger decreases in spectral power following stimulation in the period after the clinical change compared to before), the second row of examples corresponds to detection channels with aAERS differences close to 0, and the third row corresponds to detection channels with positive aAERS differences (i.e., smaller decreases in spectral power following stimulation in the period after the clinical change). The numbers in the lower right of each plot show the classification accuracy of the SVM model trained and tested on AERS features alone from the given detection channel. B. Bars show the difference in aAERS between the periods before and after the clinical change for all detection channels analyzed. AERS values were averaged over the 120 frequency bins for each iEEG segment. The resulting values were averaged over all iEEG channels during periods before and after the clinical change. The difference in aAERS values during the two periods was computed and are represented in the bar graphs. Negative values indicate that the power decrease with stimulation is higher after substantial clinical improvement (i.e., blue curve below red curve) and positive values indicate that the power decrease with stimulation is lower after substantial clinical improvement. Letters indicate treatment 1-28 days before the clinical point of change for the given patient. D denotes changes in detection parameters, S denotes changes in stimulation parameters, A denotes changes in anti-epileptic drugs. Combinations indicate coinciding treatment changes. , whereas in the current study the reduction in power was mainly seen in the lower frequency ranges (11-71 Hz) (Sohal and Sun, 2011). It should be noted that the two measures are fundamentally different, since stimulation-induced desynchronization was measured as the coherence between brain signals captured on different channels/leads, whereas spectral power measures are local to the recording electrodes. Hence it is possible that two completely different physiological phenomenon could be at play and may explain the differences in observations.
Even though stimulation-induced acute reduction in spectral power was consistently observed across patients in LE iEEG records, the amount of reduction in spectral power was not associated with the stimulation charge density (Table 1). This may be because of patient-to-patient variability in antiepileptic drugs, detection and stimulation settings, seizure onset zones, and electrode location and implantation strategies, all of which may influence pre-and/or post-event power and thus aAERS.
A prospective study in which all these factors are held constant is needed to investigate changes in aAERS with varying charge densities over time within patients.
Within individual detection channels, consistent changes in AERS were observed following substantial improvement in patient reported outcomes. Detection-channel-specific SVM models trained using AERS features could identify if the iEEG record was captured before or after the clinical improvement with 70% (median: 75%) classification accuracy. Further, SVM models trained on spectral power features in the 2-second window before (preevent features) and after (post-event features) detection of epileptiform activity could identify if the iEEG records were captured before or after the clinical improvement with 80% and 77% classification accuracies, respectively. This observation with the pre and post-event features was not entirely surprising given that interictal spikes and interictal spectral power have been shown to be positively correlated with clinical outcomes in patients with Fig. 6. Cross-channel correlation between the acute effect of brain-responsive neurostimulation and clinical outcomes. Analyses of peri-detection intracranial EEG (iEEG) segments from 47 detection channels. Each data point corresponds to the average seizure rate and spectral power features or average Acute Effect of Responsive Stimulation (aAERS) in a 28-day moving window. Rho indicates the Spearman correlation coefficient between monthly seizure rate and monthly average pre-event power, post-event power, and aAERS. Asterisk indicates statistical significance of the correlation coefficient. Left panels show results across all patients, middle and right panels show results in subgroups of patients with either mesial temporal or neocortical seizure onsets, respectively. epilepsy (Desai et al., 2019). However, adding AERS features to the pre-and post-event spectral power features for SVM training and testing resulted in an increase in clinical outcome classification performance, indicated by higher F1 scores, suggesting that AERS features have predictive power for the clinical response that are not entirely captured with the pre-or post-event power features alone. Hence, using AERS features in addition to interictal iEEG features may lead to more sensitive evaluation of a patient's outcomes.
Responsive stimulation resulted in acute reductions in spectral power, with 57% detection channels showing a greater reduction in spectral power following substantial clinical improvements, while 43% detection channels showed the opposite trend. Additionally, scatter plots of stimulation induced acute effects and clinical outcomes did not reveal strong cross-patient correlations between AERS features and clinical outcomes (Fig. 6). The lack of clear cross-patient and cross-channel trends in AERS vs clinical outcomes underscores the complex nature of brain stimulation and emphasizes the need to fine-tune stimulation parameters for each patient, individually. For the findings in this study to be of practical use for a patient, it would be necessary to collect LE type iEEG records at baseline (median LE capture rate = 2 per day (Quigg et al., 2020)) to identify the relationship between AERS and the patient's clinical outcomes before testing various stimulation settings. For example, during baseline data collection on detection channels in a patient, if it is found that 20% AERS is associated with 40% improvement in seizures and 30% AERS is associated with 70% reduction in seizures, then in this patient, higher AERS percentage is associated with better outcome. Once this relationship is established for the patient, a variety of stimulation parameters could be rapidly tested and the settings which produce the highest AERS percentage could be selected and programmed. The length of the baseline period would depend on the patient's seizure frequency.
The association between the AERS in LE iEEG records and the patient's clinical seizure outcomes could not be explained solely by differences in detection settings. In a repeat analysis with a subset of detection channels in which detection settings were held constant, SVM models based on AERS features yielded average classification accuracy of 66.3%, which is only slightly less than the 70% average classification accuracy of the models built on AERS features in iEEG records captured with varying detection settings.
Since very few patients experienced substantial increases in clinical seizure rates, a control study investigating the associations between the AERS and increases in clinical seizures could not be performed. Instead, changes in aAERS, pre-and post-event power were investigated during periods when patients had stable seizure rates and compared to periods when patients had a substantial decrease in seizure rate. This analysis showed that changes in aAERS, pre-and post-event power, were more common during periods when patients experienced substantial decreases in seizure rate compared to periods when seizure rates were stable (Fig. 4).

Limitations
Inherent limitations in this study include the type of iEEG data collected by the RNS System and the retrospective nature of this analysis. First, iEEG data is captured only where electrodes are placed and results may not necessarily reflect other brain regions. Second, iEEG data collection may have been incomplete due to device memory being overwritten or patient non-compliance with data uploads, meaning that relevant epileptiform events may have been excluded. Also, if data from a given patient was biased (e.g. there was missing data at certain times of day or after seizures), then the analysis could present an incomplete picture of actual spectral power or AERS for the given patient. Third, iEEG activity in the 2-second window following detection of epileptiform activity was excluded to avoid stimulation artifact. Fourth, only iEEG segments from the first stimulation within a given iEEG record were analyzed to avoid lingering effects of a sequential stimulation bursts. However, iEEG records may have still been affected by stimulation that, while not immediately preceding, was temporally proximal. Fifth, for all patients in this analysis, the sham stimulation period preceded the active stimulation period, and the effects of time after implantation could impact the results. Sixth, patients had detection, stimulation, antiepileptic drug changes or combinations of these that could have contributed to the clinical change and observed electrographic changes. Finally, patients had a variety of seizure onset regions, variability in the recording/stimulating electrodes placement and a variety of cortical regions treated. However, it should be noted that large datasets are generally datasets that contain variability, and in order to achieve a large dataset in patients being treated for epilepsy, there will be a variety of regions of seizure onset, reflected in this series by the variability of the recording/stimulating electrodes placement and the variety of cortical regions treated. ''Pure" data sets of highly selected patients and tightly controlled treatments are of great value, but so are large data sets that reflect the broad population of interest. Each complements the other. In this study, irrespective of electrode placements, a reduction in spectral power following stimulation was observed, suggesting common underlying interaction mechanisms between responsive electrical brain stimulation and neuronal populations exhibiting abnormal epileptiform activity.

Conclusion
Brain-responsive neurostimulation resulted in an acute decrease in spectral power in long episode iEEG records that was most pronounced in the 11-71 Hz range. This effect was not observed in scheduled iEEG records. This is the first study to show that the effects of acute stimulation on spectral power can be associated with clinical seizure outcomes. Future studies are required to explore this in the context of electrographic biomarkers and to investigate the effects of different stimulation settings on the acute iEEG response. These discoveries may enable the physician to move from empirically guided months-long testing of stimulation settings to more rapid iEEG-guided optimization of stimulation settings for each patient.

Declaration of Competing Interest
Authors SD, TT, MM and DG are employees of NeuroPace. Author RE was an employee at NeuroPace when performing analyses for this paper. Authors SR and TK have no conflicts of interest

Sources(s) of financial support
The effort of Søren Rønborg was funded by the Lundbeck Foundation.