Domain adaptation for EEG-based, cross-subject epileptic seizure prediction

The ability to predict the occurrence of an epileptic seizure is a safeguard against patient injury and health complications. However, a major challenge in seizure prediction arises from the significant variability observed in patient data. Common patient-specific approaches, which apply to each patient independently, often perform poorly for other patients due to the data variability. The aim of this study is to propose deep learning models which can handle this variability and generalize across various patients. This study addresses this challenge by introducing a novel cross-subject and multi-subject prediction models. Multiple-subject modeling broadens the scope of patient-specific modeling to account for the data from a dedicated ensemble of patients, thereby providing some useful, though relatively modest, level of generalization. The basic neural network architecture of this model is then adapted to cross-subject prediction, thereby providing a broader, more realistic, context of application. For accrued performance, and generalization ability, cross-subject modeling is enhanced by domain adaptation. Experimental evaluation using the publicly available CHB-MIT and SIENA data datasets shows that our multiple-subject model achieved better performance compared to existing works. However, the cross-subject faces challenges when applied to different patients. Finally, through investigating three domain adaptation methods, the model accuracy has been notably improved by 10.30% and 7.4% for the CHB-MIT and SIENA datasets, respectively.


Introduction
Epilepsy is a neurological disorder which causes recurrent seizures resulting from brain dysfunction.Symptoms of seizures vary greatly among patients and can range from brief disruptions in activity to loss of consciousness and severe convulsions.To diagnose epilepsy, physicians use electroencephalography (EEG), which records the electrical activity of the brain using electrodes placed on the skull.Studies have shown that there is a pre-ictal period, lasting several minutes before the onset of a seizure.During the pre-ictal EEG recordings display patterns that are different from those of the seizures and also from normal periods, called inter-ictal (Mormann et al., 2005).Thus, by distinguishing pre-ictal from inter-ictal states, it is possible to predict seizures.
Computer-aided models for seizure prediction can be grouped into three categories: (1) patient-specific modeling, which is tailored to each individual patient, (2) multiple-subject modeling, also called patient-independent modeling, which is applied to a dedicated set of patients, and (3) cross-patient modeling, a generalized model that uses data from multiple patients and can be applied to new, unseen patients.
1. Patient-specific modeling involves using a portion of a single patient's data for model training and the remaining data for performance evaluation.However, this type of model is not practical as it is limited by the amount of data available and the need to record a sufficient number of seizures for each individual patient.2. Multiple-subject modeling, also called patient-independent modeling, is a complex task that predicts seizures for subjects in a dedicated ensemble of subjects.This modeling does not have the limitation of lack of data as it utilizes all patient data grouped into at least two sets to train and test the model.However, this approach faces the major challenge of adapting the prediction model to new data from unseen patients.3. Cross-subject modeling, also known as generalized modeling, is the most complex type for seizure prediction.This approach allows generalization to other patients and does not require labeled data for new patients.
Research has mostly focused on multiple-subject modeling for seizure prediction (Khan et al., 2017;Tsiouris et al., 2017;Dissanayake et al., 2021a).As far as we know, cross-subject seizure prediction has not been investigated, although cross-subject modeling has been successfully applied to other tasks, such as seizure detection (Zhang et al., 2020), emotion recognition (Li et al., 2018), and mental load assessment (Albuquerque et al., 2019).Cross-subject modeling of seizure prediction is justified by the high variability between the data of different patients (Jemal et al., 2022).Indeed, data from a new patient may differ significantly from data of patients whose data served to train the cross-subject model.This is often referred to as a domain shift (Ben-David et al., 2010).It is common in real data applications, and can result in a significant drop in classification performance (Ponce et al., 2006).To address this issue, domain adaptation can be used.In this context, a domain refers theoretically to the probability distribution from which the problem data are drawn.The training dataset is called the source domain data and the test dataset is called the target domain data.Domain adaptation uses labeled source data and unlabeled target data to learn a model that performs well in both the target and source domains.This is generally achieved by re-weighting the source samples to minimize the distribution shift, so that the source samples closest to the target domain are given more importance (Huang et al., 2006;Sugiyama et al., 2007).Alternatively, one can use a pre-trained model from the source domain on the new target domain (Oquab et al., 2014).This approach, known as a parameter-based approach, can only be applied if some labeled data are available in the target domain.Another approach on which we focus in this study, called feature-based (Daumé III, 2009;Ganin et al., 2016;Long et al., 2018) uses the source and target data to learn features that display similar behavior in classification on both the source and the target domains data.The use of domain adaptation to classify EEG data has been successful in applications such as emotion recognition (Li et al., 2019;Ma et al., 2019;Zhang W. et al., 2019), motor imagery classification (Wu et al., 2019;Tang and Zhang, 2020), and evaluation of sleep quality (Zhang et al., 2017).
In this paper, we studied epileptic seizure prediction.We began by developing and investigating a new method of multiple-subject prediction by deep learning, and compared it to the state-of-the-art of such methods.Multiple-subject modeling broadens the scope of patient-specific modeling to account for the data from a fixed set of patients, thereby providing some useful level of generalization.To enhance seizure prediction and increase generalization across data from new patients, we have developed and investigated crosssubject model.We explored both model with and without domain adaptation, allowing us to assess the impact of data variability and underscore the significance of domain adaptation.Results show a significant improvement in accuracy, F1-score, and Area under the curve, on both CHB-MIT and SIENA datasets.
The remainder of this paper is organized as follows: Section 2 provides a summary of previous research on seizure prediction.Section 3 describes the EEG databases, the deep neural network architecture, as well as the domain adaptation methods used.Section 4 presents the experimental setup and results.Section 5 contains a conclusion and alludes to future directions of research.

Related work
Existing seizure prediction models fall into two major categories: the general multiple-subject modeling that applies to all patients, and the patient-specific modeling that addresses each patient individually.There has been little recent work on multiplesubject prediction modeling.The study (Tsiouris et al., 2017) compared different classification algorithms for seizure prediction, including the repeated incremental pruning to produce error reduction (RIPPER) algorithm, support vector machines (SVM), and neural networks (NN).The main objective was to distinguish between pre-ictal and inter-ictal EEG segments in data from multiple patients.Using a balanced number of selected pre-ictal and inter-ictal records from each patient in the CHB-MIT database, the SVM was found to have the best results with an accuracy of 68.5%.More recent studies, such as Khan et al. (2017), have demonstrated improved results using a convolutional neural network (CNN) on the wavelet transform of EEG signals, to achieve a sensitivity of 87.8% with a low false prediction rate of 0.142 FP/h.In Dissanayake et al. (2021a), a multi-task deep learning approach was used for both seizure classification and patient prediction using a Siamese network architecture.Using the CHB-MIT-EEG dataset, they reported an average accuracy of 91.54%.Another study, (Wu et al., 2022), utilized knowledge distillation to transfer information from a multiple-subject model trained on data from N − 1 patients to a patient-specific model trained on the remaining patient's data.This approach led to improved patient-specific prediction results compared to four other existing methods, with an average improvement of 3.37% in accuracy, 2.33% in sensitivity, and a reduction in false predictions by an average of 0.044/h when tested on 11 patients from the CHB-MIT dataset.
. /fninf. .Recently, deep learning has gained attention for its application in seizure prediction.For instance, a study by Tsiouris et al. (2018) employed a deep Long Short-Term Memory (LSTM) network to predict seizures using EEG segments with a pre-ictal duration of 120 minutes.The study reported high sensitivity and specificity of 99.84% and 99.86%, respectively, using the CHB-MIT dataset.Other studies have applied CNNs, such as (Truong et al., 2018) which used spectrogram representations of EEG data, and Zhang Y. et al. (2019) which applied a common spatial algorithm model prior to the CNN.Another recent study (Zhao et al., 2020) proposed a one-dimensional CNN trained on raw EEG data trained with raw EEG data to predict seizure occurrence.The study reported an area under the curve, sensitivity, and false prediction rate of 0.915, 89.26%, 0.117/h and 0.970, 94.69%, 0.095/h on american epilepsy society (AES) and CHB-MIT data, respectively.An alternative study proposed adversarial training for data augmentation to account for the limited amount of pre-ictal data, which improved the performance and robustness of the model.Recently, there has been a focus on developing interpretable models for patient-specific seizure prediction, as seen in studies such as Jemal et al. (2022) and Pinto et al. (2021), which utilize a genetic algorithm and a deep learning classifier, respectively.

Materials and methods . Datasets and pre-processing
In this study, experiments were conducted using two openaccess datasets, the SIENA EEG database and the CHB-MIT dataset.The datasets description is summarized in Table 1.
The SIENA dataset (Detti et al., 2020), acquired at the unit of neurology and neurophysiology of the university of SIENA, contains recordings from 14 epileptic subjects aged 20 to 71 years.The subjects were monitored using video EEG.A total of 29 EEG channels sampled at 512 Hz were recorded following the standard 10-20 system.During 128 hours of EEG recording, 47 epileptic seizures were recorded.The time of the onset of a seizure and its duration were identified by experts.The CHB-MIT dataset (Shoeb, 2009), collected at Boston children's hospital, contains 940 h of long-term continuous multichannel scalp EEG recordings from 23 epileptic subjects aged 1.5 to 19 years.A minimum of 19 EEG channels sampled at 256 Hz were recorded according to the international 10/20 standard.In total, these recordings included 198 seizures in which the onset and the end were precisely annotated by clinicians with expertise in neuroscience.In this study, we eliminated recordings with fewer than 23 electrodes.
The raw EEG channels from both datasets were filtered to focus on frequencies relevant to epilepsy analysis and to eliminate noise sources.This was done by using a notch filter with a cutoff frequency of 50Hz and a band-pass filter with a bandwidth of 0.5-70Hz.The pre-ictal period, which is the time before a seizure starts, was set to 1 hour based on published literature.Moreover, the postictal period, which is the time after the seizure ends, was eliminated to exclude any effects (Daoud and Bayoumi, 2019;Dissanayake et al., 2021a).Non-overlapping windows of 10 s were extracted from inter-ictal and pre-ictal recordings.To address the limited number of pre-ictal samples, under-sampling was used to randomly select examples from the majority class.The windows were then normalized so that the channels had zero mean and unit standard deviation.This resulted in a total of 77,529 inter-ictal samples and 89,783 pre-ictal samples from the CHB-MIT dataset and 197,805 inter-ictal samples and 80,845 pre-ictal samples from the SIENA dataset, which were split between training, validation, and testing data.

. Deep learning architecture
The architecture used for the multiple-subject and cross-subject models in this study was previously proposed by our team for the prediction of patient-specific seizures, as outlined in Jemal et al. (2022).We used the same network architecture.However, in contrast to the work in Jemal et al. (2022), which focuses on patientspecific modeling, our study centers around both multiple-subject modeling and cross-subject modeling.Additionally, we integrated domain adaptation techniques to enhance overall performance.As shown in Figure 1 and Table 2, the network consists of a threelayer convolutional neural network designed to be interpretable.The first layer uses standard 2D convolutions to extract relevant frequency components of the signal.The second layer uses depthwise filters, which is the application of convolution filters to each feature map (output from the previous layer) independently from the other maps.This step allows learn spatial filters from the previous outputs.The first and second steps are similar to the Filter Bank Common Spatial Pattern (FBCSP) algorithm commonly used for EEG data encoding.The third 2D convolutional layer is used for feature extraction.Finally, the output is passed through a fully connected layer with a Softmax activation function.

. Multiple-subject vs. cross-patient modeling
The task of seizure prediction can be approached using several models as depicted in Figure 2. Patient-specific modeling involves using data from a single patient to train a unique model for that patient, as shown in Figure 2A.A more practical solution is multiple-subject modeling (Figure 2B), which uses data from multiple patients grouped into training and test sets to learn a  single model that can be applied to all patients.However, this model may not generalize well to new patients.The focus of this work is cross-subject modeling (Figure 2C), which involves using labeled data from N − 1 patients for training and data from the remaining patient for testing.This study investigates domain adaptation methods to improve cross-subject modeling (Figure 2C).Domain adaptation involves using labeled data from N − 1 patients (source domain) and unlabeled data from a new patient (target domain) to transfer the model.With this method, the model is able to perform well on both the N − 1 patients used for training and the new patient.To accomplish this, we adopt a featurebased approach, which aims at learning features allowing good classification in both the source domain and the target domain.We investigate our architecture with three different domain adaptation algorithms: Discriminative Adversarial Neural Network (DANN), Domain Adversarial Conditional Adaptation (CDAN), and the Entropic conditioning variant of CDAN (CDAN+E).The selection of Domain-Adversarial Neural Network (DANN), Conditional Domain Adversarial Network (CDAN), and Conditional Domain Adversarial Network with Entropy minimization (CDAN+E) is motivated by their effectiveness in addressing domain shift challenges in previous studies (Du et al., 2020;Tang and Zhang, 2020;Li et al., 2022).DANN is chosen for its capacity to learn domain-invariant features, while CDAN incorporates conditional information for complex relationships between source and target domains.CDAN+E further enhances CDAN by integrating entropy minimization to boost model confidence in predictions.
. Domain adaptation and cross-subject generalization . .Supervised learning Let X be the input space, the set of all possible examples or data points and Y be its corresponding label space.For example, Y would be {0, 1} for a binary classification case.A domain D is defined as a distribution over X.
Moreover, let F : X → Y be a deterministic mapping function such as a neural network.In general, the quality of the predictor F(x) can be measured using loss function l(F(x), y).Supervised learning (Duda et al., 1973) can be defined as searching the optimal predictor F * using the optimization problem of the following form min The training data are used to find the optimal predictor F * , and the test data for the evaluation.Generally, the training and test data are assumed drawn from the same distribution.However, this assumption often does not hold in practice, thus justifying domain adaptation.

. . Domain adaptation
Let X S be the source domain data (training data) drawn from the distribution P S (X S ) and the target domain data (test data) denoted as X T are drawn from the distribution P T (X T ).
In the training stage, we assume in the training stage of sufficient labeled source domain data D S = {(x S i , y S i )} and unlabeled target domain data, D T = {(x T i , y T i )} .The input spaces and label spaces between domains are assumed the same: if x S = x T , then y S = y T .However, due to the data shift, P S (X S ) = P T (X T ) and P S (Y S /X S ) = P t (Y S /X T ).
The objective of domain adaptation is to adjust a model trained on a source domain to perform effectively on a new target domain.The feature-based approach aims to learn features that minimize the difference between the source and target distributions (Ganin and Lempitsky, 2015).Mathematically, this is expressed as: where L task represents the task-specific loss on the labeled source domain data, L domain is a domain discrepancy measure, and λ is a balancing parameter.
We will discuss three different methods for achieving this: the Discriminative Adversarial Neural Network (DANN), the Domain Adversarial Conditional Adaptation (CDAN), and the Entropic conditioning variant of CDAN (CDAN+E).

. . Discriminative adversarial neural network
The DANN method, as described by Ganin et al. (2016), aims at learning a feature representation that is discriminative for the  classification task on the source domain and not so regarding the shift between domains.It is based on the assumption that unlabeled target domain data is available.As shown in Figure 3, it consists of three main components: a feature extractor φ, a label predictor F and a domain discriminator D. The feature extractor φ also referred to as the generator, is a neural network that  is trained using data from both the source and target domains to learn a feature representation that is not specific to any particular domain.The label predictor F is trained to minimize the classification error on the source domain data, while the domain discriminator D is trained to differentiate between the source domain and the target domain.The label predictor and the domain discriminator work adversarially, encouraging the feature extractor to learn domain-invariant representations.The parameters of all three components are optimized according to the following objective function: (3) where λ is a trade-off parameter.

. . Conditional domain adaptation network and Entropic conditioning variant of CDAN (CDAN+E)
The CDAN approach, proposed by Long et al. (2018), is similar to the DANN approach and also contains three main components: a feature extractor φ, a label predictor F, and a domain discriminator D as illustrated in Figure 4.However, in CDAN, a conditional discriminator D is used through the joint variable H = (φ, F) in order to improve discriminability by capturing the cross-covariance between feature representations and classifier predictions.The method uses a multilinear conditioning strategy to combine the feature vector with the predicted label.The label predictor and domain discriminator are trained alternatively to minimize the label classification and domain classification losses, respectively.The optimization formulation for CDAN is as follows: where λ is a trade-off parameter, and, φ(X S ) ⊗ F(X S ) is the multilinear map between the encoded sources and the task predictions.
In addition, an extension of the CDAN algorithm, known as CDAN+E, was also proposed by Long et al. (2018), in which an entropy conditioning strategy was introduced to improve transferability.This approach involves using a score that quantifies the uncertainty of the classifier predictions.The score is based on an entropy criterion, and it is used to re-weight each example used by the conditional domain discriminator.This helps obtain better transferability.

Results
Performance evaluation of this study multiple-subject and cross-patient models for EEG based seizure prediction was conducted on CHB-MIT and SIENA datasets.Pytorch (Paszke et al., 2017) was used to implement the proposed architecture.Data pre-processing was done using the MNE-Python package Training and validation loss and accuracy curves for the multiple-subject seizure prediction model trained using CHB-MIT dataset.(Gramfort et al., 2013).Across all models, we employed the gradient-based ADAM optimizer with coefficients β 1 and β 2 set to 0.9 and 0.999 respectively for its efficiency and reliability in reaching a global minimum.The learning rate was set to 0.005.To prevent over-fitting, we used a holdout validation method to divide the data into a validation set and a training set, and the training.
The training stopped after 500 epochs or when the validation loss remained constant for at least 20 epochs.To evaluate the models, we used various metrics including accuracy, precision, recall, F1score, as well as the receiver operating characteristic (ROC) and the area under the curve (AUC). .

Multiple-subject modeling
The multiple-subject model was evaluated using data from all patients in the SIENA dataset, which was divided into training, validation, and test sets.The model achieved a high accuracy of 96.01%, sensitivity of 97.24%, and specificity of 94.57%.The model also produced a high AUC value of 0.96.The training and validation loss curves indicate that the model does not suffer from overfitting, as shown in Figure 5.The confusion matrix in Figure 6 demonstrates the model's classification performance.Comparison with current state-of-the-art seizure prediction models, as shown in Table 3, indicates that the model has comparable performance.
The multiple-subject model showed also high performance when evaluated using the CHB-MIT dataset, with an accuracy of 97.36%, a sensitivity of 98.31%, and a specificity of 96.97%.As shown in Figure 7, the training and validation loss decreased to a stable point, with a small gap between the training and validation curves, indicating that the model is well-fitting.The confusion level is relatively low, as indicated by the percentages of confusion between inter-ictal and pre-ictal instances (3.03% and 1.69%, respectively) as shown in Figure 8.According to Table 4, the model outperforms current state-of-the-art models evaluated on the same dataset.

. Cross-subject modeling
In contrast to the multiple-subject modeling approach, the cross-subject modeling employs a validation strategy called leaveone-patient-out.This strategy involves using data from each patient in the dataset, one at a time, for testing while training the classifier with data from the remaining N − 1 patients.This method is ./fninf. .commonly used to assess the ability of the classifier to generalize to new patients.We evaluated the proposed cross-subject method using both data sets by measuring performance in terms of F1-score, accuracy, and AUC.The results, presented in Tables 5, 6, show the evaluation results for each patient in the SIENA and CHB-MIT datasets respectively.The overall averages across all patients in the SIENA dataset were 39.81% for F1-score, 48.69% for accuracy, and 0.48 for AUC.Results were slightly better with the CHB-MIT dataset which uses more patients, with averaged F1-score, accuracy, and AUC, equal to, respectively, 55.34%, 63.5%, and 0.69.The performance degradation can be attributed to the mismatch between the distribution of the new patient data and the training distribution.This issue is particularly pronounced in seizure prediction, as most studies in this field focus on patient-specific models.Additionally, our previous research (Jemal et al., 2021) on the complexity of EEG features in predicting epileptic seizures, highlighted the significant variability in EEG data between patients.To mitigate the potential data shift, we explored three domain adaptation methods: DANN, CDAN, and CDAN+E.learns to discern and adapt to the inherent variations among individual patients, effectively mitigating the impact of noise introduced by inter-subject differences.This approach enables the model to generalize more robustly across patient populations, thereby enhancing its reliability and performance in the presence of accrued physiological and neural characteristics variability.We assessed the effectiveness of three different domain adaptation methods against a baseline cross-subject modeling method using leave-one-patient-out.The results displayed in Tables 7, 8, indicate that all three methods (DANN, CDAN, and CDAN+E) enhanced performance on both SIENA and CHB-MIT datasets.Notably, the CDAN method performed exceptionally well with 60.27% accuracy, 59.77% F1 score, and 0.61 AUC on the SIENA dataset.Significant improvement in performance was also observed on the CHB-MIT dataset with 70.90% accuracy, 66.45% F1-score, and 0.75 AUC for CDAN+E adaptation.The comparisons shown in Figure 9 reveal the importance of incorporating domain adaptation in cross-subject modeling compared to a traditional leave-one-patient-out approach.The CDAN method was found to significantly enhance the accuracy, F1-score, and AUC by 11.58%, 19.59%, and 0.13, respectively.The results were even better when evaluated on the CHB-MIT dataset (Figure 10), with an average improvement in accuracy, F1-score, and AUC of +7.40%, +11.11%, and +0.06%, respectively, using the CDAN+E method.Additionally, it was noted that the model's performance improved as the number of patients in the dataset increased.
A pertinent issue to consider is data under sampling to obtain a balanced dataset for improved learned model and reduced computational burden.Our examination of the SIENA dataset, with nearly balanced samples, demonstrated minimal impact from under-sampling.However, with the larger CHB-MIT dataset, potential implications become more evident.A key concern is the reduction of the majority class size, potentially impeding the model ability to capture diverse non-seizure patterns.This downsized dataset may result in decreased model performance, heightened sensitivity to noise, and biased representations of the majority class.Furthermore, under-sampling presents challenges in generalizing to new data and accurately identifying minority class instances like seizure events.A comparative analysis of results using the SIENA dataset, with limited data under sampling, and the extensively under sampled CHB-MIT dataset, suggests that under sampling does not significantly impact model performance or induce severe negative effects.Further investigations would be worthy of research, such as data augmentation, or neural networks of more representative objective functions.This line of investigation is crucial for ensuring the reliability and robustness of seizure prediction models in a scientific context.
Although accounting for patient sensitivity and specificity in model generalization ability is a problem worthy of consideration and research, it was not intended in the scope of this study.We acknowledge this as a limitation of the current study and mention it as a vein for future research that may significantly improve the method.Moreover, this study is subject to limitations inherent in the CHB-MIT and SIENA datasets, notably concerning gender, age, and ethnicity disparities.The datasets may not be representative of diverse populations, potentially introducing biases that affect the external validity of the findings.Gender imbalances may impact the generalizability of results, as conditions or responses to interventions may vary between genders.Additionally, uneven age distribution within the datasets may restrict the study's applicability to specific age groups, and ethnicity disparities may limit the generalizability of conclusions across different ethnic backgrounds.These inherent biases should be considered when interpreting the study's outcomes, emphasizing the need for cautious extrapolation to broader and more diverse populations.
. /fninf. .In conclusion, the results of predicting seizures using crosssubject models show promising outcomes.Implementing seizure prediction models in clinical settings holds promise for early intervention and personalized treatment strategies.However, challenges include the necessity for high-quality, unbiased training data, and ensuring interpretability for healthcare professionals.Seamless integration into existing clinical workflows, ethical considerations regarding patient privacy, and legal compliance are crucial.The model's ability to generalize across diverse patient populations and adapt to external factors needs careful consideration.Navigating these challenges is essential to harness the potential of seizure prediction models while ensuring ethical and practical implementation.

Conclusion
In this study, our goal was to assess the generalization capability of a seizure prediction model to new patients.Therefore, we used a deep-learning architecture previously developed for patient-specific modeling in both multiple-subject and crosssubject scenarios.Our deep-learning architecture for multiplesubject seizure prediction was compared to existing state-of-theart models and demonstrated superior performance.Despite the impressive accuracy of the model, its ability to generalize to new patients not in the dataset was uncertain.Thus, to better assess the model's performance and its ability to generalize to new patients, we employed a cross-subject modeling approach.This resulted in a noticeable decrease in performance when tested on openaccess data.To overcome this issue, we investigated various domain adaptation methods to enhance the performance of cross-subject modeling.The results showed that all three methods (DANN, CDAN, and CDAN+E) significantly improved performance on both SIENA and CHB-MIT datasets.
Although this study realized significant progress in epileptic seizure prediction, there are currently limitations that could be addressed in future research.One limitation is the use of data under-sampling to deal with data imbalance, which not only impacts the computational cost of the training method but could also remove potentially valuable data relevant to seizure prediction.Another limitation is related to the size of the datasets used in the study.While the current amount of data allowed for a fair investigation of the problem, incorporating more data from additional EEG databases would offer further support to the findings and enhance the overall validity of the study.Moreover, it's crucial to acknowledge that the study refrained from using extensive statistical analyses, presenting an avenue for future investigations to delve deeper into the quantitative aspects of the predictive model.
In future research, we aim to address this limitations.This involves exploring alternative methods, beyond under-sampling, to balance our dataset.Techniques like over-sampling, employing synthetic data, or leveraging advanced neural networks designed for imbalanced datasets will be considered.Additionally, we intend to combine patient data from various datasets to address the challenge of limited data.This expanded dataset will be evaluated to better understand how well the model performs in different datasets.

FIGURE
FIGUREIllustration of the deep-learning architecture: The network processes EEG inputs with a standard D convolution to learn frequency filters.Next, depth-wise convolution is applied to learn spatial filters.Finally, features are extracted with a D convolution, and the outputs proceed through a fully connected layer with Softmax activation.

FIGURE
FIGURE Di erent modeling for seizure prediction: patient-specific modeling, multiple-subject modeling, cross-patient modeling, and cross-patient modeling with domain adaptation.(A) Patient-specific modeling: design model which focus on individual patient.(B) Multiple-subject modeling: design model considering data from di erent patients.(C) Cross-patient modeling: design model which generalize to a new patient.(D) Cross-patient modeling with domain adaptation: improve model to work e ectively across di erent patients through domain adaptation.

FIGURE
FIGUREArchitecture of the discriminative adversarial neural network (DANN).

FIGURE
FIGUREArchitecture of the conditional domain adaptation network (CDAN).

FIGURE
FIGURETraining and validation loss and accuracy curves for the multiple-subject seizure prediction model trained using SIENA dataset.

FIGURE
FIGUREConfusion matrix for the multiple-subject seizure prediction model trained using SIENA dataset.

FIGURE
FIGUREConfusion matrix for the multiple-subject seizure prediction model trained using the CHB-MIT dataset.

FIGURE
FIGUREDomain adaptation for cross-subject modeling: a comparison between DANN, CDAN, and CDAN+E adaptation neural networks against the baseline cross-subject modeling using the leave-one-patient-out strategy on the SIENA dataset.Noticeable improvements over the baseline are consistently significant in terms of accuracy, F -score, and AUC.

FIGURE
FIGUREDomain adaptation for cross-subject modeling: a comparison between DANN, CDAN, and CDAN+E adaptation neural networks against the baseline cross-subject modeling using the leave-one-patient-out strategy on the CHB-MIT dataset.Noticeable improvements over the baseline are consistently significant in terms of accuracy, F -score, and AUC.
TABLE Comparisons of state-of-the-art seizure prediction methods applied on SIENA dataset using a multiple-subject modeling.
TABLE Comparison of the state-of-the-art seizure prediction methods applied on the CHB-MIT dataset using a multiple-subject modeling.
TABLE Evaluation of cross-subject modeling using the leave-one-patient out strategy (SIENA dataset).
TABLE Evaluation of cross-subject modeling using leave-one-patient out strategy (CHB-MIT dataset).Individual differences in physiological states, neural activity patterns, and EEG signal characteristics among patients can indeed introduce noise and confusion when combining data for model training.To address the problem, we use domain adaptation.Specifically, we use unlabeled data from new patients in learning of domain-invariant features.With domain adaptation, our modelTABLE Domain adaptation for cross-subject modeling: results obtained using DANN, CDAN, and CDAN+E adaptation methods using the leave-one-patient-out strategy on the SIENA dataset.
TABLE Domain adaptation for cross-subject modeling: Results obtained using DANN, CDAN, and CDAN+E adaptation methods using the leave-one-patient-out strategy on the CHB-MIT dataset.