Seizure forecasting by tracking cortical response to electrical stimulation

CA3305461A1Pending Publication Date: 2025-04-10KINGS COLLEGE LONDON
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CA3305461
Authority / Receiving Office
CA · CA
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-10-04
Filing Date
2024-09-23
Publication Date
2025-04-10

AI Technical Summary

Technical Problem

Current methods for predicting epileptic seizures are not accurate enough to provide reliable warning systems, which limits the ability to prevent seizures or mitigate their effects.

Method used

A method and system that utilize intracranial electrodes to deliver low-frequency electrical stimulation to the brain and measure the cortical response via iEEG, using machine learning algorithms to forecast seizure risk based on the brain's response to stimulation.

Benefits of technology

This approach provides more accurate and continuous estimation of potential seizure risk, allowing for proactive prevention of seizures through high-frequency electrical stimulation, thereby improving the quality of life for individuals with epilepsy.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The present disclosure provides a method and system for forecasting the likelihood of seizure onset within an individual. Specifically, the present disclosure relates to an intracranial implant comprising one or more electrodes attached thereto and an associated method for delivering active perturbation patterns to brain regions which includes: sending, via the intracranial implant, an electrical stimuli into a brain, wherein the electrical stimuli is sent in accordance with a stimuli pattern; measuring an output from the brain in response to the electrical stimuli; feeding the output into a forecasting model; and detecting, via the forecasting model, outputs that indicate a high likelihood of seizure. The intracranial implant and associated method may further apply via the brain-contacting electrodes, a prophylactic treatment to the brain to prevent a seizure from occurring, based on detecting an output indicating a high likelihood of seizure.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] SEIZURE FORECASTING BY TRACKING CORTICAL RESPONSE TO ELECTRICAL STIMULATION

[0002] Technical Field

[0003] The present disclosure generally relates to a method and system for predicting epileptic seizures and mitigating their effects.

[0004] More specifically, the present disclosure relates to a method and system to forecast epileptic seizures by tracking cortical response to electrical stimulation in conjunction with a method and system to administer high-frequency electrical stimulation to the brain to prevent the seizure from starting.

[0005] Embodiments of the present disclosure seek to provide more accurate continuous estimation of potential seizure risk; which can be used in conjunction with prophylactic treatment to the brain to prevent a seizure from occurring or improved epileptic seizure symptom mitigation following seizure onset.

[0006] Background and Related Art

[0007] Globally, around 65 million people have epilepsy, and 5 million new cases are diagnosed per year, making it one of the most common neurological disorders [Milligan_2021, WHO_2023]. The key feature of epilepsy is the occurrence of recurrent seizures, and the first line of treatment is the administration of antiepileptic drugs (AEDs). Although AEDs are able to control seizures in around two thirds of people, the remaining one third suffer from uncontrolled seizures that create a significant burden in their lives [Chen_2018]. The ability to forecast the occurrence of upcoming seizures would significantly increase the quality of life of people with epilepsy by providing a seizure warning system, which could be used to enhance safety and to allow the application of preventative therapy.

[0008] Several studies that analysed continuous biosignals such as intracranial electroencephalography (iEEG), scalp EEG, heart rate, electrodermal activity and accelerometer measurements demonstrated that seizures can be forecast above chance levels [Cook_2013, Karoly_2017, Baud_2018, Kuhlman_2018, Meisel_2020, Maturana_2020, Proix_2021, Stirling_2021, Brinkmann_2023]. The most successful approaches to seizure forecasting analysed long-term, passively collected iEEG from implantable devices and made seizure-risk forecasts for various time horizons [Cook_2013, Karoly_2017, Baud_2018, Kuhlman_2018, Maturana_2020, Proix_2021]. Further, seizure unpredictability is a significant burden in the lives of people with epilepsy.

[0009] One aim of embodiments of the present disclosure is therefore to provide a method and system wherein seizures can be forecast.

[0010] Summary of the Invention

[0011] In order to address the above, embodiments of the present disclosure provide a method and system wherein seizures can be forecast by stimulating the cortex via intracranial electrodes and measuring cortical response from the iEEG. In this respect, whilst the mechanism underlying time-varying seizure-risk for an individual subject is not known precisely, it is believed to relate to time-varying cortical excitability. Therefore, measuring and tracking cortical excitability more directly should provide valuable information about seizure forecasting. Active perturbation of the cortex and measuring its response will provide a more direct way to track cortical excitability. Whilst passive observation of the brain might provide some insights, repeated active perturbation of the cortex and measuring the cortical response may provide more direct information about time-varying cortical excitability.

[0012] The present disclosure provides a method and system to forecast epileptic seizures by tracking cortical response of a human subject to electrical stimulation. In addition the forecasting system may be coupled to and used in conjunction with a method and system to administer high-frequency electrical stimulation to the brain to prevent a seizure from starting in the first place.

[0013] The above-mentioned method and system consists of several elements:

[0014] (1) An intracranially implanted electronic device.

[0015] (2) Intracranial electrodes connected to the device, resting on the surface of the brain and / or inserted into brain tissue, targeting the brain region where information about the likelihood of future seizure onset can best be obtained.

[0016] (3) A system inside the implanted electronic device to deliver electrical impulses through the electrodes, at low frequency (eg. 2-3 pulses every 5 minutes).

[0017] (4) A system inside the implanted electronic device to collect and monitor the iEEG signal that includes the brain's response to low-frequency stimulation.

[0018] (5) A system inside the implanted electronic device to automatically analyse the iEEG signal containing the brain's response to stimulation, and extract from this signal features that associate with future seizure risk. (6) A system inside the implanted electronic device to estimate the level of future seizure risk from moment-to-moment, and to detect when the risk falls above a threshold.

[0019] (7) A system inside the implanted electronic device to deliver high-frequency stimulation to the seizure onset zone, in response to the threshold being exceeded, in order to prevent seizures from starting.

[0020] Current seizure forecasting algorithms passively monitor the brain via iEEG signals, compute quantitative features from those signals and embed them in machine learning algorithms to estimate the time-varying seizure risk. In contrast, embodiments of the present disclosure utilise active perturbation of the cortex and highlight that measuring its response to stimuli is much more informative for seizure forecasting. Specifically, single electrical pulses are administered to the cortex at low frequency and the brain's response to these stimuli is measured by quantitative features. Afterwards, these features are embedded into a machine learning algorithm that returns the seizure risk at each stimulus.

[0021] As the present disclosure uses periodic perturbation of the brain via electrical stimulation and measurement of the cortical response to stimuli from the iEEG; the seizure risk is not estimated from features that were computed from the passive iEEG signal, but from the brain's response to electrical stimulation as reflected on the iEEG signal. One advantage of the present disclosure over passive monitoring is that measuring seizure risk from the response to stimulation is more informative than measuring seizure risk from passive observation of iEEG signals. This allows for a more accurate monitoring of potential seizure risk as well as an increased speed of seizure risk detection.

[0022] Three commonly used methods for epilepsy treatment include deep brain stimulation or cortical stimulation systems (systems where electrical pulses are generated by a device), conventional drug treatment and conventional surgery. One existing system, NeuroPace RNS system, consists of an intracranially-implanted device with electrodes targeting the brain; the device passively monitors brain signals to detect possible seizure onset, and provides electrical stimulation following detection of possible seizure onset.

[0023] The advantage of embodiments of the present disclosure over the NeuroPace RNS system is that our method and system would treat in response to a forecast of future seizure risk, and would prevent seizures from starting; whereas NeuroPace RNS merely detects that a seizure has already started and treats to reduce the duration of the seizure. The advantage of embodiments of the present disclosure over conventional drug treatment is that such treatment fails in 1 / 3 of patients, hence our arrangement provides an alternative for this group.

[0024] The advantage of embodiments of the present disclosure over conventional surgery for epilepsy (ie. removing the part of the brain where seizures start) is that such surgery is possible in only a very small minority of cases, because of risks. Insertion of an intracranial device and electrodes includes far less risk.

[0025] A first aspect of the present disclosure relates to an intracranially-implantable electronic device, comprising one or more of: an electronic circuit having one or more processors and one or more brain-contacting electrodes, the electronic circuit configured such that in use it operates to: send electrical stimuli into a brain, wherein the electrical stimuli is sent in accordance with a stimuli pattern; measure an output from the brain in response to the electrical stimuli; feed the output into a forecasting model; and detect, via the forecasting model, outputs that indicate a high likelihood of seizure.

[0026] The one or more processors may be further arranged to: apply, via the brain-contacting electrodes, a prophylactic treatment to the brain to prevent a seizure from occurring, based on detecting an output indicating a high likelihood of seizure.

[0027] The forecasting model may apply a greater predictive weighting factor to outputs measured in response to later electrical stimuli within the stimuli pattern.

[0028] There may be a first predetermined delay between the application of the electrical stimuli to the brain and the measurement of the output from the brain.

[0029] The first predetermined delay may be at least 1 second, more preferably it may be at least 4 seconds.

[0030] A second aspect of the present disclosure relates to a method of forecasting the likelihood of seizure onset, the method comprising one or more of: sending, via an intracranial implant, an electrical stimuli into a brain, wherein the electrical stimuli is sent in accordance with a stimuli pattern; measuring an output from the brain in response to the electrical stimuli; feeding the output into a forecasting model; and detecting, via the forecasting model, outputs that indicate a high likelihood of seizure. In accordance with the second aspect, the method may further comprise: applying, via the brain-contacting electrodes, a prophylactic treatment to the brain to prevent a seizure from occurring, based on detecting an output indicating a high likelihood of seizure.

[0031] The outputs that indicate a high likelihood of seizure may be outputs that exceed a threshold value.

[0032] The threshold value may be calculated and set using a grid search or other suitable method, such that when the threshold value is crossed an alarm may be initiated that a seizure is about to happen in a next time-period.

[0033] The performance of the seizure forecasting may be assessed using one or more of: (i) time spent in warning; (ii) improvement over chance; and / or (ii) Brier Skill Score.

[0034] In accordance with the second aspect, there may be a first predetermined delay between the application of the electrical stimuli to the brain and the measurement of the output from the brain.

[0035] The stimuli pattern may consist of two or more electrical stimuli separated by a second predetermined delay. The second predetermined delay may be at least 3 seconds, more preferably it may be at least 5 seconds.

[0036] The forecasting model may comprise a Logistic Regression model with leave-one-subject- out cross-validation. Moreover, the forecasting model may further comprise a feature labelling model, that may label pre-ictal, inter-ictal and post-ictal features in the output from the brain.

[0037] In accordance with the second aspect, the method may further comprise: pre-processing the output signal from the brain in response to the electrical stimuli. The pre-processing may include one or more of: (i) bandpass filtering; (ii) bandstop filtering; (iii) butterworth filtering; (iii) removing simulation artifacts; (iv) downsampling; and / or (v) re-referencing to the average.

[0038] Feature extraction may be used to detect outputs that indicate a high likelihood of seizure, the feature extraction may comprise one or more parameters of: (i) variance; (ii) autocorrelation; (iii) cumulative average of variance; and / or (iv) cumulative average of autocorrelation. The variance may be quantified using the following equation: where N is the number of samples of the signal, x.

[0039] The autocorrelation may be quantified using the following equation: where N is the number of samples of the signal, x, and A is the lag.

[0040] Further features and advantages will be apparent from the appended claims.

[0041] Brief Description of the Drawings

[0042] Further features and advantages of the present disclosure will become apparent from the following description of an embodiment thereof, presented by way of example only, and with reference to the accompanying drawings, wherein like reference numerals refer to like parts, and wherein:

[0043] Figure 1 shows an exemplary overview diagram of the intracranial implant within a user;

[0044] Figure 2 shows a flow diagram of the procedures relating to implantation, stimulation, signal pre-processing, feature extraction and forecasting, in accordance with an embodiment of the present disclosure ;

[0045] Figure 3 shows a further flow diagram of the procedures relating to stimulation, signal preprocessing, feature extraction and forecasting in accordance with an embodiment of the present disclosure ;

[0046] Figure 4 shows an exemplary circuit diagram of the intracranial implant, in accordance with an embodiment of the present disclosure ;

[0047] Figure 5a shows a graph of the temporal evolution during the time window of 20ms to 1000ms after the first and second electrical stimulus;

[0048] Figure 5b shows a graph of the temporal evolution during the time window of 4000ms to 4980ms after the first stimulus;

[0049] Figure 6a shows a graph of seizure risk / probability during the time window of 4000ms to 4980ms after the first stimulus; Figure 6b shows a graph of the forecasting metrics used to calculate seizure risk / probability during the time window of 4000ms to 4980ms after the first stimulus;

[0050] Figure 6c shows a graph of seizure risk / probability during the time window of -1000ms to -20ms relative to the first stimulus;

[0051] Figure 6d shows a graph of the forecasting metrics used to calculate seizure risk / probability during the time window of -1000ms to -20ms relative to the first stimulus;

[0052] Figure 7a shows a graph of seizure risk / probability during the time window of 4000ms to 4980ms after the first stimulus which highlights the difference between using one, five and all iEEG electrodes;

[0053] Figure 7b shows a graph of seizure risk / probability during the time window of -1000ms to -20ms relative to the first stimulus which highlights the difference between using one, five and all iEEG electrodes;

[0054] Figure 7c shows a graph of the forecasting metrics used to calculate seizure risk / probability during the time window of 4000ms to 4980ms after the first stimulus;

[0055] Figure 7d shows a graph of the forecasting metrics used to calculate seizure risk / probability during the time window of -1000ms to -20ms relative to the first stimulus;

[0056] Figure 8 shows a graph of the temporal evolution of the features from the windows 20ms to 100ms after the first and second stimulus (or pulse);

[0057] Figure 9a shows a graph of seizure risk / probability during the time window of 20ms to 100ms after the first stimulus;

[0058] Figure 9b shows a graph of seizure risk / probability during the time window of 20ms to 100ms after the second stimulus;

[0059] Figure 9c shows a graph of seizure risk / probability during the time window of 20ms to 1000ms after the first stimulus;

[0060] Figure 9d shows a graph of seizure risk / probability during the time window of 20ms to 1000ms after the second stimulus; Figure 10a shows a graph of seizure risk / probability during the time window of 4000ms to 4980ms (Note that during the leave-one-subject-out approach no future information was used in the test patient) after the first stimulus;

[0061] Figure 10b shows a graph of seizure risk / probability during the time window of -1000ms to -20ms (Note that during the leave-one-subject-out approach no future information was used in the test patient) after the first stimulus;

[0062] Figure 10c shows a graph of the forecasting metrics used to calculate seizure risk / probability during the time window of 4000ms to 4980ms (Note that during the leave- one-subject-out approach no future information was used in the test patient) relative to the first stimulus;

[0063] Figure lOd shows a graph of the forecasting metrics used to calculate seizure risk / probability during the time window of -1000ms to -20ms (Note that during the leave- one-subject-out approach no future information was used in the test patient) relative to the first stimulus.

[0064] Detailed Description of the Preferred Embodiments

[0065] The present disclosure provides a device which is intracranially implanted within a user. The intracranial implant comprises at least one electrode which is connected to the device and rests on the surface of the brain and / or inserted into regions of brain tissue. The electrodes are positioned to target specific brain regions where information relating to the likelihood of future seizure onset can be obtained effectively.

[0066] The present disclosure provides a method, for use with the intracranial implant, for forecasting the likelihood of seizure onset within an individual, which may be an epileptic seizure. The forecasting is achieved through active perturbation of brain regions via contact electrodes and tracking the cortical response to the electrical stimulation.

[0067] In more detail, the present disclosure relates to a method and system for forecasting the likelihood of seizure onset within an individual that may incorporate the following steps: delivering electrical impulses through the electrodes, at low frequency (eg. 2-3 pulses every 5 minutes); collecting and monitoring the iEEG signal that includes the brain's response to low-frequency stimulation; automatically analysing the iEEG signal containing the brain's response to stimulation, and extracting from this signal features that associate with future seizure risk; and estimating the level of future seizure risk from moment-to- moment.

[0068] Further details relating to the specifics of the intracranial device or system and the associated seizure forecasting method will now be discussed in relation to the associated figures.

[0069] Figure 1 shows an exemplary overview diagram 1 of the intracranial implant 12 within a user 10. It is clear that the intracranial implant 12 is located anywhere within the cranium in contact with regions of the brain via a plurality of electrodes 120. In many embodiments, the intracranial implant 12 may utilise one, three or five electrodes 120 to deliver electrical stimulus to regions of the brain for either forecasting stimulation or seizure mitigation. However, in theory the intracranial implant 12 may utilize as many or as few electrodes 120 as necessary. The electrodes 120 are used for stimulation of areas of the brain for the use of seizure risk forecasting and may also be used in response to high seizure risk to provide stimulation to areas of the brain for seizure mitigation purposes.

[0070] Figure 2 shows a flow diagram 2 of the procedures relating to implantation, stimulation, signal pre-processing, feature extraction and forecasting, in accordance with an embodiment of the present disclosure . In other words, Figure 2 shows a schematic representation of the study design. As can be seen in Section A 20, two electrical pulses are delivered to areas of the brain via electrodes. The electrical pulses are separated by a very short time interval, for example a 5 second interval, and are then repeated over a longer time interval, for example every 5 minutes. In Section B 22, signal pre-processing 222 and feature extraction 224 is completed. The signal pre-processing 222 may include one or more of the following: re-referencing to the average, downsampling, removing stimulation artifacts, applying bandpass and bandstop filtering etc. The feature extraction 224 may include one or more of the following parameters or methods: variance, autocorrelation, cumulative average of variance, cumulative average of autocorrelation etc. Finally, in Section C 24 the seizure forecasting is computed from the pre-processed signal and the extracted features. The seizure forecasting comprises of a seizure forecasting algorithm 242 and forecasting metrics 244 for quantifying the algorithms performance. In the seizure forecasting algorithm 242, there are three main steps: i) feature labelling; ii) Logistic Regression model training; and iii) grid searching. In i), the feature labelling includes both pre and inter-ictal feature labelling. In ii), the Logistic Regression model training may comprise a leave-one-subject-out cross validation approach and a pre / post stimulus feature training. Finally, in iii), the grid search may comprise a probability threshold and / or a seizure occurrence period. In the forecasting metrics calculation 244, the metrics may include one or more of the following: improvement over chance, sensitivity, time spent in warning, brier skill score etc to assess the performance of the seizure forecasting.

[0071] Figure 3 shows a further flow diagram 3 of the procedures relating to stimulation, signal pre-processing, feature extraction and forecasting. The flow diagram 3 relates to a method for stimulating areas of the brain for forecasting the likelihood of seizure and potentially for providing mitigation action. Hence, the flow diagram 3 relates to a method following the implantation of the intracranial device. In s300, the method will be started including any required initialization of the systems, devices, software etc. In s302, electrical impulses will be delivered to one or more areas of the brain via electrodes attached to the intracranial implant. In an example embodiment, the electrical impulses will be sent in pairs with each impulse being separated by a 5 second delay. There will be a five minute delay between electrical impulse pairs being delivered to the brain areas. In other embodiments, different delays between electrical impulses and electrical impulse pairs may be used. Moreover, in other embodiments the electrical impulses may not be delivered in pairs but may deliver more than two electrical impulses i.e., the electrical pulses may be delivered in brief trains of several stimuli. In s304, the intracranial implant will collect and monitor the iEEG signals which will include the response by the brain to the electrical impulses. Next, in s306, the intracranial implant will automatically analyse the iEEG signal containing the electrical impulse response and in s308 any features associated with future seizure risk will be extracted. In s310, the level of future seizure risk will be calculated based upon the analysis of the iEEG response and the extracted features that are indicative of future seizure risk. In s312, an assessment will be made as to whether the calculated level of future seizure risk exceeds a threshold value. If the calculated level of future seizure risk does not exceed the threshold, then the method will loop back to s302 and begin the process of electrical impulse stimulation again. If the calculated level of future seizure risk does exceed the threshold, then the method will proceed to s314 where in response to the high level of seizure risk, high-frequency electrical impulses will be delivered to regions of the brain to prevent the seizure occurrence or mitigate the affects of the seizure if onset does occur. Once this has been delivered the method loops back to s302 such that active perturbation and monitoring can continue.

[0072] Figure 4 shows a block diagram of a typical general purpose computer system 4 that may form the processing platform for the seizure forecasting on the intracranial implant, as described, according to a first embodiment. The computer system 40 comprises a central processing unit (CPU), random access memory (RAM), and input / output ports (I / O) into which data can be received and output therefrom as is well known in the art. Additionally included is a series of electrodes 42a-42e that are connected to the computer system via the I / O ports. Although, many further appliances could be used if necessary.

[0073] The computer system 40 also includes some non-volatile storage 44, such as a hard disk drive, solid-state drive, or NVMe drive. Stored on the non-volatile storage 44 is a number of executable computer programs together with data and data structures required for their operation or training. Overall control of the system 4 is undertaken through the execution of the following programs: the stimulation program 440, the signal pre-processing program 442, the feature extraction program 444 and the seizure forecasting program 446. The other data contained in the non-volatile storage 44 is the training data 1125 which could be used to train any machine learning models that may be utilized for feature extraction, seizure forecasting etc.

[0074] Figures 5a-5b show graphs 5a / 5b of the temporal evolutions during the time windows of 20ms to 1000ms after the first and second electrical stimulus and during the time window of 4000ms to 4980ms after the first stimulus. It can be observed that there was high variability on the temporal evolution of both variance 5a2 / 5a4 and autocorrelation 5a6 / 5a8 regardless of the time of the day, the pulse sequence (first or second pulse) as well as the length of time interval i.e., 100ms (Figure 8) or 1000ms (Figure 5a). Additionally, in individual cases there was a prominent increase or decrease in the features prior to seizures. The temporal evolution of the features in the 4000ms to 4980ms window after the first stimulus is depicted in Figure 5b. We observe that in four patients (KCL1 to KCL4) the profile of the variance 5b2 shows a prominent increase prior to seizures, whilst in the other four patients the profile of autocorrelation 5b4 tends to increase prior to seizure occurrence. In addition, the increase in the feature profiles prior to seizures is much clearer and consistent compared to the profiles computed from the 20ms to 100ms post-stimulus window (Figure 8) and the 20ms to 1000ms post-stimulus window (Figure 5a).

[0075] Figures 6a-6d shows a graph of seizure risk / probability during the time windows of 4000ms to 4980ms (Figure 6a) and -1000ms to -20ms (Figure 6b) relative to the first stimulus and the corresponding forecasting metrics (Figure 6c-6d) associated with these. In Figures 6a and 6c, the vertical dashed line denotes the seizure onset, whilst the darker waveform illustrates the forecasting horizon. The shaded area indicates the night interval from 11pm to 6am. After grid search the probability threshold and seizure occurrence period were set to 0.51; 150min (Figure 6a) and 0.64; 120min (Figure 6c) respectively. Grey unfilled circles in panels B and D (specifically Figure 6b 6bl and Figure 6d 6dl) denote the average loC obtained from the shuffled forecasts across 100 runs, whilst error bars denote the standard error. Further, in Figure 6b and 6d, the different graphs relate to loC 6bl / 6dl, sensitivity 6b2 / 6d2, tiw 6b3 / 6d3, forecasting horizon (min) 6b4 / 6d4 and BSS 6b5 / 6b5. Note that negative loC values from the shuffled forecasts were set to zero prior to averaging. Figures 6a-6d were utilized to investigate whether the forecasts from poststimulation data outperform the forecasts that are computed from passive unstimulated iEEG data. Thus, the same features were investigated during the time window of -1000ms and -20ms i.e., prior to before any stimulus has been delivered. Note that the time gap from the first pulse and its previous pulse was 5min and hence any effects of stimulation on the cortical excitability would have diminished. As previously mentioned, Figure 6c illustrates the likelihood or probability of seizure onset. Specifically, Figure 6c illustrates the likelihood of seizure onset in 8 patients, KCL1-KCL8. The likelihood of seizure onset is calculated from the LR classifier using the features from the pre-stimulus intervals of the first pulse. In 5 of the patients (KCL1-KCL3 and KCL5-KCL6), there is a noticeable increase in the seizure likelihood before the seizure onset (the vertical dashed line). Across all patients the average loC was 0.54, the average tiw was 0.08, the average BSS was 0.33 and the average forecasting horizon was 78.4min, as seen in Figure 6d.

[0076] Figures 7a-d shows graphs of seizure risk / probability during the time windows of 4000ms to 4980ms and -1000ms and -20ms relative to the first stimulus and the corresponding forecasting metrics associated with these, both of which highlight the difference between using one, five and all iEEG electrodes. Similar to that of Figures 6a-6d, the vertical dashed line denotes the seizure onset, whilst the darker waveform illustrates the forecasting horizon. The shaded area indicates the night interval from 11pm to 6am. Again, Grey unfilled circles in panels C and D denote the average loC obtained from the shuffled forecasts across 100 runs, whilst error bars denote the standard error. Note that negative loC values from the shuffled forecasts were set to zero prior to averaging. Contrary to Figures 6a-6d, after grid search, the probability threshold and seizure occurrence period were set to 0.6; 210min (Figure 7a, one signal), 0.51; 150min (Figure 7a, five signals), 0.74; 150min (Figure 7a, all signals) and 0.56; 240min (Figure 7b, one signal), 0.64; 120min (Figure 7b, five signals), 0.74; 150min (Figure 7b, all signals) respectively. In Figures 7a and 7b the differing graphs represent the one signal forecasted probability 7a2, the five signal forecasted probability 7a4 and the all signals forecasted probability 7a6. In Figures 7c and 7d the different rows of graphs relate to loC 7cl / 7dl, sensitivity 7c2 / 7d2, tiw 7c3 / 7d3, forecasting horizon (min) 7c4 / 7d4 and BSS 7c5 / 7d5; the different columns of graphs relate to the one signal / one channel data 7c6 / 7d6, the five signal / five channel data 7c7 / 7d7 and the all signals / all channels data 7c7 / 7d7. It can be seen from Figures 7a and 7b, that the best performance is achieved when five iEEG channels were considered. In addition, when we analyzed one or five iEEG channels the forecasts that were estimated from the window 4000ms to 4980ms after the first stimulus (Figure 7C; average loC for one and five channels: 0.34; 0.74 respectively) outperformed the forecasts that were computed from the window -1000ms to -20ms prior to the administration of the first stimulus (Figure 7D; average loC for one and five channels: 0.1; 0.54 respectively). When we considered all channels in the analysis the forecasting performance was the same (average loC: 0.34) between the post-stimulation and pre-stimulation. On the other hand, it may be considered that one iEEG channel in the analysis might not be enough to capture all the changes in cortical excitability, whilst analyzing all iEEG channels or electrodes might add redundant information.

[0077] The seizure forecasting algorithm deployed a logistic regression model which is considered one of the simplest classifiers to obtain probability forecasts. The selection of this model in combination with the leave-one-patient out cross validation approach reduced the possibility of model overfitting. The main quantitative features that were employed in the seizure forecasting algorithm were the variance and autocorrelation. Additional features that were employed in the logistic regression classifier were the cumulative average of variance and autocorrelation to allow the model to consider the history and the evolution of those features.

[0078] Further, Figure 8 shows the temporal evolution of the features from the window 20ms to 100ms after the first stimulus, or pulse, and after the second stimulus. The vertical dashed line denotes the seizure onset. The shaded area indicates the night interval from 11pm to 6am.

[0079] Figures 9a-9d relate to the seizure likelihood computed from the windows 20ms to 100ms and 20ms to 1000ms after the first (A, C) and second stimulus (B, D). The vertical dashed line denotes the seizure onset, whilst the darker line areas illustrate the forecasting horizon. The shaded area indicates the night interval from 11pm to 6am. All patients in panels A, B and C have zero Improvement over chance. The grid search (see Methods) in patients of panel D set the probability threshold to 0.41 and the seizure occurrence period to 90min. Forecasting metrics in panel D: KCL3 (sensitivity: 1, tiw: 0.08, loC: 0.92, forecasting horizon: 17.7min, BSS: 0.03) and KCL 4 (sensitivity: 1, tiw: 0.09, loC: 0.9, forecasting horizon: 88.9 min, BSS: 0.07) respectively.

[0080] Figures lOa-lOd relate to the seizure likelihood and forecasting metrics computed from the window 4000ms to 4980ms after the first stimulus (A, C) and the -1000ms to -20ms window prior to the first stimulus (B, D). Note that during the leave-one-subject-out approach no future information was used in the test patient. The vertical dashed line denotes the seizure onset, whilst the darker line areas illustrate the forecasting horizon. The shaded area indicates the night interval from 11pm to 6am. After grid search (see Methods) the probability threshold and seizure occurrence period were set to 0.75; 120min (A) and 0.51; 60min(B) respectively. Gray unfilled circles in panels C and D denote the average loC obtained from the shuffled forecasts across 100 runs, whilst error bars denote the standard error. Note that negative loC values from the shuffled forecasts were set to zero prior to averaging.

[0081] Further details and advantages of embodiments of the present disclosure will become apparent from the following further discussion relating to the background, need for, operation of, and results obtained by embodiments of the present disclosure.

[0082] Introduction

[0083] Globally, around 65 million people have epilepsy, and 5 million new cases are diagnosed per year, making it one of the most common neurological disorders [Milligan_2021, WHO_2023]. The key feature of epilepsy is the occurrence of recurrent seizures, and the first line of treatment is the administration of antiepileptic drugs (AEDs). Although AEDs are able to control seizures in around two thirds of people, the remaining one third suffer from uncontrolled seizures that create a significant burden in their lives [Chen_2018]. The ability to forecast the occurrence of upcoming seizures would significantly increase the quality of life of people with epilepsy by providing a seizure warning system, which could be used to enhance safety and to allow the application of preventative therapy.

[0084] Several studies that analysed continuous biosignals such as intracranial electroencephalography (iEEG), scalp EEG, heart rate, electrodermal activity and accelerometer measurements demonstrated that seizures can be forecast above chance levels [Cook_2013, Karoly_2017, Baud_2018, Kuhlman_2018, Meisel_2020, Maturana_2020, Proix_2021, Stirling_2021, Brinkmann_2023]. The most successful approaches to seizure forecasting analysed long-term, passively collected iEEG from implantable devices and made seizure-risk forecasts for various time horizons [Cook_2013, Karoly_2017, Baud_2018, Kuhlman_2018, Maturana_2020, Proix_2021]. The mechanism underlying the time-varying seizure-risk is not known yet but is assumed to relate to timevarying cortical excitability. Therefore, measuring and tracking cortical excitability more directly might provide valuable information about seizure forecasting. Active perturbation of the cortex and measuring its response may provide a more direct way to track cortical excitability. The first reported study of perturbing the cortex to quantify cortical excitability changes that occur prior to seizures used MEG (magnetoencephalography) and EEG responses to intermittent photic stimulation in people with photosensitive epilepsy [Kalitzin_2002] . This study showed that a phase-based quantitative measure (rPCI) significantly increased prior to seizures. The same group [Kalitzin_2005] subsequently analysed iEEG responses to electrical stimulation and demonstrated that in people with mesial Temporal Lobe Epilepsy (mTLE) elevated rPCI values correlated with shorter time intervals to the next seizure. In another study [Freestone_2011], the temporal evolution of quantitative metrics estimated from the iEEG responses to electrical stimulation was tracked in two patients with TLE and showed variation across the sleep-wake cycle and seizure occurrence. This study showed promise that probing the cortex with electrical stimulation and measuring its response using iEEG could be informative for seizure forecasting.

[0085] In the study presented here, we investigated whether we could forecast seizures by tracking cortical response to electrical stimulation. We studied a cohort of eight epilepsy patients that were implanted with intracranial electrodes and underwent prolonged intermittent electrical stimulation for one day. We extracted quantitative features at each stimulus and developed a logistic regression algorithm to estimate the seizure likelihood in each stimulus. In addition, we investigated how the seizure forecasting performance computed from the stimulus response compared to forecasts that were estimated using passive observation of iEEG.

[0086] Methods

[0087] Patients and data collection

[0088] We studied a cohort of eight patients with treatment-resistant focal epilepsy (5 male; mean age: 34.8 years) who were admitted to King's College Hospital for presurgical evaluation using iEEG. All patients were implanted with subdural (strip, mats) or depth electrodes (Ad-Tech Medical Instruments Corp., WI, USA) whose type, number and location were determined by the clinical team for each patient individually. At King's College Hospital the administration of single pulse electrical stimulation (SPES) is part of the presurgical protocol. The SPES protocol has been described in detail in Valentin et al. [Valentin_2002, Valentin_2005]. In brief, 10 single monophasic pulses (1ms duration; current intensity 2-5mA) with a gap of 10 sec are systematically delivered to all neighbouring electrodes to map cortical excitability. SPES provoke two main types of cortical responses: the early and late response. Early cortical responses to SPES that occur within 100ms after stimulation are considered physiological responses of the cortex to SPES. Late cortical responses to SPES that occur between lOOms-lsec after stimuli are considered abnormal [Valentin_2002]. It has been shown that the surgical removal of the brain tissue that corresponds to regions that generate late SPES responses is associated with the seizure focus and good-postsurgical outcome [Valentin_2005].

[0089] Once the clinical team collected all the clinical information from the video-iEEG monitoring, and before the explantation of the iEEG electrodes, the patients underwent intermittent stimulation for approximately one day. If antiseizure medications had been reduced or withdrawn, they were restored prior to the period of stimulation. In each patient, the pair of electrodes that generated the most obvious late SPES responses was selected for the prolonged stimulation and two single monophasic pulses (1ms duration; current intensity 2-5mA) that were separated by 5sec were delivered every 5min using a constant current neurostimulator (Medelec ST10 Sensor, Oxford Instruments). This stimulation procedure lasted from 12 to 26 hours (mean: 18 hours; Table 1). During the continuous stimulation none of the patients reported any behavioural percept. The study was approved by the institutional research ethics committee and all patients gave written informed consent to participate in the study.

[0090] Patient Gender Age Stimulation Number Number of Number

[0091] ID (years) duration of lead clinical of clinical seizures analysed seizures iEEG electrodes

[0092] KCL 1 M 35.2 16h, 14min 2 1 59

[0093] KCL 2 M 18.6 22h, 35min 2 1 46

[0094] KCL 3 F 56.6 26h, 49min 1 1 17

[0095] KCL 4 F 23.1 22h, 35min 2 1 62

[0096] KCL 5 M 58.5 15h, 13min 1 1 48

[0097] KCL 6 M 17.6 17h, 49min 1 1 22

[0098] KCL 7 F 24.8 12h, 46min 1 1 13

[0099] KCL 8 M 44.2 14h, 51min 3 1 46

[0100] Signal Preprocessing

[0101] After the iEEG acquisition, all iEEG signals were epoched in 4sec segments that were centred around each stimulus. Next, all iEEG epochs were visually inspected and epochs that had corrupted signals were removed from the analysis. All iEEG signals were re- referenced to the average and downsampled to 256Hz. To eliminate the stimulation artifact, the data points 0-20 ms post-stimulus were removed and replaced using a cubic spline interpolation. Afterwards, all signals were band-pass filtered (forward and backward filtering to minimize phase distortion) between 0.1 and 120 Hz and notch filtered between 48 and 52Hz using a fourth-order Butterworth filter. Figure 2 illustrates a schematic diagram of the analysis steps.

[0102] Selection of time windows relative to stimulations

[0103] Every five minutes, a pair of stimuli were delivered with a separation of 5 s. We intended to extract features around these pairs of stimuli but had no a priori information about the relevant window timing or duration, therefore we examined several time windows. We examined short windows (20ms to 100ms post the first stimulus and post the second stimulus) and longer windows (20ms to 1000ms post the first stimulus and post the second stimulus). Preliminary analysis of data suggested that there might be long duration effects of stimulation, hence we also examined a window 4000ms to 4980ms after the first stimulus (to leave a 20ms buffer prior to the second stimulus). Finally, we also examined a time window prior to the first stimulus, i.e., -1000ms to -20ms pre-stimulation to obtain information about 'passive' unstimulated features.

[0104] Selection of electrodes

[0105] Each patient had a different number of electrodes distributed in various anatomical locations. To standardize the approach across patients, we examined data from three different electrode sets: 1) the single iEEG signal that manifested the most prominent response across the stimulation procedure; 2) five iEEG signals that showed the most prominent response across the stimulation (we chose five because many implantable devices that deliver electrical stimulation are usually equipped with two to eight iEEG electrodes and five is the median of this range); and 3) all available iEEG signals. Note that the pair of stimulated signals was excluded from the analysis.

[0106] Feature Extraction

[0107] Cortical response to electrical stimulation was quantifying using the variance a2= ^Xt^Cxi - x)2, where N is the number of samples of the signal x, and autocorrelation PA iV-1as afunction of the lag A. The autocorrelation metric was computed as the width at the half maximum of the autocorrelation function [Maturana_2020]. For the cases for which we considered more than one signal we computed the average of variance and autocorrelation across the analysed signals. For each value of variance and autocorrelation, we also computed its cumulative average across its previous 12 values that correspond to a one hour interval (i.e., 12x5 min = 1 hour). Hence, for a given number of analysed iEEG signals (one, five or all), a given analysis window (one prestimulation window, three windows post the first stimulation, and two windows post the second stimulation) we obtained four features, i.e., variance, autocorrelation, cumulative average of variance and cumulative average of autocorrelation.

[0108] Features in the lOmin time interval before and after each seizure timestamp were removed from the analysis. In addition, all features were smoothed using a backward moving average filter with a 30min window length (i.e., average between the current and previous five points) to eliminate spontaneous fluctuations. Specifically, features were split in two windows that were separated at the timestamp of the seizure. Smoothing was performed in each window separately and features that corresponded to the first 30min of each window were discarded from the analysis to eliminate edge effects.

[0109] Seizure forecasting algorithm

[0110] All features from the 3-hour interval prior to seizure occurrence were labelled as "pre- ictal", whereas all features that were more that 3-hours from the seizure timestamp were labelled as "inter-ictal". Note that we only considered in the analysis lead seizures (i.e., the time interval between preceding and succeeding seizures was more than 3 hours) and we also excluded subclinical seizures. All features were z-normalized in each patient individually, using the mean and standard deviation of the features distribution during the interictal state. Afterwards, a Logistic Regression classifier was applied with a leave-one- patient out cross-validation approach. Specifically, the algorithm was trained in turns using the feature vectors (i.e., variance, autocorrelation, cumulative average of variance and cumulative average of autocorrelation) from the 7 patients and was tested on the feature dataset from the remaining patient. This process yielded for every patient a probability distribution with the seizure likelihood for each feature vector (i.e., probability likelihood that each feature vector has a "pre-ictal" label).

[0111] Afterwards, we employed a grid search to set the optimal "probability threshold" of the probability distribution, such that when it is crossed an alarm would be initiated that a seizure is about to happen in the next time-period i.e., the "seizure occurrence period". Once this "seizure occurrence period" has passed, then a new alarm can be initiated. In the grid search the "probability threshold" values ranged from 0.4 to 0.8 in steps of 0.01, whereas the "seizure occurrence period" values ranged from 30min to 240min, and we only used the training data to ensure that no information of the test participant is used to set these parameters. The parameter combination that gave the optimal improvement over chance was selected for the analysis. Once these parameters are set, the "Forecasting horizon" denotes the time (in minutes) between the alarm onset until the seizure onset.

[0112] To quantify the performance of the seizure forecasting algorithm, we used previously described forecasting metrics [Cook_2013]. Specifically, we used Sensitivity ( S = TP / (TP + FN), where TP: seizures that occur when the alarm is on, FN: seizures that occur outside alarms), time spent in warning (tiw: the proportion of time that was spent in warning computed as the total number of points for which the alarm was on over the total number of points), Improvement over chance (JoC = Sensitivity - tiw) and Brier Skill Score that quantifies the improvement of the Brier score relative to a random reference ( BSS = 1 — —) where BS is the Brier Score BS = -1t= ft - o / )2,n is the number of refnforecasted points, ftforecasted probability of the ithforecasted point, o£observed value of the ithpoint (0 when the point had "inter-ictal" label and 1 when it had the "pre-ictal" label). BSrefwas computed by randomly shuffling the probability forecasts 100 times and afterwards taking the average BSS value). When there is not improvement over reference then BSS tends to 0, when it is worse than reference it tends to -03and to 1 when it is perfect. In addition, to show that the forecasted metric values are not due to chance, we randomly shuffled the predicted forecasted probabilities 100 times and computed the average sensitivity, tiw and loC across the 100 runs. The signal pre-processing analysis as well as the feature extraction was performed in MATLAB (MathWorks R2020b), whereas the Logistic Regression analysis was executed in Python (version 3.8.16).

[0113] Results

[0114] Temporal evolution of feature profiles

[0115] We observed that there was high variability on the temporal evolution of both variance and autocorrelation regardless the time of the day, the pulse sequence (first or second pulse) as well as the length of time interval i.e., 100ms (Figure 8) or 1000ms (Figure 5A). Additionally, in individual cases there was a prominent increase or decrease in the features prior to seizures.

[0116] The temporal evolution of the features in the 4000ms to 4980ms window after the first stimulus is depicted in Figure 5B. We observe that in four patients (KCL1 to KCL4) the profile of the variance shows a prominent increase prior to seizures, whilst in the other four patients the profile of autocorrelation tends to increase prior to seizure occurrence. In addition, the increase in the feature profiles prior to seizures is much clearer and consistent compared to the profiles computed from the 20ms to 100ms post-stimulus window and the 20ms to 1000ms post-stimulus window (Figure 8, Figure 5A).

[0117] Seizure forecasting from the post-stimulus features

[0118] Having observed the temporal evolution of the features profiles computed from the various post-stimulus windows, we trained a Logistic Regression (LR) classifier using a leave-one- subject out cross validation approach. A LR classifier was trained using features computed from the 20ms to 100ms post-stimulus window and the 20ms to 1000ms post-stimulus windows, separately for the fist and second stimuli (time windows up to 100ms and 1000ms after stimulus). A LR classifier was also trained using features computed from the time interval from 4000ms to 4980ms after the first stimulus. In each case, the output of the LR classifier was a probability distribution with the seizure likelihood at each stimulus. When we executed the LR classifier using the short-term features computed from the 20ms to 100ms post-stimulus windows from the first or second pulse, the forecasting performance was poor and yielded zero loC for both pulses (Figure 9a, 9b). The same results hold when we considered the 20ms to 1000ms post-stimulus window of the first pulse (Figure 9c). Interestingly, when the features were computed from the 20ms to 1000ms post-stimulus window of the second pulse, in two out of eight patients we obtained loC 0.92 and 0.9 (Figure 9d). In contrast, when we analysed features computed from the time interval from 4000ms to 4980ms after the first stimulus, there was a clear increase in the seizure likelihood prior to seizure occurrence in all but one patient (Figure 6A). Across all patients, the average loC was 0.74, average sensitivity 0.88, average tiw 0.14, average BSS 0.33 and average forecasting horizon 73.86min (Figure 6B). The exact values of the forecasting metrics are provided in Table SI.

[0119] Seizure forecasting from the pre-stimulus features

[0120] We sought to investigate whether the forecasts from post-stimulation data outperform the forecasts that are computed from passive unstimulated iEEG data. We thus computed the same features from -1000ms to -20ms window prior to the administration of the first stimulus and applied the LR classifier. Note that the time gap from the first pulse and its previous pulse was 5min and hence any effects of stimulation on the cortical excitability would have diminished. Figure 6C illustrates the seizure likelihood for each patient as computed from the LR classifier using the features from the pre-stimulus intervals of the first pulse. In all but three patients (KCL 4, KCL 7, KCL 8) there is an increase in the seizure likelihood before the seizure occurrence. Across all patients the average loC was 0.54, the average tiw was 0.08, the average BSS was 0.33 and the average forecasting horizon was 78.4min (Figure 6D). The exact values of the forecasting metrics are given in Table S2.

[0121] Mimicking a real-time seizure forecasting system

[0122] In the analysis that we performed so far, the feature vectors of each patient were z- normalized using the corresponding mean and standard deviation of all interictal data (see Methods). Hence, the features of the test patient were normalized at each stimulus using future information. In a real-time seizure forecasting system, no future information is used for the estimation of seizure likelihood [Mormann_2007]. We thus repeated our analysis by ensuring that no future information is used in the test dataset. Specifically, we z- normalized the features of the test patient using the mean and standard deviation of the feature vectors that corresponded to the first two hours of iEEG recordings. We then excluded these two hours from the analysis and the algorithm was evaluated on the remaining dataset. This approach required to have at least five hours of iEEG recordings prior to the seizure occurrence (i.e., two hours of interictal data for the normalization and three hours of preictal data) and it was feasible to be tested in five patients (KCL1, KCL2, KCL3, KCL4, KCL7).

[0123] When we considered the time interval from 4000ms to 4980ms after the first stimulus (Figure 10a) the average loC was 0.59. When we analysed the -1000ms to -20ms window prior to the first stimulus (Figure 10b), the average loC was 0.34 across all patients. The seizure likelihoods as well as the forecasting metrics are illustrated in Figure 10.

[0124] Impact of number of electrodes on forecasting performance

[0125] We also examined the effect of the number of analysed electrodes on the forecasts. We thus computed the forecasts using one iEEG channel (channel with most prominent response across stimulation procedure), five channels (top five channels with the most obvious responses) and all iEEG cannels in each patient. We performed this analysis using the features computed from the window 4000ms to 4980ms after the first stimulus (Figure 7A) and features computed from the window -1000ms to -20ms prior to the administration of the first stimulus (Figure 7B). We observed that the best performance was achieved when we considered five iEEG channels. In addition, when we analysed one or five iEEG channels the forecasts that were estimated from the window 4000ms to 4980ms after the first stimulus (Figure 7C; average loC for one and five channels: 0.34; 0.74 respectively) outperformed the forecasts that were computed from the window -1000ms to -20ms prior to the administration of the first stimulus (Figure 7D; average loC for one and five channels: 0.1; 0.54 respectively). When we considered all channels in the analysis the forecasting performance was the same (average loC: 0.34) between the post-stimulation and prestimulation. The exact values of the forecasting performance are given in Tables S1-S6.

[0126] Discussion

[0127] In this study we analysed a cohort of eight people with treatment-resistant focal epilepsy who underwent intermittent repeated electrical stimulation for approximately one day. We computed quantitative features from various iEEG windows relative to the stimuli, and showed that, using the window 4000ms to 4980ms after the first stimulus, seizures can be forecast above chance levels in seven out of eight patients. In addition, in the analysed cohort of patients we found that probing the brain with electrical stimulation is more informative for seizure forecasting compared to passive monitoring without stimulation. Short-term post stimulus responses to SPES are widely used in presurgical evaluation for cortical mapping [Lacruz_2007, Keller_2014, Matsumoto_2017]. Specifically, early responses to SPES that occur within 100ms after stimulation are used to map functional connectivity of the motor cortex and language areas. In addition, late responses to SPES that occur from 100ms to Isec after stimulation are used to identify the epileptogenic tissue [Valentin_2002, Valentin_2005]. In this study we found that short-term poststimulus responses that consider iEEG intervals up to 100ms after stimulation were not informative for seizure forecasting (Figure 9a and 9b). When we considered longer poststimulus intervals that encompass delayed responses (i.e., 1000ms after each stimulus), we were able to achieve seizure forecasting in two out of eight patients (Figure 9c and 9d). However, this was only possible when we analyzed the cortical responses from the second stimulus. This finding might indicate that each stimulus carries different information and therefore it may be more informative if stimuli are analyzed separately [Cornblath_2023]. In addition, those findings might indicate that the second stimulus is more informative compared to the first one due to the presence of a possible prolonged cortical excitability effect from the first stimulus (note that the time gap between the first and second stimuli was 5sec).

[0128] When we analysed the long-term post-stimulus responses of the first stimulus (i.e., 4000ms to 4980ms after the stimulus) we found that, in seven out of eight patients, seizures could be forecast above chance levels (Figure 6A and 6B). Note that for patient KCL8, in whom forecast above chance was not achieved, there were only 70min of iEEG available prior to seizure onset and therefore the poor performance might be due to the limited data. In addition, we demonstrated that seizure forecasting using passive unstimulated EEG was successful in five out of eight patients (Figure 6C and 6D). When we mimicked a real-world seizure forecasting system, we also found that active perturbation of the cortex and measuring its response is more informative for seizure forecasting compared to passive monitoring (Figure 10). These findings are in line with previous studies on theoretical models. Specifically, a computational model of TLE demonstrated that changes in excitability that proceed epileptic seizures may be more informative for seizure anticipation compared to passive monitoring [Suffczynski_2008]. Moreover, a theoretical model using a probing stimulus can extract information from the EEG for seizure anticipation [O'Sullivan-Greene_2009]. In addition, other theoretical models demonstrated that seizure anticipation may be feasible by applying small perturbation in the cortical dynamics [Kalitzin_2010].

[0129] We found that the best seizure forecasting performance was achieved when we considered five iEEG electrodes. This finding holds for both post and pre-stimulus iEEG intervals (Figure 7). The channels that were selected for the constant stimulation belong to the suspected seizure focus. In addition, the five electrodes that we considered in the analysis were those that manifested the most obvious responses during the stimulation, and hence it is very likely that those electrodes are part of the seizure onset network. Considering one channel in the analysis might not be enough to capture all the changes in cortical excitability, whilst analysing all electrodes might add redundant information. Future studies are needed to identify the optimal number and placement of electrodes for optimal seizure forecasting performance.

[0130] The seizure forecasting algorithm deployed a logistic regression model which is considered one of the simplest classifiers to obtain probability forecasts. The selection of this model in combination with the leave-one-patient out cross validation approach reduced the possibility of model overfitting. The main quantitative features that were employed in the seizure forecasting algorithm were the variance and autocorrelation. Previous studies [Mormann_2005, Maturana_2020] that analysed passively collected iEEG recordings showed that those features are informative for seizure forecasting. In addition, it has been shown in theoretical models that the variance is a metric that captures the energy between signals [Laiou_2017]. Additional features that were employed in the logistic regression classifier were the cumulative average of variance and autocorrelation to allow the model to consider the history and the evolution of those features. Future studies with larger cohorts of patients and longer recordings should deploy more advanced machine and deep learning approaches to optimize the seizure forecasting performance. To the best of our knowledge this is the first study to show that data from a time-window 4-5 sec after stimulation may be informative for seizure forecasting. Due to the limited amount of available iEEG data, we were not able to verify this finding using the second stimulus, nor explore whether the optimal long-term post-stimulation window might be even longer after the stimulus; these considerations await future studies.

[0131] Although the findings of this study show promise for seizure forecasting, they have to be interpreted with caution. First, the analysed cohort was small, and no definitive conclusions can be made. In addition, the absence of multiday recordings did not allow us to investigate the presence of circadian or multidien cycles on cortical excitability as well as to include time-matched seizure surrogate data [Andrzejak_2003]. Moreover, we analysed only one seizure per patient. Future studies with longer data should investigate whether the same findings hold for patients who manifest multiple seizures. In such cases the seizure forecasting parameters could be also optimized for each patient individually to enhance the seizure forecasting performance.

[0132] In conclusion, this study adds to previous experimental and theoretical studies [Kalitzin_2002, Kalitzin_2005, Suffczynski _2008, Kalitzin_2010, Freestone_2011] which showed that seizure forecasting may be possible by probing the brain with electrical stimulation. Additionally, this work demonstrates that late post-stimulus iEEG intervals may be more informative for seizure forecasting compared to iEEG intervals that correspond to passive monitoring of the brain. These findings may not only aid in the development of seizure forecasting algorithms but also in the design of novel implantable devices that deliver electrical stimulation to control seizures. The use of neuromodulation devices will be expanded in the near future [Denison_2022] and we hope that this work will motivate further research into uncovering the use of cortical electrical stimulation as a tool for seizure forecasting.

[0133] Unless the context clearly requires otherwise, throughout the description and the claims, the words "comprise," "comprising," "include," "including," and the like are to be construed in an inclusive sense, as opposed to an exclusive or exhaustive sense; that is to say, in the sense of "including, but not limited to."

[0134] The words "coupled" or "connected" or "tied", as generally used herein, refer to two or more elements or nodes that may be either directly connected, or connected by way of one or more intermediate elements. Additionally, the words "herein,” "above," "below," and words of similar import, when used in this application, shall refer to this application as a whole and not to any particular portions of this application. Where the context permits, words in the Detailed Description using the singular or plural number may also include the plural or singular number, respectively. The words "or" in reference to a list of two or more items, is intended to cover all of the following interpretations of the word: any of the items in the list, all of the items in the list, and any combination of the items in the list.

[0135] It will be understood that the above list is non-exhaustive, and that the method and system described herein is applicable to many technical problem domains to which machine learning models may be applied.

[0136] Various modifications, whether by addition, substitution, or deletion will be apparent to the intended reader to provide further embodiments of the present disclosure, any and all of which are intended to be encompassed by the appended claims.

[0137] Tables

[0138] Table SI: Forecasting values when we considered in the analysis the 4000ms to 4980ms window after the first stimulus using five signals.

[0139] Table S2: Forecasting values when we considered in the analysis the -1000ms to -20ms window before the first stimulus using five signals.

[0140] Table S3: Forecasting values when we considered in the analysis the 4000ms to 4980ms window after the first stimulus using one signal.

[0141] Table S4: Forecasting values when we considered in the analysis the 4000ms to 4980ms window after the first stimulus using all signals. Table S5: Forecasting values when we considered in the analysis the -1000ms to -20ms window before the first stimulus using one signal.

[0142] Table S6: Forecasting values when we considered in the analysis the -1000ms to -20ms window before the first stimulus using all signals.

[0143] References [Andrzejak_2003]: Andrzejak, R. G., Mormann, F., Kreuz, T., Rieke, C., Kraskov, A., Eiger, C. E., & Lehnertz, K. (2003). Testing the null hypothesis of the nonexistence of a preseizure state. Physical Review E, 67(1), 010901.

[0144] [Chen_2018]: Chen Z, Brodie MJ, Liew D, Kwan P. "Treatment outcomes in patients with newly diagnosed epilepsy treated with established and new antiepileptic drugs: a 30-year longitudinal cohort study.", JAMA Neurol., 75, 279, 86 (2018)

[0145] [Baud_2018]: Baud, M. O., Kleen, J. K., Mirro, E. A., Andrechak, J. C., King-Stephens, D., Chang, E. F., & Rao, V. R. (2018). Multi-day rhythms modulate seizure risk in epilepsy. Nature communications, 9(1), 88.

[0146] [Brinkmann_2023]: Brinkmann, B., Nurse, E., Viana, P., Nasseri, M., Kuhlmann, L., Karoly, P., ... & Freestone, D. (2023). Seizure Forecasting and Detection with Wearable Devices and Subcutaneous EEG-Outcomes from the My Seizure Gauge Trial (PL4. 001).

[0147] [Cook_2013]: Cook, M. J., O'Brien, T. J., Berkovic, S. F., Murphy, M., Morokoff, A., Fabinyi, G., ... & Himes, D. (2013). Prediction of seizure likelihood with a long-term, implanted seizure advisory system in patients with drug-resistant epilepsy: a first-in-man study. The Lancet Neurology, 12(6), 563-571.

[0148] [Cornblath_2023]: Cornblath, E. J., Lucas, A., Armstrong, C., Greenblatt, A. S., Stein, J. M., Hadar, P. N., ... & Conrad, E. C. (2023). Quantifying trial-by-trial variability during cortico-cortical evoked potential mapping of epileptogenic tissue. Epilepsia.

[0149] [Denison_2022]: Denison, T., & Morrell, M. J. (2022). Neuromodulation in 2035: the neurology future forecasting series. Neurology, 98(2), 65-72.

[0150] [Dumanis_2017]: Dumanis, S. B., French, J. A., Bernard, C., Worrell, G. A., & Fureman, B. E. (2017). Seizure forecasting from idea to reality. Outcomes of the my seizure gauge epilepsy innovation institute workshop. Eneuro, 4(6).

[0151] [Freestone_2011]: Freestone, D. R., Kuhlmann, L., Grayden, D. B., Burkitt, A. N., Lai, A., Nelson, T. S., ... 8<. Cook, M. J. (2011). Electrical probing of cortical excitability in patients with epilepsy. Epilepsy & Behavior, 22, S110-S118. [Kalitzin_2002] : Kalitzin, S., Parra, J., Velis, D. N., & Da Silva, F. L. (2002). Enhancement of phase clustering in the EEG / MEG gamma frequency band anticipates transitions to paroxysmal epileptiform activity in epileptic patients with known visual sensitivity. IEEE Transactions on Biomedical Engineering, 49(11), 1279-1286.

[0152] [Kalitzin_2005] : Kalitzin, S., Velis, D., Suffczynski, P., Parra, J., & Da Silva, F. L. (2005). Electrical brain-stimulation paradigm for estimating the seizure onset site and the time to ictal transition in temporal lobe epilepsy. Clinical neurophysiology, 116(3), 718-728.

[0153] [Kalitzin_2010] : Kalitzin, S. N., Velis, D. N., 8<. da Silva, F. H. L. (2010). Stimulation-based anticipation and control of state transitions in the epileptic brain. Epilepsy & Behavior, 17(3), 310-323.

[0154] [Karoly_2017]: Karoly, P. J., Ung, H., Grayden, D. B., Kuhlmann, L., Leyde, K., Cook, M. J., & Freestone, D. R. (2017). The circadian profile of epilepsy improves seizure forecasting. Brain, 140(8), 2169-2182.

[0155] [Keller_2014] : Keller, C. J., Honey, C. J., Megevand, P., Entz, L., Ulbert, I., 8<. Mehta, A. D. (2014). Mapping human brain networks with cortico-cortical evoked potentials. Philosophical Transactions of the Royal Society B: Biological Sciences, 369(1653), 20130528.

[0156] [Kuhlmann_2018]: Kuhlmann, L., Lehnertz, K., Richardson, M. P., Schelter, B., 8<. Zaveri, H. P. (2018). Seizure prediction— ready for a new era. Nature Reviews Neurology, 14(10), 618-630.

[0157] [Lacruz_2007]: Lacruz, M. E., Garcia Seoane, J. J., Valentin, A., Selway, R., 8<. Alarcon, G. (2007). Frontal and temporal functional connections of the living human brain. European Journal of Neuroscience, 26(5), 1357-1370.

[0158] [Laiou_2017]: Laiou, P., 8<. Andrzejak, R. G. (2017). Coupling strength versus coupling impact in nonidentical bidirectionally coupled dynamics. Physical Review E, 95(1), 012210. [Matsumoto_2017]: Matsumoto, R., Kunieda, T., & Nair, D. (2017). Single pulse electrical stimulation to probe functional and pathological connectivity in epilepsy. Seizure, 44, 27- 36. [Maturana_2020]: Maturana, M. I., Meisel, C., Dell, K., Karoly, P. J., D'Souza, W., Grayden, D. B., ... & Freestone, D. R. (2020). Critical slowing down as a biomarker for seizure susceptibility. Nature communications, 11(1), 2172.

[0159] [Meisel_2020]: Meisel, C., El Atrache, R., Jackson, M., Schubach, S., Ufongene, C., & Loddenkemper, T. (2020). Machine learning from wristband sensor data for wearable, noninvasive seizure forecasting. Epilepsia, 61(12), 2653-2666.

[0160] [Milligan_2021] : Milligan, T. A. (2021). Epilepsy: a clinical overview. The American Journal of Medicine, 134(7), 840-847.

[0161] [Mormann_2005]: Mormann, F., Kreuz, T., Rieke, C., Andrzejak, R. G., Kraskov, A., David, P., ... & Lehnertz, K. (2005). On the predictability of epileptic seizures. Clinical neurophysiology, 116(3), 569-587.

[0162] [Mormann_2007]: Mormann, F., Andrzejak, R. G., Eiger, C. E., & Lehnertz, K. (2007). Seizure prediction: the long and winding road. Brain, 130(2), 314-333.

[0163] [O’Sullivan-Greene_2009]: O'Sullivan-Greene, E., Mareels, I., Freestone, D., Kulhmann, L., & Burkitt, A. (2009, September). A paradigm for epileptic seizure prediction using a coupled oscillator model of the brain. In 2009 Annual International Conference of the IEEE Engineering in Medicine and Biology Society (pp. 6428-6431). IEEE.

[0164] [Proix_2021]: Proix, T., Truccolo, W., Leguia, M. G., Tcheng, T. K., King-Stephens, D., Rao, V. R., & Baud, M. O. (2021). Forecasting seizure risk in adults with focal epilepsy: a development and validation study. The Lancet Neurology, 20(2), 127-135.

[0165] [Stirling_2021] : Stirling, R. E., Grayden, D. B., D'Souza, W., Cook, M. J., Nurse, E., Freestone, D. R., ... & Karoly, P. J. (2021). Forecasting seizure likelihood with wearable technology. Frontiers in neurology, 12, 704060.

[0166] [Suffczynski_2008]: Suffczynski, P., Kalitzin, S., da Silva, F. L., Parra, J., Velis, D., & Wendling, F. (2008). Active paradigms of seizure anticipation: computer model evidence for necessity of stimulation. Physical Review E, 78(5), 051917.

[0167] [Valentin_2002]: Valentin, A., Anderson, M., Alarcon, G., Seoane, J. G., Selway, R., Binnie, C. D., & Polkey, C. E. (2002). Responses to single pulse electrical stimulation identify epileptogenesis in the human brain in vivo. Brain, 125(8), 1709-1718. [Valentin_2005] : Valentin, A., Alarcon, G., Honavar, M., Seoane, J. J. G., Selway, R. P., Polkey, C. E., & Binnie, C. D. (2005). Single pulse electrical stimulation for identification of structural abnormalities and prediction of seizure outcome after epilepsy surgery: a prospective study. The Lancet Neurology, 4(11), 718-726.

[0168] [WHO_2023]: World Health Organization, (2023), https: / / www.who.int / news-room / fact- sheets / detail / epilepsy

Claims

Claims1. An intracranially-implantable electronic device, comprising: an electronic circuit having one or more processors and one or more braincontacting electrodes, the electronic circuit configured such that in use it operates to: send electrical stimuli into a brain, wherein the electrical stimuli is sent in accordance with a stimuli pattern; measure an output from the brain in response to the electrical stimuli; feed the output into a forecasting model; and detect, via the forecasting model, outputs that indicate a likelihood of seizure.

2. The device of claim 1, wherein the one or more processors are further arranged in use to: apply, via the brain-contacting electrodes, a prophylactic treatment to the brain to prevent a seizure from occurring, based on detecting an output indicating a high likelihood of seizure.

3. The device of claim 1 or 2, wherein the forecasting model applies a greater predictive weighting factor to outputs measured in response to later electrical stimuli within the stimuli pattern.

4. The device of any of the preceding claims, wherein there is a first predetermined delay between the application of the electrical stimuli to the brain and the measurement of the output from the brain.

5. The device of claim 4, wherein the first predetermined delay is at least 1 second, more preferably at least 4 seconds.

6. A method of forecasting the likelihood of seizure onset, the method comprising: sending, via an intracranial implant, an electrical stimuli into a brain, wherein the electrical stimuli is sent in accordance with a stimuli pattern; measuring an output from the brain in response to the electrical stimuli; feeding the output into a forecasting model; and detecting, via the forecasting model, outputs that indicate a high likelihood of seizure.

7. The method of claim 6, the method further comprising: applying, via the brain-contacting electrodes, a prophylactic treatment to the brain to prevent a seizure from occurring, based on detecting an output indicating a high likelihood of seizure.

8. The method of claim 6, wherein outputs that indicate a high likelihood of seizure are outputs that exceed a threshold value.

9. The method of claim 8, wherein the threshold value is calculated and set using a grid search or other suitable method, such that when the threshold value is crossed an alarm is initiated that a seizure is about to happen in a next time-period.

10. The method of any of claims 6-9, wherein the performance of the seizure forecasting is assessed using one or more of:(i) time spent in warning;(ii) improvement over chance; and / or(ii) Brier Skill Score.

11. The method of any of claims 6-10, wherein there is a first predetermined delay between the application of the electrical stimuli to the brain and the measurement of the output from the brain.

12. The method of any of claims 6-11, wherein the stimuli pattern consists of two or more electrical stimuli separated by a second predetermined delay.

13. The method of claim 12, wherein the second predetermined delay is at least 3 seconds, more preferably at least 5 seconds.

14. The method of any of claims 6-13, wherein the forecasting model comprises a Logistic Regression model with leave-one-subject-out cross-validation.

15. The method of any of claims 6-14, wherein the forecasting model further comprises a feature labelling model, that labels pre-ictal, inter-ictal and post-ictal features in the output from the brain.

16. The method of any of claims 6-15, the method further comprising: pre-processing the output signal from the brain in response to the electrical stimuli.

17. The method of claim 16, wherein the pre-processing includes one or more of:(i) bandpass filtering;(ii) bandstop filtering;(iii) butterworth filtering;(iii) removing simulation artifacts;(iv) downsampling; and / or(v) re-referencing to the average.

18. The method of any of claims 6-17, wherein feature extraction is used to detect outputs that indicate a high likelihood of seizure, the feature extraction comprising one or more parameters of:(i) variance;(ii) autocorrelation;(iii) cumulative average of variance; and / or(iv) cumulative average of autocorrelation.

19. The method of claim 18, wherein the variance is quantified using the following equation:where N is the number of samples of the signal, x.

20. The method of claim 18, wherein the autocorrelation is quantified using the following equation:where N is the number of samples of the signal, x, and A is the lag.