SEEG attack detection method based on time-frequency space-dynamic graph attention network
Through a method based on time-frequency space dynamic graph attention network, combined with multi-band directed transfer function and dynamic graph attention mechanism, the epilepsy brain network sequence is constructed, which solves the time-consuming and subjective problems in SEEG seizure detection, and achieves high accuracy and interpretability of epilepsy detection.
Patent Information
- Application Number
- CN202510511191.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-08-12
AI Technical Summary
The prior art has time-consuming, subjective and error-prone problems in SEEG seizure detection, and the existing machine learning methods fail to fully reflect the distribution characteristics of epilepsy signals and lack of dynamic feature learning, resulting in insufficient accuracy and interpretability of epilepsy detection.
The method based on the time-frequency space dynamic graph attention network is adopted, and the node characteristics and dynamic graph attention mechanism are calculated through the multi-band directed transfer function, combined with the time-sequence convolution network, the epileptic seizure brain network sequence is constructed, and the space-spectrum-time features are extracted for detection.
The accuracy and interpretability of epilepsy detection were significantly improved, and the sensitivity and specificity of the model on the SEEG dataset reached 94.6% and 96.4%, which was able to better capture the dynamic characteristics and propagation patterns of epilepsy.
Smart Images

Figure CN120458602A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of biomedical signal processing technology, and in particular relates to a SEEG seizure detection method based on a time-frequency-space dynamic graph attention network. Background Art
[0002] Drug-resistant epilepsy (DRE) is characterized by inability to control the condition despite regular and adequate antiepileptic medication. Long-term, recurrent seizures can easily lead to lasting changes in brain tissue, significantly increasing mortality and disability. Clinically, DRE is often treated with surgical resection or minimally invasive techniques to remove the epileptogenic focus. When conventional noninvasive imaging methods, such as electroencephalography (EEG), multimodal structural and functional neuroimaging, and symptomatology, fail to provide consistent and accurate lesion localization, more sophisticated invasive techniques, namely stereotactic electroencephalography (SEEG), are required.
[0003] SEEG is the internationally recognized "gold standard" for localizing epileptogenic foci. Figure 1 As shown, precise intracranial EEG monitoring and direct electrical stimulation can be performed by implanting multiple depth electrodes into suspected epileptogenic areas of the brain. Figure 1 In area A, SEEG electrodes are placed at the suspected epilepsy origin area, with multiple electrode leads shown on the right. Area B shows SEEG signals during the interictal and ictal phases of the epileptic seizures.
[0004] Analyzing the difference between interictal and ictal signals is a key first step in SEEG diagnosis. Therefore, this paper aims to develop more accurate and interpretable seizure detection and analysis methods using SEEG data, effectively improving the performance of DRE seizure detection and assisted localization of the epileptogenic zone.
[0005] Compared with scalp EEG, SEEG has a higher sampling rate and can provide more detailed information on the origin of epileptic seizures in the time, spectrum, and space dimensions. In the time domain, detected electrophysiological markers of epilepsy, such as sharp waves and pathological high-frequency oscillations, can provide more discriminative pathological information. In the spectrum dimension, SEEG can cover a wide frequency range from low-frequency rhythms to high-frequency oscillations, including ripples (R) from 80Hz to 250Hz and fast ripples (FR) from 250Hz to 500Hz. Its wider frequency resolution is important for distinguishing normal brain activity from pathological signals and provides a more comprehensive perspective for in-depth understanding of the dynamic changes of epileptic activity. In the spatial dimension, epileptic discharges spread rapidly from the epileptogenic area to other brain regions, manifesting as a complex and transient spatiotemporal dynamic process. Therefore, it is crucial to optimize SEEG decoding methods and effectively extract and interpret the above dynamic, high-dimensional SEEG epilepsy features.
[0006] Through the above analysis, the problems and defects of the existing technology are as follows:
[0007] The current international standard for epileptic seizure detection is to visually inspect pathological discharges in multi-channel SEEG recordings by medical experts. However, visual inspection of continuous SEEG recordings is a time-consuming, subjective, and error-prone process, and misdiagnosis can lead to serious consequences or even life-threatening consequences. Existing machine learning research on epileptic seizure detection tasks is mainly divided into three steps: (1) Establishing a SEEG brain network model, usually using a functional connectivity matrix to represent the connection dependencies between SEEG channels, including local directional consistency analysis, directed transfer function (DTF), and information theory methods; (2) Extracting brain network topological features such as in-degree, out-degree, and degree centrality through statistical or graph theory methods; (3) Using machine learning algorithms to classify the extracted features, such as clustering algorithms. However, existing research still has important problems such as insufficient representation of epileptic brain network features, lack of dynamic feature learning of brain network evolution, and lack of model mechanism explanation analysis corresponding to the mechanism of epileptic seizures.
[0008] The first step in SEEG seizure detection is to construct an individual epileptic seizure brain network. Intracranial brain networks are usually constructed by treating SEEG leads as nodes of a graph and the effective connection relationships between brain regions as edges of the graph. Graph node features are usually defined as statistical features of the signal in the time domain, frequency domain or differential entropy, but these methods fail to fully reflect the distribution characteristics of epileptic signals. Graph edge features are usually defined by functional connectivity metrics. Brain networks can also be automatically learned through deep learning models. Although these methods are flexible and can converge to the optimal graph structure for specific tasks, the learned brain network graph cannot accurately reflect the connectivity features associated with specific pathological frequency bands of the disease, such as the R band and FR band, which are important frequency bands where interictal electrophysiological markers are located. To this end, a brain network modeling method that can simultaneously utilize the full frequency domain and spatial domain is needed. The present invention decomposes multiple pathological frequency bands to represent the edges of the graph, extracts epileptogenicity index features to enhance node features, and thus constructs an epileptic seizure brain network sequence with comprehensive and strong discriminative information.
[0009] The main objectives of the second and third steps are to model network features and classify signals. Graph neural networks (GNNs) can simultaneously accomplish both steps, providing new research directions for deep learning and graph data analysis. Dou et al. employed a graph convolutional network (GCN) to aggregate features from adjacent leads in the task of epileptic seizure detection. Klepl et al. proposed an adaptive gated GCN for Alzheimer's disease EEG signal detection, weighting the contributions of different spatial scales. The present inventors also previously proposed an adaptive graph construction and analysis module that integrates epilepsy detection and localization. Although these methods provide innovative approaches for modeling complex relationships in data structures, they still have some limitations, such as the inability of static graph models to reflect the dynamic changes in the topological properties of epileptic networks. Sliding windows are commonly used in research to construct dynamic time graph sequences. Wang et al. proposed a spatiotemporal graph attention network to mine spatial topological structure information in the task of epileptic seizure prediction. Zheng et al. used a dynamic variational autoencoder and a spatiotemporal attention mechanism to analyze dynamic brain connectivity. Dynamic graphs can more realistically reflect spatiotemporal processes by learning structural and attribute information that changes over time. Brody et al. proposed a dynamic graph attention variant (Graph Attention Variant V2, GATv2) that addresses the limitations of static attention mechanisms by adjusting the order of operations. Furthermore, combining the GNN architecture with sequence modeling effectively captures the temporal dependencies of dynamic GNN evolution, enabling a more accurate description of complex epileptic networks. Therefore, the present invention is inspired by dynamic GNNs and dynamic graph attention mechanisms, which can more accurately represent the evolving brain network characteristics during epileptic seizures.
[0010] The present invention combines the dynamic attention mechanism of dynamic GNN with time series modeling to better capture the spatial-spectral-temporal (SPT) dynamic evolution characteristics of epileptic seizures, improve the accuracy of epilepsy detection, and further enhance the model's ability to characterize and explain the state of epileptic seizures and interictal seizures. SEEG has SPT characteristics of spatial-spectral-temporal dimensions, and these three dimensions are crucial for epilepsy detection. Therefore, the explanation of the algorithm's prediction should cover these three dimensions: the spatial dimension reflects the location of deep brain areas; the spectral dimension indicates the frequency band with significant discrimination in the signal; and the time dimension represents the time point in the recording process. Therefore, based on the SPT attention mechanism, the present invention corresponds the model mechanism to the mechanism of epileptic seizures and conducts an explanatory analysis. Summary of the Invention
[0011] In order to overcome the problems existing in the related art, the embodiments disclosed in the present invention provide a SEEG seizure detection method based on a time-frequency-space dynamic graph attention network.
[0012] The technical solution is as follows:
[0013] A SEEG seizure detection method based on a time-frequency-space dynamic graph attention network includes the following steps:
[0014] S1: Representing SEEG as a multi-band epileptic seizure brain network sequence
[0015] A: SEEG lead points are defined as nodes of the graph, and the weights of directed connections between nodes are calculated using a multi-band directed transfer function;
[0016] B: Constructing node feature matrix based on epilepsy epileptogenicity index features;
[0017] C: Multi-band epileptic brain networks are arranged in time order to form a dynamic sequence;
[0018] S2: Dynamic Graph Representation Learning Based on GATv2
[0019] Use GATv2 dynamic attention mechanism to extract spatial-spectral correlations and dynamically weight node connection weights through a learnable attention matrix;
[0020] S3: TCN-based spatiotemporal feature learning
[0021] Combine TCN with the temporal attention mechanism to extract, identify and focus on key temporal features.
[0022] Preferably, in step S1, the frequency band is focused on seven different frequency bands of SEEG, and the multi-band directed transfer function calculation includes the following steps:
[0023] a: Construct a multivariate autoregressive model and calculate the estimated autoregressive coefficient after obtaining the data set S. The calculation process is as follows:
[0024]
[0025] Where Λ(0)=1, is a multivariate zero-mean vector; p is the optimal model order, selected by the information criterion;
[0026] b: Convert the parameters to the frequency domain to obtain Λ(f), and obtain the transfer coefficient matrix H(f) at frequency f by inverting Λ(f);
[0027] According to the above definition, the estimated causal effect of the j-th region of interest on the i-th region in the SEEG structure is expressed as:
[0028] θ ij =|H ij (f)| 2
[0029] Each estimated transfer function value is divided by the sum of the squares of all elements in the associated row to obtain the normalized transfer function ψ ij (f); After normalization, the DTF value from region j to region i is obtained:
[0030]
[0031] Among them, φ ij The value range of is [0,1], and φ ij (f1, f2) exceeds or equals 1 in a wider frequency range;
[0032] c: Set the parameters for DTF matrix calculation and perform sparse processing on the DTF matrix, retaining the more important edges in the network and removing the edges with lower weights.
[0033] Further preferably, in step S1, constructing the node feature matrix includes the following steps:
[0034] a: Count the number and incidence of various epileptic electrical activities at each SEEG contact point, and use the validated SEEG-Net model loaded with optimal pre-trained parameters for detection. Detection types include spikes, HFOs, and other significant numerical features.
[0035] b: Sample Entropy, PFD, and KFD were used as epileptogenicity index features, and PFD and KFD were used to calculate the fractal dimension of SEEG signals;
[0036] c: Construct the node feature matrix and calculate the seven features within the time window T. These features are used to characterize the epilepsy intensity coefficient of the node, which is called the node weight degree.
[0037] Further preferably, HFOs include three waveform types: ripple, fast ripple, and co-occurrence of ripple and fast ripple; when the sampling frequency is 500 Hz, only ripple is detected;
[0038] HFOs detection identifies high-frequency oscillation events with more than six oscillations within a specified time window based on the Hilbert envelope amplitude of the bandpass filtered signal.
[0039] Preferably, in step S1, the dynamic sequence is obtained by taking snapshots of the dynamic graph at equal time intervals to obtain a discrete network evolution sequence, which is defined as
[0040] in:
[0041] Each graph G t =(V t ,E t ,X t ), represents the brain network computed at time step t;
[0042] V t is a set of nodes, i.e., SEEG channel;
[0043] E t is the edge set, i.e., the channel connections calculated based on the DTF matrix;
[0044] X t is the node feature matrix, representing the epilepsy intensity.
[0045] Preferably, step S2 is to introduce a dynamic attention mechanism into GAT to obtain GATv2, and the attention score is calculated as follows:
[0046]
[0047] Based on the above, the learned graph representation vector is weighted according to seven frequency bands, and its attention calculation formula is:
[0048] v t =Utanh(Wμ i +b)
[0049]
[0050] in:
[0051] μ t represents the input of the hidden layer;
[0052] v tis the attention weight calculated by the network output layer at time t;
[0053] γ t Represents the normalized attention weight, which is calculated using the learned weight parameters U and W and the bias b.
[0054] Preferably, in step S3, the TCN module includes:
[0055] Causal convolution: used to ensure that data processing follows a strict temporal order;
[0056] Dilated convolution: The receptive field is expanded by introducing a dilation factor d to solve the problem of limited receptive field of causal convolution;
[0057] Residual convolution: Introduces residual connections, dropout, and layer normalization to alleviate the vanishing gradient problem. Residual connections establish shortcut connections between layers to maintain gradient flow and prevent gradient vanishing.
[0058] The calculation formula of dilated convolution is as follows:
[0059]
[0060] in:
[0061] f(i) represents the i-th convolution coefficient, k is the size of the convolution kernel, x (t-d·i) represents the input data after i expansions at time t;
[0062] The expansion factor d is set to d=2 i , where i is the layer index;
[0063] The representation of the residual connection is:
[0064] o=Activation(x+F(x))
[0065] Where x represents the input, F(x) is the residual mapping to be learned, and o is the output;
[0066] Finally, the spatial-spectral-temporal features are weighted by attention weights and finally, classification is performed by a nonlinear activation function.
[0067] Combining all the above technical solutions, the advantages and positive effects of the present invention are as follows:
[0068] 1. Combining multi-band directed transfer function calculation and epilepsy index node feature extraction, SEEG data are represented as dynamic epileptic seizure network sequences, aiming to capture comprehensive and discriminative information between different time periods;
[0069] 2. Design a dynamic graph attention network to dynamically weight different spatial scales;
[0070] 3. Designing a spatial-spectral-temporal (SPT) attention mechanism that can identify and focus on key features in different brain regions, frequency bands, and time dimensions, significantly improving the interpretability and accuracy of the model for detecting epileptic seizures and interictal periods;
[0071] The experiment utilized the latest publicly available SEEG dataset and selected 14 patients with DRE to evaluate the model's high sensitivity and specificity in epileptic seizure detection. Overall, the model demonstrated strong learning capabilities for dynamic propagation features, revealing SEEG pathological connectivity patterns and correlating the model's mechanism with epileptic seizure propagation mechanisms. This model has promising application prospects in epileptic seizure detection and aided localization of the epileptogenic zone. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0073] Figure 1 is a schematic diagram of intracranial EEG monitoring;
[0074] Figure 2 This is a schematic diagram of the overall framework of the invention provided by an embodiment of the present invention;
[0075] Figure 3 Schematic diagram of results under different dynamic sequence lengths provided by an embodiment of the present invention;
[0076] Figure 4 is a schematic diagram of comparison results between average frequency band and multi-band frequency provided by an embodiment of the present invention;
[0077] Figure 5 2 is a schematic diagram of the results of an ablation experiment on the effectiveness of the representation model provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0078] To make the above-mentioned objects, features, and advantages of the present invention more readily apparent, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings. The following description sets forth numerous specific details to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways than those described herein, and those skilled in the art may make similar modifications without departing from the scope of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0079] 1. Explanation of the embodiment:
[0080] Example 1:
[0081] The embodiment of the present invention provides a SEEG seizure detection method based on a time-frequency-space dynamic graph attention network. Figure 2 The overall framework of the present invention is described, which is divided into two parts: A and B:
[0082] A: Multi-channel SEEG is represented as an epileptic brain network sequence;
[0083] First, we used multi-band directed transfer function analysis to represent the edges of the SEEG functional brain network. Then, we characterized the nodes based on the statistical distribution of spikes, high-frequency oscillations, and epileptogenicity index features. Finally, we arranged the multi-band epilepsy brain network into a sequence according to chronological order.
[0084] B: Module composition;
[0085] The module consists of two parts: for spatial-spectral dynamic graph representation, the GATv2 mechanism is used to dynamically weight node connections according to the importance of the nodes, enhancing the model's ability to focus on key relationships; for temporal feature learning, the temporal attention mechanism is combined with the temporal convolutional network (TCN) to identify and focus on key features in the time step.
[0086] English corresponding Chinese annotations:
[0087] DTF-Directed Transfer Function; SPT-Space-Spectrum-Time;
[0088] HFOs-high frequency oscillations; PFD-rock fractal dimension; KFD-Katz fractal dimension; Sample Entropy-sample entropy; spikes-spike waves;
[0089] TCN - Temporal Convolutional Network.
[0090] This paper defines SEEG epileptic seizure detection based on dynamic functional connectivity as a graph-level binary classification task, whose goal is to construct an epileptic seizure brain network sequence. A graph neural network model F is trained to learn this dynamic graph representation to predict epileptic seizure labels.
[0091] Specifically, for a given patient, SEEG is represented as a set of dynamic image sequences, denoted as The graph sequence Capturing the evolution of brain functional connectivity. Model F learns to represent {h0,h1,…,h T}, to predict the corresponding label
[0092]
[0093] in, Denotes the predicted label, classifying the SEEG signal as interictal or ictal. Model F refers to the detection method proposed in the present invention.
[0094] The following describes in detail the technical solution of the SEEG seizure detection method based on the time-frequency-space dynamic graph attention network:
[0095] A SEEG seizure detection method based on a time-frequency-space dynamic graph attention network includes the following steps:
[0096] S1: Representing SEEG as a multi-band epileptic seizure brain network sequence
[0097] A: SEEG lead points are defined as nodes of the graph, and the weights of directed connections between nodes are calculated using a multi-band directed transfer function;
[0098] B: Constructing node feature matrix based on epilepsy epileptogenicity index features;
[0099] C: Multi-band epileptic brain networks are arranged in time order to form a dynamic sequence;
[0100] S2: Dynamic Graph Representation Learning Based on GATv2
[0101] Use GATv2 dynamic attention mechanism to extract spatial-spectral correlations and dynamically weight node connection weights through a learnable attention matrix;
[0102] S3: TCN-based spatiotemporal feature learning
[0103] Combine TCN with the temporal attention mechanism to extract, identify and focus on key temporal features.
[0104] In the embodiment of the present invention, SEEG lead points are defined as nodes of the graph, the connections between nodes are defined as edges, and the direction of the connection represents the causal relationship. Specifically, given a time window T, the dynamic graph sequence is represented as Each SEEG segment t is represented as a directed graph G = (V, E, W), where V represents the node set (i.e., different SEEG contact points), E represents the edge set, and W is the functional connectivity matrix.
[0105] Step S1 is decomposed into three processes in sequence: functional connection edge representation based on multi-band directional transfer function, node feature representation based on epilepsy epileptogenicity index, and epileptic brain network sequence.
[0106] 1. Functional connection edge representation based on multi-band directional transfer function:
[0107] This method focuses on seven different frequency bands of SEEG, as shown in Table 1. The weights of directed edges are calculated by DTF, and the effective connectivity analysis between lead points is performed.
[0108] Table 1 Seven different pathological frequency bands of SEEG
[0109]
[0110] The calculation of SEEG signals is performed within a time window of length T, and the time windows do not overlap.
[0111] First, a multivariate autoregressive model is constructed. After obtaining the data set S, the estimated autoregressive coefficient is calculated. The specific calculation process is as follows:
[0112]
[0113] Where Λ(0) = 1 is a multivariate zero-mean vector. In formula (2), p is the optimal model order, which is selected by the information criterion.
[0114] Secondly, the parameters are transformed into the frequency domain to obtain Λ(f), and the transfer coefficient matrix H(f) at frequency f is obtained by inverting Λ(f). An important property of H(f) is its asymmetry, which indicates the directionality of the correlation. According to the above definition, the causal effect of the j-th region of interest on the i-th region in the SEEG structure is estimated as:
[0115] θ ij =|H ij (f)| 2 (3)
[0116] Each estimated transfer function value is divided by the sum of the squares of all elements in the associated row to obtain the normalized transfer function ψ ij (f). After normalization, the DTF value from region j to region i is obtained:
[0117]
[0118] Among them, φ ij The value range of is [0,1], and φ ij (f1, f2) may exceed 1 in a wider frequency range, that is, there are cases where it exceeds or is equal to 1;
[0119] Finally, the DTF matrix is sparsified to retain the more important edges in the network and remove the edges with lower weights.
[0120] Specifically:
[0121] 1) Set the values of the diagonal elements to 0;
[0122] 2) Set edges with values lower than 25% of the total matrix value to 0, and only keep edges with weight ranking in the top 25%.
[0123] The parameter settings for DTF matrix calculation, such as the model order, are set to p = 10 based on heuristic algorithms and comparative experience.
[0124] 2. Node feature representation based on epilepsy-induced epilepsy index:
[0125] Using validated models and algorithms, we detect various epileptic electrical activities, such as spikes, high-frequency oscillations (HFOs), and significant numerical features, under different SEEG states. We calculate the incidence of various epileptic activities at each contact point, characterizing the epileptic intensity of brain network nodes and constructing a corresponding node feature matrix.
[0126] The specific process is as follows:
[0127] First, count the number of various epileptic electrical activities at each contact point. For the spike count ns on contact point i i , use the SEEG-Net model to load the optimal pre-trained parameters to detect spikes with high sensitivity.
[0128] Spike wave incidence rs i Expressed as:
[0129] rs i =ns i / T (5)
[0130] Where T is the length of the time window.
[0131] In order to more accurately detect the number nh of high frequency oscillations (HFOs) on the contact point i i Three waveform types were considered: ripples (R), rapid ripples (FR), and ripples and rapid ripples co-occurring (R&FR). For patients with a sampling frequency of 500 Hz, only ripples (R) were detected. High-frequency oscillation events with more than six oscillations within a specified time window were identified based on the Hilbert envelope amplitude of the bandpass-filtered signal. The incidence rate of HFOs, rh i Expressed as:
[0132] rh i =nh i / T (6)
[0133] Secondly, three important epileptogenicity index features are used: sample entropy, Petrosen fractal dimension (PFD), and Katz fractal dimension (KFD). Specifically, PFD and KFD are used to calculate the fractal dimension of SEEG signals.
[0134] Finally, the node feature matrix is constructed and seven features within the time window T are calculated. These features are used to characterize the epilepsy intensity coefficient of the node, which is called the weight degree of the node.
[0135] 3. Epilepsy brain network sequence:
[0136] To capture the dynamic spatial-spectral-temporal (SPT) epileptic characteristics of SEEG brain networks, epileptic brain network sequences were constructed, each of which represents the brain state at a specific time step.
[0137] By taking snapshots of the dynamic graph at equal time intervals, a discrete network evolution sequence is obtained, which is defined as Each graph G t =(V t ,E t ,X t ) represents the brain network at time step t.
[0138] Specifically, G t represents the brain network computed at time step t; V t is a node set (i.e., SEEG channel), E t is the edge set (connections between channels based on DTF calculation), X t is the node feature matrix, representing the epilepsy intensity.
[0139] Step S2 describes the process of learning dynamic graph representations based on GATv2 and explains the modification principles and processes.
[0140] The core goal of graph representation learning is to construct low-dimensional node vector representations while preserving key information, including spatial-spectral-temporal (SPT) features.
[0141] Specifically, the epileptic brain network sequence is input into the encoder, and the spatial-spectral correlation is extracted through the dynamic GATv2 module.
[0142] GAT uses a self-attention mechanism in the hidden layer to calculate the correlation between each node and its neighboring nodes, that is, the attention coefficient;
[0143] It aggregates information by assigning different weights to adjacent nodes and uses an aggregation function in the message passing step. Specifically, the attention coefficient α is calculated for each pair of neighbor nodes (i, j) and the l-th layer by concatenating the feature vectors of the node and its neighbors and applying a feedforward neural network. The process can be expressed as
[0144]
[0145]
[0146]
[0147] in, represents the set of neighboring nodes of node i, e is the attention score, and α is the final attention coefficient calculated using the softmax function. This attention mechanism enables GAT to focus on the most relevant neighbors during the aggregation process, thereby enhancing the representational power of node embeddings and improving performance in node classification tasks. Furthermore, attention weights play a crucial role in model interpretability, highlighting the importance of key nodes in the network.
[0148] However, the attention weights in GAT are fixed, calculated only based on initial features and cannot be dynamically adjusted during training. This limitation prevents the model from adjusting attention weights based on changes in relationships in the graph. The static attention mechanism causes nodes with similar initial features to receive the same attention, making it difficult for the model to effectively capture dynamic relationships in the graph that change over time.
[0149] To address the issue of static graph attention, Brody et al. proposed a dynamic graph attention extension that adds a learnable attention matrix. This improvement enables the attention weights to be dynamically updated during training, allowing the model to capture more complex and adaptive attention patterns.
[0150] To build a dynamic graph attention network, the internal calculations of GAT were modified, and GATv2 was introduced. This is a simple revision of GAT by enhancing the attention mechanism. GATv2 introduces a dynamic attention mechanism, which enables more detailed and adaptive learning. This modification adjusts the order of operations in the GAT architecture to ensure that the attention matrix is applied after the nonlinear activation function. The attention score is calculated as follows:
[0151]
[0152] While this modification is relatively simple, it significantly enhances the model's expressiveness and robustness, particularly when dealing with noise. GATv2 addresses the limitations of combining learning layers into a single linear operation by introducing a more expressive attention mechanism. This improvement significantly increases the flexibility of the attention mechanism, enabling it to compute dynamic attention for any set of node representations. Furthermore, the combined linear layers in GATv2 are more computationally efficient than the original GAT model.
[0153] After completing the above spatial representation, the learned graph representation vector is weighted according to the seven frequency bands, which not only reduces the dimension of the data but also reveals the importance of each frequency band in epileptic stage classification. The attention calculation formula is:
[0154] vt =Utanh(Wμ i +b) (11)
[0155]
[0156]
[0157] Among them, μ t represents the input of the hidden layer, v t is the attention weight calculated by the network output layer at time t, γ t Represents the normalized attention weight, which is calculated using the learned weight parameters U and W and the bias b.
[0158] Step S3 describes the process of learning spatiotemporal features based on TCN, which further improves the TCN setting.
[0159] In the proposed model, the temporal convolutional network (TCN) module consists of a TCN layer and a self-attention layer. Compared with convolutional neural networks, TCN is more powerful in processing temporal causal relationships and has a more flexible receptive field.
[0160] The TCN module contains three main components: causal convolution, dilated convolution, and residual convolution.
[0161] Causal convolution ensures that data processing follows a strict temporal order. To address the problem of limited receptive field of causal convolution, dilated convolution is introduced to expand the receptive field by adding a dilation factor d.
[0162] The calculation formula of dilated convolution is as follows:
[0163]
[0164] Here, f(i) represents the i-th convolution coefficient, k is the size of the convolution kernel, and x (t-d·i) represents the input data after i expansions at time t. Usually, the expansion factor d is set to d = 2 i , where i is the layer index, and a higher dilation factor helps to expand the receptive field.
[0165] To alleviate the vanishing gradient problem, the residual module of TCN introduces residual connections, dropout, and layer normalization. These components establish shortcut connections between layers, helping to maintain gradient flow and prevent gradient vanishing. The representation of the residual connection is:
[0166] o=Activation(x+F(x)) (15)
[0167] Here, x represents the input, F(x) is the residual mapping to be learned, and o is the output. Next, the SPT features are weighted using attention weights. Finally, classification is performed using an activation function.
[0168] In summary, the present invention quantitatively analyzes and visually explains the importance of each frequency band and the dynamic abnormal connection pattern in epileptic seizure detection, solving the problems existing in existing research, such as insufficient representation of epileptic brain network features, lack of dynamic feature learning of brain network evolution, and lack of model mechanism explanation and analysis corresponding to the mechanism of epileptic seizures.
[0169] The detection method provided in Example 1 was applied to Model F, specifically as follows:
[0170] Let Y t is the actual label vector, To predict the label vector, the loss function of the model is set to the cross entropy function, where θ represents the model parameters and α is the regularization weight. Used to prevent model overfitting. The cross entropy function is used to measure the inconsistency between the true label and the predicted label of the model. The formula is as follows:
[0171]
[0172] The proposed epileptic seizure detection model (Model F) setup is described in detail below.
[0173] Algorithm settings of the model:
[0174]
[0175]
[0176] Experimental parameter settings of the model:
[0177] The SEEG dataset used by Model F contains interictal (non-epileptic seizure) signals and epileptic seizure (ictal) signals. The data are provided in BIDS format to facilitate standardized data organization and processing.
[0178] To improve the effectiveness of discriminative information, channels with poor quality were removed and the data were segmented into 1-second time segments for further analysis. The dynamic time step was set to 7 seconds, and ablation experiments were performed in all patients.
[0179] Each patient's data was independently evaluated and randomly divided into 70% for training, 20% for validation, and 10% for testing. To evaluate the model's performance against baseline models, the model's parameter range and final specifications were determined based on multiple comparative experiments. The relevant parameter settings are shown in Table 2. The Adam optimizer was used for model optimization. The model was implemented in PyTorch and trained on an Nvidia 3090 GPU.
[0180] Table 2 Model parameter range and related parameter settings.
[0181]
[0182]
[0183] II. Evidence of the relevant effects of the embodiments:
[0184] Experiment 1: Classification Performance of the Model in Epileptic Seizure Detection
[0185] This experiment demonstrates the performance of the model in SEEG seizure detection. Table 3 shows the average classification results for each patient (calculated based on all seizures), as well as the overall results for the entire dataset. The average accuracy was 94.6%, the sensitivity was 93.4%, and the specificity was 96.4%. In addition, the model's positive predictive value averaged 97.8%, indicating high predictive accuracy in classifying signals as seizures, effectively reducing false positives. The model performed well in predicting non-seizure states, with an average negative predictive value of 91.1%, ensuring the reliability of non-seizure state predictions. This performance improvement is due to the construction of the epileptic brain network sequence, the GATv2 module, and the SPT attention mechanism, all of which play a crucial role in simultaneously learning the spatial-spectral-temporal patterns of the dynamic epileptic brain.
[0186] Table 3 Classification performance of the model in epileptic seizure detection
[0187]
[0188] Experiment 2: Comparison with the most advanced algorithms
[0189] To demonstrate the advantages of the proposed model, its average classification performance on 14 patients with DRE was compared with other models. All models were trained and tested under the same conditions to ensure a fair comparison. Table 4 shows the performance comparison of the proposed method with models based on CNN, RNN, GNN, and GNN-RNN (including CNN, BiLSTM, IEG-TCN combined with ECC-GNN, GCN-GRU, GAT-BiLSTM, and STGAT-GRU).
[0190] Compared with other models, the method of the present invention performs best in classification performance and has significant advantages in specificity. It is worth noting that the classification performance of the models based on CNN and RNN is relatively low, with an accuracy of only 83.1%-85.1% and a specificity of 72.02%-80.5%, while the models based on GNN and GNN-RNN perform better. This shows that the GNN-based model is more suitable for processing spatial information features. In addition, the GNN-RNN model has improved in all indicators, indicating that it can effectively capture the dynamic changes of spatial information over time, and is consistent with the explanation results of the mechanism of epileptic seizures.
[0191] Table 4 Comparison of the model with the existing state-of-the-art algorithms
[0192]
[0193] Experiment 3: Ablation experiment: the impact of dynamic sequence length
[0194] To evaluate the performance at different dynamic sequence lengths and determine the optimal evaluation window, the scores were calculated for all patients' data. Figure 3 The results show that a 7-second window provides the best balance between capturing features, achieving accurate predictions, and avoiding overfitting. Accuracy and sensitivity steadily increase from 3 to 7 seconds, reaching their highest values at 7 seconds, at 95.7% and 95.1%, respectively. However, beyond 7 seconds, accuracy begins to decline, indicating that the model is overfitting and is beginning to capture noise. Conversely, specificity decreases significantly at 10 and 15 seconds, falling to 82.0% and 78.3%, respectively, further confirming that overfitting becomes more severe with longer time windows.
[0195] Experiment 4: Ablation experiment: the effectiveness of frequency band decomposition in epileptic brain network properties
[0196] First, the necessity of frequency band decomposition is evaluated by comparing the experimental results using averaged frequency bands with those using multi-band frequency bands. Figure 4 The results show that replacing multi-band maps with full-band maps results in decreased accuracy, sensitivity, and specificity, indicating that frequency-specific information in SEEG signals is crucial for epileptic seizure detection. The multi-band approach provides richer information, helping the model capture the frequency characteristics of epileptic seizures, especially the onset and propagation of seizures.
[0197] Experiment 5: Ablation experiment: Comparison of the contribution of different node features to epileptic brain network properties
[0198] To investigate the contributions of different node features and identify the most effective feature set, we conducted node feature ablation experiments, retaining the frequency band decomposition and model classifier unchanged. The results are shown in Table 5. When using only high-frequency oscillations (HFOs) features, the model achieved an accuracy of 86.7%, a sensitivity of 91.9%, and a specificity of 80.4%. In comparison, the performance of using only spike incidence features was lower, indicating that HFOs features better balance prediction reliability. The combination of spikes and HFOs performed best among the two-feature combinations, demonstrating its strong ability to distinguish between ictal and interictal seizures. Combining all three statistical distribution features further improved model performance. The inclusion of the EI (Epilepsy Index) significantly improved specificity and positive predictive value, demonstrating its importance in improving the reliability of epilepsy prediction.
[0199] Table 5 Performance comparison under different node characteristics
[0200]
[0201] Experiment 6: Ablation Experiment: Effectiveness of Graph Representation Model
[0202] The contribution of each module to the proposed model was evaluated through ablation experiments. The following seven GNN-RNN based ablation variants were tested:
[0203] A: Replace GATv2 with GCN layers;
[0204] B: Use the GAT layer instead of GATv2;
[0205] C: Replace TCN layers with MLP layers;
[0206] D: Replace the TCN layer with a BiLSTM layer;
[0207] E: combination of variants A and C;
[0208] F: combination of variants A and D;
[0209] G: combination of variants B and C;
[0210] H: Combination of variants B and D.
[0211] Figure 5Ablation results in
[15] show that each module contributes significantly to model performance. For variant A, performance degrades significantly, with accuracy dropping to 86%. GCN lacks attention to the most relevant nodes and edges, resulting in decreased accuracy when capturing key spatial relationships. For variant B, although the GAT layer includes an attention mechanism, it is less flexible than GATv2 in adapting to dynamic graph structures, which are crucial for modeling the time-varying nature of SEEG data. Furthermore, the GATv2 module is able to generate interpretable predictions.
[0212] Next, we demonstrate that the TCN encoder significantly outperforms both the MLP layer and the BiLSTM encoder (Variants C and D). When the temporal feature learning module is replaced with the MLP layer, performance degrades significantly. While Bi-LSTMs are suitable for sequence modeling, they are prone to the vanishing gradient problem and may perform poorly at modeling long-range dependencies compared to TCNs, which offer greater computational efficiency and flexibility. The TCN layer avoids these issues and offers greater computational efficiency and flexibility.
[0213] Since all the main modules contribute significantly to the final performance of the model, the remaining ablation models (variants EH) that modify multiple modules also perform significantly worse (see Figure 5 ). Overall, the ablation results clearly show that each module in the DynSeizureGAT architecture significantly improves the overall performance. Specifically, the GATv2 layer is critical for determining the importance of brain connections, highlighting key connections between seizure and non-seizure periods. This module captures dynamic abnormal connectivity patterns, such as the bidirectional widespread diffusion characteristics of the seizure network, and the unidirectional flow from the medial temporal lobe region to other structures in the non-seizure network. The spectral attention mechanism captures significant frequency bands during seizures (such as sharp activity and low-frequency slow waves) as well as significant frequency bands during non-seizures (such as HFOs). While the TCN layer is crucial for modeling temporal dependencies in SEEG signals, its learned temporal dependencies are crucial for detecting the sequence of seizure events. In addition, the full model outperforms the ablation variant, highlighting its potential as an auxiliary diagnostic tool for DRE in clinical applications.
[0214] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A SEEG seizure detection method based on a time-frequency-space dynamic graph attention network, characterized by: The following steps are involved: S1: Representing SEEG as a multi-band epileptic seizure brain network sequence A: SEEG lead points are defined as nodes of the graph, and the weights of directed connections between nodes are calculated using a multi-band directed transfer function; B: Constructing node feature matrix based on epilepsy epileptogenicity index features; C: Multi-band epileptic brain networks are arranged in time order to form a dynamic sequence; S2: Dynamic Graph Representation Learning Based on GATv2 Use GATv2 dynamic attention mechanism to extract spatial-spectral correlations and dynamically weight node connection weights through a learnable attention matrix; S3: TCN-based spatiotemporal feature learning Combine TCN with the temporal attention mechanism to extract, identify and focus on key temporal features.
2. The SEEG seizure detection method based on a time-frequency-space dynamic graph attention network according to claim 1, characterized in that: In step S1, the frequency band is focused on seven different frequency bands of SEEG, and the multi-band directed transfer function calculation includes the following steps: a: Construct a multivariate autoregressive model and calculate the estimated autoregressive coefficient after obtaining the data set S. The calculation process is as follows: Where Λ(0)=1, is a multivariate zero-mean vector; p is the optimal model order, selected by the information criterion; b: Convert the parameters to the frequency domain to obtain Λ(f), and obtain the transfer coefficient matrix H(f) at frequency f by inverting Λ(f); According to the above definition, the estimated causal effect of the j-th region of interest on the i-th region in the SEEG structure is expressed as: i ij =|H ij (f)| 2 Each estimated transfer function value is divided by the sum of the squares of all elements in the associated row to obtain the normalized transfer function ψ ij (f); After normalization, the DTF value from region j to region i is obtained: Among them, φ ij The value range of is [0,1], and φ ij (f1, f2) exceeds or equals 1 in a wider frequency range; c: Set the parameters for DTF matrix calculation and perform sparse processing on the DTF matrix, retaining the more important edges in the network and removing the edges with lower weights.
3. The SEEG seizure detection method based on the time-frequency-space dynamic graph attention network according to claim 2 is characterized in that In step S1, constructing the node feature matrix includes the following steps: a: Count the number and incidence of various epileptic electrical activities at each SEEG contact point, and use the validated SEEG-Net model loaded with optimal pre-trained parameters for detection. Detection types include spikes, HFOs, and other significant numerical features. b: Sample Entropy, PFD, and KFD were used as epileptogenicity index features, and PFD and KFD were used to calculate the fractal dimension of SEEG signals; c: Construct the node feature matrix and calculate the seven features within the time window T. These features are used to characterize the epilepsy intensity coefficient of the node, which is called the node weight degree.
4. The SEEG seizure detection method based on the time-frequency-space dynamic graph attention network according to claim 3 is characterized in that HFOs include three waveform types: ripples, fast ripples, and co-occurrence of ripples and fast ripples. When the sampling frequency is 500 Hz, only ripples are detected. HFOs detection identifies high-frequency oscillation events with more than six oscillations within a specified time window based on the Hilbert envelope amplitude of the bandpass filtered signal.
5. The SEEG seizure detection method based on a time-frequency-space dynamic graph attention network according to claim 3, characterized in that: In step S1, the dynamic sequence is obtained by taking snapshots of the dynamic graph at equal time intervals to obtain a discrete network evolution sequence, which is defined as in: Each graph G t =(V t ,E t ,X t ), represents the brain network computed at time step t; V t is a set of nodes, i.e., SEEG channel; E t is the edge set, i.e., the channel connections calculated based on the DTF matrix; X t is the node feature matrix, representing the epilepsy intensity.
6. The SEEG seizure detection method based on a time-frequency-space dynamic graph attention network according to claim 1, characterized in that: Step S2 introduces the dynamic attention mechanism into GAT to obtain GATv2. The attention score is calculated as follows: Based on the above, the learned graph representation vector is weighted according to seven frequency bands, and its attention calculation formula is: v t =Utanh(Wμ i +b) in: μ t represents the input of the hidden layer; v t is the attention weight calculated by the network output layer at time t; γ t Represents the normalized attention weight, and the weight parameter U obtained by learning Calculate with W and bias b.
7. The SEEG seizure detection method based on time-frequency-space dynamic graph attention network according to claim 1, characterized in that In step S3, the TCN module includes: Causal convolution: used to ensure that data processing follows a strict temporal order; Dilated convolution: The receptive field is expanded by introducing a dilation factor d to solve the problem of limited receptive field of causal convolution; Residual convolution: Introduces residual connections, dropout, and layer normalization to alleviate the vanishing gradient problem. Residual connections establish shortcut connections between layers to maintain gradient flow and prevent gradient vanishing. The calculation formula of dilated convolution is as follows: in: f(i) represents the i-th convolution coefficient, k is the size of the convolution kernel, x (t-d·i) represents the input data after i expansions at time t; The expansion factor d is set to d=2 i , where i is the layer index; The representation of the residual connection is: o=Activation(x+F(x)) Where x represents the input, F(x) is the residual mapping to be learned, and o is the output; Finally, the spatial-spectral-temporal features are weighted by attention weights and finally, classification is performed by a nonlinear activation function.
Citation Information
Cited By
Double-branch electroencephalogram emotion recognition method and system based on brain region topology and space-time
CN121388531A