Epilepsy detection method based on multi-scale spatiotemporal graph attention fusion network
Through the multi-scale space-time graph attention fusion network, EEG signals are decomposed, combined with graph attention and sparse attention mechanism, the problem of mutual influence of EEG signal timing characteristics and long-term dependence modeling is solved, and efficient and accurate epilepsy detection is achieved.
Patent Information
- Application Number
- CN202411756841.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2044-12-03
AI Technical Summary
The existing epileptic seizure prediction technology has shortcomings in accuracy, real-time and model interpretability. The problem of mutual influence of the timing characteristics of EEG signals and the inefficiency of long-term dependence modeling has not been effectively solved.
A multi-scale space-time graph attention fusion network is used to decompose the EEG signals into macroscopic and microscopic change sequences, and feature extraction is performed separately. The space-time dependence relationship is captured through the graph attention mechanism and the sparse attention mechanism, and a full connection layer is used for classification.
It effectively avoids mutual interference between EEG signal characteristics, improves the accuracy and real-time nature of epilepsy detection, reduces the computational complexity, and realizes efficient modeling and accurate prediction of EEG signal.
Smart Images

Figure CN119745399B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to image detection and recognition and biomedical signal processing technology, and in particular to an epilepsy detection method based on a multi-scale spatiotemporal graph attention fusion network. Background Art
[0002] Epilepsy is a serious neurological disorder characterized by recurrent seizures caused by abnormal brain electrical activity. These unpredictable seizures pose a significant threat to patients' daily lives and safety. Therefore, developing a technology that can accurately predict epileptic seizures in advance is of great clinical significance. In recent years, with the development of deep learning technology, an increasing number of studies have attempted to apply artificial intelligence to predict epileptic seizures, primarily by analyzing electroencephalogram (EEG) signals to identify potential abnormal patterns. Although some existing methods have made some progress in epileptic seizure prediction, they still have significant shortcomings in terms of accuracy, real-time performance, and model interpretability.
[0003] Currently, mainstream epilepsy prediction technologies can be roughly classified into models based on convolutional neural networks (CNN), recurrent neural networks (RNN, such as LSTM or GRU), and some models based on Transformer architecture.
[0004] However, existing similar technologies have the following disadvantages:
[0005] 1. Since EEG signals contain a large amount of temporal information, various features may affect each other during the model fusion process.
[0006] Previous work usually directly inputs EEG signals into the model for feature extraction. However, since EEG signals contain a large number of temporal features, these features will inevitably affect each other during model learning, thereby affecting the model's performance.
[0007] 2. Modeling efficiency issues related to long-term dependence of EEG signals
[0008] To capture the temporal dynamics of EEG signals, recurrent neural networks (such as LSTMs or GRUs) are widely used. However, RNN-based models often suffer from vanishing gradients and computational inefficiency when processing long-duration signals, making it difficult to effectively model long-term dependencies. Furthermore, RNNs require step-by-step computation of sequential data, resulting in high computational overhead when processing long sequences, making real-time prediction difficult. Summary of the Invention
[0009] Purpose of the invention: The purpose of the present invention is to address the deficiencies in the prior art and provide an epilepsy detection method based on a multi-scale spatiotemporal graph attention fusion network, which decomposes EEG signals into multiple scales and processes the EEG signals at each scale separately, thereby avoiding mutual interference between features; a sparse attention mechanism is used to model long-term dependencies, reducing the complexity of the tranformer from O(L2) to O(LlogL).
[0010] Technical solution: The present invention provides an epilepsy detection method based on a multi-scale spatiotemporal graph attention fusion network, comprising the following steps:
[0011] Step 1: Obtain the EEG signal and preprocess it to obtain the corresponding time domain data X after noise reduction d ;
[0012] Step 2: Construct a macroscopic multi-scale fusion module and a microscopic multi-scale fusion module with exactly the same structure; transform the time domain data X obtained in step 1 into d Sequence decomposition is performed to obtain the macroscopic change sequence trend and microscopic change sequence season of the EEG signal; the macroscopic change sequence trend is input into the macroscopic multi-scale fusion module for time series feature extraction, while the microscopic change sequence season is input into the microscopic multi-scale fusion module for time series feature extraction;
[0013] The two types of change sequences are downsampled respectively, and the graph attention mechanism GAT is used to extract features layer by layer; the two types of features are added and fused to obtain the spatiotemporal dynamic fusion feature X t ;
[0014] Step 3: Fusion the spatiotemporal dynamic features X obtained in step 2 t Input global dependency extraction module, which uses sparse attention mechanism to capture the global dependency of EEG signals;
[0015] Step 4: Use a classifier composed of a fully connected layer MLP for classification (the classifier consists of a fully connected layer MLP, and uses the stochastic gradient descent mechanism to automatically adjust its parameters to map the two types of features to different categories).
[0016] Furthermore, the detailed method of step 1 is:
[0017] First, the collected raw EEG signals are normalized by selecting specific leads to retain the frequency band information between 1 and 40 Hz and reduce the influence of noise such as blinking and rapid heartbeat.
[0018] Then, the Spearman correlation coefficient is used to construct the EEG signal and obtain the adjacency matrix of the EEG signal spatial structure. Each node in the graph represents the channel of the corresponding EEG signal.
[0019]
[0020] Among them, M Raw and M Norm Represent the original samples and the normalized data respectively;
[0021]
[0022] in, and Represents the i-th rank value in the two sequences M and N, and express and the average of
[0023] Next, remove the artifacts in the EEG signal by first converting the normalized time domain EEG data X into frequency domain data X using fast Fourier transform (FFT). f , then, the frequency domain data X f Multiply it with the learnable denoising matrix to adjust the spectrum and reduce artifact components. Then, the denoised data is converted into time domain data X through inverse Fourier transform IFFT d , and reduce the feature dimension by one-dimensional convolution; the denoising process is written as:
[0024] X f =W1(FFT(X));
[0025] X d =conv1d(IFFT(X f ));
[0026] Where W1 refers to the denoising matrix, X∈R B×C×L , X d ∈R B×C×L′ , B is the batch size, C is the number of channels, L is the feature length, and L' is the feature length after denoising.
[0027] Furthermore, in step 2, the time domain data X d The formula for decomposition is:
[0028] trend=AvgPool(X d );
[0029] season=X d -trend;
[0030] Among them, AvgPool represents average pooling, and the macro change sequence trend∈R B×C×L′ , microscopic change sequence season∈R B×c×L′ .
[0031] EEG signals contain a large amount of information that changes over time and interferes with each other. When extracting EEG temporal features for nose hair, we avoid the mutual interference between various features and extract the spatial dependency of EEG signals at the same time. Furthermore, the specific content of feature extraction in the macro / micro multi-scale fusion module in step 2 is as follows:
[0032] Step 1) Downsample the input macro-change sequence trend and micro-change sequence season to obtain a set of time series of different scales;
[0033] Step 2) Feature extraction and fusion are performed on the two sets of time series respectively. The process is written as follows:
[0034] t m+1 =t m+1 +GAT(t m ),m∈{0,…,M},
[0035] s m+1 =s m+1 +GAT(s m ),m∈{0,…,M}
[0036] In the above formula, m refers to the mth sampling number, t m+1 and s m+1 Macro and micro time series after m+1 downsampling respectively; GAT() uses the graph attention mechanism GAT operation;
[0037] Step 3), respectively m+1 and s m+1 Fusion to obtain t M and s M , and the fused feature t M and s M After adding, the output spatiotemporal dynamic fusion feature X t ;
[0038] X t =t M +s M .
[0039] In the above operations, GAT is used to extract temporal features from coarse-grained time series and aggregate spatial features. At the same time, GAT is used to map the coarse-grained time series to the same length as the fine-grained time series. The two are then added together to achieve feature fusion and avoid mutual interference between various temporal features.
[0040] In step 2), the spatiotemporal information of time series at each scale is summarized through the graph attention mechanism GAT. During the operation of the graph attention mechanism GAT, each node in the graph represents the channel of the corresponding EEG signal. The features of each node are first multiplied by the parameter matrix for mapping, which is equivalent to extracting the temporal features. After that, the attention coefficient between each node is calculated, and each node and its adjacent nodes are summarized, which is equivalent to extracting the spatial features:
[0041]
[0042] Among them, h i 、h j Respectively represent the node representation of node i and node j, α ij represents the attention coefficient between node i and node j, N i represents the set of adjacent nodes of node i, W∈R F×F′ , a∈R 2F′ is a trainable weight parameter, F is the input feature dimension, and F' is the output feature dimension.
[0043] Furthermore, for the input spatiotemporal dynamic fusion feature X t ={x1,x2,…,x L The specific method of the global dependency extraction module using the sparse attention mechanism to extract global dependency information is as follows:
[0044] First, X={x1,x2,…,x L} perform linear transformation, the formula is as follows:
[0045] Q=XW Q , K=XW K , V=XW V ;
[0046] in, is the learnable weight matrix, d k is the dimension of the feature, L represents the number of timestamps;
[0047] Then, the similarity between the query and the key is calculated by the dot product:
[0048]
[0049] Z = αV;
[0050] where α∈R L×L is the attention matrix, each element α mn Represents the element x in the sequence m and element x n The attention score between mnIt is the result of normalizing each row in A so that the sum of each row in A is equal to 1. Z is the final output. A is an L×L matrix, and each row in the matrix A is a vector of length L. mn represents the attention score between timestamp m and timestamp n, A mn The higher the value, the more the mth timestamp depends on the nth timestamp;
[0051] The sparse attention mechanism reduces the computational complexity by introducing a query sparsity measure to measure the importance of each query; the calculation method of this measure is
[0052]
[0053] Among them, M(q m ,K) measures the importance of the m-th query; reduces the computational effort by selecting the top u queries and setting the other queries to 0, where u = c·lnL.
[0054] Furthermore, the step 4 uses a classifier composed of fully connected components to complete the epilepsy classification task based on EEG;
[0055] Using Focal Loss function FL(p t ) Dynamically adjust model parameters, Focal Loss loss function FL(p t ) Based on the cross entropy loss function, a parameter about the sample ratio is introduced to reduce the impact of the imbalance of positive and negative samples on the model by assigning different weights to the losses of positive and negative samples;
[0056] The Focal Loss loss function expression is:
[0057] FL(p t )=-α t (1-p t ) γ log(p t );
[0058] Among them, p t represents the predicted probability of the target category, α and γ are hyperparameters; α is set to 0.25 and γ is set to 2.
[0059] Beneficial effects: Compared with the prior art, the present invention has the following advantages:
[0060] 1. The present invention adopts a sequence decomposition strategy to decompose the macro-trend and micro-trend of EEG signals to avoid mutual interference between them.
[0061] 2. The present invention uses a multi-scale analysis strategy to decompose EEG signals into multiple scales and learn the signals of each scale one by one, thereby avoiding the interaction between complex information in EEG signals.
[0062] 3. The present invention considers the spatiotemporal correlations of EEG signals and extracts these correlations using sparse attention.
[0063] 4. This paper conducts experiments on the CHB-MIT dataset, and the experimental results show that our model has excellent performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 This is a schematic diagram of the network framework of the present invention;
[0065] Figure 2 Schematic diagram of the effect of an embodiment of the present invention. DETAILED DESCRIPTION
[0066] The technical solution of the present invention is described in detail below, but the protection scope of the present invention is not limited to the embodiments.
[0067] like Figure 1 As shown, the present invention provides an epilepsy detection method based on a multi-scale spatiotemporal graph attention fusion network, comprising the following steps:
[0068] Step 1: Obtain the EEG signal and preprocess it to obtain the corresponding time domain data X after noise reduction d ;
[0069] Step 2: Construct a macroscopic multi-scale fusion module and a microscopic multi-scale fusion module with exactly the same structure; transform the time domain data X obtained in step 1 into d Sequence decomposition is performed to obtain the macroscopic change sequence trend and microscopic change sequence season of the EEG signal; the macroscopic change sequence trend is input into the macroscopic multi-scale fusion module for time series feature extraction, while the microscopic change sequence season is input into the microscopic multi-scale fusion module for time series feature extraction;
[0070] The two types of change sequences are downsampled respectively, and the graph attention mechanism GAT is used to extract features layer by layer; the two types of features are added and fused to obtain the spatiotemporal dynamic fusion feature X t ;
[0071] Step 3: Fusion the spatiotemporal dynamic features X obtained in step 2 t Input global dependency extraction module, which uses sparse attention mechanism to capture the global dependency of EEG signals;
[0072] Step 4: Use a classifier composed of a fully connected layer MLP to perform epilepsy detection and classification.
[0073] The detailed process of step 1 of this embodiment is as follows:
[0074] First, a specific lead is selected to normalize the collected raw EEG signals, retaining the frequency band information between 1 and 40 Hz;
[0075] Then, the Spearman correlation coefficient is used to construct the EEG signal and obtain the adjacency matrix of the EEG signal spatial structure. Each node in the graph represents the channel of the corresponding EEG signal.
[0076]
[0077] Among them, M Raw and M Norm Represent the original samples and the normalized data respectively;
[0078]
[0079] in, and Represents the i-th rank value in the two sequences M and N, and express and the average of
[0080] Next, remove the artifacts in the EEG signal by first converting the normalized time domain EEG data X into frequency domain data X using fast Fourier transform (FFT). f , then, the frequency domain data X f Multiply it with the learnable denoising matrix, and then convert the denoised data into time domain data X through inverse Fourier transform IFFT d , and reduce the feature dimension by one-dimensional convolution; the denoising process is written as:
[0081] X f =W1(FFT(X));
[0082] X d =conv1d(IFFT(X f ));
[0083] Where W1 refers to the denoising matrix, X∈R B×C×L , X d ∈R B×C×L′ , B is the batch size, C is the number of channels, L is the feature length, and L' is the feature length after denoising.
[0084] The general calculation formula for the above Spearman correlation is as follows:
[0085]
[0086] Where n is the number of samples, R i is the insignificance of the i-th data point in variable X, S i is the indices of the ith data point in variable Y, is the sum of squares of the oval differences.
[0087] In step 2 of this embodiment, the time domain data X d The formula for decomposition is:
[0088] trend=AvgPool(X d );
[0089] season=X d -trend;
[0090] Among them, AvgPool represents average pooling, and the macro change sequence trend∈R B×C×L′ , microscopic change sequence season∈R B×C×L′ .
[0091] The specific content of the feature extraction of the macro / micro multi-scale fusion module in step 2 of this embodiment is as follows:
[0092] Step 1) Downsample the input macro-change sequence trend and micro-change sequence season to obtain a set of time series of different scales;
[0093] Step 2) Extract and fuse features of the two time series respectively. The process can be written as follows:
[0094] t m+1 =t m+1 +GAT(t m ),m∈{0,…,M};
[0095] s m+1 =s m+1 +GAT(s m ),m∈{0,…,M};
[0096] In the above formula, m refers to the mth sampling number, t m+1 and s m+1 Macro and micro time series after m+1 downsampling respectively; GAT() uses the graph attention mechanism GAT operation;
[0097] Step 3), respectively m+1 and s m+1 Fusion to obtain t M and s M , and the fused feature t M and s M After adding, the output spatiotemporal dynamic fusion feature Xt ;
[0098] X t =t M +s M ;
[0099] In step 2), the spatiotemporal information of time series at each scale is summarized through the graph attention mechanism GAT. During the operation of the graph attention mechanism GAT, each node in the graph represents the channel of the corresponding EEG signal. The features of each node are first multiplied by the parameter matrix for mapping, which is equivalent to extracting the temporal features. After that, the attention coefficient between each node is calculated, and each node and its adjacent nodes are summarized, which is equivalent to extracting the spatial features:
[0100]
[0101]
[0102] Among them, h i 、h j Respectively represent the node representation of node i and node j, α ij represents the attention coefficient between node i and node j, N i represents the set of adjacent nodes of node i, W∈R F×F′ , a∈R 2F′ is a trainable weight parameter, F is the input feature dimension, F ’ is the output feature dimension.
[0103] In this embodiment, the input spatiotemporal dynamic fusion feature X t ={x1,x2,…,x L The specific method of the global dependency extraction module using the sparse attention mechanism to extract global dependency information is as follows:
[0104] First, X={x1,x2,…,x L} perform linear transformation, the formula is as follows:
[0105] Q=XW Q , K=XW K , V=XW V ;
[0106] in, is the learnable weight matrix, d k is the dimension of the feature, L represents the number of timestamps;
[0107] Then, the similarity between the query and the key is calculated by the dot product:
[0108]
[0109] Z = αV;
[0110] where α∈R L×L is the attention matrix, each element α mn Represents the element x in the sequence m and element x n The attention score between them, Z is the final output; A is an L×L matrix, each row in the matrix A is a vector of length L, A mn represents the attention score between timestamp m and timestamp n, A mn The higher the value, the more the mth timestamp depends on the nth timestamp;
[0111] The sparse attention mechanism reduces the computational complexity by introducing a query sparsity measure to measure the importance of each query; the calculation method of this measure is
[0112]
[0113] Among them, M(q m ,K) measures the importance of the m-th query; reduces the computational effort by selecting the top u queries and setting the other queries to 0, where u = c·lnL.
[0114] In step 4 of this embodiment, a classifier composed of fully connected components is used to complete the epilepsy classification task based on EEG;
[0115] Using Focal Loss function FL(p t ) Dynamically adjust model parameters, Focal Loss loss function FL(p t ) Based on the cross entropy loss function, a parameter about the sample ratio is introduced to reduce the impact of the imbalance of positive and negative samples on the model by assigning different weights to the losses of positive and negative samples;
[0116] The Focal Loss loss function expression is:
[0117] FL(p t )=-α t (1-p t ) γ log(p t );
[0118] Among them, p t represents the predicted probability of the target category, α and γ are hyperparameters; α is set to 0.25 and γ is set to 2.
[0119] To verify the technical effect of the present invention, this embodiment was experimented on the CHB-MIT dataset described in Table 1. The experimental results show that the present invention has excellent performance.
[0120] Table 1 Contents of the CHB dataset
[0121]
[0122]
[0123] This embodiment evaluates the relevant technical effects from the following four indicators.
[0124] TP (True Positive) refers to the number of samples that are actually positive but are correctly predicted as positive (epileptic EEG is correctly identified). TN (True Negative) refers to the number of samples that are actually negative but are correctly predicted as negative (non-epileptic EEG is correctly identified). FN (False Negative) refers to the number of samples that are actually positive but are incorrectly predicted as negative (epileptic EEG is incorrectly identified). FP (False Positive) refers to the number of samples that are actually negative but are incorrectly predicted as positive (non-epileptic EEG is incorrectly identified).
[0125] Since the ultimate goal of the present invention is to detect epilepsy, the network model of the present invention is capable of correctly screening out the preictal stage. The evaluation indicators for this are mainly AUC, Sen, and Spe.
[0126] 1. AUC: It is used to evaluate the overall distinguishing ability of the model. It can comprehensively reflect the performance of the model under various possible thresholds and is an important overall performance indicator.
[0127] AUC refers to the area under the ROC curve (Receiver Operating Characteristic Curve). The ROC curve is a curve drawn with sensitivity as the vertical axis and 1-specificity as the horizontal axis, and the value is between 0 and 1.
[0128] 2. Sensitivity (Sen): used to measure the model's ability to identify epileptic EEG.
[0129]
[0130] 3. Specificity (Spe): used to measure the model's ability to identify normal situations
[0131]
[0132] Here, the technical solution of the present invention is further compared with the prior art in terms of the above indicators, as shown in Table 2.
[0133] Table 2 Comparison data with existing technology experiments
[0134]
[0135]
[0136] like Figure 2 As shown in the figure, the T-SNE visualization of the technical effect of the present invention can project high-dimensional data into a two-dimensional space for observation. The yellow points in the figure represent the EEG data of epileptic seizures, and the blue points represent normal EEG data. Figure 2 (a) shows the EEG data before model processing. It can be seen that the yellow points and blue points are mixed together and cannot be distinguished. Figure 2 (b) shows the data processed by the present invention. As can be seen from the figure, the yellow points and the blue points are distributed at the two ends of the space and can be easily distinguished.
[0137] It can be seen from the above experimental results that the present invention is able to capture and understand the feature relationships in EEG signals at different levels, and successfully captures and understands the feature relationships in EEG signals by combining spatial context dependency and long-range content modeling.
Claims
1. An epilepsy detection method based on a multi-scale spatiotemporal graph attention fusion network, characterized in that: The following steps are involved: Step 1: Obtain the EEG signal and preprocess it to obtain the corresponding time domain data X after noise reduction d ; Step 2: Construct a macroscopic multi-scale fusion module and a microscopic multi-scale fusion module with exactly the same structure; transform the time domain data X obtained in step 1 into d Sequence decomposition is performed to obtain the macroscopic change sequence trend and microscopic change sequence season of the EEG signal; the macroscopic change sequence trend is input into the macroscopic multi-scale fusion module for time series feature extraction, while the microscopic change sequence season is input into the microscopic multi-scale fusion module for time series feature extraction; The two types of change sequences are downsampled and the graph attention mechanism GAT is used to extract features layer by layer. The two types of features are added and fused to obtain the spatiotemporal dynamic fusion feature X t ; Step 3: Fusion the spatiotemporal dynamic features X obtained in step 2 t Enter the global dependency extraction module, which uses a sparse attention mechanism to capture the global dependency relationship of EEG signals. The specific method of extracting global dependency information using the sparse attention mechanism is as follows: First, X={x1,x2,…,x L } perform linear transformation, the formula is as follows: Q=XW Q ,K=XW K ,V=XW V ; in, is the learnable weight matrix, d k is the dimension of the feature, L represents the number of timestamps; Then, the similarity between the query and the key is calculated by the dot product: Z = αV; where α∈R L×L is the attention matrix, each element α mn Represents the element x in the sequence m and element x n The attention score between them, Z is the final output; A is an L×L matrix, each row in the matrix A is a vector of length L, A mn represents the attention score between timestamp m and timestamp n, A mn The higher the value, the more the mth timestamp depends on the nth timestamp; The sparse attention mechanism reduces the computational complexity by introducing a query sparsity measure to measure the importance of each query; the measurement value is calculated as Among them, M(q m ,K) measures the importance of the m-th query; reduces the computational effort by selecting the top u queries and setting the other queries to 0, where u = c·lnL; Step 4: Use a classifier composed of a fully connected layer MLP to perform epilepsy detection and classification.
2. The epilepsy detection method based on a multi-scale spatiotemporal graph attention fusion network according to claim 1, characterized in that: The detailed method of step 1 is: First, a specific lead is selected to normalize the collected raw EEG signals, retaining the frequency band information between 1 and 40 Hz; Then, the Spearman correlation coefficient is used to construct the EEG signal and obtain the adjacency matrix of the EEG signal spatial structure. Each node in the graph represents the channel of the corresponding EEG signal. Among them, M Raw and M Norm Represent the original samples and the normalized data respectively; in, and Represents the i-th rank value in the two sequences M and N, and Represents R Mi and R Ni the average of Next, remove artifacts from the EEG signal by first converting the normalized time domain EEG data X into frequency domain data X using fast Fourier transform (FFT). f , then, the frequency domain data X f Multiply it with the learnable denoising matrix, and then convert the denoised data into time domain data X through inverse Fourier transform IFFT d , and reduce the feature dimension by one-dimensional convolution; the denoising process is written as: X f =W1(FFT(X)); X d =conv1d(IFFT(X f )); Where W1 refers to the denoising matrix, X∈R B×C×L , X d ∈R B×C×L′ , B is the batch size, C is the number of channels, L is the feature length, and L' is the feature length after denoising.
3. The epilepsy detection method based on a multi-scale spatiotemporal graph attention fusion network according to claim 1, characterized in that: In step 2, the time domain data X d The formula for decomposition is: trend=AvgPool(X d ); season=X d -trend; Among them, AvgPool represents average pooling, and the macro change sequence trend∈R B×C×L′ , microscopic change sequence season∈R B ×C×L′ .
4. The epilepsy detection method based on a multi-scale spatiotemporal graph attention fusion network according to claim 1, characterized in that: The specific content of the feature extraction of the macro / micro multi-scale fusion module in step 2 is as follows: Step 1) Downsample the input macro-change sequence trend and micro-change sequence season to obtain a set of time series of different scales; Step 2) Extract and fuse features of the two time series respectively. The process can be written as follows: t m+1 =t m+1 +GAT(t m ),m∈{0,…,M}; s m+1 =s m+1 +GAT(s m ),m∈{0,…,M}; In the above formula, m refers to the mth sampling number, t m+1 and s m+1 Macro and micro time series after m+1 downsampling respectively; GAT( ) uses the graph attention mechanism GAT operation; Step 3), respectively m+1 and s m+1 Fusion to obtain t M and s M , and the fused feature t M and s M After adding, the output spatiotemporal dynamic fusion feature X t ; X t =t M +s M ; In step 2), the spatiotemporal information of time series at each scale is summarized through the graph attention mechanism GAT. During the operation of the graph attention mechanism GAT, each node in the graph represents the channel of the corresponding EEG signal. The features of each node are first multiplied by the parameter matrix for mapping to achieve temporal feature intent. After that, the attention coefficient between each node is calculated, and each node and its adjacent nodes are summarized to achieve spatial feature extraction: Among them, h i 、h j Respectively represent the node representation of node i and node j, α ij represents the attention coefficient between node i and node j, N i represents the set of adjacent nodes of node i, W∈R F×F′ , a∈R 2F′ is a trainable weight parameter, F is the input feature dimension, and F' is the output feature dimension.
5. The epilepsy detection method based on a multi-scale spatiotemporal graph attention fusion network according to claim 1, characterized in that: The step 4 uses a classifier composed of fully connected components to complete the epilepsy classification task based on electroencephalogram; Using Focal Loss function FL(p t ) Dynamically adjust model parameters, Focal Loss loss function FL(p t ) Based on the cross entropy loss function, a parameter about the sample ratio is introduced to reduce the impact of the imbalance of positive and negative samples on the model by assigning different weights to the losses of positive and negative samples; The Focal Loss loss function expression is: FL(p t )=-a t (1-p t ) γ log(p t ); Among them, p t represents the predicted probability of the target category, and α and γ are hyperparameters.
Citation Information
Patent Citations
Epilepsy detection system based on graph attention residual network and focus loss
CN113197545A
Electroencephalogram emotion recognition method based on graph convolution and fusion attention
CN117407748A