Cross-subject multi-stage brain wave data enhancement method for epilepsy disease diagnosis

Through the multi-stage brain wave data enhancement method across subjects, LSTM-GAN is used to generate high-quality virtual samples, which solves the scarcity and individual differences of epilepsy EEG data, improves the training and generalization ability of the model, and improves the accuracy of epilepsy diagnosis and prediction.

CN119833126AInactive Publication Date: 2025-04-15NORTHEAST DIANLI UNIVERSITY
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510307486.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-04-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The scarcity and individual differences of epilepsy EEG data limit the training and generalization capabilities of deep learning models, making it difficult to effectively capture heterogeneity among different patients and the intrinsic connections and transition patterns between different clinical stages.

Method used

The multi-stage brain wave data enhancement method across subjects is adopted, and the adversarial optimization mechanism of the generator and discriminator is combined with the self-attention mechanism and hierarchical generation of the designed LSTM-GAN to generate virtual samples closer to the actual EEG distribution, expand the number of a few types of samples, and balance the data set.

Benefits of technology

The generated virtual samples are highly diverse and authentic, and can effectively expand the data set, improve the model's ability to capture complex timing relationships in EEG data at different stages, and improve the accuracy of epilepsy diagnosis and prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119833126A_ABST
    Figure CN119833126A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of medical treatment, and discloses a cross-subject multi-stage brain wave data enhancement method for epilepsy disease diagnosis, a generator and a discriminator are included, after data preprocessing, LSTM-GAN including a self-attention mechanism and a hierarchical generation design is adopted for data enhancement, the generator adopts a staged generation design, and the discriminator adopts a hierarchical generation design. A low-resolution signal is preliminarily generated, a global time sequence mode is captured in combination with a self-attention module, then details of the signal are gradually refined, generated data are closer to actual electroencephalogram distribution, a discriminator adopts a long-short-term memory network, fine-grained evaluation is conducted on time sequence features of real data and the generated data, and the accuracy of electroencephalogram distribution is improved. In the training process, the discriminator optimizes the loss function to enhance the recognition capability of real data and the discrimination capability of forged data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of medical technology, and in particular, relates to a method for enhancing multi-stage brain wave data across subjects for diagnosing epilepsy. Background Art

[0002] Epilepsy is a common chronic disease caused by abnormal activity of neurons in the central nervous system. According to statistics from the World Health Organization, about 70 million people suffer from epilepsy worldwide, and with the increasing social pressure, the prevalence of epilepsy is still increasing year by year. It is characterized by repeated and sudden attacks. Clinical manifestations include limb convulsions, loss of consciousness, fainting, etc., which seriously affect the health and quality of life of patients. Accurate diagnosis of the disease is very important for preparing timely intervention and improving the patient's condition. In recent years, intelligent diagnostic technology has shown good application prospects in epilepsy diagnosis and related research. However, the scarcity and individual differences of epilepsy data have put forward higher requirements on the generalization ability of the model. How to make full use of limited data to build a more robust intelligent diagnostic model has become one of the key research topics in this field.

[0003] The clinical course of epilepsy is usually divided into four stages: interictal, preictal, ictal, and postictal. The interictal period is the stable period between two epileptic seizures. During this stage, intermittent sharp waves or spike wave discharges may occur, but the overall brain activity is relatively normal, and there are no obvious epileptic symptoms. This stage is helpful for disease diagnosis research; the preictal period refers to the transition stage between the interictal period and the ictal period. At this time, the patient's behavior is not significantly different from the interictal period, but the abnormal EEG activity gradually increases. The preictal period can be used for epileptic seizure prediction research; the ictal period is the stage of epileptic seizure, which is manifested by violent abnormal brain discharges and obvious clinical symptoms. This stage can be used for epileptic seizure detection research; the postictal period is the recovery stage after the end of the seizure, which may be accompanied by cognitive and emotional abnormalities. This stage is of great significance for the study of the patient's psychological state. The key feature of epilepsy is abnormal brain discharges. The characteristics of brain activity at different stages are different, which can reveal the pathological characteristics and mechanisms of epilepsy from multiple angles. The electroencephalogram (EEG) can effectively capture these abnormalities by recording the spontaneous rhythmic potential changes generated by the activity of neurons in the cerebral cortex, and is widely used in epilepsy disease research and clinical diagnosis. However, EEG signals are easily affected by electromyography, eye movements, and external electromagnetic interference, and require analysis by experienced experts. This process consumes a lot of time and resources and is prone to errors, resulting in many challenges in manually analyzing and calculating EEG signals. In recent years, the application of deep learning technology to analyze EEG data has made significant progress in epilepsy research, especially in tasks such as automatic detection, prediction, and classification of epilepsy, showing high accuracy and efficiency. The high accuracy of deep learning models requires a large number of training samples.

[0004] However, the scarcity of epilepsy EEG data has become a major obstacle to its widespread application. First, the collection of epilepsy EEG data requires high-precision sensors and complex electrode arrangements to capture tiny changes in EEG signals, which makes the data collection cost high. Secondly, due to low patient cooperation and behavioral interference such as head movement and blinking, the signal quality is often affected, resulting in a reduction in the amount of valid data. In addition, the data collected by different devices may be different or incommunicable, which further increases the difficulty of data integration. These factors lead to a shortage of epilepsy EEG data, making it difficult to fully train deep learning models, thereby limiting the improvement of model performance. In order to solve the problem of data scarcity in epilepsy research, researchers have proposed a variety of data enhancement methods to generate more high-quality EEG data and expand the size of the data set, but they mainly focus on enhancing epileptic seizure data for seizure detection, or enhancing interictal and pre-ictal data for seizure prediction. It is difficult to fully reveal the intrinsic connection and transformation rules between different clinical stages, which limits the effectiveness of data enhancement methods; Second, epilepsy is a complex and highly individualized neurological disease, and different patients may show significant differences in seizure frequency, type, EEG characteristics, and pathological mechanisms. This individual variability makes it difficult for traditional data augmentation methods, especially those that train or generate data based on a single patient's data, to effectively capture the heterogeneity between different patients. Summary of the invention

[0005] In order to solve the above technical problems, the basic concept of the technical solution adopted by the present invention is a cross-subject multi-stage EEG data enhancement method for epilepsy diagnosis, including a generator and a discriminator, which fully considers the time series information characteristics of EEG signals and optimizes the generation model structure to improve the quality of data generation. After data preprocessing, LSTM-GAN containing self-attention mechanism and hierarchical generation design is used for data enhancement. Among them, the generator adopts a staged generation design, which captures the global time series pattern by preliminarily generating low-resolution signals and combining the self-attention module, and then gradually refines the signal details to make the generated data closer to the actual EEG distribution. The discriminator adopts a long short-term memory network to perform fine-grained evaluation of the time series characteristics of real data and generated data. During the training process, the discriminator enhances the recognition ability of real data and the discrimination ability of forged data by optimizing the loss function; at the same time, the generator continuously optimizes the generated pseudo data through adversarial training, so that it gradually approaches the distribution of real data. Ultimately, through the dynamic game between the generator and the discriminator, virtual samples that are highly consistent with the actual data distribution are generated, effectively expanding the number of minority class samples and balancing the data set, thereby providing more sample support for epilepsy diagnosis and prediction.

[0006] Compared with the prior art, the present invention has the following beneficial effects: 1. Time series discrimination based on adversarial optimization: In the process of data enhancement, we designed an adversarial optimization mechanism for cross-subject differences, and continuously optimized the quality of generated data through generative adversarial networks (GANs). Through adversarial training, the generator can learn a more accurate distribution of EEG signals, thereby generating data with high diversity and authenticity; 2. Global feature modeling based on self-attention mechanism: In order to overcome the limitations of traditional LSTM in modeling long-distance time step dependencies, we introduced a self-attention mechanism in the generator. The self-attention mechanism enhances the modeling ability of the generated signal for global dependencies by calculating the correlation between each time step in the sequence. This mechanism makes the generated EEG signal more consistent and consistent with the global features in the real data, and improves the model's ability to capture complex temporal relationships in EEG data at different stages; 3. Hierarchical data generation: We use a gradually refined hierarchical structure in the generator. In the first stage, we generate low-resolution EEG signals and use LSTM to capture global temporal features. In the second stage, we further refine the signals and improve the signal resolution, thereby gradually improving the quality of the generated data. This gradually refined strategy enables the generator to more effectively model the temporal dependencies and local features in the EEG signal.

[0007] The specific implementation modes of the present invention are further described in detail below in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] In the attached picture: Figure 1 It is a schematic diagram of various stages of epilepsy in the present invention; Figure 2 This is a flow chart of the epilepsy EEG data enhancement method of the present invention; Figure 3 This is a visualization diagram of the interictal EEG data enhancement results of the present invention; Figure 4 This is a visualization diagram of the preictal EEG data enhancement results of the present invention; Figure 5 This is a visualization diagram of the enhanced results of EEG data during the seizure period of the present invention; Figure 6 This is a comparison chart of the classification results before and after the single subject data enhancement of the present invention; Figure 7 This is the average result diagram of the three-stage classification group of epilepsy EEG data of the present invention; Figure 8 This is a comparison chart of the CNN model results before and after data enhancement of the present invention; Fig. 9 This is a comparison chart of the MLP model results before and after data enhancement of the present invention; Fig.10 This is a comparison chart of the SVM model results before and after data enhancement of the present invention; Fig.11 This is a schematic diagram of the electrode positions for epilepsy patients according to the present invention. DETAILED DESCRIPTION

[0009] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. The following embodiments are used to illustrate the present invention.

[0010] like Figures 1 to 11 As shown in the figure, a method for enhancing EEG data across multiple stages across subjects for epilepsy diagnosis is as follows: (1) Data generation based on hierarchical structure The generator adopts a two-layer structure design to gradually refine the generated EEG data. In the original GAN ​​architecture, the generator generates samples directly from random noise, and then the discriminator determines whether these samples are real. Although this method has achieved certain success in image generation tasks, when generating time series data (such as EEG signals), the generator directly generates high-resolution signals, which may lead to the loss of local features. Therefore, we adopt a gradually refined design in the generator to better capture the time series features in the EEG signal and gradually improve the signal quality.

[0011] The goal of the first layer is to generate low-resolution EEG signals. In order to model the temporal structure of EEG signals, LSTM (Long Short-Term Memory Network) is used to process the temporal information of the signal. The generator first processes the input random noise through the LSTM network. LSTM (Long Short-Term Memory Network) can effectively capture long-term dependencies in time series through its special gating structure. The generator first converts the random noise into Input to the LSTM network, extract the implicit state step by step, and its dynamic changes describe the global characteristics of the time series. The update formula of LSTM is as follows: (1) (2) (3) (4) (5) (6) in, is the activation value of the input gate, which controls the impact of the current input on the hidden state; is the activation value of the forget gate, which controls the influence of the hidden state at the previous moment on the current state; is the activation value of the output gate, which controls the impact of the current state on the output; is the update of the cell state, which integrates the information from the previous moment and the current input information; is the output (i.e., hidden state) of LSTM, which contains the output features of the current time step. is the first time step input, , , and are the weight matrices of LSTM respectively, , , and are the biases of LSTM respectively. Subsequently, the hidden state is mapped to the output signal space through a linear transformation layer to generate a preliminary low-resolution signal. and is the weight matrix and bias term of the linear transformation, is the low-resolution EEG signal output by the generator. Although the output signal of this stage has a global structure, it may lack sufficient detail information due to the randomness of the noise.

[0012] The goal of the second layer of the generator is to refine the signal and improve its resolution, making the generated signal more accurate. The generator continues to use LSTM to further optimize the generated signal and enhance local details. Sent into the second layer of LSTM, the generator captures more detailed temporal features and generates high-resolution EEG signals: (7) and is the weight matrix and bias term of the linear transformation, It is a high-resolution generated EEG signal, which contains more detailed local information, among which, is the hidden state of the second layer of LSTM, which contains the refined time series features. This method of gradually refining the signal can gradually improve the quality of the signal during the generation process, thereby generating a more realistic and detailed EEG signal.

[0013] (2) Global feature modeling based on self-attention mechanism LSTM networks are good at modeling long-term dependencies in time series, but they are limited in processing dependencies between distant time steps. In the generator, in addition to using LSTM networks, a self-attention mechanism is introduced to enhance the global dependency modeling capability of the signal. The self-attention mechanism adjusts the flow of information between time steps by calculating the correlation between each time step in the sequence and other time steps. In the context of EEG signal generation, especially the long-distance dependencies of the signal, traditional LSTM may find it difficult to capture this global information. The self-attention mechanism makes up for this deficiency, allowing the generator to capture global features more flexibly.

[0014] To make up for the lack of global time series dependency capture in low-resolution signals, the generator introduces a self-attention mechanism after the first stage. By calculating the correlation of the features of each time step in the sequence to other time steps, the global feature dependency is captured, thereby enhancing the consistency and integrity of the generated signal. First, the query, key, and value matrices are calculated. The formula is as follows: (8) in, The inputs to each query, key, and value matrix in the self-attention computation, , , is the learnable weight matrix, , , Represent the query, key and value matrices respectively, and convert the input Transform into query, key and value vectors; Then calculate the attention distribution and query With all keys The correlation is calculated and the new output representation is obtained by weighted summation. The formula is as follows: (9) in, The inner product between the query and all keys is calculated, which represents the time step Correlation with other time steps. is the dimension of the key vector, which is used to normalize the inner product result so that the influence of each time step on other time steps conforms to the probability distribution, avoiding the gradient disappearance or explosion caused by too large or too small values. Multiplying them together, we get the adjusted representation, which enables the generator to significantly enhance the global consistency of the time series based on the low-resolution signal, laying the foundation for the subsequent refinement process.

[0015] (3) Time series discrimination based on LSTM The main task of the discriminator is to judge the authenticity of the input data, that is, it needs to distinguish whether the input EEG data comes from the real data distribution or the fake data generated by the generator. In order to better capture the temporal characteristics of EEG data, we designed a discriminator architecture based on LSTM (Long Short-Term Memory Network). The LSTM network can effectively model the long-term dependencies of time series data, thereby ensuring that the discriminator can understand and judge the temporal information in the sequence. Similar to the LSTM layer in the generator, the LSTM layer of the discriminator extracts its temporal features by processing the input sequence. However, since the goal here is to judge the authenticity of the data, the final output of the LSTM layer in the discriminator It is passed to the fully connected layer to calculate the probability of true or false data. The output of the fully connected layer is normalized by the Sigmoid activation function, indicating the probability that the input data is true data. .

[0016] (10) in, and are the weights and biases of the fully connected layer, It is a Sigmoid activation function that maps the output of LSTM to a probability value in the range of [0, 1], indicating the probability that the input data is true data.

[0017] The goal of the generator is to make it impossible for the discriminator to distinguish between the generated fake data and the real data, that is, the generator hopes that the discriminator will think that the fake data is "real". To this end, the generator minimizes the discriminator's judgment value on the fake data, so that the generated data is as consistent as possible with the distribution of real data. During the training process of the generator, we introduce a regularization term to constrain the feature consistency of the generated signal between subjects and prevent the generated signal from deviating too much from the actual data distribution. The total loss of the generator It consists of two parts: adversarial loss and regularization loss. The formula is as follows: (11) (12) in, is the regularization loss, is the regularization weight, and setting it to 0.05 can achieve a good balance between the quality and consistency of the generated signal. is the predicted probability of the discriminator for the data generated by the generator. The generator hopes to minimize , so that the generated fake data is considered “real” by the discriminator, where is the total number of samples, is the sample index, is a real data sample, To generate data samples.

[0018] The goal of the discriminator is to maximize the prediction probability of real data while minimizing the prediction probability of fake data. The loss function of the discriminator is: (13) in, is the predicted probability of the discriminator for the real data. The goal of the discriminator is to maximize and minimize , thus enabling it to correctly distinguish between real data and forged data.

[0019] The overall loss function of the generative adversarial network is the weighted sum of the generator and discriminator losses. The ultimate training goal is to optimize the generator and discriminator simultaneously. Through adversarial training, the generator and the discriminator compete with each other during the training process, and finally the generator can generate high-quality forged data, while the discriminator can successfully distinguish between real data and forged data.

[0020] Experimental data: The EEG data used in the present invention comes from the CHB-MIT epilepsy data set, which was collected by Boston Children's Hospital and contains EEG signal records of 23 epilepsy patients (5 males, aged 3-22 years; 17 females, aged 1.5-19 years). The data covers the interictal period, preictal period, ictal period and postictal period, with a sampling frequency of 256 Hz, and the electrode arrangement is based on the international 10-20 system standard. In order to achieve consistency of electrode channels between different patients and facilitate data analysis, 18 dual-electrode channels with high consistency and uniform distribution were selected, including FP1-F7, F7-T7, T7-P7, P7-O1, FP1-F3, F3-C3, C3-P3, P3-O1, FP2-F4, F4-C4, C4-P4, P4-O2, FP2-F8, F8-T8, T8-P8, P8-O2, FZ-CZ and CZ-PZ. It should be noted that the dual-electrode channel represents the potential difference between the two electrodes, so it is not possible to directly display the position information. In the present invention, the position of each electrode is independently displayed to ensure the clear presentation of the position information. In addition, taking subject chb01 as an example, the changes in the EEG signals of the subject at different epilepsy stages are visualized. Figure 1 and Fig.11 shown.

[0021] To ensure signal quality and minimize artifact interference, the data was first preprocessed. A 0-50 Hz bandpass filter was used to remove high-frequency noise to improve the accuracy of signal analysis. Subsequently, independent component analysis (ICA) was used to separate artifact signals, and the ICLabel tool was used to automatically label artifact components to further remove artifact interference such as electrooculography and electromyography, retaining the true EEG activity. This process ensures the effectiveness of artifact removal while minimizing the impact of subjective interference.

[0022] In order to realize the comparative analysis of signals across subjects and different stages, the data is processed in segments, with a window length of 10 seconds and a sliding step of 5 seconds, and the EEG data of the interictal and preictal periods are divided into continuous time periods. Due to the short duration of epileptic seizures, in order to ensure that the seizure period has a certain initial sample size, the sliding step of the seizure period is set to 2 seconds, which significantly increases the amount of original data while avoiding data redundancy. The reason why the postictal data was not selected is that the characteristics of this stage overlap more with other stages, and its independent clinical significance in epilepsy diagnosis and prediction is relatively limited. Therefore, the present invention focuses on the interictal, preictal and ictal data to more effectively reveal the dynamic characteristics of epilepsy at different stages and provide high-quality input data for model training. The final epilepsy data information is shown in Table 1.

[0023] Table 1 Epilepsy dataset information

[0024] Specific implementation The experimental hardware platform is a 3.6GHz Intel Core i7 12700K processor, 32G memory and a GeForce RTX 3090 graphics card with 24G video memory. The software environment is the Windows 10 operating system. Python 3.8 and TensorFlow framework are used for model construction and training. The experimental methods are run 5 times and the average is taken as the final result. During the training of the data augmentation model, the initial learning rate of the generator is set to 0.002, the initial learning rate of the discriminator is 0.001, the training batch size (batch_size) is 16, and a total of 100 epochs are iterated. Through the above experimental settings, the quality of the augmented data and its contribution to the classification task are comprehensively evaluated.

[0025] Experimental comparison results Module performance comparison: In order to evaluate the performance of different modules in generating epileptic EEG data, we divide them into: basic model (M1), model with added hierarchical structure (M2), model with added attention mechanism (M3), and HT-GAN model (M4) proposed in this paper. The difference between the generated data and the original data of each model is compared by three evaluation indicators: root mean square error (RMSE), mean absolute error (MAE), and KL divergence (KLD). We conducted a detailed analysis of the interictal period, preictal period, and ictal period respectively. For the convenience of comparison, statistics were made according to different stages of epilepsy. Table 2 shows the EEG data enhancement effect of the four models in the interictal period, Table 3 shows the EEG data enhancement effect of the four models in the preictal period, and Table 4 shows the EEG data enhancement effect of the four models in the epileptic seizure period.

[0026] Table 2 Results of interictal EEG data enhancement

[0027] Through Table 2 and Figure 3 It can be found that in the enhancement of interictal EEG data, as the model complexity increases, from the basic model (M1) to the HT-GAN model (M4), the difference between the generated data and the original data gradually decreases, showing a better enhancement effect. Specifically, in all patients, the HT-GAN model (M4) showed the best performance in the three evaluation indicators of RMSE, MAE and KL divergence. For example, the RMSE value of patient chb01 decreased from 0.3254 of the basic model to 0.2641 of HT-GAN, MAE decreased from 0.2597 to 0.1997, and KL divergence decreased from 0.3162 to 0.2195, all indicating that the similarity between the data generated by the HT-GAN model and the original data is significantly improved. Overall, the HT-GAN model can effectively reduce the error of interictal data and generate enhanced data that is more consistent with the distribution of the original data.

[0028] Table 3 Preictal EEG data enhancement results

[0029] Table 3 and Figure 4The results of EEG data enhancement in the preictal stage are shown. The HT-GAN model also shows excellent performance, which is manifested by a significant reduction in RMSE, MAE, and KL divergence. Especially for patient chb01, the HT-GAN model has obvious advantages in RMSE, MAE, and KL divergence indicators, among which RMSE is reduced from 0.3452 of the basic model to 0.2341, MAE is reduced from 0.2886 to 0.2012, and KL divergence is reduced from 0.3085 to 0.2035. These results show that the HT-GAN model can better fit the characteristics of preictal EEG data, reduce the error between generated data and real data, and improve the consistency of data distribution.

[0030] Table 4 Results of EEG data enhancement during the ictal period

[0031] Table 4 and Figure 5 The results of EEG data enhancement during the ictal period are shown, and the HT-GAN model also shows lower errors and better data distribution matching. For example, the RMSE of patient chb01 during the ictal period dropped from 0.3854 of the basic model to 0.2846, MAE dropped from 0.3141 to 0.2143, and KL divergence dropped from 0.3982 to 0.2489, indicating that the ictal data generated by HT-GAN is closer to the real data than other models in all evaluation indicators. In other patients (such as chb02 and chb03), the HT-GAN model also performed well in RMSE, MAE, and KL divergence, further verifying the effectiveness of the model in ictal EEG data enhancement. The HT-GAN model better captures the complexity of ictal EEG activity through its hierarchical generation structure and adaptive characteristics, significantly reducing the error of generated data.

[0032] Combining the results of the interictal, preictal and ictal periods, it can be clearly seen that the HT-GAN model shows significant advantages over other models in all stages. At each clinical stage, as the complexity of the model increases, especially after the introduction of the hierarchical structure and self-attention mechanism, the difference between the generated enhanced data and the original data gradually decreases, and the model shows the best effect in terms of RMSE, MAE and KL divergence. Specifically, the RMSE of the HT-GAN model in the interictal, preictal and ictal periods are 0.2439, 0.2787 and 0.2774, respectively, the MAE is 0.1992, 0.2333 and 0.2704, respectively, and the KL divergence is 0.2545, 0.235 and 0.2519, respectively, which are significantly lower than other models, indicating that the model can better restore the characteristics of the original data and generate high-quality enhanced data. By comparing the results of each stage, it can be concluded that the HT-GAN model has strong adaptability and stability in epilepsy EEG data enhancement, can effectively improve data quality, and better simulate the characteristics of EEG activity in different patients.

[0033] Performance verification of epilepsy three-stage classification: In order to verify the effectiveness of the epilepsy EEG data enhancement method based on HT-GAN proposed in this paper in the three-stage classification task, a single-subject classification experiment was first conducted. Specifically, the EEG data of the pre-ictal, interictal and ictal periods were used as the research objects, and CNN was used as the classifier to conduct a comparative experiment on the data before and after enhancement. The evaluation indicators include accuracy, precision, recall and F1 value to comprehensively evaluate the classification performance of the model. Figure 6 It can be observed that all indicators are significantly improved after enhancement, showing the effectiveness of HT-GAN enhanced data in improving the classifier's ability to distinguish the three stages of epilepsy.

[0034] In order to further verify the positive role of data augmentation methods in improving classification accuracy in the task of epilepsy EEG data classification across subjects and stages, this study selected three basic models: CNN, MLP and SVM, and used five-fold cross-validation to classify and identify the interictal, preictal and ictal EEG data of all subjects. The design of the cross-subject experiment is mainly based on the fact that epilepsy EEG data has large individual differences and complex temporal characteristics. Direct training of classification models often leads to performance degradation due to insufficient sample number or uneven distribution. By introducing data augmentation technology, more high-quality samples can be generated, which can not only effectively alleviate the problem of insufficient data, but also significantly improve the generalization ability of the model in cross-subject scenarios. Tables 5 to 7 show the group average results of the three models (CNN, MLP and SVM) for three classifications before and after data augmentation, including accuracy, precision, recall and F1 value, and are supplemented by statistical tests (T value and P value) to evaluate the significance of the effect of the enhancement method. In order to more intuitively show the overall classification effect before and after enhancement, Figure 7 The group average results were visually compared in the form of a bar graph.

[0035] Table 5 Comparison of three-stage classification results of epilepsy EEG data based on CNN

[0036] Table 6 Comparison of three-stage classification results of epilepsy EEG data based on MLP

[0037] Table 7 Comparison of three-stage classification results of epilepsy EEG data based on SVM

[0038] from Figure 7It can be clearly seen that after the introduction of data enhancement technology, the group average results of the three classification models (CNN, MLP and SVM) were significantly improved, indicating the effectiveness of the enhancement method in the cross-subject and cross-stage epilepsy EEG classification task. As can be seen from Tables 5 to 7, all models have achieved significant improvements in key indicators such as accuracy, precision, recall and F1 value, and the corresponding T values ​​and P values ​​indicate that the results are highly statistically significant (P values ​​are all less than 0.001). Among them, the CNN model performed best after enhancement, with the accuracy rate increasing from 86.04% to 92.46%, the precision rate increasing from 87.34% to 92.75%, the recall rate increasing from 82.80% to 91.99%, and the F1 value increasing from 84.96% to 92.09%. The classification performance of the MLP and SVM models has also achieved similar improvements, for example, the accuracy of the MLP model increased from 85.48% to 92.81%, and the accuracy of the SVM model increased from 85.18% to 91.51%. These results indicate that data augmentation not only alleviates the problem of insufficient samples, but also improves the model's ability to classify EEG signals of epilepsy at different stages.

[0039] In addition, in order to analyze the specific classification performance of different models before and after data enhancement, Figure 8 The ROC curve and confusion matrix of the CNN model are shown; Fig. 9 The ROC curve and confusion matrix of the MLP model are shown; Fig.10 The ROC curve and confusion matrix of the SVM model are shown. By comparing the charts, we can fully reveal the optimization effect of data enhancement on classification performance, especially in improving the model's ability to distinguish EEG signals of epilepsy at different stages.

[0040] Figures 8 to 10 All of them show that after data enhancement, the overall performance of the classifier has been significantly improved. The AUC value (area under the curve) of the ROC curve has increased significantly compared with before enhancement, which means that the model's ability to distinguish between interictal, preictal, and ictal periods has been optimized. From the confusion matrix results, it can be seen that after data enhancement, the classification accuracy of all models for preictal and interictal periods has been significantly improved, which shows that enhanced data has played a positive role in solving the problem of uneven sample distribution.

[0041] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0042] While the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that many changes, modifications, substitutions and variations can be made to the embodiments without departing from the principles and spirit of the invention.

Claims

1. A method for enhancing multi-stage EEG data across subjects for epilepsy diagnosis, comprising a generator and a discriminator, characterized in that: S1: The generator generates low-resolution EEG signals and combines the self-attention module to capture the global time series; S2: Using LSTM to refine the signal, the generator captures more detailed temporal features and generates high-resolution EEG signals; S3: The discriminator extracts time series features to maximize the prediction probability of real data and minimize the prediction probability of fake data. The generator and the discriminator compete with each other in the generation and discrimination process, and finally generate data with diversity and authenticity.

2. A method for enhancing multi-stage EEG data across subjects for epilepsy diagnosis according to claim 1, characterized in that: The generator adopts a double-layer structure design. Among them, the goal of one layer is to generate low-resolution EEG signals and use LSTM to process the timing information of the signals, where LSTM is a long short-term memory network; Among them, the goal of the second layer is to refine the signal, improve the resolution, make the generated signal more accurate, and continue to use LSTM to further optimize the generated signal and enhance local details.

3. A method for enhancing multi-stage EEG data across subjects for epilepsy diagnosis according to claim 2, characterized in that: The generator first generates random noise Input to the LSTM network, extract the implicit state step by step, and its dynamic changes describe the global characteristics of the time series. The update formula of LSTM is as follows: (1) (2) (3) (4) (5) (6) in, is the activation value of the input gate, which controls the impact of the current input on the hidden state; is the activation value of the forget gate, which controls the influence of the hidden state at the previous moment on the current state; is the activation value of the output gate, which controls the impact of the current state on the output; is the update of the cell state, which integrates the information from the previous moment and the current input information; is the output of LSTM (i.e., hidden state), which contains the output features of the current time step; is the first time step input, , , and are the weight matrices of LSTM respectively, , , and They are the biases of LSTM respectively. Subsequently, a linear transformation layer is used to map the hidden state to the output signal space to generate a preliminary low-resolution signal.

4. The method for enhancing multi-stage EEG data across subjects for epilepsy diagnosis according to claim 2, characterized in that: Use LSTM to refine the signal in S2, including the input low-resolution signal Feeding into the second layer of LSTM, the generator captures more detailed timing features and generates high-resolution EEG signals: (7) and is the weight matrix and bias term of the linear transformation, It is a high-resolution generated EEG signal, which contains more detailed local information, among which, is the hidden state of the second layer of LSTM, which contains the refined time series features. This method of gradually refining the signal can gradually improve the quality of the signal during the generation process, thereby generating a more realistic and detailed EEG signal.

5. The method for enhancing multi-stage EEG data across subjects for epilepsy diagnosis according to claim 1, characterized in that: Integrating the self-attention module in S1 involves first calculating the query, key, and value matrices as follows: (8) in, represents the input of each query, key, and value matrix in the self-attention computation, , , is the learnable weight matrix, , , Represent the query, key and value matrices respectively, and convert the input Transform into query, key and value vectors; Then calculate the attention distribution and query With all keys The correlation is calculated and the new output representation is obtained by weighted summation. The formula is as follows: (9) in, The inner product between the query and all keys is calculated, which represents the time step Correlation with other time steps, is the dimension of the key vector, which is used to normalize the inner product result so that the influence of each time step on other time steps conforms to the probability distribution, avoiding the disappearance or explosion of the gradient caused by too large or too small values. Finally, the calculated weighted sum is summed with the value Multiplying them together, we get the adjusted representation, which enables the generator to significantly enhance the global consistency of the time series based on the low-resolution signal, laying the foundation for the subsequent refinement process.

6. The method for enhancing multi-stage EEG data across subjects for epilepsy diagnosis according to claim 1, characterized in that: In S3, the discriminator extracts time series features, including the discriminator based on the LSTM architecture. The LSTM layer of the discriminator extracts time series features by processing the input sequence. The final output of the LSTM layer in the discriminator It will be passed to the fully connected layer to calculate the true or false probability of the data; Specifically, the output of each fully connected layer is normalized by the Sigmoid activation function to indicate the probability that the input data is real data. : (10) in, and are the weights and biases of the fully connected layer, It is a Sigmoid activation function that maps the output of LSTM to a probability value in the range of [0, 1], indicating the probability that the input data is true data.

7. The method for enhancing multi-stage EEG data across subjects for epilepsy diagnosis according to claim 1, characterized in that: In S1, the generator introduces a regularization term to constrain the feature consistency of the generated signal between subjects and prevent the generated signal from deviating too much from the actual data distribution. The total loss of the generator It consists of two parts: adversarial loss and regularization loss. The formula is as follows: (11) (12) in, is the regularization loss, is the regularization weight, and setting it to 0.05 can achieve a good balance between the quality and consistency of the generated signal. is the predicted probability of the discriminator for the data generated by the generator, where is the total number of samples, is the sample index, is a real data sample, To generate data samples.

8. The method for enhancing multi-stage EEG data across subjects for epilepsy diagnosis according to claim 7, characterized in that: The loss function of the discriminator is: (13) in, is the predicted probability of the discriminator for the real data. The goal of the discriminator is to maximize and minimize , so that real data and forged data can be correctly distinguished.

Citation Information

Patent Citations

  • Epileptic seizure prediction method through electroencephalogram signal on the basis of multi-scale convolution and self-attention network

    CN113907706A

  • Electroencephalogram signal data amplification algorithm based on improved generative adversarial network

    CN116776093A

  • Epilepsy prediction method and system in combination with spatial-temporal characteristics

    CN118072947A

  • Cross-subject cognitive load electroencephalogram signal data enhancement method based on generative adversarial network

    CN119415847A

  • ECG anomaly detection method based on AE-GAN

    CN119622583A