EEG epileptic seizure prediction method based on semi-supervised deep learning
By adopting a semi-supervised deep learning method in EEG epilepsy prediction, using adversarial autocoding module and Bi-LSTM classification network, EEG data features are automatically extracted and predicted, and the feature extraction requires manual and generalization capabilities in the prior art. Weaker problems significantly improve predictive performance.
Patent Information
- Application Number
- CN202411569343.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-02-18
AI Technical Summary
When using machine learning algorithms to predict EEG epilepsy, the prior art faces problems such as manual feature extraction and weak generalization ability.
Using a semi-supervised deep learning method, the characteristics of EEG data are automatically extracted and predicted by constructing an adversarial autocoding module and Bi-LSTM classification network, combining unsupervised and supervised learning.
The accuracy and generalization ability of epilepsy prediction were improved, and the prediction performance was significantly improved, reaching an average accuracy of 93.56%, an average sensitivity of 90.02%, and an average specificity of 91.70%.
Smart Images

Figure CN119474679A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical information prediction, and in particular to a method for EEG epileptic seizure prediction based on semi-supervised deep learning. Background Art
[0002] Epilepsy is a brain functional disorder caused by abnormal discharge of brain neurons. Its main feature is repeated epileptic seizures. These seizures may manifest as transient sensory abnormalities, automatic behaviors, loss of consciousness, and limb convulsions. Depending on the different manifestations during the seizure, epilepsy can be divided into two types: partial epilepsy and generalized epilepsy.
[0003] Medical research shows that although epilepsy cannot be completely cured, seizures can be controlled through treatments such as drugs, electrical stimulation or surgery. Extensive research is essential to establish a systematic method to predict upcoming epileptic seizures and notify patients in advance. Most of the methods that have been developed mainly use electroencephalogram (EEG) recordings to detect abnormalities. During epileptic seizures, EEG often shows abnormalities such as intermittent and rhythmic discharges, sharp wave-slow wave complexes and multi-spike sharp waves, reflecting abnormal discharges of brain neurons. Sharp or slow wave discharges can be seen before and after the attack, indicating the possibility of seizures. In the past few decades, machine learning has developed rapidly in various research fields by using statistical methods to identify patterns in large amounts of data. The availability of large-scale biomedical data has opened a new chapter for healthcare researchers. Although a large number of traditional machine learning algorithms have been used to build epilepsy prediction models in previous studies, these methods face problems such as the need to manually extract features and weak generalization ability. Neural network algorithms have many advantages such as automatic feature extraction and model diversity, and can be well applied to scenarios where a large number of EEG signals are processed. Summary of the invention
[0004] In view of the shortcomings of the prior art, the present invention provides a method for EEG epileptic seizure prediction based on semi-supervised deep learning, which solves the problems raised in the above background technology.
[0005] In order to achieve the above-mentioned purpose, the present invention specifically adopts the following technical scheme: a method for EEG epileptic seizure prediction based on semi-supervised deep learning, comprising:
[0006] S1, construct the data set, select channels and preprocess the EEG data, and divide the data set according to the signal characteristics in different states;
[0007] S2. Construct an adversarial autoencoder module, which uses the autoencoder to extract the features of the input data and map it to the latent space, and at the same time makes the latent representation conform to the predefined target distribution through adversarial training;
[0008] S3, using semi-supervised learning methods, by combining a small amount of labeled data with a large amount of unlabeled data, making full use of the information in the labeled data to guide the model to effectively capture the potential characteristics of data in different states;
[0009] S4. A classification network is constructed based on Bi-LSTM to extract key time information from the STFT time-frequency diagram, and the epilepsy prediction data is obtained by combining the spatial information extracted by the unsupervised learner.
[0010] In S1, the data is preprocessed, including: merging patient data to select appropriate channels; using STFT with a window length of 28s to convert the EEG signal into a time-frequency two-dimensional matrix; removing power line noise and excluding specific frequency bands.
[0011] Furthermore, we use the CHB-MIT epilepsy prediction dataset. Due to the variations in electrodes, patients usually have less than 22 EEG recording channels, and some individual patients have only 17 channels. In order to effectively train with non-patient-specific data, 16 channels with strong correlation are selected through an automatic channel selection method.
[0012] Furthermore, the EEG data were STFT transformed using a cosine window of 1 second in length and 50% overlap, excluding the components in the frequency range of 57-63 Hz and 117-123 Hz to remove the 60 Hz power line noise, while the DC component (0 Hz) and the last two frequency components of 127-128 Hz were removed.
[0013] In S2, the encoder maps the input data x to a low-dimensional latent representation z; the decoder ensures that the latent representation can effectively retain the key information of the input data by minimizing the reconstruction error; the discriminator is introduced in the adversarial stage, and the encoder acts as a generator and the discriminator to compete with each other until the Nash equilibrium point is reached.
[0014] Furthermore, in the sample reconstruction stage, the encoder part of the autoencoder and the decoder parameters are updated by gradient descent to minimize the reconstruction loss function; then in the regularization constraint stage, the discriminant network parameters and the generative network parameters are updated alternately to improve the ability of the decoder part to confuse the discriminant network.
[0015] Minimizing the reconstruction error is:
[0016] MinimizeLoss = dist(x,x')
[0017] Where: x is the original data, x' is the output data of the decoder, and dist is the distance measurement function between the two.
[0018] The generator loss is:
[0019] LG =-E z~q(z|x) [logD(z)]
[0020] Where: D(z) is the output of the discriminator for the generated latent variable z (z~q(z|x) is the output of the encoder after encoding the input x), indicating the probability that Z comes from the prior distribution.
[0021] The discriminator loss is:
[0022] L D =-E z~p(z) [logD(z)]-E z~q(z|x) [log(1-D(z))]
[0023] Where: p(z) represents the true prior distribution (for example, Gaussian distribution), the output of the discriminator D(z) is the probability of judging whether the sample z comes from the true prior distribution, and the best state is achieved when D(z)≈0.5.
[0024] In S3, a semi-supervised learning method is introduced. By using unlabeled data, the model can learn more potential patterns or features in the input space. A small amount of labeled data is used to guide the model to learn more effective feature representations, enhance the controllability of generated data, and achieve a balance between feature learning and generation tasks.
[0025] In S4, Bi-LSTM is used to construct a classification network, and the classifier network is labeled The real STFT time-frequency diagram As input, the output sample class probability prediction value p(y i ), the network training adopts a supervised learning strategy to optimize the model parameters by minimizing the crossover function. The loss function C of the classifier model loss Expressed as:
[0026]
[0027] Compared with the prior art, the present invention provides a method for EEG epileptic seizure prediction based on semi-supervised deep learning, which has the following beneficial effects: the present invention proposes to add an adversarial network module to the autoencoder, and update the parameters of the encoder part and the decoder in the autoencoder by gradient descent to minimize the reconstruction loss function; by alternately updating the discriminant network parameters and the generating network parameters, the ability of the decoder part to confuse the discriminant network is improved, so that the adversarial autoencoder can learn features that are closer to the real data. The feature extractor after unsupervised training is connected to the classification network based on Bi-LSTM. Bi-LSTM expands the traditional LSTM structure. When processing sequence data, it learns from the forward (past) and backward (future) directions respectively, and can capture the contextual information in the time series more comprehensively. By using a small amount of labeled EEG signals to guide the generation of pseudo labels from unlabeled data, the classifier is trained together, and epilepsy prediction data is obtained through the classifier. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 The overall flow chart of the method designed for the present invention;
[0029] Figure 2 To combat the autoencoder structure diagram;
[0030] Figure 3 This is the Bi-LSTM principle diagram; DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0032] like Figure 1 As shown, an embodiment of the present invention proposes a method for EEG epileptic seizure prediction based on semi-supervised deep learning, comprising:
[0033] In S1, the data were preprocessed, including: merging patient data to select appropriate channels; converting EEG signals into a time-frequency two-dimensional matrix using STFT with a window length of 28 s; removing power line noise and excluding specific frequency bands.
[0034] Exemplarily, due to the change of electrodes, the number of EEG recording channels of patients is different, and 16 channels with strong correlation are selected by automatic channel selection. The EEG data is transformed by STFT using a cosine window with a length of 1 second and an overlap rate of 50%. The components with a frequency range of 57-63Hz and 117-123Hz are excluded to remove the 60Hz power line noise, and the DC component (0 Hz) and the last two frequency components of 127-128Hz are also removed.
[0035] In S2, the encoder maps the input data x to a low-dimensional latent representation z; the decoder ensures that the latent representation can effectively retain the key information of the input data by minimizing the reconstruction error; the discriminator is introduced in the adversarial stage, and the encoder acts as a generator and the discriminator competes with each other until the Nash equilibrium point is reached.
[0036] Exemplarily, in the sample reconstruction stage, the encoder part in the autoencoder and the parameters of the decoder are updated by gradient descent to minimize the reconstruction loss function; then comes the regularization constraint stage, in which the discriminant network parameters and the generator network (encoder part) parameters are updated alternately to improve the ability of the decoder part to confuse the discriminant network.
[0037] Minimizing the reconstruction error is:
[0038] MinimizeLoss = dist(x,x')
[0039] Where: x is the original data, x' is the output data of the decoder, and dist is the distance measurement function between the two.
[0040] The generator loss is:
[0041] L G =-E z~q(z|x) [logD(z)]
[0042] Where: D(z) is the output of the discriminator for the generated latent variable z (z~q(z|x) is the output of the encoder after encoding the input x), indicating the probability that z comes from the prior distribution.
[0043] The discriminator loss is:
[0044] L D =-E z~p(z) [logD(z)]-E z~q(z|x) [log(1-D(z))]
[0045] Where: p(z) represents the true prior distribution (for example, Gaussian distribution), the output of the discriminator D(z) is the probability of judging whether the sample z comes from the true prior distribution, and the best state is achieved when D(z)≈0.5.
[0046] In S3, a semi-supervised learning method is introduced. By using unlabeled data, the model can learn more potential patterns or features in the input space. A small amount of labeled data is used to guide the model to learn more effective feature representations, enhance the controllability of generated data, and achieve a balance between feature learning and generation tasks.
[0047] For example, labeled data provides a clear supervisory signal to build an initial model through training. Unlabeled data helps the model better capture the underlying structure and optimize the classification boundary by revealing the overall distribution of the data. Use the initial model to predict the unlabeled data and select the class with the highest confidence in the model prediction as the pseudo label. Combine the generated pseudo labels with the labeled data as a new training data set, retrain the classification model, and continuously improve the performance of the model.
[0048] In S4, a classification network based on Bi-LSTM is constructed to extract key time information from the STFT time-frequency diagram, and the epilepsy prediction data is obtained by combining the spatial information extracted by the unsupervised learner.
[0049] For example, the classifier network is labeled The real STFT time-frequency diagram As input, the output sample class probability prediction value p(y i ), the network training adopts a supervised learning strategy to optimize the model parameters by minimizing the crossover function. The loss function C of the classifier model loss Expressed as:
[0050]
[0051] To further illustrate the relevant effects of the embodiments of the present invention, the method for EEG epilepsy seizure prediction based on semi-supervised deep learning proposed in the present invention has achieved significant results on the CHB-MIT epilepsy prediction dataset. Based on the TensorFlow framework implementation and testing, training is performed on an NVIDIA GeForce GTX 3090 image processing unit (GPU) with a memory of 24GB. In the feature learning model training, the number of training epochs (epochs) is set to 10, and the initial learning rate of the generator and discriminator is 1e-4. In the classifier (predictor) model training, 25% of the training data set is divided as a validation set, and the remaining data is used to train the network. As shown in Table 1, based on the method for EEG epilepsy seizure prediction based on semi-supervised deep learning, our model has achieved an average accuracy of 93.56%, an average sensitivity of 90.02%, and an average specificity of 91.70% as a whole. The present invention significantly improves the prediction performance compared to the existing model.
[0052] Table 1. Experimental results and comparison based on CHB-MIT dataset
[0053]
[0054] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention is described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for EEG epileptic seizure prediction based on semi-supervised deep learning, characterized in that: The method includes: S1, construct the data set, select channels and preprocess the EEG data, and divide the data set according to the signal characteristics in different states; S2. Construct an adversarial autoencoder module, which uses the autoencoder to extract the features of the input data and map it to the latent space, and at the same time makes the latent representation conform to the predefined target distribution through adversarial training; S3, using semi-supervised learning methods, by combining a small amount of labeled data with a large amount of unlabeled data, making full use of the information in the labeled data to guide the model to effectively capture the potential characteristics of data in different states; S4. A classification network is constructed based on Bi-LSTM to extract key time information from the STFT time-frequency diagram, and the spatial information extracted by the unsupervised learner is combined to obtain epilepsy classification prediction data.
2. The method for EEG epileptic seizure prediction based on semi-supervised deep learning according to claim 1, characterized in that: In S1, the data is preprocessed, including: merging patient data to select appropriate channels; using STFT with a window length of 28s to convert the EEG signal into a time-frequency two-dimensional matrix; removing power line noise and excluding specific frequency bands.
3. The method for EEG epilepsy seizure prediction based on semi-supervised deep learning according to claim 1, characterized in that: In S2, the encoder maps the input data x to a low-dimensional potential representation z; the decoder ensures that the potential representation can effectively retain the key information of the input data by minimizing the reconstruction error; the discriminator is introduced in the adversarial stage, and the encoder acts as a generator and the discriminator to compete with each other until the Nash equilibrium point is reached, and the minimized reconstruction error is: MinimizeLoss = dist(x,x') Where: x is the original data, x' is the output data of the decoder, and dist is the distance measurement function between the two; The generator loss is: L G =-E z~q(z|x) [logD(z)] Where: D(z) is the output of the discriminator for the generated latent variable z, (z~q(z|x) is the output of the encoder after encoding the input x), indicating the probability that z comes from the prior distribution; The discriminator loss is: L D =-E z~p(z) [logD(z)]-E z~q(z|x) [log(1-D(z))] Where: p(z) represents the true prior distribution (for example, Gaussian distribution), the output of the discriminator D(z) is the probability of judging whether the sample z comes from the true prior distribution, and the best state is achieved when D(z)≈0.
5.
4. The method for EEG epileptic seizure prediction based on semi-supervised deep learning according to claim 1, characterized in that: In S3, a semi-supervised learning method is introduced. By using unlabeled data, the model can learn more potential patterns or features in the input space. A small amount of labeled data is used to guide the model to learn more effective feature representations, enhance the controllability of generated data, and achieve a balance between feature learning and generation tasks.
5. The method for EEG epileptic seizure prediction based on semi-supervised deep learning according to claim 1, characterized in that: In S4, Bi-LSTM is used to construct a classification network, and the classifier network is labeled The real STFT time-frequency diagram As input, the output sample class probability prediction value p(y i ), the network training adopts the supervised learning strategy, and the model parameters are optimized by minimizing the cross function. The loss function C of the classifier model loss It is expressed as: