Cross-patient epileptic EEG signal classification method based on data enhancement and adversarial optimization

Through the method of training data augmentation and adversarial optimization strategy for EEG signal fragments during epilepsy, the existing EEG signal classification methods for cross-patient epilepsy are solved, and higher classification accuracy and efficiency are achieved.

CN117435993BActive Publication Date: 2025-03-04PEKING UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311443629.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-01
Publication Date
2025-03-04
Estimated Expiration
2043-11-01

AI Technical Summary

Technical Problem

The existing classification methods for EEG signal classification across patients with epilepsy are inaccurate and efficient, especially when considering spatial information, there is room for improvement in sensitivity.

Method used

Using a method based on data augmentation and adversarial optimization, data augmentation of EEG signal fragments during epilepsy periods is used to generate new training samples, and a cross-patient epilepsy EEG signal classification model is trained using adversarial optimization strategies to eliminate the individual characteristics of the patient and improve the generalization ability of the model.

Benefits of technology

It improves the accuracy and efficiency of the classification of EEG signals in epilepsy, enhances the generalization ability of the model, and enables more accurate and quick detection of whether it is out of the seizure or non-seizure period in cross-patient settings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117435993B_ABST
    Figure CN117435993B_ABST
Patent Text Reader

Abstract

The present invention relates to a cross-patient epilepsy EEG signal classification method based on data enhancement and adversarial optimization, which belongs to the field of epilepsy detection technology and solves the problem of low accuracy and efficiency of the prior art cross-patient epilepsy EEG signal classification method. The method comprises the following steps: obtaining EEG signal segments, performing data enhancement on the EEG signal segments during the epileptic attack period, and constructing a training sample set based on the EEG signal segments after data enhancement; constructing a cross-patient epilepsy EEG signal classification model, and using an adversarial optimization strategy to train the cross-patient epilepsy EEG signal classification model based on the training sample set to obtain a trained cross-patient epilepsy EEG signal classification model; inputting the EEG signal to be classified into the trained cross-patient epilepsy EEG signal classification model to obtain the classification result of the EEG signal to be classified. Fast and accurate cross-patient epilepsy EEG signal classification is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of epilepsy detection, and in particular to a cross-patient epilepsy EEG signal classification method based on data enhancement and adversarial optimization. Background Art

[0002] Brain activity related to epilepsy is divided into four stages: interictal, preictal, ictal, and postictal, which correspond to the non-ictal period, the time period close to the onset, the onset period, and the interval after the onset. The purpose of epilepsy detection is to distinguish whether the EEG signal is in the onset period. Epilepsy seizure detection aims to distinguish whether the waves in a short time interval are in the onset stage, which is usually understood as a binary classification problem. The research goal of automatic epilepsy detection is to design a classifier that can correctly classify whether it is in the onset stage based on the EEG signal fragments of the patient over a period of time. Epilepsy detection is divided into same-patient detection and cross-patient epilepsy detection. The same-patient detection algorithm uses the same patient for training and testing. The data of the training set and test set in cross-patient detection come from different individuals, which has stronger practical significance and greater difficulty.

[0003] Existing automatic classification algorithms for epilepsy patients' EEG signals during seizures or non-seizures are usually based on machine learning. Machine learning algorithms require consistent training and test distributions, but in a cross-patient setting, the training set patients and the test set patients do not overlap, and the data between patients vary greatly.

[0004] Some researchers have used data augmentation methods to improve cross-patient performance, such as the method of using and decreasing sequences (MIDS) and the generative adversarial network (WGAN) method. However, their enhancement methods mainly focus on the temporal dimension and do not consider spatial information, so their performance, especially sensitivity, has a lot of room for improvement.

[0005] Another effective method for cross-patient epilepsy seizure or non-seizure classification is to use feature decoupling to separate individual patient characteristics from common epilepsy characteristics. For example, time domain features and time-frequency domain features are manually extracted, and then the original EEG signal is combined with automatic encoding to achieve feature decomposition. The two parts of the features are generated by two generative adversarial neural networks. Although the feature decoupling method has attracted attention in the medical field due to its interpretability, its number of models is twice that of other methods, the training parameters and duration are relatively long, and it is difficult to combine with other existing epilepsy detection models.

[0006] Another method used in the task of classifying epilepsy seizures and non-seizures across patients is the meta-learning method, which divides the training data into multiple tasks to construct effective cross-patient internal feature representations. This type of method consists of two neural network meta-networks (Meta-Net) and the main network alternating in learning, and the two types of neural networks also acquire knowledge from each other to improve themselves. The limitation of the meta-learning method is that the training process of the meta-task cannot guarantee that an effective representation will be learned, and the number of models is twice that of other methods, which has a higher training difficulty.

[0007] Some researchers also use domain transfer methods to improve the performance of the model on the test set. For example, they use domain transfer methods to combine data from two different data sets for training and test on a third data set. It uses more data, but the sensitivity is still very low. Although methods such as domain transfer can improve the generalization performance on the test set, their training model is seriously inconsistent with actual use, because in real medical treatment, it is impossible to obtain data of patients who have not been seen in advance. Summary of the invention

[0008] In view of the above analysis, an embodiment of the present invention aims to provide a cross-patient epileptic EEG signal classification method based on data enhancement and adversarial optimization, so as to solve the problems of low accuracy and efficiency of existing cross-patient epileptic EEG signal classification methods.

[0009] On the one hand, an embodiment of the present invention provides a method for classifying epileptic EEG signals across patients based on data enhancement and adversarial optimization, comprising the following steps:

[0010] Obtaining EEG signal segments, performing data enhancement on the EEG signal segments during epileptic seizures, and constructing a training sample set based on the EEG signal segments after data enhancement;

[0011] Constructing a cross-patient epilepsy EEG signal classification model, and using an adversarial optimization strategy to train the cross-patient epilepsy EEG signal classification model based on the training sample set to obtain a trained cross-patient epilepsy EEG signal classification model;

[0012] The EEG signal to be classified is input into the trained cross-patient epilepsy EEG signal classification model to obtain the classification result of the EEG signal to be classified.

[0013] Based on the further improvement of the above method, data enhancement is performed on the EEG signal fragments during the epileptic seizure period, including:

[0014] Convert the EEG signal of each epileptic seizure period into a one-dimensional vector;

[0015] Calculate the mean vector and covariance matrix of the EEG signal based on the one-dimensional vector of the EEG signal during each epileptic seizure period;

[0016] A new epileptic seizure EEG signal segment is generated based on the mean vector and the covariance matrix.

[0017] Based on the further improvement of the above method, the mean vector and covariance matrix of the EEG signal are calculated based on the one-dimensional vector of the EEG signal during each epileptic seizure period, including:

[0018] By formula Calculate the mean vector μ of the EEG signal;

[0019] By formula Calculate the element cov in the pth row and qth column of the covariance matrix pq , and obtain the covariance matrix ∑=(cov pq ) TC×TC , where x ip The one-dimensional vector x represents the i-th EEG signal segment i The pth signal element, x iq The one-dimensional vector x represents the i-th EEG signal segment i The qth element of p represents the pth element in the mean vector, μ q represents the qth element in the mean vector, n1 represents the number of EEG signal segments during epileptic seizures, C represents the number of electrode channels of the EEG signal, and T represents the signal length of each channel.

[0020] Based on the further improvement of the above method, multivariate Gaussian distribution sampling is adopted based on the mean vector and covariance matrix to generate new EEG signal segments during epileptic seizures.

[0021] Based on further improvement of the above method, the cross-patient epilepsy detection model includes a feature extractor, a seizure classifier and an individual classifier; the feature extractor is used to extract features from the input EEG signal; the seizure classifier is used to determine whether it is an epileptic seizure period based on the features, and the individual classifier is used to determine the patient to which the input EEG signal belongs.

[0022] Based on the further improvement of the above method, the cross-patient epilepsy EEG signal classification model is trained based on the training sample set using an adversarial optimization strategy, including:

[0023] For each batch of training samples, the parameters of the individual classifier are first optimized with the goal of minimizing the individual classification loss;

[0024] Based on the optimized individual classifiers, the parameters of the feature extractor and the seizure classifier are optimized with the goal of minimizing the adversarial loss.

[0025] Based on the further improvement of the above method, the adversarial loss is calculated using the following formula:

[0026] L adv =L seiz -λL id

[0027] Among them, L adv represents the adversarial loss, L seiz represents the classification loss during the attack period, L id represents the individual classification loss, and λ represents the weight parameter.

[0028] Based on the further improvement of the above method, the following formula is used to calculate the seizure classification loss:

[0029]

[0030] Among them, y i represents the epileptic seizure label of the ith sample, It represents the probability that the i-th sample predicted by the seizure classifier is a seizure period.

[0031] Based on the further improvement of the above method, the following formula is used to calculate the individual classification loss:

[0032]

[0033] Among them, id i represents the individual identity label of the i-th sample, represents the identity type of the i-th sample predicted by the individual classifier, represents the probability that the identity type of the i-th sample predicted by the individual classifier is the j-th individual, id i,j Indicates whether the identity type of the i-th sample is the j-th individual. If so, it is 1, otherwise it is 0. N represents the number of individuals in the training sample set.

[0034] Based on the further improvement of the above method, the feature extractor adopts a channel-weighted convolutional neural network, and the channel-weighted convolutional neural network includes a plurality of residual modules connected in sequence; the main branch of each residual module is used for feature extraction, and the residual branch is used for weight calculation; the weight and feature are multiplied by channel to obtain the output feature of each residual module.

[0035] Compared with the prior art, the cross-patient EEG signal classification method based on data enhancement and adversarial optimization provided in this embodiment can effectively increase sample diversity and improve the generalization ability of the model by performing data enhancement on EEG signal fragments during epileptic seizures. By adopting an optimized adversarial strategy to classify the cross-patient epilepsy EEG signal based on the training sample set, the individual characteristics of the patient are eliminated, so that the model can better adapt to the cross-patient setting. The trained cross-patient epilepsy EEG signal classification model can more accurately and quickly detect whether it is in the seizure period or the non-seizure period, thereby improving the accuracy and efficiency of epileptic EEG signal classification.

[0036] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be achieved and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings are only used for the purpose of illustrating specific embodiments and are not to be considered as limiting the present invention. In the entire drawings, the same reference symbols represent the same components;

[0038] Figure 1 This is a flow chart of a method for classifying epileptic EEG signals across patients based on data enhancement and adversarial optimization according to an embodiment of the present invention;

[0039] Figure 2 Schematic diagram of the structure of a feature extractor according to an embodiment of the present invention. DETAILED DESCRIPTION

[0040] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0041] A specific embodiment of the present invention discloses a method for classifying epileptic EEG signals across patients based on data enhancement and adversarial optimization, such as Figure 1 As shown, the following steps are included:

[0042] S1, obtaining EEG signal segments, performing data enhancement on the EEG signal segments during epileptic seizures, and constructing a training sample set based on the EEG signal segments after data enhancement;

[0043] S2. constructing a cross-patient epilepsy EEG signal classification model, and using an adversarial optimization strategy to train the cross-patient epilepsy EEG signal classification model based on the training sample set to obtain a trained cross-patient epilepsy EEG signal classification model;

[0044] S3. Input the EEG signal to be classified into the trained cross-patient epilepsy EEG signal classification model to obtain the classification result of the EEG signal to be classified.

[0045] The goal of the EEG signal classification task for epileptic patients is to design a classifier that can correctly classify whether the patient is in the attack stage based on the EEG signal fragments of T seconds of the patient. Compared with the prior art, the cross-patient EEG signal classification method based on data enhancement and adversarial optimization provided in this embodiment can effectively increase sample diversity and improve the generalization ability of the model by performing data enhancement on the EEG signal fragments during the epileptic attack period. By adopting an optimized adversarial strategy to classify the cross-patient epileptic EEG signal based on the training sample set, the individual characteristics of the patient are eliminated, so that the model can better adapt to the cross-patient setting. The trained cross-patient epileptic EEG signal classification model can more accurately and quickly detect whether it is in the attack period or the non-attack period, thereby improving the accuracy and efficiency of epileptic EEG signal classification.

[0046] In implementation, the acquired EEG signal can be first downsampled, for example, the frequency of the data can be downsampled from 256Hz to 64Hz or from 500Hz to 50Hz, which can reduce data noise and storage costs. Then, a sliding window can be used to collect EEG signal segments, and each EEG signal segment is marked as (y i ,x i ),i=1,2,...,n, where n is the number of available EEG signal segments, y i ∈{0,1} is the category label, y i = 0 means that the EEG signal of the ith segment is the EEG signal of the non-ictal period, y i =1 means that the i-th EEG signal segment is an EEG signal during the seizure period, x i Represents the i-th EEG signal segment, which is C×T-dimensional EEG signal data, where C represents the number of electrode channels of the EEG signal, and T is the product of the time window and the frequency, that is, the signal length of each channel.

[0047] Since the collection and labeling of EEG data is difficult, medical data such as epilepsy EEG has problems such as small number of samples, imbalanced categories, expensive or difficult labeling, etc. Therefore, data enhancement is needed to solve the problem of data imbalance. Data enhancement technology refers to a method of transforming existing small sample data and expanding the original data set to generate new training data. Compared with the EEG signal when the patient is not having an attack, the amount of positive sample data in the epileptic attack stage is too small. This imbalance problem leads to decreased detection performance and poor generalization ability. Data enhancement technology in image data has been relatively complete, but data enhancement methods for time series are still relatively limited.

[0048] The present invention aims at the temporal and spatial properties of EEG signals, explores the statistical characteristics of signals, and designs a suitable data enhancement method. Specifically, data enhancement is performed on the EEG signal fragments during the epileptic seizure period, including:

[0049] S11, converting the EEG signal of each epileptic seizure period into a one-dimensional vector;

[0050] S12, calculating the mean vector and covariance matrix of the EEG signal based on the one-dimensional vector of the EEG signal during each epileptic seizure period;

[0051] S13, generating a new epileptic seizure EEG signal segment based on the mean vector and the covariance matrix.

[0052] During implementation, the EEG signal x of each epileptic seizure period is first i Convert to a one-dimensional vector, that is, x i ∈R T×C Flattened to a one-dimensional vector x i ∈R TC .

[0053] By formula Calculate the mean vector μ of the EEG signal;

[0054] By formula Calculate the element cov in the pth row and qth column of the covariance matrix pq , and obtain the covariance matrix ∑=(cov pq ) m×m , where x ip The one-dimensional vector x represents the i-th EEG signal segment i The pth signal element, x iq The one-dimensional vector x represents the i-th EEG signal segment i The qth element of p represents the pth element in the mean vector, μ q represents the qth element in the mean vector, n1 represents the number of EEG signals during epileptic seizure, C represents the number of electrode channels of EEG signals, and T represents the signal length of each channel. 1≤p≤TC, 1≤q≤TC, TC is the product of T and C, and m=TC.

[0055] The distribution law of epileptic seizure signals has a certain correlation with the multivariate Gaussian distribution. Therefore, after obtaining the mean vector and covariance matrix, additional epileptic seizure data are generated through the multivariate Gaussian distribution, and the generated data distribution satisfies N(μ,∑). The covariance matrix contains the correlation information between any two channels at any two moments, so it is possible to generate reasonable training samples while considering the temporal and spatial correlations between the existing training data. Each generated sample is modified to R T×C form.

[0056] The data augmentation method of the present invention (denoted as STEA) can not only alleviate the class imbalance problem, but also expand the sample diversity to cover more potential data distributions, thereby improving the generalization ability to different data distributions. Therefore, it can greatly improve the performance in cross-patient settings. And because of the use of spatiotemporal information, the robustness of the model and the understanding of epileptic seizure signals can be greatly improved.

[0057] These generated samples have no individual identity information and therefore do not participate in the subsequent calculation of individual classification loss.

[0058] The original collected samples are divided into a training set and a test set, and the samples of epileptic seizures in the training set are subjected to STEA data enhancement, where the samples in the training sample set and the test sample set come from different individuals, that is, the individuals do not overlap, thereby achieving cross-patient detection.

[0059] An important difficulty in cross-patient classification is that the distributions between the training set and the test set are different. However, existing machine learning algorithms require the same training and test distributions. To solve this problem, the present invention uses a patient adversarial optimization strategy (PANN) to learn an invariant representation of the patient.

[0060] Specifically, the constructed cross-patient epilepsy EEG signal classification model includes a feature extractor, a seizure classifier and an individual classifier; the feature extractor is used to extract features from the input EEG signal; the seizure classifier is used to determine whether it is in an epileptic seizure period based on the features, and the individual classifier is used to determine the patient to which the input EEG signal belongs.

[0061] The features extracted by the feature extractor are transferred to two classifiers, one for classifying whether it is an epileptic seizure period based on the extracted features, and the other classifier for identity classification.

[0062] On the basis of the seizure classifier, the present invention adds an individual classifier to distinguish the patient identity. By alternately training the seizure classifier and the individual classifier in an adversarial manner, the model can distinguish whether an epileptic seizure occurs or not, while being unable to distinguish the individual identity of the patient. This enables the feature extractor to automatically extract individual invariant features related to epilepsy, thereby achieving cross-patient generalization capabilities.

[0063] Specifically, the adversarial optimization strategy is used to train the cross-patient epilepsy EEG signal classification model based on the training sample set, including:

[0064] S21. For each batch of training samples, first optimize the parameters of the individual classifier with the goal of minimizing the individual classification loss;

[0065] S22. Based on the optimized individual classifier, the parameters of the feature extractor and the seizure classifier are optimized with the goal of minimizing the adversarial loss.

[0066] For each batch of training data, the present invention adopts two stages to perform model training. In the first stage, the parameters θ of the individual classifier are optimized with the goal of minimizing the individual classification loss of the individual classifier. I , so that the individual classifier can accurately distinguish the patient to which the EEG signal belongs. At this time, the parameters of the seizure classifier and feature extractor remain unchanged, and only the parameters of the individual classifier are optimized.

[0067] Specifically, the individual classification loss is calculated by the following formula:

[0068]

[0069] Among them, id i represents the individual identity label of the i-th sample, represents the identity type of the i-th sample predicted by the individual classifier, represents the probability that the identity type of the i-th sample predicted by the individual classifier is the j-th individual, id i,j Indicates whether the identity type of the i-th sample is the j-th individual. If so, it is 1, otherwise it is 0. N represents the number of individuals in the training sample set.

[0070] After calculating the individual classification loss, the gradient back propagation updates the parameters of the individual classifier. The specific formula is:

[0071]

[0072] The second stage optimizes the parameters θ of the feature extractor based on the updated individual classifier to minimize the adversarial loss. f and the parameters θ of the seizure classifier y , at this time, the parameters of the individual classifier remain unchanged, ensuring that the confusion in individual classification at this time is the contribution of the feature extractor rather than the identity classifier. By alternating the training of the individual classifier and the feature extractor and seizure classification, the model can extract common features between different patients, that is, the patient identity cannot be distinguished based on the features. This patient-invariant representation can also better generalize to different unseen patients, thereby improving the cross-patient performance of the model.

[0073] Specifically, the adversarial loss is calculated using the following formula:

[0074] L adv =L seiz -λL id

[0075] Among them, L adv represents the adversarial loss, Lseiz represents the classification loss during the attack period, L id represents the individual classification loss, λ represents the weight parameter, and λ is a positive number. For the sample data generated by data enhancement, its classification loss L id is 0.

[0076] Among them, the following formula is used to calculate the attack classification loss:

[0077]

[0078] Among them, y i represents the epileptic seizure label of the ith sample, It represents the probability that the i-th sample predicted by the seizure classifier is a seizure period.

[0079] By minimizing the adversarial loss, we use gradient backpropagation to update the parameters θ of the feature extractor. f and the parameters θ of the seizure classifier y .

[0080]

[0081] Among them, n b Indicates the number of samples in the current training batch, n c Represents the number of real samples in the current training batch, that is, the number of non-enhanced generated samples.

[0082] The cross-patient epilepsy EEG signal classification model of the present invention includes two tasks: one is the classification task of whether it is an epileptic seizure period, and the other is to eliminate the deviation of individual characteristics. Therefore, the goal of adversarial optimization consists of two opposite loss functions, individual classification loss and seizure classification loss. The optimization directions of the two losses are different. The training goal is to minimize the seizure classification loss and maximize the individual classification loss.

[0083] During implementation, the individual classifier and the seizure classifier may adopt a multi-layer perceptron.

[0084] Considering that focal epileptic seizures are only related to some channels, and most existing epileptic seizure types are focal seizures, a channel-weighted convolutional neural network is used as a feature extractor. The channel-weighted convolutional neural network includes a plurality of residual modules connected in sequence; the main branch of each residual module is used for feature extraction, and the residual branch is used for weight calculation; the weight and feature are multiplied by channel to obtain the output feature of each residual module.

[0085] The main branch of each residual module includes two convolutional layers, and the residual branch includes a channel weighted module (CW-Block) or a backlog excitation module (SE-Block), and the convolutional layer is a 3×3 convolutional structure. The channel-weighted convolutional neural network adds a channel weighted module and a squeeze excitation module on the basis of multiple convolutional layers to calculate the channel weight.

[0086] The channel weighting module calculates the weight of each EEG channel through one-dimensional convolution, fully connected layer, softmax layer and average pooling. Finally, the data of each channel is multiplied by its corresponding weight to capture the importance of different EEG channels. The core idea of ​​the squeeze excitation module is to add small sub-network dynamic learning weights when the convolutional neural network processes three-dimensional data.

[0087] For a residual module, its input data is represented by In the form of, C1 represents the number of network channels, C represents the number of EEG signal channels, and T represents the signal length of each EEG signal channel.

[0088] The main branch of the residual module uses two convolutional layers for feature extraction, and the branch performs weight calculation. If the branch is CW-Block, the weight of the EEG signal channel is calculated. First, the global signal representation is captured by one-dimensional convolution, and the input is mapped from C1×T×C to a fragment of size S×C. The fragment is placed in the fully connected network to obtain the output after the softmax layer processing, and then average pooling is applied to each EEG signal channel to obtain the final channel weight vector of size 1×C, that is, the weight of each EEG signal channel. The features output by the main branch are multiplied by the weights calculated by the branch according to the EEG signal channel to obtain the output data of the residual module.

[0089] If the branch is an SE-Block, the weight of the network channel is calculated. The features output by the main branch are multiplied by the weight calculated by the branch according to the network channel to obtain the output data of the residual module. The SE-Block block is a prior art and will not be described here.

[0090] During implementation, the channel weighted convolutional neural network can perform initial feature extraction through a 2DCW-Block block before the first residual module. The output data of the previous residual module of the network is used as the input data of the next residual module, and the output data of the last residual module is input into the classifier to obtain the predicted ST segment type. During implementation, the channel weighting module and the backlog excitation module are used alternately to obtain channel weights of different dimensions. The network structure of the feature extractor can be as follows: Figure 2 shown.

[0091] The network is trained through an adversarial optimization strategy. When the adversarial loss accuracy reaches a preset threshold or reaches a preset number of iterations, the training is stopped to obtain a trained cross-patient epilepsy detection model.

[0092] The trained model can be tested on the test set.

[0093] For the EEG signal to be classified, it is input into the trained cross-patient epilepsy EEG signal classification model to obtain the classification result of whether it is in the seizure period.

[0094] In order to verify the effectiveness of the STEA data enhancement method and PANN adversarial optimization strategy proposed in this invention, the effects are verified on two clinical datasets, CHB-MIT and PKU1st. The CHB-MIT dataset was collected at Boston Children's Hospital and includes EEG signals of 23 patients with a sampling frequency of 256Hz and 23 electrode channel information. The PKU1st dataset is the latest EEG data collected by the Department of Pediatrics of Peking University First Hospital. The EEG sampling frequency is 500Hz, and 19 channels are used to collect EEG. The PKU1st dataset consists of EEG records of 19 patients. Table 1 summarizes the statistical information of these datasets.

[0095] Table 1 Dataset overview

[0096]

[0097] Four common indicators are used to evaluate the prediction performance of the present invention, namely sensitivity, area under the receiver operating characteristic curve (ROC), geometric mean index (GMean) and corrected accuracy (RAccuracy). Given the number of true positives (TP), false positives (FP), true negatives (TN), false negatives (FN), negative-positive ratio The indicators are defined as follows:

[0098]

[0099]

[0100]

[0101]

[0102] All experiments are implemented on PyTorch with Adam as the optimizer and NVIDIA GeForce RTX3090 as the computing resource.

[0103] Table 2 shows the performance of different models for cross-patient epilepsy EEG signal classification models on the CHB-MIT dataset, and Table 3 shows the performance of different models for cross-patient epilepsy EEG signal classification models on the PKU1st dataset, with the best model in bold. Among them, the AAN model is the model of the present invention, AAN+finetune is the model of the AAN model of the present invention after fine-tuning, and Dist-DCRNN+AAN represents a model in which the feature extractor is Dist-DCRNN, and the STEA data enhancement method and PANN adversarial optimization strategy are used. It can be seen from the two tables that under the cross-patient setting, the AAN model has achieved better performance in four metrics (sensitivity, AUC, GMean and RAccurcy) compared with other methods, which is attributed to the effective PANN adversarial strategy and STEA data enhancement method. In particular, the AAN model can achieve more than 80% sensitivity and AUC effects on the CHB-MIT dataset and the PKU1st dataset under a 5-second time window, reaching the clinical use standard. In addition, Tables 2 and 3 also show the performance under the fine-tuning (AAN+finetune) setting. The data of the training set and the test set in the effect cross-patient detection come from different individuals. Since there is little patient data from the patients in the test set, a small amount of data is divided from the test set to fine-tune the model to obtain better generalization. When the number of test patients is large, the fine-tuning setting helps to further improve the performance of the AAN model. This corresponds to some real situations. After the new patients arrive for the first time, doctors can collect their data and fine-tune the model so that the model works better during their subsequent diagnosis and treatment. The performance of the Dist-DCRNN+AAN model in Table 3 is greatly improved compared with the Dist-DCRNN model, which also shows the effectiveness of the STEA data enhancement method and the PANN adversarial optimization strategy proposed in the present invention.

[0104] Table 2 Performance comparison of different detection models on the CHB-MIT dataset

[0105]

[0106]

[0107] Table 3 Performance comparison of different detection models on the PKU1st dataset

[0108]

[0109] The running time of online detection of this method is calculated in Table 4. It can be seen that the method in this paper has a fast running speed and can be used for software deployment in practical applications.

[0110] Table 4 Online processing time of our method on epilepsy dataset

[0111]

[0112] The present invention balances samples through data enhancement and enhances the generalization ability of the model through adversarial optimization strategies. It has good application prospects in clinical practice and can assist doctors in detecting when patients have epileptic seizures and help determine the start and end time of epileptic seizures. It can reduce the workload of neurologists and help improve the diagnosis level when doctors are inexperienced. It has great significance in auxiliary diagnosis. For patients, more timely and effective treatment can be given, helping patients and their families alleviate the inconvenience caused by the disease.

[0113] The cross-patient epilepsy EEG signal classification model of the present invention can handle the situation where the data differences between patients in real medical treatment are large, and has important practical significance. The method of the present invention can be better generalized to unseen patients, so that the method is universal among different patients, and the experimental details are concise and easy to operate, and easy to promote and use in clinical practice.

[0114] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0115] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

Claims

1. A cross-patient epileptic EEG signal classification method based on data enhancement and adversarial optimization, characterized in that: The following steps are involved: Obtaining EEG signal segments, performing data enhancement on the EEG signal segments during epileptic seizures, and constructing a training sample set based on the EEG signal segments after data enhancement; Constructing a cross-patient epilepsy EEG signal classification model, and using an adversarial optimization strategy to train the cross-patient epilepsy EEG signal classification model based on the training sample set to obtain a trained cross-patient epilepsy EEG signal classification model; Inputting the EEG signal to be classified into the trained cross-patient epilepsy EEG signal classification model to obtain the classification result of the EEG signal to be classified; The cross-patient epilepsy detection model includes a feature extractor, a seizure classifier and an individual classifier; the feature extractor is used to extract features from the input electroencephalogram signal; the seizure classifier is used to determine whether the patient is in an epileptic seizure period according to the features, and the individual classifier is used to determine the patient to which the input electroencephalogram signal belongs; The cross-patient epilepsy EEG signal classification model is trained based on the training sample set using an adversarial optimization strategy, including: For each batch of training samples, the parameters of the individual classifier are first optimized with the goal of minimizing the individual classification loss; Based on the optimized individual classifiers, the parameters of the feature extractor and seizure classifier are optimized with the goal of minimizing the adversarial loss; The feature extractor adopts a channel-weighted convolutional neural network, which includes a plurality of residual modules connected in sequence; the main branch of each residual module is used for feature extraction, and the residual branch is used for weight calculation; the weight and the feature are multiplied by channel to obtain the output feature of each residual module; The main branch of each residual module includes two convolutional layers, and the residual branch includes a channel weighting module or a backlog excitation module; If the residual branch of the residual module is a channel weighting module, the channel weighting module calculates the weight of each EEG channel through one-dimensional convolution, fully connected layer, Softmax layer and average pooling in sequence; multiplying the features output by the main branch with the weight calculated by the channel weighting module according to the EEG signal channel to obtain the output data of the residual module; If the residual branch of the residual module is a backlog excitation module, the backlog excitation module is used to calculate the weight of the network channel; the features output by the main branch are multiplied by the weight calculated by the backlog excitation module according to the network channel to obtain the output data of the residual module.

2. The method for classifying epileptic EEG signals across patients based on data enhancement and adversarial optimization according to claim 1, characterized in that: Data enhancement is performed on the EEG signal fragments during the epileptic seizure period, including: Convert the EEG signal of each epileptic seizure period into a one-dimensional vector; Calculate the mean vector and covariance matrix of the EEG signal based on the one-dimensional vector of the EEG signal during each epileptic seizure period; A new epileptic seizure EEG signal segment is generated based on the mean vector and the covariance matrix.

3. The method for classifying epileptic EEG signals across patients based on data enhancement and adversarial optimization according to claim 2, characterized in that: The mean vector and covariance matrix of the EEG signal are calculated based on the one-dimensional vector of the EEG signal during each epileptic seizure period, including: By formula Calculate the mean vector v of the EEG signal; By formula Calculate the element cov in the pth row and qth column of the covariance matrix pq , and obtain the covariance matrix ∑=(cov pq ) TC×TC , where x ip The one-dimensional vector x represents the i-th EEG signal segment i The pth signal element, x iq The one-dimensional vector x represents the i-th EEG signal segment i The qth element of p represents the pth element in the mean vector, μ q represents the qth element in the mean vector, n1 represents the number of EEG signal segments during epileptic seizures, C represents the number of electrode channels of the EEG signal, and T represents the signal length of each channel.

4. The method for classifying epileptic EEG signals across patients based on data enhancement and adversarial optimization according to claim 2, characterized in that: Based on the mean vector and the covariance matrix, multivariate Gaussian distribution sampling is adopted to generate new EEG signal segments during the epileptic seizure period.

5. The method for classifying epileptic EEG signals across patients based on data enhancement and adversarial optimization according to claim 1, characterized in that: The adversarial loss is calculated using the following formula: THE adv =L seiz -λL id Among them, L adv represents the adversarial loss, L seiz represents the classification loss during the attack period, L id represents the individual classification loss, and λ represents the weight parameter.

6. The method for classifying epileptic EEG signals across patients based on data enhancement and adversarial optimization according to claim 5, characterized in that: The following formula is used to calculate the seizure classification loss: Among them, y i represents the epileptic seizure label of the ith sample, It represents the probability that the i-th sample predicted by the seizure classifier is a seizure period.

7. The method for classifying epileptic EEG signals across patients based on data enhancement and adversarial optimization according to claim 5, characterized in that: The individual classification loss is calculated using the following formula: Among them, id i represents the individual identity label of the i-th sample, represents the identity type of the i-th sample predicted by the individual classifier, represents the probability that the identity type of the i-th sample predicted by the individual classifier is the j-th individual, id i,j Indicates whether the identity type of the i-th sample is the j-th individual. If so, it is 1, otherwise it is 0. N represents the number of individuals in the training sample set.

Citation Information

Patent Citations

  • Automatic detection method for electroencephalogram high-frequency oscillation signal of epilepsy patient

    CN114532993A

  • Post-transplantation chronic kidney disease sample augmentation method based on neural network depth features

    CN116779176A