Seizure forecasting with ultra long-term EEG signals

Objective: The apparent randomness of seizure occurrence affects greatly the quality of life of persons with epilepsy. Since seizures are often phase-locked to multidien cycles of interictal epileptiform activity, a recent forecasting scheme, exploiting RNS data, is capable of forecasting seizures days in advance. Methods: We tested the use of a bandpass ﬁlter to capture the universal mid-term dynamics enabling both patient-speciﬁc and cross-patient forecasting. In a retrospective study, we explored the feasibility of the scheme on three long-term recordings obtained by the NeuroPace RNS System, the NeuroVista intracranial, and the UNEEG subcutaneous devices, respectively. Results: Better-than-chance forecasting was observed in 15 (83 %) of 18 patients, and in 16 (89 %) patients for daily and hourly forecast, respectively. Meaningful forecast up to 30 days could be achieved in 4 (22 %) patients for hourly forecast frequency. The cross-patient performance decreased only marginally and was patient-wise strongly correlated with the patient-speciﬁc one. Comparable performance was obtained for NeuroVista and UNEEG data sets. Signiﬁcance: The feasibility of cross-patient forecasting supports the universal importance of mid-term dynamics for seizure forecasting, demonstrates promising inter-subject-applicability of the scheme on ultra long-term EEG recordings, and highlights its huge potential for clinical use. (cid:1) 2024 International Federation of Clinical Neurophysiology. Published by Elsevier B.V. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/).


Highlights
• A simple method for extracting multidien cycles is proposed, allowing intra-and inter-subject seizure prediction days in advance.
• The feasibility of multi-day prediction using multidien cycles is demonstrated for human/canine, intracranial/subcutaneous EEG.
• Cross-patient forecasting benefits person with seizures without waiting for model training.

Introduction
Epilepsy is a chronic disorder of the central nervous system characterized by rare, brief, abnormal collective activity of neurons termed seizures.Approximately 65 million people worldwide are affected, and the social and economic burden is significant due to high disability and mortality (Leonardi and Ustun, 2002;Feigin et al., 2019).For people with drug-resistant epilepsy, who represent about one third of all epilepsy patients, the apparent randomness of seizure occurrence is a major challenge in everyday life (Schulze-Bonhage and Kühn, 2008).An automated algorithm able to reliably forecast the risk of seizures would undoubtedly improve their quality of life and provide new therapeutic options, such as customized medication and closed-loop stimulation.
The development of seizure forecasting algorithms for electroencephalography (EEG) started long way back (Litt and Echauz, 2002;Iasemidis, 2003;Mormann et al., 2007;Kuhlmann et al., 2018b).A common approach has been to identify essential differences between preictal states, just before seizure onset, and interictal states, far from any seizure.Recent results from two worldwide open competitions clearly showed better-than-chance prediction performance in both human and canine intracranial EEG (iEEG) recordings (Brinkmann et al., 2016;Kuhlmann et al., 2018a).The first in-human study demonstrated the feasibility of long-term iEEG monitoring in ambulatory settings (Cook et al., 2013) and proved to be a valuable source of ultra-long term data for subsequent studies (Karoly et al., 2016(Karoly et al., , 2017(Karoly et al., , 2018;;Maturana et al., 2020).Other types of data obtained by less invasive methods, including scalp EEG, subcutaneous EEG (Duun-Henriksen et al., 2020), or wristband sensor data (Meisel et al., 2019), and even seizure diaries (Karoly et al., 2020;Goldenholz et al., 2020), have also been used for seizure prediction.
Using the information of the current brain state to estimate the seizure risk of future states, a better-than-chance prediction with an unprecedented over-day horizon was demonstrated for IEA data recorded with the RNS system (NeuroPace, Inc., Mountain View, CA, USA).
However, despite the promising results, important questions remain: How far can the forecasting horizon be extended, and is there an upper limit to the prediction horizon?How do the new prediction schemes perform on different data sets and different features?To what extent does the scheme rely on patient-specific characteristics?What assumptions/restrictions can be relaxed in order to broaden its scope and ease its application?To all of these questions, we chose the following approach: 1. We applied a patient-independent band-pass filter to eliminate the fast fluctuations and longterm trends in order to preserve the essential medium-term dynamics of the data.Thus, the estimation of the phase of patient-specific multidien epileptic cycles (Proix et al., 2021;Stirling et al., 2021a,b) can be avoided.This approach makes it possible to predict the seizure risk in a patient-specific and in a cross-patient manner, respectively, even without estimating the phase or cycle.
2. We analyzed the forecasting performance with respect to a horizon of up to one month in order to identify the temporal limits of the proposed algorithm.
3. In addition to the IEA counts on data obtained with the NeuroPace RNS system, we applied the method to canine iEEGs recorded with the NeuroVista seizure advisory system (Davis et al., 2011;Howbert et al., 2014) and to subcutaneous EEGs from patients using the UN-EEG device (Lynge, Denmark) (Weisdorf et al., 2019).Unlike the NeuroPace recordings, no stimulation was applied, which has been demonstrated to interfere with ictogenesis (Bergey et al., 2015).4. For the NeuroVista and UNEEG data sets, continuous EEG signals were considered instead of IEA counts.In particular, band power and cross-channel Pearson correlation were used to infer the epileptic cycle, indicating the existence of universal cycles that are informative for seizure forecasting.

Data sets
Three data sets were used in this study.The first is the development cohort in (Proix et al., 2021), which consists of 18 adult patients implanted with and receiving neurostimulation from the NeuroPace RNS System, an implantable brain stimulator for detecting and treating seizures.
Seizures were identified by detecting prolonged IEA events using patient-specific thresholds, and visually verified by a board-certified epileptologist through consistency checks with seizures in EEGs stored by the RNS system.The 18 patients were selected from 72 participants after excluding 37 with unreliable electroencephalographic seizure detection (<90% positive predictive value for long IEA episodes representing electrographic seizures based on EEG) and 17 with electrographic seizures in >50 % of the days (where seizure forecasting would be of low utility).IEA time series from two RNS detectors of each patient were z-scored for each recording block with different detection settings and interpolated to fill short recording gaps (Proix et al., 2021).Preprocessed hourly IEA counts are used as common.
The second data set consists of two canine iEEG recordings obtained with the NeuroVista system (Davis et al., 2011;Howbert et al., 2014), which are publicly available on the International Epilepsy EEG Portal (ieeg.org).Candidate seizures were detected using a highly sensitive seizure detection algorithm (Gardner et al., 2006).Expert neurologists then annotated the entire iEEG record and verified all seizures.Three of the eight shared recordings have no seizures.Two of the remaining are suitable for further consideration, with >3 months of recording time and >20 seizures over the recording period, allowing a reliable training of our forecasting models.Signals were sampled at 400 Hz from two electrodes with four contacts each.
The third set includes subcutaneous EEG (SqEEG) of two patients recorded with the UNEEG system (Weisdorf et al., 2019).SqEEGs were reviewed by a trained epileptologist in both the Fourier and time domains, with seizure annotation verified by a board-certificated neurophysiologist.These two were selected from nine patients because they both had >15 seizures and were representative of those with (patient B) and without (patient E) a circadian seizure cycle, respectively.Two-channel EEG data sampled at 207 Hz were obtained through a single-wire implant with three contacts (one as reference).
The key information of the data sets is summarized in Table 1, with clinical information presented in Supplementary Table 4.Further details can be found in the references (Howbert et al., 2014;Proix et al., 2021;Weisdorf et al., 2019;Brinkmann et al., 2015;Ung et al., 2016).

Preprocessing and handling of data gaps
There are data gaps of different lengths in the NeuroVista and UNEEG recordings, most of which are short (<15 s).A local data-missing ratio was estimated using a rolling window method with a window size of five minutes.Recording intervals with a data-missing ratio above a threshold of 0.5 were discarded.The processed EEG recordings were then partitioned into 15s segments for feature extraction.Incomplete segments, amounting to < 1.2% of the total data for each subject, were zero-filled prior to feature extraction.Empty segments that fell completely within a gap were discarded.
To obtain the cyclical variation of the features via band-pass filtering, missing values in feature gaps shorter than 2 weeks were filled with Gaussian white noise, with the mean and standard deviation estimated from the feature time series in the last 5 days before the gap.Blocks of recordings separated by gaps longer than 2 weeks were treated independently.For the NeuroPace data set, the preprocessed hourly IEA counts were used as provided.The short gaps were filled by interpolation methods (Proix et al., 2021).

Features
For NeuroPace data set analysis, we used the two-channel IEA counts as provided (Proix et al., 2021).For NeuroVista and UNEEG data set analysis, EEG signals were first notch filtered at 50 Hz and harmonics to remove power line noise.Next, power in five frequency bands (<4 Hz, 4-8 Hz, 8-12 Hz, 12-35 Hz, >35 Hz) and cross-channel Pearson correlation coefficients were calculated for each 15s segment.
The feature time series were band-pass filtered to remove the fluctuating fast dynamics and long-term trend caused by the nonstationarities (Ung et al., 2016(Ung et al., , 2017;;Schroeder et al., 2022) using a zero-phase tenth-order Butterworth filter.The cutoff frequencies were set to 1 50d and 1 5d , respectively.For forecasts at a longer time interval (e.g., daily), the mean feature values over all 15s segments within a given time step (of one day) were used.For the NeuroVista data set, features were further averaged over all channels to accentuate possible cycles of feature variation.The data preprocessing steps are shown in Figure 1(a).

Forecasting models
For each forecasting horizon h, the features {x t−i } D−1 i=0 of the past D time steps were used to predict the seizure probability p of the future step, i.e., we are looking for a model that can be represented by a function: where t indexes the current time step, and the duration of a time step corresponds to the forecast frequency f x , which can be daily, hourly, or every 10 minutes.The forecast horizon h represents the length of time into the future that the forecast target goes.A scheme to illustrate the model For the machine learning implementation, we tested three models.Two belong to the generalized linear model (GLM) category (Poisson regression and logistic regression), and the third is a support vector machine (SVM) with a linear kernel.
For a GLM realization, the output p of our model 1 can be understood as the conditional expected value of a random variable Y characterised by a given distribution, and the function F is the composition of an inverse link function l and a linear function with parameter β, i.e.

E(Y|X)
where X is the set of input features.For Poisson and logistic regressions, the link function is of the form l(z) = e z and l(z) = log z 1−z , and the random variable Y follows the Poisson and Bernoulli distributions, respectively.By assuming the independence of Y between time steps, the joint probability of a sequence of forecasts can be easily computed.The model parameter β can then be estimated using maximum likelihood.
If not stated otherwise, the results presented are from Poisson regression.All models were implemented using Scikit-learn 1.1.2(Pedregosa et al., 2011).
For patient-specific models, features were split into temporally non-overlapping subsets for training and testing, i.e. the part of the feature time series before and after a split time was used as training and test set, respectively.Details of the split time and the corresponding number of seizures used for the training and test periods can be found in Table 1.
For cross-patient models, the leave-one-patient-out method was used for the train-test split, i.e., data from a given patient was left for testing while the remaining 17 patients were used for training.
For the NeuroPace data set, the forecasting frequency varied from daily to once every 12, 6, 3, and 1 hours.For the NeuroVista and UNEEG data sets, additional frequencies of once every 30, 20, and 10 minutes were tested.Regardless of the frequency, the horizon was tested up to 30 days for all data sets.

Performance measures
To characterize the forecasting performance, we used the area under the curve (AUC) value of the receiver operating characteristic plot.A forecast is classified as improvement over chance (IoC) if the corresponding AUC value is significantly higher than a random forecaster (with p < 0.05).The brier skill score (BSS) was used as a complementary measure to indicate the relative improvement in the mean squared error of the forecast over a reference strategy where the model output was randomly shuffled in time (Mason, 2004).A BSS of 1 represents a perfect forecast, 0 is no improvement, and negative values indicate worse performance than the reference model.Other metrics include the portion of time in warning (PITW) and the false warning rate per day (FWR).
They measure the specificity and are of particular clinical relevance.

Statistical analysis
1) The p-value of an AUC value, i.e. the probability that a random predictor would achieve the same performance, was estimated using the Hanley-McNeil method (Hanley and McNeil, 1982).
IoC was defined for the case with p < 0.05 for the AUC value.For multiple comparisons, the p-value was adjusted by the false discovery rate (FDR) (Benjamini and Hochberg, 1995) with 2) The significance of the AUC values was additionally tested with a Monte Carlo method (Proix et al., 2021).Here, models trained on original training data for each patient were tested on 200 surrogate feature sets to obtain surrogate AUCs.The p-value was defined as the probability that the surrogate AUCs are not smaller than the original AUC.
3) Finally, with known values of PTIW and sensitivity, an alternative significance test was performed using a binomial test (Snyder et al., 2008).
4) A linear regression was used to infer the dependence between patient-specific and crosspatient AUCs.The p-value for the null hypothesis, i.e. there is no relation between the two variables, was estimated with the students t-test.The significance level was set at p = 0.05.
Since no significant differences were found between the three significance tests of the performance measure, only the results of the Hanley-McNeil test are presented below.

Data availability
The NeuroPace data set in the form of preprocessed hourly IEA counts has been made publicly available by T. Proix et al. (Proix et al., 2021) at DOI: 10.5281/zenodo.4274624.Canine Neu-roVista iEEGs are publicly available on the International Epilepsy EEG Portal (ieeg.org).The subcutaneous data set is the property of UNEEG and is not publicly available.Python codes used in this work will be made publicly available.

Performance for NeuroPace data set
The band-pass filtered IEA was used as the only feature type of our model input and is shown in Fig. 2(a).As can be seen in the top panel, the noisy fast fluctuations have been filtered out and the resulting time series look qualitatively similar to the multidien cycle presented in [26] (see their Fig.1E).
As illustrated in the middle and bottom panels of Fig. 2(a), the variation of the predicted seizure risk from our models with time was relatively smooth, even for hourly forecasts.This reduces the probability of frequent false alarms.The trend of variation is highly coherent for patient-specific and cross-patient models.However, the range of variation is smaller for the cross-patient forecast.
Similar AUC values were expected, but the BSS for the cross-patient case should be smaller, as confirmed by the following results.
Regarding the performance of our patient-specific study, IoC (p < 0.05) was observed in 15 (83 %) of 18 patients and in 16 (89 %) patients for daily and hourly forecasts with a one-hour horizon, respectively (see Tab.2).If the horizon is extended to 6 days, IoC can still be found for 6 (33 %) patients for daily forecasts (see Fig. 2(b)).Notably, the hourly forecast achieved IoC performance in 6 (33 %) patients even 4 days in advance (see Fig. 2(c)).This is a first estimate of the number of patients who could benefit from extended horizon forecasting.
For patients with IoC, our patient-specific study yields a median AUC of 0.77 (Interquartile range (IQR) 0.73-0.86)and of 0.76 (0.71-0.82) for daily and hourly forecasts, respectively.The complementary measure BSS gives a median of 0.27 (IQR 0.20-0.37)and 0.04 (0.03-0.04) for daily and hourly forecasts, respectively.The performance distributions for individual patients and their variation with forecasting horizons are shown in Fig. 2. Compared to the results with multidien phases (Proix et al., 2021), our method performed comparably well for the short-term prediction of the next day/hour and proved to be superior with extended horizon, i.e. we obtained an IoC for 6 patients with a 6-day horizon compared to 3 patients with a 3-day horizon.
Two additional measures were used to characterize the specificity of the forecasts, the PTIW for the proportion of time in warning and the FWR for the rate of false warnings per day.The median PTIW is 0.35 (IQR 0.15-0.41)for daily and 0.35 (0.26-0.42) for hourly forecasts.A reduction of the PTIW value is required for clinical application, but may be limited by the type of features used, as discussed later.The median FWR is 0.03 (IQR 0.02-0.04)and 0.01 (0.01-0.03) for daily and hourly forecasts, respectively.This corresponds to one false alert per month and one false alert per 100 days, respectively.Note that a long continuous false alert, exceeding the forecast frequency value, was treated as a single event.
A pre-trained cross-patient model would eliminate the need for months or even years of training for current patient-specific models.This would be particularly useful for further in-human studies with implantable devices.Using cross-patient training, our model performs marginally worse than the patient-specific case in all quantified measures (see Table 2).In detail, an IoC could be achieved for 4 patients with a 6-day horizon and for 5 patients with a 4-day horizon for daily and hourly forecasts, respectively.
For further comparison and evaluation of our results, we used the instantaneous phase of bandpass filtered IEA counts instead of IEA counts as input features for the model in Fig. 1(b).The instantaneous phase φ(t) is estimated by constructing a complex signal s(t)+jŝ(t) = r(t)e jφ , where s(t) represents the bandpass filtered IEAs and ŝ(t) is the Hilbert transform of s(t).The results using the phase are shown in the Supplementary Table 5.The performance is slightly worse than our results using IEA counts (see Table 2).This indicates that useful information for seizure forecasting is contained in the amplitude of the IEA time series.
In Fig. 2(b) we see a decrease in performance with longer horizons, but a 6-day horizon is obviously not the upper limit.To explore how long the horizon can be extended, we trained patient-specific models of hourly forecasting with horizons of up to 30 days and evaluated the performance.The median and interquartile range (IQR) of AUCs and the number of patients with IoC are shown in Fig. 3(a).At the group level, the scores first decreased for the horizon up to about 3 to 4 days, and then oscillated without a clear trend.As a manifestation of the oscillation, the number of IoC patients is significant (≥ 4) for horizons of about 10, 15 or even 30 days.Correspondingly, the change in AUCs for a single patient was strongly non-monotonic, and above-chance values were observed at almost regular intervals for horizons longer than 15 days (see Fig. 3(b)).Similar behavior was found for different types of forecasting models (Poisson regression, logistic regression and support vector machine), suggesting that the oscillatory behavior was due to certain properties of the data.

Performance for NeuroVista and UNEEG data sets
For both dogs and patients, significantly better than chance performance can be achieved over day-long horizons, even at a frequency of every 10 minutes.The performance measures for both data sets are listed in Table 3.
For the dogs of the NeuroVista data set the AUC values are shown in dependence of the forecasting horizon in Fig. 4(a).Exemplarily for the UNEEG data, the predicted seizure risk over time for a single patient is shown in Fig. 4(b).An oscillatory behavior similar to the NeuroPace data was observed for the variation of the horizon.Forecasted seizure risks varied over time in a similar manner for different forecasting frequencies.Rare jitter was observed for the high forecasting frequency cases.The similarity between different forecasting frequencies may be due to the elimination of fluctuating fast dynamics by our band-pass filtering preprocessing method.

Discussion
In this work, we proposed a novel preprocessing method to capture the essential mid-term brain dynamics and tested it retrospectively for patient-specific and cross-patient forecasting on three different chronic data sets.Our main findings include: 1.A simple band-pass filtering method to capture the dynamics relevant to seizure forecasting provides significantly better than chance forecasting for horizons up to one month (the largest value tested).Without the need to identify patient-specific epileptic cycles, our method significantly reduces the recording time required to identify cycles before providing a prediction.
2. Our method performed well for cross-patient and patient-specific forecasting.In a crosspatient model the long recording period required to train a patient-specific model is no longer necessary.
3. We tested the feasibility of our method for application to iEEG and subcutaneous EEG recordings.Despite the small number of subjects, our results showed that the success of our approach is not limited to seizures persisting beyond stimulation-induced suppression.
Moreover, our use of features other than IEA counts supports the hypothesis that there exists a set of unique underlying cycles and that these cycles can be estimated using different feature sets.
4. To explore the temporal limit of performance, we systematically tested our model with horizons up to one month.We found that performance decreases in the first few days, then oscillates without a clear trend, and "islands" of better-than-chance performance appear at almost regular intervals.

Seizure onset biomarkers and universal cycles
According to our findings and those of previous studies, an important component of a successful prediction scheme is a robust biomarker for the onset of seizures.Here, a biomarker is considered good if it exclusively marks seizure onset.An example is the instantaneous phase of multidien cycles used by Proix et al. (Proix et al., 2021) and Maturana et al. (Maturana et al., 2020), where seizures are locked to specific phases of epileptic cycles (Karoly et al., 2021;Baud et al., 2018;Gregg et al., 2020).For the development of new prediction algorithms, several biomarkers that have proven useful in previous seizure detection studies (Baldassano et al., 2017) and have a continuous temporal evolution can serve as candidates.Our choice of features for the NeuroVista and UNEEG data was motivated by just this consideration.Its success may be due to the fact that the selected features describe the same cycles of epileptic brain activity as IEA counts.Moreover, we always used features with amplitude information as input to the models, rather than the mere phase of epileptic cycles.

Patient-independent cycle extraction
There is a key distinction between our method and that of Proix et al. (2021), which lies in the use of a patient-independent band-pass filter in our study, whereas Proix et al. (2021) employed patient-specific cycles.In terms of performance, as discussed with reference to Figure 2, our method performed comparably well for short-term predictions (next day/hour) and demonstrated superior performance over extended horizons spanning several days.
The improved performance of our method can be attributed to factors beyond the multidien cycles themselves, such as the phase-locking behavior of seizures to these cycles.First, seizures from different patients may be phase-locked to different cycles, whether dominant or non-dominant, and potentially to multiple cycles.Without prior knowledge of this, extracting only patient-specific dominant cycles cannot guarantee optimal forecasting performance.Second, the degree of phaselocking can vary, and the cycles discussed here are not pure sinusoidal waves but rather correspond to smooth peaks in the power spectrum of EEG or IEA.Without prior knowledge of the degree of phase-locking, determining the patient-specific frequency range optimal for cycle extraction is nearly impossible.

Oscillation of forecast performance
The long-term oscillatory behavior of forecast performance, as shown in Fig. 3 and 4, was naturally expected to be related to cycles in brain dynamics.The idea is that if a seizure is successfully predicted due to phase-locking to a cycle with period T , then a second seizure occurring approximately time T later should also be predicted.However, the frequency spread of these cycles and the nonlinear dynamics of the brain complicate this scenario.A qualitative characterization, such as correlating the number of patients with significant IEA cycles of period T with those showing IoC for horizon T , is relevant but beyond the scope of this study.

Cross-patient forecasting
The development of cross-patient algorithms is of great importance, as patients would then benefit from the first measurements without the need for long patient-specific model training periods.A similar cross-patient study was performed by Proix et al. (Proix, 2022).Without further details, an in-depth comparison is not possible.Attia et al. reported that with subcutaneous EEGs a generalized cross-patient model could classify preictal and interictal states better than chance in four out of six patients (Pal Attia et al., 2022).Goldenholz et al. demonstrated in a retrospective study of 5419 patients that the use of e-diaries is able to provide meaningful crosspatient forecasts of impending seizures (Goldenholz et al., 2020).The studies support the fact that epilepsy dynamics show a certain universality independent of patient-specific characteristics.
Our own results confirm that epilepsy dynamics follow some universally present cycles, but their characteristics in respect to seizure occurrence may vary between patients.This is shown by the difference between patient-specific and cross-patient forecast performance in patient 5.

Applicability to different recording types
The extra-ordinary over-day forecasting was originally reported only for the NeuroPace data set.There is evidence that the stimulus delivered by the NeuroPace recording device can significantly reduce the rate of seizure occurrence (Bergey et al., 2015).The study by Proix et al.
(2021) considered therefore only seizures that persisted beyond stimulation-induced suppression.
Our application to the NeuroVista and SQEEG datasets excludes the possibility that the success of the scheme is limited to the special group of persistent seizures.Moreover, our use of the SQEEG dataset demonstrates that seizure predictive cycles can also be inferred from less-invasive subcutaneous EEG signals.
Another potential concern is the specificity and sensitivity of EEG event detection by the NeuroPace RNS system.As in Proix et al. (2021), our study focused on a cohort with high seizure detection specificity by excluding patients with a positive predictive value of less than 90% for long IEA episodes representing electrographic seizures based on EEG.The results obtained from the two other datasets further validate the proposed forecasting method.

Optimization of forecast scheme
Our proposed method motivates for a more general forecasting approach by first predicting future brain states and then assigning the corresponding seizure risk.It opens the possibility for systematic optimization of such forecasting algorithms.
For the state forecasting step, several standard machine learning tools are available, such as autoregressive models, long short-term memory, reservoir computing, etc.In addition, features must be evaluated for their ability to indicate seizure onsets.In this way, an interpretable system can be developed.
For the risk assigning step one may use a prior distribution of seizure risk with respect to the current biomarker value.Such a data-based construction matches all the patient/cohort nature, and is superior to any prefixed function forms.A similar approach was used by Maturana et al. (2020) to assign seizure risk for future states.

Caveats and future steps
The main purpose of this retrospective study is to explore feasibility.Similar to the commonly used phase extraction method (Proix et al., 2021;Stirling et al., 2021b,a), our zero-phase bandpass filter, which can accurately eliminate the fast fluctuating dynamics and long-term trend due to nonstationarity, is only suitable for off-line, non-clinical investigations.The creation of an appropriate alternative to the zero-phase filter is a future step for a prospective algorithm suitable for clinical application.
Due to the limited availability of ultra-long term recordings, the data sets used are small.They were screened, either by the data provider or by us, with different inclusion criteria.The data sets seemed sufficient to demonstrate the feasibility of the proposed method and to understand the predictability.The results can, however, only be indicative rather than conclusive.Other large cohorts are needed to further explore the universality of the conclusions drawn here or to define the candidate group of patients for whom the scheme works well.
By using recordings with and without neurostimulation as two complementary scenarios, we have shown that our forecasting algorithm performs well in both contexts.While open-loop interventions, such as those in the NeuroPace dataset used here, provide valuable insights, a more complex scenario involves closed-loop interventions.For instance, the NeuroPace RNS device can deliver neurostimulation based on the output of forecasting algorithms, or immediate medication might be administered following the prediction.Exploring such scenarios will be an intriguing next step.

Conclusion
In this contribution, we have explored the potential of multi-day seizure prediction and evaluated the performance of a cross-patient scheme.The novelty of our work lies in the application of a band-pass filter to capture the medium-term dynamics of the data, while avoiding the need to estimate the patient-specific phase or cycles.By analyzing the prediction performance over different forecasting horizons, we were able to identify the temporal limits of the proposed algorithm.
Given the size of the dataset used, this study serves more as a proof of concept than as conclusive evidence for broad applicability.
Looking ahead, there are several directions for future research in this field.First, it would be beneficial to explore the upper limits of the forecasting horizon to understand the factors that determine its extent.Examining longer-term predictions and assessing their accuracy would provide valuable insights into their practical applicability.
In addition, further research should consider investigating the performance of the prediction scheme on larger and more diverse data sets, encompassing a wider range of patient populations and data acquisition techniques.Incorporating complementary data sources, such as seizure diaries and wristband sensor data, could further improve the forecasting models and their predictive capabilities.Tables Table 1:

Figure 5
Figure 5 depicts the variation of AUC values of models with cross-patient training with the corresponding values of patient-specific forecasts for the NeuroPace data set.In the plot, each point is marked by the corresponding patient ID and the individual prediction frequencies are colored differently.Except for patient 5, the two performance scores are highly correlated, as shown by a linear regression with r = 0.86 and p = 1.7 • 10 −25 .It implies that a certain universal property was captured by both types of models and led to their correlated success.For the exceptional patient, the performance of the cross-patient model decreased significantly compared to the patient-specific model (AUC of next-day forecast from about 0.9 to 0.1).

Figure 5 :
Figure 5: Correlation between cross-patient and patient-specific forecasting performances of Neu-roPace data set.The AUC values are for the next time step, and different forecasting resolutions are indicated by colors.

Table 2 : Performance of patient-specific and cross-patient forecasting of the NeuroPace data set.
The shown values are n (%) or median (IQR) of patients with IoC.

Table 3 : Forecasting performance for dogs of Neurovista data set and patients of UNEEG data set.
Non-significant cases with p > 0.05(Hanley-McNeil test). *

Table 5 : Patient-specific and cross-patient forecasting performance for NeuroPace data set when using phase of bandpass filtered IEAs as input features.
The shown values are n (%) or median (IQR) of patients with IoC.The performance is worse than shown in Tab. 2 for the case using filtered IEA count as feature input.