A method, device and storage medium for classifying event-driven epileptic EEG signals
Through the event-driven method, the low-complexity characteristics and cosine similarity of the EEG signal are used for pre-classification, and the two-dimensional convolutional neural network model is activated only under specific conditions, solving the problem of large power loss in the existing technology and achieving efficient classification of EEG signal for epilepsy.
Patent Information
- Application Number
- CN202410848490.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2044-06-27
AI Technical Summary
In the prior art, large CNNs are continuously activated to classify epileptic seizure states and non-seizure states, resulting in a large power loss.
The event-driven method is adopted to obtain the low-complexity characteristics of the EEG signal of the user to be detected and the EEG signal of the healthy user, calculate the cosine similarity, and compare it with the preset threshold. If it is higher than the threshold, it is determined to be a normal EEG signal. Otherwise, the pre-trained two-dimensional convolutional neural network model will be activated for further classification.
It reduces the continuous activation of CNN, reduces power consumption and loss, and improves the accuracy of epilepsy EEG signal classification.
Smart Images

Figure CN118626935B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electroencephalogram (EEG) signal classification, and in particular to an event-driven epileptic electroencephalogram (EEG) signal classification method, device and storage medium. Background Art
[0002] Epilepsy is a relatively significant brain disease that poses a great threat to life. The physical condition of epilepsy patients, such as neurology and psychology, will be seriously disturbed, and it will also have a very serious impact on the entire society, accounting for a large proportion of the world's disease burden. The World Health Organization (WHO) has counted the number of epilepsy patients in the world and found that there are about 50 million epilepsy patients. Within a specific time frame, the number of people who suffer from continuous seizures and need treatment is about 4 people in every 1,000.
[0003] Epileptic seizures are unpredictable and recurrent. The most mainstream treatment method is to analyze and monitor the EEG signals collected from patients. The EEG can fully record the clinical manifestations of patients before, during and after the seizure. The analysis of EEG waveforms can also be used to diagnose the progression of the patient's condition. Early detection of epileptic seizures, giving appropriate and reasonable treatment, and taking timely treatment measures before epileptic seizures or recurrences can provide patients with a greater possibility of treatment and relieve the symptoms of epileptic patients during seizures. Since the epileptic lesions in the patient's brain will have repeated abnormal discharges during epileptic seizures, doctors can determine whether epilepsy has occurred by observing abnormal discharges in the patient's brain. Epilepsy can be effectively studied by generating multidimensional time series from complex, non-stationary, nonlinear and random EEG records. Monitoring epileptic seizures through EEG is currently a very efficient method, which has been widely used in clinical practice.
[0004] With the deepening of the research on EEG signals, machine learning methods such as neural networks (NN) and deep learning (DL) have also been proposed. The use of such methods to analyze epileptic EEG signals at different stages of epilepsy has a high recognition accuracy. In the existing technology, large CNNs are usually used to detect all EEG signals;
[0005] In fact, in epilepsy detection, epileptic seizures are sparse events, and the non-epileptic state is usually dominant compared to the epileptic state. Continuously activating a large CNN to classify epileptic seizure state and non-seizure state will cause a large power consumption loss. Summary of the invention
[0006] In view of this, the purpose of the present invention is to provide an event-driven epileptic EEG signal classification method, device and storage medium to solve the problem in the prior art that large CNN is continuously activated to classify epileptic seizure states and non-seizure states, resulting in great power consumption loss.
[0007] According to a first aspect of an embodiment of the present invention, a method for classifying event-driven epileptic EEG signals is provided, the method comprising:
[0008] Acquire an electroencephalogram (EEG) signal of a user to be detected, and extract a first low-complexity feature according to the electroencephalogram (EEG) signal of the user to be detected;
[0009] Acquire EEG signals of multiple healthy users, extract second low-complexity features of the EEG signals of the multiple healthy users respectively, and acquire third low-complexity features representing normal EEG signals through the multiple second low-complexity features;
[0010] Obtaining the cosine similarity between the first low-complexity feature and the third low-complexity feature;
[0011] The cosine similarity is compared with a preset cosine similarity threshold. If it is higher than the preset cosine similarity threshold, the EEG signal of the user to be detected is determined to be a normal EEG signal; if it is lower than or equal to the preset cosine similarity threshold, the pre-trained two-dimensional convolutional neural network model is activated to further classify the EEG signal of the user to be detected;
[0012] According to the output of the two-dimensional convolutional neural network model, it is determined whether the EEG signal of the user to be detected is a normal EEG signal or an epileptic seizure signal.
[0013] Preferably,
[0014] The activating the pre-trained two-dimensional convolutional neural network model to further classify the EEG signal of the user to be detected includes:
[0015] Mapping the nonlinear characteristics of the EEG signal of the user to be detected to a two-dimensional plane using a recursive graph;
[0016] Extracting recursive quantitative analysis features according to the recursive graph of the EEG signal of the user to be detected;
[0017] The recursive quantitative analysis features are input into a pre-trained two-dimensional convolutional neural network model, and the classification results are output.
[0018] Preferably;
[0019] The recursive quantitative analysis feature is input into a pre-trained two-dimensional convolutional neural network model, and the output classification result includes:
[0020] The recursive quantization analysis features are input into the input layer of a pre-trained two-dimensional convolutional neural network model, the input layer receives the recursive quantization analysis features and passes them to the convolution module, and the convolution module learns the main features from the recursive quantization analysis features; the learned features are flattened by the flattening layer, and the flattened features are input into the fully connected module for classification, and the classification results are normal EEG signals or epileptic seizure signals;
[0021] The convolution module includes three convolution layers, each of which performs a convolution operation through a 3×3 convolution kernel;
[0022] The fully connected module includes two fully connected layers, and the number of output neurons is changed to 2 through the two fully connected layers, indicating that the classification result is a normal EEG signal or an epileptic seizure signal.
[0023] Preferably,
[0024] The step of obtaining an electroencephalogram signal of a user to be detected and extracting a first low-complexity feature according to the electroencephalogram signal of the user to be detected comprises:
[0025] Extracting a signal mean, a signal line length, an average number of zero crossings, and a signal attenuation from the EEG signal of the user to be detected to obtain a first low-complexity feature;
[0026] The step of respectively extracting the second low-complexity features of the EEG signals of the plurality of healthy users to obtain the plurality of second low-complexity features comprises:
[0027] The signal mean, signal line length, average number of zero crossings and signal attenuation are extracted from the EEG signal of each healthy user to obtain multiple second low complexity features.
[0028] Preferably,
[0029] The step of obtaining a third low-complexity feature representing a normal EEG signal by using the plurality of second low-complexity features comprises:
[0030] The signal mean, signal line length, average number of zero crossings and signal attenuation in the multiple second low-complexity features are normalized respectively, and then the median of the normalized signal means, signal line length, average number of zero crossings and signal attenuation is obtained, and the median of the signal mean, signal line length, average number of zero crossings and signal attenuation is used as the third low-complexity feature.
[0031] Preferably,
[0032] The acquisition of the preset cosine similarity threshold includes:
[0033] Obtaining and numbering the electroencephalogram signals of X healthy users, extracting low-complexity features of the electroencephalogram signals of the X healthy users, and respectively obtaining cosine similarities between the X low-complexity features and the third low-complexity feature to obtain X cosine similarities;
[0034] Calculate the mean of each Y cosine similarities according to the number of X cosine similarities to obtain the mean of Z groups of cosine similarities;
[0035] The largest one among the cosine similarity means of the Z groups is used as the preset cosine similarity threshold.
[0036] Preferably,
[0037] The step of extracting recursive quantitative analysis features according to the recursive graph of the EEG signal of the user to be detected comprises:
[0038] The recursion rate is obtained by calculating the proportion of dark points in the recursion graph;
[0039] The determination rate is obtained by calculating the ratio of the number of recursive points in the line segment parallel to the main diagonal line in the recursive graph to the total number of points in the recursive graph;
[0040] The average diagonal length is obtained by calculating the average value of the lengths of the line segments parallel to the main diagonal lines in the recursive graph;
[0041] The laminar flow rate is obtained by calculating the ratio of the number of recursive points in the vertical line segment of the recursive graph to the total number of points in the recursive graph;
[0042] The average vertical line segment length is obtained by calculating the average value of the vertical line segment lengths in the recursive graph.
[0043] According to a second aspect of an embodiment of the present invention, there is provided an event-driven epileptic EEG signal classification device, the device comprising:
[0044] A first feature extraction module: used to obtain an EEG signal of a user to be detected, and extract a first low-complexity feature according to the EEG signal of the user to be detected;
[0045] A second feature extraction module: used to obtain EEG signals of multiple healthy users, respectively extract second low-complexity features of the EEG signals of the multiple healthy users, and obtain third low-complexity features representing normal EEG signals through the multiple second low-complexity features;
[0046] Similarity calculation module: used to obtain the cosine similarity between the first low-complexity feature and the third low-complexity feature;
[0047] The first classification module is used to compare the cosine similarity with a preset cosine similarity threshold. If it is higher than the preset cosine similarity threshold, the EEG signal of the user to be detected is determined to be a normal EEG signal; if it is lower than or equal to the preset cosine similarity threshold, the pre-trained two-dimensional convolutional neural network model is activated to further classify the EEG signal of the user to be detected;
[0048] The second classification module is used to determine whether the EEG signal of the user to be detected is a normal EEG signal or an epileptic seizure signal according to the output of the two-dimensional convolutional neural network model.
[0049] According to a third aspect of an embodiment of the present invention, there is provided a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a main controller, each step in the above method is implemented.
[0050] The technical solution provided by the embodiments of the present invention may have the following beneficial effects:
[0051] The present application extracts simple features of the EEG signals of the user to be detected and the simple features of the EEG signals of healthy users, obtains the cosine similarity between the two, compares the obtained cosine similarity with a preset cosine similarity threshold to achieve pre-classification, and determines whether to activate CNN for subsequent classification by comparing the threshold. CNN is a two-dimensional convolutional neural network that performs secondary classification on EEG signals that cannot be pre-classified. The pre-classification design makes it unnecessary to continuously activate CNN when determining whether the user's EEG signal is an epileptic signal, thereby reducing power consumption.
[0052] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0054] Figure 1 is a flow chart of a method for classifying event-driven epileptic EEG signals according to an exemplary embodiment;
[0055] Figure 2 is a schematic diagram of a cosine similarity threshold acquisition principle according to another exemplary embodiment;
[0056] Figure 3 is a schematic diagram showing a comparison of spans of one-dimensional convolution and two-dimensional convolution according to another exemplary embodiment;
[0057] Figure 4is a schematic diagram showing the relationship between convolution kernel size and perception efficiency according to another exemplary embodiment;
[0058] Figure 5 is a schematic diagram of a two-dimensional convolutional neural network structure according to another exemplary embodiment;
[0059] Figure 6 is a schematic diagram of cosine similarity calculation results according to another exemplary embodiment;
[0060] Figure 7 is a schematic diagram of selecting a cosine similarity comparison threshold according to another exemplary embodiment;
[0061] Figure 8 is a schematic diagram showing the effect of the cosine similarity threshold on the accuracy and the amount of data to be classified according to another exemplary embodiment;
[0062] Fig. 9 is a schematic diagram of comparing recursive quantization features corresponding to two types of EEG data according to another exemplary embodiment;
[0063] Fig.10 is a schematic diagram of a five-fold cross validation method according to another exemplary embodiment;
[0064] Fig.11 is a schematic diagram of a convolutional neural network model accuracy curve according to another exemplary embodiment;
[0065] Fig.12 is a schematic diagram of a loss function curve of a convolutional neural network model according to another exemplary embodiment;
[0066] Fig.13 is a system schematic diagram of an event-driven epileptic EEG signal classification device according to another exemplary embodiment;
[0067] In the accompanying drawings: 1-first feature extraction module, 2-second feature extraction module, 3-similarity calculation module, 4-first classification module, 5-second classification module. DETAILED DESCRIPTION
[0068] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0069] Embodiment 1
[0070] Figure 1 is a flow chart of an event-driven epilepsy EEG signal classification method according to an exemplary embodiment. Figure 1 As shown, the method includes:
[0071] S1, obtaining an electroencephalogram signal of a user to be detected, and extracting a first low-complexity feature according to the electroencephalogram signal of the user to be detected;
[0072] S2, obtaining EEG signals of multiple healthy users, extracting second low-complexity features of the EEG signals of the multiple healthy users respectively, and obtaining third low-complexity features representing normal EEG signals through the multiple second low-complexity features;
[0073] S3, obtaining the cosine similarity between the first low-complexity feature and the third low-complexity feature;
[0074] S4, comparing the cosine similarity with a preset cosine similarity threshold, if it is higher than the preset cosine similarity threshold, determining that the EEG signal of the user to be detected is a normal EEG signal; if it is lower than or equal to the preset cosine similarity threshold, activating a pre-trained two-dimensional convolutional neural network model to further classify the EEG signal of the user to be detected;
[0075] S5, determining whether the EEG signal of the user to be detected is a normal EEG signal or an epileptic seizure signal according to the output of the two-dimensional convolutional neural network model;
[0076] It is understandable that in order to verify the above-mentioned algorithm, this application uses a public epilepsy EEG signal dataset, which not only ensures the accuracy and reliability of the EEG data, but also facilitates comparison with other similar research works. Finally, the Bonn epilepsy EEG database is used to train the model. This dataset is used by many researchers and has certain authority and versatility.
[0077] There are five types of EEG data in the Bonn epilepsy EEG database, namely A_Z, B_O, C_N, D_F and E_S. Each category contains 100 EEG signals, each of which is 23.6 seconds long and has a total of 4097 points. The sampling frequency of the signal is 173.61Hz. All data in the data set have been carefully screened by doctors, and do not contain signals that are greatly affected by electrooculography or electromyography. All data have been filtered with a filtering frequency of 0.5-40Hz. Types A and B are scalp EEG data of healthy people, where A is the EEG signal when the subject opens his eyes, and B is the EEG signal when the subject closes his eyes. The other three types C, D, and E are EEG signals of epileptic patients, and the epileptic seizure areas of the three patients have been located by doctors. Among them, C is the EEG signal collected from the patient's seizure area, while D is collected from the patient's non-seizure area, and E is the EEG signal of the patient during the epileptic seizure period;
[0078] In this application, the algorithm performs two classifications on epileptic EEG signals, namely healthy EEG and epileptic EEG. Therefore, two types of EEG data, A and E, are selected for analysis and verification. The specific process is as follows:
[0079] The low-complexity features of the EEG signals of healthy users and users in epileptic seizure period are extracted respectively. The low-complexity features include signal mean, signal line length, signal zero-crossing time and attenuation. The specific calculation method of each feature is as follows:
[0080] Input: EEG signal, dataWindow;
[0081] The duration of the EEG signal, duration;
[0082] Output: signal mean, mean;
[0083] Signal line length, L;
[0084] Average number of zero crossings, zero _ times;
[0085] Signal attenuation, decay;
[0086] Signal mean:
[0087]
[0088] Signal line length:
[0089]
[0090] Among them, Window size Indicates the window size, which is calculated based on the number of data;
[0091] Average number of zero crossings:
[0092]
[0093] Signal attenuation:
[0094]
[0095] Based on the four low-complexity features calculated above, the cosine similarity is calculated to check whether the signal to be analyzed is similar to the standard reference for EEG signal classification. The cosine similarity can be used to compare the similarity between two vectors. First, the cosine value of the angle between the two vectors is calculated and compared with 1. The smaller the difference between the calculated cosine value and 1, the smaller the angle between the two vectors being compared, and the closer it is to 0 degrees, which means that the two vectors are very similar. When calculating the cosine similarity, after extracting the four features from the two data sets A and E, they must be normalized first, and then the median of each feature of the A data set (multiple healthy users) after normalization is calculated. Finally, the median is used to calculate the similarity of AE. The calculation formula for cosine similarity is as follows:
[0096]
[0097] Wherein, i includes 1, 2, 3, and 4 (representing the signal mean, signal line length, signal zero-crossing time, and attenuation, respectively);
[0098] When pre-classifying by cosine similarity, a suitable threshold should be selected for comparison. If the calculated cosine similarity is higher than the threshold, it indicates that the sample is likely to be non-epileptic seizure, that is, healthy state, and there is no need to activate CNN (two-dimensional convolutional neural network model). If the calculated cosine similarity is lower than the threshold, it indicates that the sample is likely to be an epileptic seizure, and further classification processing is required through CNN.
[0099] For the selection of cosine similarity threshold, use the following Figure 2 As shown, the cosine similarity between the normalized median of each feature of the 100 samples of healthy EEG signals and the A data set (multiple healthy users) (that is, the third lowest complexity feature mentioned above) is first calculated, and then the average of every 10 cosine similarities is taken, and then the maximum cosine similarity CSmax is obtained by comparing the average values of the 10 groups of cosine similarities, which is the selected threshold;
[0100] Since EEG signals are very complex nonlinear signals, when the traditional one-dimensional linear analysis method is used to analyze and process EEG signals, it will cause the loss of nonlinear hidden features, so it is necessary to use two-dimensional convolution to analyze EEG signals;
[0101] Before designing the convolutional neural network, in order to improve the classification accuracy, it is necessary to retain the nonlinear characteristics of the EEG signal as much as possible. Therefore, the recursive graph is first used to map the nonlinear characteristics of the EEG signal to a two-dimensional plane, and then input it into the neural network for feature extraction, learning and classification. The core idea of the recursive graph is to map the trajectory of the high-dimensional motion state to a two-dimensional plane to achieve the purpose of directly characterizing its dynamic behavior. Visualizing the dynamic characteristics of the system is an important means to analyze the non-stationarity and chaos of time series.
[0102] The recursive graph shows obvious differences in the EEG patterns of healthy EEG and epileptic seizures. In the recursive graph of healthy EEG, the recursive points are denser and mostly in strips; while the recursive graph of the seizure period is more block-shaped. The larger block recursive area also shows that there are more similar nonlinear motion states in the EEG signals of epileptic patients. The recursive graph contains rich nonlinear dynamic features and retains more abstract high-level representation attribute features. This feature is a perfect match with the superior characteristics of CNN. The recursive graph is symmetrical about the -45° diagonal line, with no obvious periodic phenomenon, which is consistent with the EEG waveform and can fully reflect the ups and downs between the peaks and troughs of the EEG signal at each moment;
[0103] Although the recursion diagram contains the nonlinear dynamic characteristics of the chaotic sequence, its internal structure is relatively complex, and it is difficult to directly obtain accurate and effective characteristic information from it. Therefore, recursive quantitative analysis is required. The commonly used eigenvalues of recursive quantitative analysis are: Recurrence Rate (RR), Determinism (DET), Average Diagonal Line Length (DLL), Laminarity (LAM), Average Vertical Line Length (TT). The explanation and specific calculation method of the eigenvalues are as follows:
[0104] Recursion rate RR: It is used to measure the density of recursion points, that is, the proportion of dark points in the recursion graph. The calculation method is as follows:
[0105]
[0106] Where R i,j is the dark point in the recursive graph, N is the number of points on the phase space trajectory, N 2 Represents the total number of points in the recursion graph;
[0107] Determinism rate DET: The ratio of the number of recursive points in the line segment parallel to the main diagonal line in the recursive graph to the total number of points in the recursive graph. It can distinguish continuous recursive points from isolated recursive points to reflect the predictability and randomness of the sequence. The calculation method is as follows:
[0108]
[0109] Where l represents the length of the diagonal line, lmin is the minimum value of the diagonal line length, which is 3 in this application, and P(l) is the proportion of diagonal structures with a length of l in the recursive graph;
[0110] Average diagonal length DLL: The average length of the line segments parallel to the main diagonal in the recursive graph can reflect the randomness of the sequence. The calculation method is as follows:
[0111]
[0112] Laminar flow rate LAM: The ratio of the number of recursive points in the vertical line segment of the recursive graph to the total number of points in the recursive graph, which is used to reflect the speed of the sequence state change. The calculation method is as follows:
[0113]
[0114] where P(v) is the frequency distribution of vertical line segments of length v in the recursive graph, v min is the threshold of the line segment, only when it is greater than v min The line segments are counted. In this application, v min The value is 3;
[0115] Average vertical line segment length TT: The average length of the vertical line segment in the recursive graph can reflect the degree of divergence of the sequence. The calculation method is as follows:
[0116]
[0117] In addition, inspired by the concept of "receptive field", when one-dimensional convolution is used for feature extraction, if the convolution kernel size is "1×3", the "span" of the extracted data features is 2, and the perception range is small; after converting the one-dimensional data into two-dimensional data, the convolution kernel size becomes "3×3" accordingly, and the "span" of each feature extraction becomes 18, and the perception range becomes larger. The larger perception range allows the neural network to see a larger pixel range on the input image, thereby better understanding the global information of the image and extracting global features, such as the attached Figure 3 Shown is the span comparison between one-dimensional convolution and two-dimensional convolution;
[0118] The larger the "span", the larger the perception range. Although the "span" can be increased by increasing the size of the one-dimensional convolution kernel, compared with the two-dimensional convolution, the perception efficiency of increasing the one-dimensional size is much lower than that of the two-dimensional convolution. The perception efficiency η is defined as follows:
[0119]
[0120] Where Span is the "span" and Ks is the convolution kernel size;
[0121] If one-dimensional convolution is used, if you want to perceive data with a "span" of 18, the convolution kernel size is "1×19" and the perception efficiency is 0.95. For the same "span", the convolution kernel size of two-dimensional convolution is "3×3" and the perception efficiency is 2. Figure 4 The figure shows the perceptual efficiency corresponding to the convolution kernel size of two dimensions. It can be seen from the figure that for one-dimensional convolution, the perceptual efficiency increases with the increase of the convolution kernel size, but is always less than 1. The perceptual efficiency of two-dimensional convolution decreases with the increase of the convolution kernel size. When the convolution kernel size is less than "8×8", the perceptual efficiency of two-dimensional convolution is always greater than that of one-dimensional convolution.
[0122] Based on the above analysis, taking into account the feature extraction and training efficiency, two-dimensional convolution is used in this application to process one-dimensional epileptic EEG signals, and a convolution kernel size of "3×3" is used;
[0123] As attached Figure 5 The figure shows the structure of the convolutional neural network model used in this experiment, including the configuration details and number of parameters of each layer. This CNN consists of 7 layers and is divided into two parts: the first part learns the main features from the input signal, including three convolutional layers. The second part contains two fully connected layers to classify the signal. The input layer is convolved with a kernel of size 3 with a step size of 1 to generate the second layer. Then, the feature map of the second layer is convolved with a kernel of size 3 with a step size of 1 to generate layer 3. A strided convolution operation is used in layer 3 to replace the pooling operation, thereby generating layer 4. All intermediate layers use the ReLU function as the activation function, which can well complete the nonlinear transformation. After the input signal passes through the convolution layer, the flattened high-level features (layer 5) are fed to the fully connected layers (layers 6 and 7) for final classification. The number of output neurons of the first fully connected layer is 256. Since the final output result is a binary classification, the number of output neurons of the last layer is 2, which are normal EEG and epileptic seizure.
[0124] It is worth mentioning that:
[0125] The experimental summary of the above pre-classification feature extraction is summarized in Table 1 below. From the experimental results, it can be seen that for the four extracted features, the ranges of the two types of data overlap. Therefore, if epilepsy detection is judged based on a single feature, the chance is relatively large and it is easy to cause misjudgment. Considering this, it is decided to normalize the data and then calculate the cosine similarity to improve the accuracy of classification:
[0126] Table 1 Results of feature extraction for category A and category E
[0127]
[0128]
[0129] The calculation results of cosine similarity are shown in the attached Figure 6 As shown, it can be seen that the signal similarity between healthy EEG and epileptic EEG is quite different, and the cosine similarity of healthy EEG is closer to 1;
[0130] The selection of cosine similarity comparison threshold is shown in the attached Figure 7 As shown in the figure, the threshold in this application is finally selected as 0.91. By comparing the calculated cosine similarity with the threshold, it can be concluded that 26% of the data does not need to activate the convolutional neural network for further classification when being processed, and the accuracy loss is only 0.5% compared with the benchmark without event-driven pre-classification. When the similarity threshold continues to decrease, the accuracy drops too much to an unacceptable 94.2%, and the amount of data to be classified is only reduced by an additional 3%. The results are shown in the attached figure. Figure 8 As shown;
[0131] Combined with the recursive graph of the EEG signal and based on the calculation method of the five recursive quantized eigenvalues, the mean values of the recursive quantized features corresponding to the two types of EEG data A and E calculated in Table 2 below are obtained:
[0132] Table 2 Mean values of recursive quantization features corresponding to two types of EEG data (A and E)
[0133]
[0134] In order to more intuitively reflect the difference in the quantitative eigenvalues of the recursive graphs of healthy and seizure EEG signals, the attached Fig. 9 , shows a comparison diagram of the five recursive quantization eigenvalues corresponding to the two types of data. It can be seen from the figure that in the EEG characteristic signals of a shorter time length, the recursive quantization features of the two types of data are different and the gap is large. It can be seen that the use of the above five recursive quantization features can better reflect the different characteristics of healthy EEG signals and epileptic EEG signals;
[0135] For the evaluation of convolutional neural networks, this application uses five-fold cross validation when training the algorithm. First, the EEG recursive feature signal to be classified is randomly divided into five equal parts, four fifths of which are used to train CNN, and the remaining one fifth is used to test the performance of the system. This strategy repeatedly alternates training and testing by moving the test and training data sets. The specific implementation method is shown in the attached Fig.10 As shown in the figure, this method is suitable for situations where the sample size of the data set is small. In each round, most of the samples are used to train the model, so this method can be used to make the most reliable evaluation of the model results statistically.
[0136] The proposed model was trained, and the accuracy curve and loss function curve (after fitting) of the model were obtained, which are the results of the training set and the test set respectively. The two curves are shown in the attached figure. Fig.11 and attached Fig.12 As shown in the figure, by comparing the model accuracy experimental results and loss function curves of the training set and the test set, it can be found that the fluctuation of the data is very small, and there is basically no big difference, indicating that the configuration of the model is relatively reasonable and there is no overfitting phenomenon. The accuracy of the epilepsy detection model reaches 97.7%.
[0137] Embodiment 2:
[0138] Fig.13 is a system schematic diagram of an event-driven epilepsy EEG signal classification device according to another exemplary embodiment, the device comprising:
[0139] The first feature extraction module 1 is used to obtain the EEG signal of the user to be detected, and extract the first low-complexity feature according to the EEG signal of the user to be detected;
[0140] The second feature extraction module 2 is used to obtain EEG signals of multiple healthy users, respectively extract second low-complexity features of the EEG signals of the multiple healthy users, and obtain third low-complexity features representing normal EEG signals through the multiple second low-complexity features;
[0141] Similarity calculation module 3: used to obtain the cosine similarity between the first low-complexity feature and the third low-complexity feature;
[0142] The first classification module 4 is used to compare the cosine similarity with a preset cosine similarity threshold. If it is higher than the preset cosine similarity threshold, the EEG signal of the user to be detected is determined to be a normal EEG signal; if it is lower than or equal to the preset cosine similarity threshold, the pre-trained two-dimensional convolutional neural network model is activated to further classify the EEG signal of the user to be detected;
[0143] The second classification module 5 is used to determine whether the EEG signal of the user to be detected is a normal EEG signal or an epileptic seizure signal according to the output of the two-dimensional convolutional neural network model.
[0144] Embodiment three:
[0145] This embodiment provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a main controller, each step in the above method is implemented;
[0146] It is understandable that the storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0147] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.
[0148] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "a small number of sparsely distributed" refers to at least two.
[0149] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code that includes one or less sparsely distributed executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.
[0150] It should be understood that the various parts of the present invention can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiment, a small number of sparsely distributed steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0151] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0152] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0153] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0154] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or a small number of sparsely distributed embodiments or examples in a suitable manner.
[0155] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A method for classifying event-driven epileptic EEG signals, characterized in that: The method comprises: Acquire an electroencephalogram (EEG) signal of a user to be detected, and extract a first low-complexity feature according to the electroencephalogram (EEG) signal of the user to be detected; Acquire EEG signals of multiple healthy users, extract second low-complexity features of the EEG signals of the multiple healthy users respectively, obtain multiple second low-complexity features, and acquire third low-complexity features representing normal EEG signals through the multiple second low-complexity features; The step of obtaining an electroencephalogram signal of a user to be detected and extracting a first low-complexity feature according to the electroencephalogram signal of the user to be detected comprises: Extracting a signal mean, a signal line length, an average number of zero crossings, and a signal attenuation from the EEG signal of the user to be detected to obtain a first low-complexity feature; The step of respectively extracting the second low-complexity features of the EEG signals of the plurality of healthy users to obtain the plurality of second low-complexity features comprises: Extract the signal mean, signal line length, average number of zero crossings, and signal attenuation from the EEG signal of each healthy user to obtain multiple second low complexity features; The step of obtaining a third low-complexity feature representing a normal EEG signal by using the plurality of second low-complexity features comprises: Normalizing the signal mean, signal line length, average number of zero crossings, and signal attenuation in the plurality of second low-complexity features respectively, and then obtaining the median of the normalized signal mean, signal line length, average number of zero crossings, and signal attenuation, and using the median of the signal mean, signal line length, average number of zero crossings, and signal attenuation as the third low-complexity feature; Obtaining the cosine similarity between the first low-complexity feature and the third low-complexity feature; The cosine similarity is compared with a preset cosine similarity threshold. If it is higher than the preset cosine similarity threshold, the EEG signal of the user to be detected is determined to be a normal EEG signal; if it is lower than or equal to the preset cosine similarity threshold, the pre-trained two-dimensional convolutional neural network model is activated to further classify the EEG signal of the user to be detected; According to the output of the two-dimensional convolutional neural network model, it is determined whether the EEG signal of the user to be detected is a normal EEG signal or an epileptic seizure signal.
2. The method according to claim 1, characterized in that The activating the pre-trained two-dimensional convolutional neural network model to further classify the EEG signal of the user to be detected includes: Mapping the nonlinear characteristics of the EEG signal of the user to be detected to a two-dimensional plane using a recursive graph; Extracting recursive quantitative analysis features according to the recursive graph of the EEG signal of the user to be detected; The recursive quantitative analysis features are input into a pre-trained two-dimensional convolutional neural network model, and the classification results are output.
3. The method according to claim 2, characterized in that: The recursive quantitative analysis feature is input into a pre-trained two-dimensional convolutional neural network model, and the output classification result includes: The recursive quantization analysis features are input into the input layer of a pre-trained two-dimensional convolutional neural network model, the input layer receives the recursive quantization analysis features and passes them to the convolution module, and the convolution module learns the main features from the recursive quantization analysis features; the learned features are flattened by the flattening layer, and the flattened features are input into the fully connected module for classification, and the classification results are normal EEG signals or epileptic seizure signals; The convolution module includes three convolution layers, each of which performs a convolution operation through a 3×3 convolution kernel; The fully connected module includes two fully connected layers, and the number of output neurons is changed to 2 through the two fully connected layers, indicating that the classification result is a normal EEG signal or an epileptic seizure signal.
4. The method according to claim 3, characterized in that The acquisition of the preset cosine similarity threshold includes: Obtaining and numbering the electroencephalogram signals of X healthy users, extracting low-complexity features of the electroencephalogram signals of the X healthy users, and respectively obtaining cosine similarities between the X low-complexity features and the third low-complexity feature to obtain X cosine similarities; Calculate the mean of each Y cosine similarities according to the number of X cosine similarities to obtain the mean of Z groups of cosine similarities; The largest one among the cosine similarity means of the Z groups is used as the preset cosine similarity threshold.
5. The method according to claim 4, characterized in that The step of extracting recursive quantitative analysis features according to the recursive graph of the EEG signal of the user to be detected comprises: The recursion rate is obtained by calculating the proportion of dark points in the recursion graph; The determination rate is obtained by calculating the ratio of the number of recursive points in the line segment parallel to the main diagonal line in the recursive graph to the total number of points in the recursive graph; The average diagonal length is obtained by calculating the average value of the lengths of the line segments parallel to the main diagonal lines in the recursive graph; The laminar flow rate is obtained by calculating the ratio of the number of recursive points in the vertical line segment of the recursive graph to the total number of points in the recursive graph; The average vertical line segment length is obtained by calculating the average value of the vertical line segment lengths in the recursive graph.
6. An event-driven epileptic EEG signal classification device, characterized in that: The device comprises: A first feature extraction module: used to obtain an EEG signal of a user to be detected, and extract a first low-complexity feature according to the EEG signal of the user to be detected; The step of obtaining an electroencephalogram signal of a user to be detected and extracting a first low-complexity feature according to the electroencephalogram signal of the user to be detected comprises: Extracting a signal mean, a signal line length, an average number of zero crossings, and a signal attenuation from the EEG signal of the user to be detected to obtain a first low-complexity feature; A second feature extraction module: used to obtain EEG signals of multiple healthy users, respectively extract second low-complexity features of the EEG signals of the multiple healthy users, and obtain third low-complexity features representing normal EEG signals through the multiple second low-complexity features; The step of respectively extracting the second low-complexity features of the EEG signals of the plurality of healthy users to obtain the plurality of second low-complexity features comprises: Extract the signal mean, signal line length, average number of zero crossings, and signal attenuation from the EEG signal of each healthy user to obtain multiple second low complexity features; The step of obtaining a third low-complexity feature representing a normal EEG signal by using the plurality of second low-complexity features comprises: Normalizing the signal mean, signal line length, average number of zero crossings, and signal attenuation in the plurality of second low-complexity features respectively, and then obtaining the median of the normalized signal mean, signal line length, average number of zero crossings, and signal attenuation, and using the median of the signal mean, signal line length, average number of zero crossings, and signal attenuation as the third low-complexity feature; Similarity calculation module: used to obtain the cosine similarity between the first low-complexity feature and the third low-complexity feature; The first classification module is used to compare the cosine similarity with a preset cosine similarity threshold. If it is higher than the preset cosine similarity threshold, the EEG signal of the user to be detected is determined to be a normal EEG signal; if it is lower than or equal to the preset cosine similarity threshold, the pre-trained two-dimensional convolutional neural network model is activated to further classify the EEG signal of the user to be detected; The second classification module is used to determine whether the EEG signal of the user to be detected is a normal EEG signal or an epileptic seizure signal according to the output of the two-dimensional convolutional neural network model.
7. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the main controller, each step of the event-driven epileptic EEG signal classification method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Time sequence classification method based on deep convolutional network and gray recursive graph analysis
CN110443276A
Electroencephalogram signal intelligent processing circuit based on multistage neural network and block calculation
CN114818837A
Consciousness state analysis method and equipment based on multi-scale feature fusion
CN117137499A