Epilepsy detection method based on multi-scale space-time diagram attention fusion network
Through the multi-scale space-time graph attention fusion network, sequence decomposition and sparse attention mechanism, the problem of mutual interference between the timing characteristics of EEG signals and low efficiency in modeling of long-term dependencies is solved, and high accuracy and real-time epilepsy detection is achieved.
Patent Information
- Application Number
- CN202411756841.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-03
AI Technical Summary
The prior art has shortcomings in accuracy, real-timeness and model interpretability in epilepsy prediction, the timing characteristics of EEG signals interfere with each other and the long-term dependency modeling efficiency is low.
A multi-scale space-time graph attention fusion network is used to obtain macroscopic and microscopic change sequences through sequence decomposition, and the timing and spatial features are extracted respectively using the graph attention mechanism and the sparse attention mechanism to reduce the mutual interference of features and the computational complexity.
It effectively avoids mutual interference between EEG signal characteristics, improves the accuracy and real-time of the model, reduces the computational complexity, and achieves excellent epilepsy detection performance.
Smart Images

Figure CN119745399A_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 disease characterized by recurrent seizures caused by abnormal brain electrical activity. Such unpredictable seizures pose a huge 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, more and more studies have attempted to use artificial intelligence for the prediction of epileptic seizures, mainly by analyzing electroencephalogram (EEG) signals to discover potential abnormal patterns. Although some existing methods have made some progress in the prediction of epileptic seizures, there are still significant deficiencies in accuracy, real-time and model interpretability.
[0003] At present, 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 performance of the model.
[0007] 2. Modeling efficiency issues of long-term dependence of EEG signals
[0008] In order to capture the temporal dynamic characteristics of EEG signals, recurrent neural networks (such as LSTM or GRU) are widely used. However, RNN-type models often face the problems of gradient vanishing and low computational efficiency when processing signals with long time spans, which makes it difficult for the model to effectively model long-term dependencies. In addition, RNN needs to calculate sequence data step by step, which leads to high computational overhead when processing long sequences, making it difficult to achieve real-time prediction. Summary of the invention
[0009] Purpose of the invention: The purpose of the present invention is to solve the deficiencies in the prior art and to 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 of 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 The macroscopic change sequence trend and microscopic change sequence season of the EEG signal are obtained by sequence decomposition; 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: Combine the spatiotemporal dynamic fusion feature 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, a specific lead is selected to normalize the collected raw EEG signals, retaining the frequency band information between 1 and 40 Hz and reducing 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, the artifacts in the EEG signal are removed 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, convert the denoised data into time domain data X through inverse Fourier transform IFFT. d , and reduce the feature dimension through one-dimensional convolution; the denoising process is written as:
[0024] X f =W 1 (FFT(X));
[0025] X d =conv1d(IFFT(X f ));
[0026] Among them, W 1 is 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 variation sequence season∈R B×c×L′ .
[0031] The EEG signal contains a large amount of information that changes with time and will interfere with each other. When extracting the EEG time features for nose hair, the mutual interference between various features is avoided, and the spatial dependency of the EEG signal is extracted at the same time. Furthermore, the specific content of the feature extraction of 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) Extract and fuse the features of the two 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 m+1 The 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 m+1 Fusion to obtain t M and M , and the fused feature t M and 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 summarize 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, and then the two are 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 feature of each node is first multiplied by the parameter matrix for mapping, which is equivalent to extracting the temporal feature. 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 feature:
[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 neighboring 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 ={x 1 ,x 2 ,…,x L}, the specific method of the global dependency extraction module using the sparse attention mechanism to extract global dependency information is:
[0044] First, X={x 1 ,x 2 ,…,x L} for 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, and 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 betweenmn is the result of normalizing each row in A, so that the sum of each row in A is equal to 1, and Z is the final output; A is an L×L matrix, and 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;
[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 amount of computation by selecting the top u queries and setting other queries to 0, where u = c·lnL.
[0054] Furthermore, the step 4 uses a classifier composed of full connections to complete the task of epilepsy classification based on electroencephalogram;
[0055] Using Focal Loss function FL(p t ) Dynamically adjust model parameters, Focal 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 and micro trends 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 takes into account the spatiotemporal correlations of EEG signals and extracts these correlations using sparse attention.
[0063] 4. The present invention is experimented on the CHB-MIT dataset, and the experimental results show that our model has excellent performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 It is a schematic diagram of the network framework of the present invention;
[0065] Figure 2 It is a 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, an epilepsy detection method based on a multi-scale spatiotemporal graph attention fusion network of the present invention comprises 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 The macroscopic change sequence trend and microscopic change sequence season of the EEG signal are obtained by sequence decomposition; 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: Combine the spatiotemporal dynamic fusion feature 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 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, the artifacts in the EEG signal are removed 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 through one-dimensional convolution; the denoising process is written as:
[0081] X f =W 1 (FFT(X));
[0082] X d =conv1d(IFFT(X f ));
[0083] Among them, W 1 is 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 rank of the ith 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 odd-order 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 variation 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 the 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 m+1 The 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 m+1 Fusion to obtain t M and M , and the fused feature t M andM After adding, the output spatiotemporal dynamic fusion feature X t ;
[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 feature of each node is first multiplied by the parameter matrix for mapping, which is equivalent to extracting the temporal feature. 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 feature:
[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 neighboring 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.
[0103] In this embodiment, the input spatiotemporal dynamic fusion feature X t ={x 1 ,x 2 ,…,x L}, the specific method of the global dependency extraction module using the sparse attention mechanism to extract global dependency information is:
[0104] First, X={x 1 ,x 2 ,…,x L} for 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, and 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 amount of computation by selecting the top u queries and setting 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 task of epilepsy classification based on EEG;
[0115] Using Focal Loss function FL(p t ) Dynamically adjust model parameters, Focal 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 is 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 misidentified). 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 in the present invention can correctly screen out the preictal stage. The evaluation indicators 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 prior art experiments
[0134]
[0135]
[0136] like Figure 2 As shown, 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 being processed by the model. It can be seen that the yellow points and the blue points are mixed together and cannot be distinguished; Figure 2 (b) shows the data processed by the present invention. It can be seen from the figure that 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 The macroscopic change sequence trend and microscopic change sequence season of the EEG signal are obtained by sequence decomposition; 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: Combine the spatiotemporal dynamic fusion feature X obtained in step 2 t Input global dependency extraction module, which uses sparse attention mechanism to capture the global dependency of EEG signals; Step 4: Use a classifier composed of a fully connected layer MLP to perform epilepsy detection classification.
2. The epilepsy detection method based on multi-scale spatiotemporal graph attention fusion network according to claim 1 is 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, the artifacts in the EEG signal are removed 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 through 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 multi-scale spatiotemporal graph attention fusion network according to claim 1 is 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 variation sequence season∈R B ×c×L′ .
4. The epilepsy detection method based on 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 the 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 m+1 The macro and micro time series after m+1 downsampling respectively; GAT() uses the graph attention mechanism GAT operation; Step 3), respectively m+1 and m+1 Fusion to obtain t M and M , and the fused feature t M and 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 feature of each node is first multiplied by the parameter matrix for mapping to achieve the 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 neighboring 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 multi-scale spatiotemporal graph attention fusion network according to claim 1, characterized in that: 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: First, X={x1,x2,…,x L } for 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, and 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 calculation method of this measure is Among them, M(q m ,K) measures the importance of the m-th query; reduces the amount of computation by selecting the top u queries and setting other queries to 0, where u = c·lnL.
6. The epilepsy detection method based on multi-scale spatiotemporal graph attention fusion network according to claim 1, characterized in that: The step 4 uses a classifier composed of full connections to complete the epilepsy classification task based on the electroencephalogram; Using Focal Loss function FL(p t ) Dynamically adjust model parameters, Focal 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
Epileptic seizure prediction method through electroencephalogram signal on the basis of multi-scale convolution and self-attention network
CN113907706A
Epilepsy detection system based on CNN and Transform
CN114129129A
Epileptic seizure prediction system and method based on space-time multi-scale attention mechanism
CN117122281A
Electroencephalogram emotion recognition method based on graph convolution and fusion attention
CN117407748A
Cited By
Space auditory attention dynamic coupling analysis method and system based on multilayer network
CN120216935A
EEG signal ratchet wave detection method and system based on KAN feature fusion
CN120408385A
Emotion recognition method, system and terminal based on multi-scale brain network decoding model
CN120661158A
Epilepsy detection method and system based on multi-band brain function network
CN120982974A