Skip to main content
Scientific Reports logoLink to Scientific Reports
. 2025 Jul 2;15:22852. doi: 10.1038/s41598-025-06123-5

A novel ST-GCN model based on homologous microstate for subject-independent seizure prediction

Wei Shi 1, Yi Shi 2, Fangni Chen 1,✉, Lei Zhang 1, Jian Wan 1
PMCID: PMC12217839  PMID: 40596418

Abstract

Due to the lack of validated universal seizure markers, population-level prediction methods often exhibit limited performance. This study proposes homologous microstate dynamic attributes as a generalized, subject-independent seizure marker. Homologous microstate dynamic attributes were extracted using a novel spatiotemporal graph convolutional network (ST-GCN) model for subject-independent seizure prediction. An online deployment stage was introduced to validate the model’s clinical applicability. The online deployment stage demonstrated that the model achieved sensitivities of 96.79% and 98.84% on the private dataset and Siena dataset, respectively. The ST-GCN model successfully predicts seizures in a subject-independent manner, demonstrating its potential as a generalized tool for seizure prediction in clinical settings. This study indicates that dynamics within homologous microstates can serve as a universal predictive biomarker for seizures, expanding microstate research beyond transition patterns. It also provides a practical template for clinical seizure prediction models.

Keywords: Subject-independent seizure prediction, Homologous microstate dynamic attributes, ST-GCN, Online deployment stage

Subject terms: Epilepsy, Neurological disorders

Introduction

Since the early 1970s, efforts have been directed towards identifying the properties of preictal Electroencephalography (EEG) data and predicting seizure onset. In recent years, deep learning has demonstrated remarkable performance in seizure prediction1–3. However, most algorithms are subject-specific, trained using data from a single individual, and have limited generalization capabilities to other subjects. This limitation arises from the significant inter-subject variability in EEG data, posing a formidable obstacle to clinical adoption.

Currently, there are two primary strategies to tackle this issue. The first involves training subject-specific models and utilizing contrast learning to enhance inter-group differentiation while minimizing intra-group variability, aiming for broader applicability4. Nevertheless, this approach does not fundamentally alleviate the problem of insufficient training data. The second approach, subject-independent seizure prediction, aims to obtain seizure markers that can characterize all subjects by training and predicting using multi-subject data5.

Different subjects may exhibit varying seizure types, regions, and mechanisms, leading to distinct optimal prediction characteristics and prediction times. The absence of universal markers that can characterize seizures across all subjects represents one of the most challenging issues in epilepsy research today6. Consequently, it is imperative to train models using data from all subjects to develop a predictive model with strong generalization capabilities and to identify markers with the potential to characterize seizures universally.

Microstate analysis has gained popularity as a method for mining EEG data. It posits that normal cognitive processes involve alternating microstates, which are brief, stable topological configurations of cognitive networks7–9. Current studies delve into the interconnectedness and transformations between different microstates, aiming to unravel brain functional impairments associated with neurological conditions through their combinatorial dynamics10–12. However, there have been limited studies on the complex dynamics within homologous microstates.

Recently, Chu et.ai.10 has utilized homologous microstates to uncover alterations in brain network dynamics, achieving impressive performance in categorizing Parkinson’s patients based on these changes. Motivated by the success of Chu et al., we attempted to introduce the microstate mechanism to ascertain whether the dynamic attributes within homologous microstates could serve as a universal indicator for seizures. However, the extraction of homologous microstate dynamic attributes remains a novel challenge.

Studies have shown that seizures, although sudden, involve a transitional period from normal brain activity to seizure onset13,14. Furthermore, epilepsy is a classic network disorder of brain function, with seizures originating from abnormal neuronal discharges in specific regions that rapidly propagate to larger areas15,16. These findings suggest that the preictal period is rich in temporal and spatial dynamic information that can potentially characterize seizures. Therefore, we believe that homologous microstate dynamic attributes encompass both temporal and spatial information.

Over the years, some researchers have comprehensively considered the temporal and spatial information of EEG signals in seizure prediction tasks17. However, their exploration of the temporal and spatial properties of EEG signals was limited to extracting information from raw data using data-driven approaches without fully considering the physiological mechanisms of the brain itself.

We believe that the introduction of microstate mechanism can not only enhance the temporal resolution of EEG data, but also increase the interpretability of the predicted results. Dynamic attributes, including temporal and spatial dynamics, within homologous microstate may serve as a universal marker of seizures. Thus, this study aims to construct a framework for subject-independent seizure prediction using the dynamic attributes within homologous microstate. The contributions of this study are as follows:

  1. A novel model is proposed for subject-independent seizure prediction, arriving excellent sensitivity across multiple datasets.

  2. Homologous microstates significantly enhance EEG temporal resolution, confirming their potential to signal seizures.

  3. A unique clinical translational online deployment stage was proposed based on homologous microstate.

The remainder of this paper is organized as follows. Section "Data materials" describes the sources of the EEG data and the preprocessing procedure. Section "Methodology" introduces the detailed methods of framework structure and the ST-GCN model. Section "Experimental and results" describes the experimental procedure and results. Further analysis and discussion of the model are presented in Section "Analysis and discussion". Section "Conclusion" provides the conclusion and limitations.

Data materials

Data acquisition

In this study, the private dataset and the public Siena EEG dataset were used to evaluate the predictive performance of the proposed framework.

The private EEG dataset used in this study was obtained from the Department of Neurology at the Fourth Affiliated Hospital of Zhejiang University School of Medicine, as determined by experienced neurologists, based on clinical history and continuous video EEG recordings. An XLTEK EEG32U system, adhering to the international 10-20 standard, was employed for data acquisition18. During online recording, the impedance of the recording electrodes was maintained below 10KInline graphic, with a recording bandwidth of 0.05 to 70 Hz and a sampling rate of 500 Hz. 19 patients (12 males and 7 females; mean age 29.07 years) were enrolled. Detailed participant information is provided in Table 1.

Table 1.

Detail information of subjects in private dataset.

ID Age-Sex Num Dur ID Age-Sex Num Dur
1 4-M 1 5 11 18-M 1 5
2 19-F 1 5 12 13-M 2 5
3 31-F 1 5 13 1-M 2 5
4 75-M 2 5 14 37-M 3 5
5 7-M 3 5 15 16-F 1 5
6 18-F 2 5 16 18-M 1 5
7 18-M 1 5 17 42-F 1 5
8 52-F 2 5 18 68-F 1 5
9 15-F 1 5 19 38-M 3 5
10 10-F 3 5

Value of Age-Sex: M- Male; F- Female.

Num: the number of seizure.

Dur: the duration of the record.

The Siena scalp EEG dataset19 was collected by the Department of Neurology and Neurophysiology of the University of Siena. The dataset consisted of scalp EEG recordings from 14 patients (8 males and 6 females; mean age 43.5 years). The recordings were acquired at a sampling rate of 512 Hz with electrodes arranged on the international 10-20 system and saved in the EDF format. Detailed information regarding the selected subjects is provided in Table 2.

Table 2.

Detail information of subjects in Siena dataset.

ID Age-Sex Num Dur ID Age-Sex Num Dur
A 55-M 5 3 H 25-M 10 16
B 46-M 2 13 I 58-F 1 2
C 54-M 2 12 J 71-M 4 4
D 51-F 3 5 K 34-F 3 8
E 36-M 5 12 L 49-M 4 23
F 20-F 1 8 M 41-F 2 5
G 27-F 3 6 N 42-M 2 5

Value of Age-Sex: M- Male; F- Female.

Num: the number of seizure.

Dur: the duration of the record.

The patients provided their written informed consent to participate in this study. The private dataset involving human participants were reviewed and approved by the Ethics Committee of the Fourth Affiliated Hospital, Zhejiang University School of Medicine (registration number: K20190031). Besides, all methods were performed in accordance with the relevant guidelines and regulations.

Preprocessing

EEG preprocessing was performed using the EEGLAB20 toolbox in MATLAB (R2021a; MathWorks Inc., USA). The preprocessing steps were as follows. 1) The 10 minutes immediately preceding the seizure onset were selected to define the preictal period, with a minimum of 30 minutes post-seizure to define the interictal period. 2) Redundant channels such as ECG and EMG, etc. were removed according to the international 10-20 system for channel localization. After removing useless electrodes, 19 channels remained, including Fp1, Fp2, F3, F4, C3, C4, P3, P4, O1, O2, F7, F8, T3, T4, T5, T6, Fz, Cz, and Pz. 3) Down sampling to 125 Hz and applying band-elimination filter (48-52 Hz) and band-pass filter (2-40 Hz) to eliminate industrial frequency (IF) interference, baseline drift, and high-frequency noise. 4) Perform the average-reference and automatically removing common artifacts using the independent component analysis (ICA) with probability parameter of 0.9.

Methodology

In this section, we propose a subject-independent seizure prediction framework. As depicted in Fig. 1, the framework encompasses five components: microstate analysis, graph structure construction, temporal feature extraction, spatial feature extraction, and classification. Following the first four steps, spatiotemporal feature vectors from various EEG bands are concatenated and used as the input for softmax classifier. The details of the first four components are provided below.

Fig. 1.

Fig. 1

Main framework of the process. Upon preprocessing the EEG data, the microstate analysis had efficiently extracted four distinct homologous microstate fragments. Each of these fragments was then individually fed into the ST-GCN model for training. During the training phase, four graph structures were constructed for each microstate based on different frequency bands. Subsequently, spatio-temporal attributes were extracted from these graph structures and transformed into corresponding hidden vectors.

Microstate analysis

EEG signals exhibit interconversion between multiple network topologies, maintaining a relatively stable state for 60-120 ms9. The microstate analysis aims to increase the understanding of brain function by studying the characteristic of microstate. The extracting of microstates essentially involves extracting multiple classes of stable network topologies from EEG data segments.

Each sampled EEG signal can be used to calculate a Global Field Power (GFP) value, which represents the overall field strength of the sampled EEG signal. The EEG topography at the GFP peak was extracted as a raw map to obtain a high signal-to-noise ratio. The GFP was calculated as follows:

graphic file with name d33e812.gif 1

Here, N represents the number of EEG sampling points in the sequence, n denotes the number of EEG channels, Inline graphic indicates the value of the i-th channel at time point x, and Inline graphic represents the average value of all channels at time point x.

Indiscriminate polarity clustering was performed on the raw maps using the topographic atomize and agglomerate hierarchical clustering (T-AAHC) method21. T-AAHC combines atomization and hierarchical clustering to accurately identify and classify EEG microstates, providing robust results even in noisy data. The clustering termination condition was determined using the meta-criterion22, which combines multiple indices to ensure the selected clustering solution is reliable and meaningful. For each subject, clustering of the raw maps yielded 3 to 8 primary clustering maps. Subsequently, the primary clustering maps were consolidated into 4 best clustering maps. Based on the topological features of these maps, as reference8, they were labeled as microstate A, microstate B, microstate C, and microstate D. Notably, the dynamic transitions between these microstates convey temporal information, reflecting the brain’s functional dynamics over time.

The microstate sequences were obtained by fitting the microstate maps back into the EEG data of each subject through calculating the spatial correlation between the raw maps and the microstate maps. Subsequently, smoothing operation was performed on the microstate sequences. Finally, the EEG data from the same type of microstate were concatenated, thus forming the homologous microstate EEG segments.

The extraction process of homologous microstate fragments was shown in Fig. 2. We used Cartool software (v4.11; https://denisbrunet.github.io/Cartool/)23 to acquire microstate sequences and extracted homologous microstate segments using custom matlab scripts.

Fig. 2.

Fig. 2

Extraction process of homologous microstate fragments. Four different microstates can be obtained from the preprocessed EEG data after i. The four microstates can be fitted back to the EEG data by III inverse fitting to obtain the microstate sequences. The microstate sequences can be extracted from the homologous microstate fragments after IV.

Graph structure construction

The proposed ST-GCN model was designed to extract temporal and spatial dynamic features within homologous microstate. Consequently, EEG data were processed into a graph structure. We divided the aforementioned homologous microstate EEG data into 5s segments without overlap and constructed the graph structure. The two most important elements in the graph structure are node characteristic and edge relationship.

Node characteristic

Many studies have utilized spectral-related information for epilepsy prediction and have found that spectral power in specific frequency bands correlates with the predicted EEG signal24,25. Meanwhile, to preserve the homologous microstate temporal information, we chose the time-frequency power as the node characteristic. EEG signals were subjected to morlet wavelet processing to generate Inline graphic (2-4Hz), Inline graphic (5-7Hz), Inline graphic (8-13Hz) and Inline graphic (14-30Hz) time-frequency power features.

To mitigate differences in EEG signals between subjects, z-score normalization was also used:

graphic file with name d33e920.gif 2

where Inline graphic and Inline graphic are average and standard deviation of the power values of the subject (containing the interictal and preictal periods), respectively. Each 5s epoch had 4*19*625 (4 bands, 19 channels, and 625 samples) node characteristic.

Edge relationship

Seizure is a neurological disorder characterized by abnormal, highly synchronized discharges of brain neurons, which develop over time. Consequently, the brain state preceding a seizure exhibits a degree of supersynchronicity. This synchrony can be quantified through functional connectivity between various brain regions or channels26,27.

Phase Locking Value (PLV) characterizes the degree of phase synchronization between signals by measuring the clustering of the phase difference between two signals within a specific frequency band28. PLV functional connectivity networks are commonly used to analyze the mechanism of information transfer and coordination between brain regions and are defined as

graphic file with name d33e956.gif 3

where Inline graphic represents the instantaneous phase difference between signal i and signal j at time t; and W is the length of the window. The instantaneous phase of a signal can be derived from its analytical signal, and the analytical signal of an x(t) signal can be expressed as

graphic file with name d33e988.gif 4
graphic file with name d33e994.gif 5
graphic file with name d33e1000.gif 6

where z(t) is the analytical signal for x(t); Inline graphic is the real part with a value equal to the x(t) signal itself, and Inline graphic is the imaginary part, which is equal to the Hilbert transform result Inline graphic. Inline graphic is the instantaneous amplitude and Inline graphic is the instantaneous phase.

Inline graphic can be obtained using Eq. (5), where p.v represents the Cauchy principal value.

graphic file with name d33e1067.gif 7

We used Brainstorm software (v3.230705; https://neuroimage.usc.edu/brainstorm/)29 to compute the PLV functional connectivity networks for the delta, theta, alpha, and beta bands for each 5s epoch. The functional connectivity network was constructed into an adjacency matrix Inline graphic by setting a threshold Inline graphic (this threshold value was the optimal value obtained through several experiments, as detailed in Section V).

graphic file with name d33e1095.gif 8

where Inline graphic denotes the synchronization relationship between channels i and j. An Inline graphic of 1 implies that the channels i and j have an edge relationship.

In summary, we combined the adjacency matrix and power features as graph structure for temporal and spatial features extraction.

Temporal feature extraction

We utilized a gate recurrent unit (GRU) module to extract the temporal dynamic features from homologous microstate, with node characteristics updated as depicted in Fig. 3. Node characteristics were processed using windows of 20 sampling points, with a step size of one. These windowed data were sequentially fed into the GRU, and the final hidden state was extracted as the node feature.

Fig. 3.

Fig. 3

The process of extracting temporal features. The node characteristic contain time-frequency information for 19 channels. After the windowing process sequentially into the GRU module, the final output of the hidden vector as the node feature.

GRU is a variant of a recurrent neural network (RNN) that effectively addresses the issues of gradient vanishing and explosion in RNNs through a gating mechanism with reduced computational complexity17.

The update process for GRU is expressed in Eq. (7). Inline graphic is the reset gate that determines the extent to which information from the previous hidden state Inline graphic should be forgotten, while Inline graphic is the update gate that controls how much information from Inline graphic is retained in the current hidden state Inline graphic. Inline graphic, Inline graphic and W represent the parameter weights, whereas Inline graphic, Inline graphic and b denote the bias. Inline graphic signifies the candidate hidden state.

graphic file with name d33e1215.gif 9

The receptive field mechanism from the CNN model update was utilized herein. Each window can be considered a receptive field, and after multiple connected receptive field inputs, the final GRU output maintains the trend of the historical moments while also incorporating the EEG information from the most recent moments. The final hidden vectors of the GRU are employed to construct a new graph structure.

Spatial feature extraction

GCN can capture the global information of a graph, thereby enhancing the representation of node features. Therefore, in this study, a GCN module was used to extract the spatial dynamic features of functional connectivity.

Let Inline graphic denote the graph structure. Where V is the set of nodes, E is the set of edges, Inline graphic represents the node characteristic matrix. Here, N represents the number of nodes, and C is the characteristic dimension of each node. The adjacency matrix Inline graphic can be derived from this graph structure G.

In a GCN module, the propagation rules for updating the node representations in each layer are expressed as follows:

graphic file with name d33e1264.gif 10

where Inline graphic is the self-connecting adjacency matrix of a given undirected graph G, allowing for the inclusion of the nodes themselves when updating their features. Inline graphic is the unit matrix. Inline graphic is a diagonal matrix, where Inline graphic. Inline graphic denotes a node characteristic of the kth layer, Inline graphic. Inline graphic is the parameter weight matrix of the kth layer.

In this section, the time-frequency power of the corresponding bands is updated based on the functional connectivity features, an unprecedented operation. Previous studies extracted temporal features between graph structures using acquired spatial features, while ignoring temporal information within a graph structure. The method proposed not only focuses on dynamics within the graph structure, but also solves the limitation that data from different subjects cannot be trained together due to temporal discontinuity and is more suitable for subject-independent seizure prediction training.

Experimental and results

In this section, we detail the process and results of the model training stage and the online deployment stage. Additionally, we compare the outcomes of the online deployment stage with those of other existing algorithms.

Training stage

The proposed ST-GCN model was trained separately for each microstate type, with each type comprising four frequency bands, as illustrated in Fig. 1.

In this stage, we employed a 10-fold cross-validation to assess model performance. The dataset was uniformly partitioned into 10 subsets. The training, validation, and testing sets were maintained in an 8:1:1 ratio. Multiple training iterations were conducted, ensuring that each subset served as the test set once. The average and standard deviation of the test results were then calculated to summarize the training stage outcomes.

Model training was conducted to improve the ability to discriminate between positive and negative samples. If the number of positive and negative samples is unbalanced, the model will be biased toward the class with more samples. The preictal period in epileptic patients is much shorter than the interictal period. Therefore, in each training cycle, we randomly selected the same quantity of samples from the interictal period as from the preictal period.

To evaluate the prediction performance of the proposed model, we used six metrics:

  • Accuracy: Ratio of the correctly identified sample size to the total sample size.

  • Sensitivity: Ratio of correctly predicted seizures to the total number of actual seizures.

  • F1-score: The reconciled mean of precision and recall was used as a measure of the precision of the binary classification model.

  • FPR: Number of false alarms per hour.

  • Kappa: A statistical measure of the degree of agreement between classifier output and clinical labels.

  • P-value: The permutation test quantifies the disparity between the model’s predictions and random ones, facilitating an evaluation of whether the model has effectively extracted meaningful information from the data.

Our model was trained in Python 3.8, using an NVIDIA RTX 3090 graphics card, based on the Pytorch library. The hyperparameters were as follows: learning rate was 0.001, dropout was 0.5, batch size was 128, and the number of epochs was set to 80. Experiments were conducted using the Adam optimizer with a cross-entropy loss function. The primary parameters of the ST-GCN model are listed in Table 3.

Table 3.

Primary parameters of ST-GCN model.

M Layer Act Input size Output size
T N Ext - (Inline graphic, 625) (Inline graphic, 606, 20)
GRU Relu (Inline graphic, 606, 20) (Inline graphic, 256)
S GCN1 Relu (Inline graphic, 256) (Inline graphic, 128)
GCN2 Relu (Inline graphic, 128) (Inline graphic, 64)
GCN3 Relu (Inline graphic, 64) (Inline graphic, 32)
Linear - (Inline graphic, 32) (Inline graphic, 16)
Global - (Inline graphic, 16) (Inline graphic, 16)
Dropout - (Inline graphic, 16) (Inline graphic, 16)
Conca - (Inline graphic, 16) (Inline graphic, 64)
Linear Softmax (Inline graphic, 64) (Inline graphic, 2)

M, Module. T, Temporal. S, Spatial. N Ext, Node Extract. GCN1, GCNConv-1. GCN2, GCNConv-2. GCN3, GCNConv-3. Global, Global_mean_pool. Conca, Concatenate. Act, Activation.

The prediction performance of the proposed model after training is presented in Table 4. As shown in the table, on the private dataset, the average accuracy is 96.05%±0.62%, and the sensitivity is 96.35%±0.94%. Microstate C exhibits the strongest discriminator for positive samples, with a sensitivity of 97.30%±0.48%. For negative samples, microstate D demonstrates the strongest discriminatory ability, with a false-positive rate (FPR) of 0.028/h. Overall, microstates C and D perform slightly better than microstates A and B on the private dataset.

Table 4.

The performance of subject-independent prediction in the training stage.

Dataset Microstate Accuracy(%) Sensitivity(%) F1-score(%) FPR(/h) Kappa P-value
Private A 95.67±0.65 95.47±1.05 95.47±0.79 0.041±0.008 0.913±0.013 Inline graphic0.001
B 94.85±0.73 95.65±1.12 94.94±0.76 0.059±0.013 0.897±0.014 Inline graphic0.001
C 96.60±0.38 97.30±0.48 96.79±0.29 0.041±0.010 0.931±0.007 0.001
D 97.09±0.75 97.01±1.11 96.97±0.79 0.028±0.007 0.941±0.015 Inline graphic0.001
Average 96.05±0.62 96.35±0.94 96.04±0.65 0.042±0.009 0.920±0.012
Siena A 99.32±0.17 99.34±0.34 98.91±0.28 0.006±0.002 0.987±0.008 Inline graphic0.001
B 97.82±0.31 98.93±0.30 98.18±0.26 0.038±0.006 0.954±0.006 Inline graphic0.001
C 94.10±1.72 83.24±4.53 90.79±2.67 0.003±0.003 0.855±0.024 0.009
D 98.74±0.72 98.45±0.79 98.92±0.61 0.008±0.009 0.979±0.005 Inline graphic0.001
Average 97.49±0.73 94.99±1.49 96.70±0.95 0.013±0.005 0.943±0.010

Meanwhile, on the Siena dataset, the predictive performance of the model is generally superior to that on the private dataset. This may be attributed to the greater diversity in age among subjects in the private dataset, as well as the smaller volume of trainable data compared to the Siena dataset, both of which increase the complexity of model training. The Siena dataset achieve an accuracy exceeding 97% for all microstates except microstate C, and attains an impressive resolution of over 98% for the preictal period.

It should be noted that the microstate in the Siena dataset exhibited significant performance differences. The sensitivity of microstate A reached an outstanding value of 99.34%±0.34%, whereas the sensitivity of microstate C only reached 83.24%±4.53%. The p-values for both the private and Siena datasets were Inline graphic 0.05, indicating that the predictive performance of the model is statistically significant.

Online deployment stage

For clinical applications, seizures are usually predicted in real time, i.e., future states are predicted from the current time period. However, the probability of microstate occurrence is inherently uncontrollable. Determining the possibility of concatenating 5 seconds of the homologous microstate requires sufficiently long durations of EEG data, which complicates the determination and extraction of the current required time period. Therefore, we proposed the online deployment stage for the prediction of seizures in clinical setting.

All pre-processed data were cut into 30s segments without repetition. Homologous microstate segments were extracted using microstate analysis. Any homologous microstate segment shorter than 5 seconds was discarded, while segments longer than 5 seconds were truncated to the first 5 seconds for constructing the graph structure. The already trained ST-GCN model was then utilized.

Each class of homologous microstate can yield one prediction result, and ultimately, the results from various homologous microstate are used to vote on the classification of the 30s EEG data. Note that if the duration of a certain class of homologous microstate is less than 5s, the results of that class of microstate are excluded from the voting process. We combined hard and soft voting methods.

If Inline graphic:

graphic file with name d33e1659.gif 11

If Inline graphic:

graphic file with name d33e1672.gif 12

where Inline graphic is the prediction result of microstate i, Inline graphic is the number of microstate predictions that result in 0, and Inline graphic is the probability that the microstate prediction results in 0. R is the final classification result of the 30s data.

The data used were from the training stage after re-disruption. Consequently, the results from the online deployment stage more accurately reflect the model’s generalizability. Moreover, treating each microstate as a weak classifier and employing the voting method can boost error tolerance and enhance prediction performance.

On the private dataset, we achieved 93.42% accuracy, 96.79% sensitivity, and 93.65% F1-score with an FPR of 0.099/h. On the Siena dataset, we achieved 98.71% accuracy, 98.84% sensitivity, and a 99.81% F1-score with an FPR of 0.021/h. Compared with the performance in the training stage, the performance in the online deployment stage remains robust. This not only clarifies that the model captures the inherent properties of the preictal period, but also suggests that the dynamics of homologous microstate have the potential to serve as an effective marker for the prediction of seizures.

To demonstrate the advantages of the proposed model in predictive performance, we compared it with other subject-independent epileptic seizure prediction algorithms from recent years. As shown in Table 5, the subject-independent epileptic prediction performance of our model is comparable to the state-of-the-art methods, even though different datasets were used by various researchers. Our model achieves high sensitivity and a low false positive rate (FPR), indicating robust performance across the datasets used in this study. Additionally, most existing algorithms are only applicable for offline state prediction, whereas our model performs well during the online deployment phase and can be applied in clinical practice. This underscores the practical utility of our model, particularly in real-world scenarios where real-time prediction is essential.

Table 5.

The performance of subject-independent prediction in the online deployment stage.

Reference Dataset Method Acc(%) Sen(%) FPR(/h)
Truong et al.(2018)30 Freiburg Hospital iEEG CNNs with Minimum Feature Engineering - 81.4 0.06
You et al.(2022)31 Private EEG Improved Variational Autoencoder Network - 90.4 0.83
Dissanayake et al.(2022)5 Siena Scalp EEG Geometric Deep Learning 96.05 96.05 -
Guo et al.(2023)4 CHB-MIT EEG Spatio-Temporal-Spectral Network with Contrastive Learning - 96.7 0.072
Wang et al.(2023)17 CHB-MIT EEG Spatiotemporal Graph Attention Network 99.01 99.10 -
This paper Private EEG ST-GCN with homologous microstate 93.42 96.79 0.099
This paper Siena Scalp EEG ST-GCN with homologous microstate 98.71 98.84 0.021

Acc, Accuracy. Sen, Sensitivity.

Analysis and discussion

This section includes ablation experiments on the Siena dataset, visualizes the model training process, evaluates the impact of parameters on seizure prediction, and analyzes abnormalities in functional connectivity networks during the preictal period.

Ablation experiment

We selected the ST-GCN model, proposed in Section II, as the baseline method for ablation experiments. Three groups of comparison experiments were established: non-temporal,non-spatial and non-microstate.

  • Non-temporal: To assess the effect of temporal features on the prediction of seizure, we removed the GRU module and directly extracted the spatial features from the original graph structure using the GCN module.

  • Non-spatial: To assess the effect of spatial features on seizure prediction, we replaced the GCN module with fully connected layers with an equal number of layers.

  • Non-microstate: To assess the effect of dynamic attributes in homologous microstate on seizure prediction, we removed the homologous microstate extraction module and used raw EEG data directly for graph structure construction.

As there was no online deployment stage for the non-microstate group experiments, we used the highest homologous microstate performance from the training stage of the non-temporal and non-spatial experiments for comparison. The prediction results of the various experiments are listed in Table 6.

Table 6.

Ablation experiments on the Siena dataset for microstates A.

Architecture Accuracy(%) Sensitivity(%) F1-Score(%) FPR(/h) Kappa
No-Temporal*** 59.59±1.10 70.94±1.23 66.16±0.98 0.546±0.012 0.165±0.022
No-Spatial*** 72.23±0.93 80.85±1.72 76.95±0.61 0.393±0.036 0.422±0.022
No-Microstate*** 88.01±0.46 85.66±0.71 87.69±0.47 0.096±0.008 0.760±0.009
ST-GCN 99.32±0.17 99.34±0.34 98.91±0.28 0.006±0.002 0.987±0.008

The differences in accuracy between ST-GCN and other methods are highlighted with stars (***p Inline graphic 0.001).

As can be seen from the table, the performance in the non-temporal group, which did not utilize temporal features, was particularly poor, with only 59.59% accuracy and 70.94% sensitivity. In contrast, the non-spatial group achieved 72.23% accuracy and 80.85% sensitivity. This suggests that, without considering the effects of the number of model layers and parameters, the temporal dynamics of EEG data are more suitable for seizure prediction than spatial dynamics. Notably, in both the non-temporal and non-spatial experimental groups, the model’s discriminative ability for positives was generally greater than for negatives. In other words, the model’s ability to identify preictal period would be stronger when only temporal or spatial features are considered.

To assess the role of homologous microstate in this model, we compared a non-microstate group. The results demonstrated that the performance of seizure prediction using both temporal and spatial features from raw EEG data was significantly better than using a single type of feature. However, compared with ST-GCN model, the sensitivity and FPR were considerably worse. This underscores the importance of homologous microstates in enhancing prediction, as their dynamics can be used as a universal marker for seizure prediction.

Training visualization

We randomly assessed individual modules’ significance in ST-GCN model, examining their role in specific microstates and frequency bands. Thus, we dismantled the model prediction process based on microstate A from Siena dataset in the training stage and presented the prediction process visually.

We used the t-stochastic neighbor embedding (t-SNE)32 algorithm with a perplexity of 200 in Rstudio software (2022.07.2+576; https://posit.co/downloads/)33 to reduce the dimensionality of the GRU module results for the delta band, the GCN module results for the delta band, and the final results of ST-GCN model to two dimensions. As depicted in Fig. 4(a), after extracting the temporal features through the GRU module, the samples remain challenging to classify linearly. However, following the GCN module, the samples could be distinguished between positive and negative as in Fig. 4(b). After concatenating the prediction results from the four frequency bands, the separation between positive and negative samples becomes more apparent, as shown in Fig. 4(c). Comparing Figs. 4(b) with 4(c), it is evident that the comprehensive utilization of all frequency band information improves the performance of seizure prediction.

Fig. 4.

Fig. 4

Feature distributions based on microstate A from Siena dataset in the training stage using t-SNE algorithm: (a) GRU module results of delta band, (b) GCN module results of delta band and (c) ST-GCN model results.

Optimization of the connectivity threshold

We conducted experiments to determine the optimal threshold for constructing graph structure. Given that the majority of PLV values in functional connectivity networks are less than 0.3, with a few exceeding 0.7, we performed experiments only on connectivity strength with threshold in the range of 0.3-0.7. Fig. 5 illustrates the results of the online deployment stage based on different connectivity threshold. The highest accuracy of 98.71% was achieved at a threshold value of 0.6. Deviating from this threshold, either by increasing or decreasing it, led to a decline in performance. This may be attributed to the fact that an overly dense connectivity network can resemble a fully connected layer, thereby neglecting true spatial information, while an overly sparse connectivity network diminishes the utility of spatial information.

Fig. 5.

Fig. 5

The effect of various connectivity thresholds on model accuracy during the graph structure construction.

Although various metrics such as coherence, phase lag index (PLI), and Granger causality can be used to construct brain functional networks26,27, this study chose Phase Locking Value (PLV) due to its effectiveness in capturing phase synchronization and its low computational complexity. Future work could explore these alternative metrics and combining multiple metrics to improve the accuracy of seizure prediction.

Differences in connectivity network

Epileptic seizures stem from abnormal hyper-synchronization in brain neurons, boosting regional correlations and network connectivity. Therefore, we randomly selected subject C from the Siena dataset and performed a visual validation using the adjacency matrix. The PLV functional connectivity networks between the interictal and preictal periods of subject C are illustrated in Fig. 6. The intensity during the preictal period is notably higher than during interictal period, suggesting a significant increase in correlation between brain regions as a seizure approaches.

Fig. 6.

Fig. 6

Connectivity networks of the Subject C from Siena dataset obtained through the PLV higher than 0.3 for various microstate. Different connectivity strength between nodes are indicated by different colors. From left to right are Microstate A, Microstate B, Microstate C and Microstate D.

To further dissect the significant anomalies of functional connectivity network in the preictal period, we plotted the connectivity networks of different microstate of subject C in Fig. 6. For enhanced visualization, we only included edges with a connectivity strength greater than 0.3. In each microstate class, the connectivity strength and breadth increased in the preictal period compared with the interictal period. In particular, the connectivity of microstate B increased significantly during the preictal period.

To more rigorously analyze the functional connectivity network changes between various microstates, we analyzed the small-world coefficients between the interictal and preictal periods using microstate calculations for all subjects.

It is well known that the brain is neither a completely random nor a completely ordered network, but rather a small-world network characterized by “economy”. In graph theory, small-world properties are quantified using small-world coefficients, which are derived from characteristic path lengths and clustering coefficients.

From Fig. 7, it is evident that for all microstate types, the small-world coefficients are higher in the preictal period compared to the interictal period, further substantiating that functional connectivity network are more tightly linked in the preictal period. It should be noted that the small-world coefficients of microstate A exhibit the highest significance difference, which may explain why microstate A had the best performance in the training stage on the Siena dataset.

Fig. 7.

Fig. 7

Small-world coefficients calculated with a threshold of 0.3 of diverse microstate. (p* Inline graphic 0.05).

Limitation

While our model demonstrates promising results, several limitations are evident. The limited number of subjects and seizures in these datasets hindered our ability to extend the preictal analysis window and conduct a comprehensive assessment. We will construct larger epilepsy datasets in subsequent experiments, aiming to refine the model further. Additionally, the complex microstate extraction and high model parameters prolonged training times and heightened resource demands, posing obstacles for clinical adoption. We intend to streamline the extraction of dynamic microstate attributes and refine the model architecture, thereby enhancing its practicality and suitability for clinical applications.

Furthermore, the current study did not assess the model’s performance across different horizon times between the preictal segments and the actual onset of seizures. This omission may affect the real-world applicability of our model, as varying horizon times could influence its predictive accuracy and reliability. Future research will address this limitation by evaluating the model’s performance across various horizon times to ensure its robustness and practical utility in clinical settings.

Conclusion

In this study, we proposed a novel ST-GCN model for subject-independent seizure prediction, which achieved outstanding performance on the private and Siena datasets. Homologous microstate mechanism was introduced and the potential of homologous microstate spatiotemporal dynamics to serve as a universal predictive marker for seizures was verified. Moreover, a unique clinical online deployment stage was proposed with great performance. Lastly, we found that the gap of small-world property between preictal and interictal periods in microstate A is the most significant among the four microstate types.

Acknowledgements

This study was supported by Joint Research and Development Program of the Yangtze River Delta Science and Technology Innovation Community (2022CSJGG1000/2023ZY1068), Key Research and Development Project of Zhejiang Province (2022C03043/2023C03195), the key projects of major health science and technology plan of Zhejiang Province (WKJ-ZJ-2129) and the National Natural Science Foundation of China (61601409).

Author contributions

Wei Shi: Conceptualization, Methodology, Software, Formal analysis, Data management, Data analysis, Writing-original draft, Visualization. Yi Shi: Validation, Data collection, Survey project management. Fangni Chen: Resources, Project management, Funding acquisition, Methodology, Writing-review and editing. Lei Zhang: Writing-review and editing, Supervision, Funding acquisition. Jian Wan: Writing-review and editing, Supervision, Funding acquisition.

Data availibility

The datasets analysed during the current study are not publicly available due to the lack of consent from all participants to publish their data. However, the data are available from the corresponding author on reasonable request.

Declarations

Competing interests

The authors declare no competing interests.

Footnotes

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

References

  • 1.Li, Y. et al. Automatic seizure detection using fully convolutional nested LSTM. Int. J. Neural. Syst.30(04), 2050019 (2020). [DOI] [PubMed] [Google Scholar]
  • 2.Cao, J., Zhu, J., Hu, W. & Kummert, A. Epileptic signal classification with deep EEG features by stacked CNNs. IEEE Trans. Cogn. Dev. Syst.12(4), 709–722 (2019). [Google Scholar]
  • 3.Daoud, H. & Bayoumi, M. A. Efficient epileptic seizure prediction based on deep learning. IEEE Trans. Biomed. Circuits Syst.13(5), 804–813 (2019). [DOI] [PubMed] [Google Scholar]
  • 4.Guo, L., Yu, T., Zhao, S., Li, X., Liao, X. & Li, Y. Clep: Contrastive learning for epileptic seizure prediction using a spatio-temporal-spectral network. IEEE Transactions on Neural Systems and Rehabilitation Engineering (2023). [DOI] [PubMed]
  • 5.Dissanayake, T., Fernando, T., Denman, S., Sridharan, S. & Fookes, C. Geometric deep learning for subject independent epileptic seizure prediction using scalp EEG signals. IEEE J. Biomed. Health. Inform.26(2), 527–538 (2021). [DOI] [PubMed] [Google Scholar]
  • 6.Andrzejak, R. G. et al. Seizure forecasting: Where do we stand?. Epilepsia64, S62–S71 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.Koenig, T. et al. Millisecond by millisecond, year by year: normative EEG microstates and developmental stages. Neuroimage16(1), 41–48 (2002). [DOI] [PubMed] [Google Scholar]
  • 8.Zhao, Z. et al. EEG microstate in first-episode drug-naive adolescents with depression. Journal of Neural Engineering19(5), 056016 (2022). [DOI] [PubMed] [Google Scholar]
  • 9.Luo, N. et al. Aberrant brain dynamics and spectral power in children with ADHD and its subtypes. European Child & Adolescent Psychiatry32(11), 2223–2234 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Chu, C., Zhang, Z., Wang, J., Li, Z., Shen, X., Han, X., et al. Temporal and spatial variability of dynamic microstate brain network in early Parkinson’s disease. npj Parkinson’s Disease 9(1):57 (2023). [DOI] [PMC free article] [PubMed]
  • 11.Li, Y. et al. Abnormalities in resting-state EEG microstates are a vulnerability marker of migraine. The journal of headache and pain23(1), 45 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12.Takarae, Y. et al. EEG microstates suggest atypical resting-state network activity in high-functioning children and adolescents with autism spectrum development. Developmental science25(4), e13231 (2022). [DOI] [PubMed] [Google Scholar]
  • 13.Lu, X. et al. An epileptic seizure prediction method based on CBAM-3D CNN-LSTM model. IEEE Journal of Translational Engineering in Health and Medicine11, 417–423 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Le Van, Quyen M. et al. Anticipation of epileptic seizures from standard EEG recordings. The Lancet357(9251), 183–188 (2001). [DOI] [PubMed] [Google Scholar]
  • 15.Spencer, SS. Neural networks in human epilepsy: evidence of and implications for treatment. Epilepsia (Series 4) 43(3) (2002). [DOI] [PubMed]
  • 16.Raeisi, K. et al. A graph convolutional neural network for the automated detection of seizures in the neonatal EEG. Computer methods and programs in biomedicine222, 106950 (2022). [DOI] [PubMed] [Google Scholar]
  • 17.Wang, Y. et al. A spatiotemporal graph attention network based on synchronization for epileptic seizure prediction. IEEE J. Biomed. Health. Inform.27(2), 900–911 (2022). [DOI] [PubMed] [Google Scholar]
  • 18.Klem, GH. The ten-twenty electrode system of the international federation. The international federation of clinical neurophysiology. Electroencephalogr Clin. Neurophysiol. Suppl.52, 3–6 (1999). [PubMed]
  • 19.Detti, P., Vatti, G., Zabalo, Manrique de. & Lara, G. EEG synchronization analysis for seizure prediction: A study on data of noninvasive recordings. Processes8 (7), 846 (2020).
  • 20.Delorme, A. & Makeig, S. EEGLAB: an open source toolbox for analysis of single-trial EEG dynamics including independent component analysis. J. Neurosci. Methods.134(1), 9–21 (2004). [DOI] [PubMed] [Google Scholar]
  • 21.Von Wegner, F., Knaut, P. & Laufs, H. EEG microstate sequences from different clustering algorithms are information-theoretically invariant. Front. Comput. Neurosci.12, 70 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 22.Bréchet, L. et al. Capturing the spatiotemporal dynamics of self-generated, task-initiated thoughts with EEG and fMRI. Neuroimage194, 82–92 (2019). [DOI] [PubMed] [Google Scholar]
  • 23.Siegel, A., Grady, C. L. & Mirsky, A. F. Prediction of spike-wave bursts in absence epilepsy by EEG power-spectrum signals. Epilepsia23(1), 47–60 (1982). [DOI] [PubMed] [Google Scholar]
  • 24.McFarland, D. J., McCane, L. M., David, S. V. & Wolpaw, J. R. Spatial filter selection for EEG-based communication. Electroencephalogr Clin. Neurophysiol.103(3), 386–394 (1997). [DOI] [PubMed] [Google Scholar]
  • 25.Peng, G., Nourani, M., Harvey, J. & Dave, H. Personalized EEG feature selection for low-complexity seizure monitoring. Int. J. Neural. Syst.31(08), 2150018 (2021). [DOI] [PubMed] [Google Scholar]
  • 26.Peng, G., Nourani, M. & Harvey, J. SEEG-Based Bilateral Seizure Network Analysis for Neurostimulation Treatment. IEEE Transactions on Neural Systems and Rehabilitation Engineering (2025). [DOI] [PubMed]
  • 27.Chiarion, G., Sparacino, L., Antonacci, Y., Faes, L. & Mesin, L. Connectivity analysis in EEG data: a tutorial review of the state of the art and emerging trends. Bioengineering10(3), 372 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 28.Medani, T. et al. Brainstorm-DUNEuro: An integrated and user-friendly Finite Element Method for modeling electromagnetic brain activity. Neuroimage267, 119851 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 29.Cho, K. On the Properties of Neural Machine Translation: Encoder-decoder Approaches. arXiv preprint arXiv:1409.1259 (2014).
  • 30.Truong, N. D. et al. Convolutional neural networks for seizure prediction using intracranial and scalp electroencephalogram. Neural Networks105, 104–111 (2018). [DOI] [PubMed] [Google Scholar]
  • 31.You, S., Cho, B. H., Shon, Y. M., Seo, D. W. & Kim, I. Y. Semi-supervised automatic seizure detection using personalized anomaly detecting variational autoencoder with behind-the-ear EEG. Comput. Methods Programs Biomed.213, 106542 (2022). [DOI] [PubMed] [Google Scholar]
  • 32.Van der Maaten, L. & Hinton, G. Visualizing data using t-SNE. J. Mach. Learn. Res.9(11) (2008).
  • 33.R Core Team, R., et al. R: A language and environment for statistical computing. R foundation for statistical computing Vienna, Austria; (2013).

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

The datasets analysed during the current study are not publicly available due to the lack of consent from all participants to publish their data. However, the data are available from the corresponding author on reasonable request.


Articles from Scientific Reports are provided here courtesy of Nature Publishing Group

RESOURCES