Epileptic seizure prediction method based on multivariate depth self-attention convolutional network

By using a multivariate deep self-attention convolutional network to represent the temporal context of EEG signals, this method solves the problem of the failure to effectively utilize the temporal correlation of EEG signals in existing technologies, achieving higher accuracy in epileptic seizure prediction and improving the accuracy and interpretability of the prediction.

CN119033388AInactive Publication Date: 2024-11-29HARBIN UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411460791.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2024-11-29
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing technologies fail to effectively consider the temporal correlation between EEG signal segments in epileptic seizure prediction, resulting in an inability to fully analyze the continuous temporal variability of epileptic seizures and affecting prediction accuracy.

Method used

We employ a multivariate deep self-attention convolutional network to represent the temporal context of EEG signals through autoencoder and self-attention mechanism networks, constructing highly relevant temporal context prediction features to enhance the data's discriminative power and applicability.

Benefits of technology

It improves the accuracy of epileptic seizure prediction, enhances the interpretability of deep learning algorithms, provides more accurate pre-seizure prediction, helps doctors adjust treatment plans, and reduces the frequency and severity of seizures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119033388A_ABST
    Figure CN119033388A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of epileptic seizure prediction, and discloses an epileptic seizure prediction method based on a multivariate depth self-attention convolutional network, and the method comprises the following steps: S1, based on a data collection module, obtaining electroencephalogram signals of an early stage and an interval of epileptic seizure; s2, based on a data processing module, filtering purification and segmentation are conducted on the electroencephalogram signals, and time window signal fragments are obtained; and S3, on the basis of a model construction and training module, constructing a multivariate depth self-attention convolutional network to realize high-precision epileptic seizure prediction. According to the epileptic seizure prediction method based on the multivariate depth self-attention convolutional network, high-correlation time sequence context feature prediction is carried out on time window signal fragments, time sequence correlation between waveform fragments is reasonably described, the identification of original data is enhanced, and the prediction precision of epileptic seizure is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of epileptic seizure prediction, and in particular to an epileptic seizure prediction method based on a multi-dimensional deep self-attention convolutional network. Background Art

[0002] Epilepsy is a common neurological disease with high morbidity, suddenness, and recurrence. Currently, most deep learning models for epileptic seizure prediction usually train time segments of the same length independently without considering the temporal correlation between waveform segments. This will lose some epileptic seizure temporal continuity information and fail to comprehensively analyze the temporal continuity of epileptic seizure development information.

[0003] Deep semantic feature learning refers to the use of a deep neural network language model to map text encodings of different granularity units into a low-dimensional, dense semantic vector space, in which the vectors of the context in the text have different degrees of semantic correlation.

[0004] Based on this, it is worthwhile to borrow semantic learning technology from natural language processing to self-encode the temporal information between EEG signal segments and construct a reliable deep learning network structure to describe the inter-element and intra-element temporal context correlation of time window EEG signals, so as to achieve EEG temporal context representation and thus improve the accuracy of epileptic seizure prediction. Summary of the invention

[0005] The purpose of the present invention is to provide an epileptic seizure prediction method based on a multivariate deep self-attention convolutional network, to perform temporal context representation on time window signal segments, to obtain high-correlation temporal context prediction features, to reasonably describe the temporal correlation between waveform segments, to achieve EEG temporal context representation, and to improve the prediction accuracy of epileptic seizures; in addition, the present invention also enhances the recognition of original data, and improves the interpretability and applicability in deep learning algorithms.

[0006] To achieve the above object, the present invention provides an epileptic seizure prediction method based on a multivariate deep self-attention convolutional network, comprising the following steps:

[0007] S1, based on the data collection module, obtaining the EEG signals before and during the epileptic seizure;

[0008] S2, based on the data processing module, filtering, purifying and segmenting the EEG signal to obtain time window signal segments;

[0009] S3. Based on the model building and training module, a multi-dimensional deep self-attention convolutional network is constructed to achieve high-precision epileptic seizure prediction.

[0010] Preferably, in step S3, a multi-dimensional deep self-attention convolutional network is constructed based on the model construction and training module, and the specific process is as follows:

[0011] S31, constructing an autoencoding module, performing autoencoding on each time window signal segment, and obtaining the features of each signal segment after reconstruction;

[0012] S32. Construct a self-attention mechanism network module to perform context learning on the features of each signal segment after reconstruction, obtain highly correlated contextual temporal features, and reasonably describe the temporal correlation between waveform segments;

[0013] S33. Based on the probability distribution learning method, update the multivariate deep self-attention convolutional network to achieve epileptic seizure prediction.

[0014] Preferably, in step S31, a self-encoding module is constructed to self-encode each time window signal segment to obtain the features of each signal segment after reconstruction, and the steps are as follows:

[0015] S311, build convolutional autoencoder;

[0016] S312, self-encode each time window signal segment to obtain the features of each signal segment after reconstruction, as shown below:

[0017] h i =f(x)=σ(Wx i +b)

[0018]

[0019] Among them, x i represents the i-th data point of the original signal segment, i.e., the true value input to the autoencoder; h i is the embedding vector; is the feature of the reconstructed signal segment; W and W' are weight matrices; b and b' are biases; σ is the activation function;

[0020] S313, based on the root mean square error cost function, ensure that the encoding feature can retain the information of the original signal to the maximum extent, as shown below:

[0021]

[0022] in, represents the output at time t, and M represents the number of samples contained in the time window signal segment.

[0023] Preferably, in step S32, a self-attention mechanism network module is constructed to perform context learning on the features of each reconstructed signal segment to obtain highly correlated contextual time series features and reasonably describe the time series correlation between waveform segments. The steps are as follows:

[0024] S321. Construct a self-attention mechanism network module, including a multi-head attention mechanism and a feedforward network layer;

[0025] S322, based on the attention mechanism in the self-attention mechanism network module, the features of each signal segment after reconstruction are processed to extract the temporal features of different segments, as shown below:

[0026]

[0027] Where Attention represents the output of the attention mechanism; Q, K, and V represent the query matrix, key matrix, and value matrix, respectively; d k is the dimension of the key matrix, used to scale the dot product attention to prevent the gradient from vanishing or exploding;

[0028] S323, using multiple attention heads to independently learn the temporal information, integrating these temporal features by weighted average, and inputting them into the feedforward network layer to obtain highly relevant contextual prediction features of different segments;

[0029] The multi-head attention mechanism is as follows:

[0030]

[0031] Z=Concat(head1,head2,...,head h )W0

[0032] in, and is the weight matrix of the i-th head; Z is the output of the multi-head attention mechanism; h is the number of attention heads; W0 is the output weight matrix;

[0033] The feed-forward network layer is as follows:

[0034] FFN(Z)=max(o,ZW1+b)W2+b2

[0035] Among them, W1 and W2 are the learnable weights of the two fully connected layers of the feedforward network layer, and max(o,ZW1+b) is the relu activation function;

[0036] S324. Based on the multi-head attention mechanism and the feedforward network layer, a self-attention mechanism network module is constructed as follows:

[0037]

[0038] H'=MHAFFN(H,θ)

[0039] Among them, H' represents the high-correlation temporal context prediction feature, and H is the feature of the embedded vector sequence composed of multiple reconstructed signal fragments. is composed of, θ is the network parameter.

[0040] Preferably, in step S33, based on the probability distribution learning method, the multivariate deep self-attention convolutional network is updated to achieve epileptic seizure prediction, and the steps are as follows:

[0041] S331, based on the Softmax decoder, the temporal features of the self-attention mechanism network module are mapped to the link category space; the link category space is analyzed to obtain the predicted probability distribution of each connection category, as shown below:

[0042]

[0043] Among them, y i represents the output at time i; Q i represents the original output layer of the network on the i-th class; Represents the sum of the exponents of all elements of the input vector;

[0044] S332. Use the cross entropy loss function to update the network parameters to improve the accuracy of the predicted probability, as shown below:

[0045]

[0046] Where N is the number of samples, is the true label of the i-th sample, y i is the probability that the i-th sample is predicted to be a positive class;

[0047] S333. Comprehensive loss function is used for network optimization, combining the reconstruction error loss of the autoencoder and the cross entropy loss of the classification task, as shown below:

[0048] L total =λL AE +L CE

[0049] Among them, λ is a trade-off parameter used to balance the reconstruction error of the autoencoder and the loss of the classification task.

[0050] Therefore, the present invention adopts the above-mentioned epileptic seizure prediction method based on multi-dimensional deep self-attention convolutional network, and predicts in advance before the epileptic seizure by real-time monitoring and analysis of EEG signals, providing patients and doctors with valuable preparation time. Accurate prediction helps doctors adjust treatment plans in time, reduce the number and severity of epileptic seizures, and improve the quality of life of patients. It provides new ideas and technical means for the field of epileptic seizure prediction, and helps to promote scientific research progress and clinical applications in this field.

[0051] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 It is a flow chart of an epileptic seizure prediction method based on a multivariate deep self-attention convolutional network of the present invention;

[0053] Figure 2 It is a flowchart of the implementation of the present invention to construct a multi-dimensional deep self-attention convolutional network;

[0054] Figure 3 is a flow chart of constructing an auto-encoding module of the present invention;

[0055] Figure 4 It is a flow chart of constructing a self-attention mechanism network module of the present invention;

[0056] Figure 5 It is a flowchart of the present invention for updating the multi-dimensional deep self-attention convolutional network. DETAILED DESCRIPTION

[0057] The technical solution of the present invention is further described below through the accompanying drawings and embodiments.

[0058] like Figure 1 As shown, the present invention provides an epileptic seizure prediction method based on a multivariate deep self-attention convolutional network, comprising the following steps:

[0059] S1, based on the data collection module, obtaining the EEG signals before and during the epileptic seizure;

[0060] S2, based on the data processing module, filtering, purifying and segmenting the EEG signal to obtain time window signal segments;

[0061] S3. Based on the model building and training module, a multi-dimensional deep self-attention convolutional network is constructed to achieve high-precision epileptic seizure prediction.

[0062] Example

[0063] The epileptic seizure prediction system based on the multi-dimensional deep self-attention convolutional network in this embodiment includes: a data collection module, a data processing module, a model building and training module, and a prediction and evaluation module.

[0064] Data collection module: Use multi-channel electroencephalogram (EEG) equipment to monitor and record the EEG signals of epileptic patients for a long time. According to the marker information of epileptic seizures, the signals are divided into pre-ictal and interictal periods.

[0065] Data processing module: including data preprocessing, noise filtering, signal segmentation and other steps. The original EEG signal is denoised and filtered to reduce the impact of external interference on signal quality.

[0066] Model building and training module: By building a multivariate deep self-attention convolutional network, the preprocessed signal is extracted and learned to distinguish the pre-ictal and interictal signals. The model is trained using labeled EEG data, and the model parameters are adjusted through the back-propagation algorithm to minimize the prediction error.

[0067] Prediction and evaluation module: predict the input real-time EEG signal to determine whether it is in the early stage of epileptic seizure, and use indicators such as accuracy, recall rate, F1 score to evaluate the prediction performance of the model. At the same time, the performance of the model can be further analyzed through ROC curve and AUC value.

[0068] Based on this, the present invention provides an epileptic seizure prediction method based on a multivariate deep self-attention convolutional network, comprising the following steps:

[0069] S1. Based on the data collection module, the EEG signals before and during the epileptic seizure are obtained; wherein the EEG signals are non-invasive scalp EEG signals rather than intracranial EEG signals, which can reduce the pain and burden of patients.

[0070] S2. Based on the data processing module, the EEG signal is filtered and purified by using a suitable filter, and the EEG signal is segmented by using a time window of a certain time length and an overlap rate to obtain time window signal segments.

[0071] S3, such as Figure 2 As shown in the figure, based on the model building and training module, a multivariate deep self-attention convolutional network is constructed to perform temporal context representation on the time window signal fragments, obtain high-correlation temporal context prediction features, reasonably describe the temporal correlation between waveform fragments, realize EEG temporal context representation, and ensure high-precision epileptic seizure prediction. The specific process is as follows:

[0072] S31, such as Figure 3 As shown, a self-encoding module is constructed to self-encode each time window signal segment and obtain the features of each signal segment after reconstruction. The steps are as follows:

[0073] S311. Construct a convolutional autoencoder.

[0074] S312, self-encode each time window signal segment to obtain the features of each signal segment after reconstruction, as shown below:

[0075] h i =f(x)=σ(Wx i +b)

[0076]

[0077] Among them, x i represents the i-th data point of the original signal segment, i.e., the true value input to the autoencoder; h i is the embedding vector; is the feature of the reconstructed signal segment; W and W' are weight matrices; b and b' are biases; σ is the activation function.

[0078] S313, based on the root mean square error cost function, ensure that the encoding feature can retain the information of the original signal to the maximum extent, as shown below:

[0079]

[0080] in, represents the output at time t, and M represents the number of samples contained in the time window signal segment.

[0081] S32, such as Figure 4 As shown in the figure, a self-attention mechanism network module is constructed to perform context learning on the features of each reconstructed signal segment, obtain highly correlated contextual timing features, and reasonably describe the timing correlation between waveform segments. The steps are as follows:

[0082] S321. Construct a self-attention mechanism network module, including a multi-head attention mechanism and a feedforward network layer.

[0083] S322, based on the attention mechanism in the self-attention mechanism network module, the features of each signal segment after reconstruction are processed to extract the temporal features of different segments, as shown below:

[0084]

[0085] Where Attention represents the output of the attention mechanism; Q, K, and V represent the query matrix, key matrix, and value matrix, respectively; d k is the dimension of the key matrix, used to scale the dot-product attention to prevent vanishing or exploding gradients.

[0086] S323. Use multiple attention heads to independently learn the temporal information, integrate these temporal features by weighted averaging, and input them into the feedforward network layer to obtain high-correlation contextual prediction features of different fragments.

[0087] The multi-head attention mechanism is as follows:

[0088]

[0089] Z=Concat(head1,head2,...,head h)W0

[0090] in, and is the weight matrix of the i-th head; Z is the output of the multi-head attention mechanism; h is the number of attention heads; W0 is the output weight matrix.

[0091] The feed-forward network layer is as follows:

[0092] FFN(Z)=max(o,ZW1+b)W2+b2

[0093] Among them, W1 and W2 are the learnable weights of the two fully connected layers of the feedforward network layer, and max(o,ZW1+b) is the relu activation function.

[0094] S324. Based on the multi-head attention mechanism and the feedforward network layer, a self-attention mechanism network module is constructed as follows:

[0095]

[0096] H'=MHAFFN(H,θ)

[0097] Among them, H' represents the high-correlation temporal context prediction feature, and H is the feature of the embedded vector sequence composed of multiple reconstructed signal fragments. is composed of, θ is the network parameter.

[0098] S33, such as Figure 5 As shown in the figure, based on the probability distribution learning method, the multivariate deep self-attention convolutional network is updated to achieve epileptic seizure prediction. The steps are as follows:

[0099] S331, based on the Softmax decoder, the temporal features of the self-attention mechanism network module are mapped to the link category space; the link category space is analyzed to obtain the predicted probability distribution of each connection category, as shown below:

[0100]

[0101] Among them, y i represents the output at time i; Q i represents the original output layer of the network on the i-th class; Represents the sum of the exponentials of all elements of the input vector.

[0102] S332. Use the cross entropy loss function to update the network parameters to improve the accuracy of the predicted probability, as shown below:

[0103]

[0104] Where N is the number of samples, is the true label of the i-th sample, y i is the probability that the i-th sample is predicted to be a positive class.

[0105] S333. Comprehensive loss function is used for network optimization, combining the reconstruction error loss of the autoencoder and the cross entropy loss of the classification task, as shown below:

[0106] L total =λL AE +L CE

[0107] Among them, λ is a trade-off parameter used to balance the reconstruction error of the autoencoder and the loss of the classification task.

[0108] Therefore, the present invention adopts the above-mentioned epileptic seizure prediction method based on multi-dimensional deep self-attention convolutional network, and predicts in advance before the epileptic seizure by real-time monitoring and analysis of EEG signals, providing patients and doctors with valuable preparation time. Accurate prediction helps doctors adjust treatment plans in time, reduce the number and severity of epileptic seizures, and improve the quality of life of patients. It provides new ideas and technical means for the field of epileptic seizure prediction, and helps to promote scientific research progress and clinical applications in this field.

[0109] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.

Claims

1. A method for predicting epileptic seizures based on a multivariate deep self-attention convolutional network, characterized in that: The following steps are involved: S1, based on the data collection module, obtaining the EEG signals before and during the epileptic seizure; S2, based on the data processing module, filtering, purifying and segmenting the EEG signal to obtain time window signal segments; S3. Based on the model building and training module, a multi-dimensional deep self-attention convolutional network is constructed to achieve high-precision epileptic seizure prediction.

2. The epileptic seizure prediction method based on a multivariate deep self-attention convolutional network according to claim 1, characterized in that: In step S3, based on the model building and training module, a multi-dimensional deep self-attention convolutional network is constructed. The specific process is as follows: S31, constructing an autoencoding module, performing autoencoding on each time window signal segment, and obtaining the features of each signal segment after reconstruction; S32. Construct a self-attention mechanism network module to perform context learning on the features of each signal segment after reconstruction, obtain highly correlated contextual temporal features, and reasonably describe the temporal correlation between waveform segments; S33. Based on the probability distribution learning method, update the multivariate deep self-attention convolutional network to achieve epileptic seizure prediction.

3. The epileptic seizure prediction method based on a multi-dimensional deep self-attention convolutional network according to claim 2, characterized in that: In step S31, a self-encoding module is constructed to self-encode each time window signal segment to obtain the features of each signal segment after reconstruction. The steps are as follows: S311, build convolutional autoencoder; S312, self-encode each time window signal segment to obtain the features of each signal segment after reconstruction, as shown below: h i =f(x)=σ(Wx i +b) Among them, x i represents the i-th data point of the original signal segment, i.e., the true value input to the autoencoder; h i is the embedding vector; is the feature of the reconstructed signal segment; W and W' are weight matrices; b and b' are biases; σ is the activation function; S313, based on the root mean square error cost function, ensure that the encoding feature can retain the information of the original signal to the maximum extent, as shown below: in, represents the output at time t, and M represents the number of samples contained in the time window signal segment.

4. The epileptic seizure prediction method based on a multi-dimensional deep self-attention convolutional network according to claim 2, characterized in that: In step S32, a self-attention mechanism network module is constructed to perform context learning on the features of each reconstructed signal segment, obtain highly correlated contextual temporal features, and reasonably describe the temporal correlation between waveform segments. The steps are as follows: S321. Construct a self-attention mechanism network module, including a multi-head attention mechanism and a feedforward network layer; S322, based on the attention mechanism in the self-attention mechanism network module, the features of each signal segment after reconstruction are processed to extract the temporal features of different segments, as shown below: Where Attention represents the output of the attention mechanism; Q, K, and V represent the query matrix, key matrix, and value matrix, respectively; d k is the dimension of the key matrix, used to scale the dot product attention to prevent the gradient from vanishing or exploding; S323, using multiple attention heads to independently learn the temporal information, integrating these temporal features by weighted average, and inputting them into the feedforward network layer to obtain highly relevant contextual prediction features of different segments; The multi-head attention mechanism is as follows: head i =Attention(QW i Q ,KW i K ,VW i V ) Z=Concat(head1,head2,...,head h )W0 Among them, W i Q , W i K and W i V is the weight matrix of the i-th head; Z is the output of the multi-head attention mechanism; h is the number of attention heads; W0 is the output weight matrix; The feed-forward network layer is as follows: FFN(Z)=max(o,ZW1+b)W2+b2 Among them, W1 and W2 are the learnable weights of the two fully connected layers of the feedforward network layer, and max(o,ZW1+b) is the relu activation function; S324. Based on the multi-head attention mechanism and the feedforward network layer, a self-attention mechanism network module is constructed as follows: H'=MHAFFN(H,θ) Among them, H' represents the high-correlation temporal context prediction feature, and H is the feature of the embedded vector sequence composed of multiple reconstructed signal fragments. is composed of, θ is the network parameter.

5. The epileptic seizure prediction method based on a multi-dimensional deep self-attention convolutional network according to claim 2, characterized in that: In step S33, based on the probability distribution learning method, the multivariate deep self-attention convolutional network is updated to achieve epileptic seizure prediction, the steps are as follows: S331, based on the Softmax decoder, the temporal features of the self-attention mechanism network module are mapped to the link category space; the link category space is analyzed to obtain the predicted probability distribution of each connection category, as shown below: Among them, y i represents the output at time i; Q i represents the original output layer of the network on the i-th class; Represents the sum of the exponentials of all elements of the input vector; S332. Use the cross entropy loss function to update the network parameters to improve the accuracy of the predicted probability, as shown below: Where N is the number of samples, is the true label of the i-th sample, y i is the probability that the i-th sample is predicted to be a positive class; S333. Comprehensive loss function is used for network optimization, combining the reconstruction error loss of the autoencoder and the cross entropy loss of the classification task, as shown below: THE total =λL AE +L CE Among them, λ is a trade-off parameter used to balance the reconstruction error of the autoencoder and the loss of the classification task.