Electroencephalogram classification method, storage medium, and device

By transforming and extracting features from multidimensional EEG data, and combining extreme random trees and random forest algorithms, the problems of time-consuming and low-accuracy EEG classification have been solved, achieving more efficient and accurate classification and promoting the advancement of medical diagnosis.

CN118378169BActive Publication Date: 2026-07-28CHINA UNIV OF GEOSCIENCES (WUHAN)
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA UNIV OF GEOSCIENCES (WUHAN)
Filing Date
2024-05-10
Publication Date
2026-07-28

AI Technical Summary

Technical Problem

Existing EEG classification methods are time-consuming and have low classification accuracy, especially due to the time-consuming calculation of interval features and the reliance on manual selection, which leads to insufficient classifier accuracy.

Method used

By transforming the original time series of multidimensional EEG, interdimensional difference sequences, first-order difference sequences, and Fourier sequences are generated. Subsequence features are extracted and fused. The extreme random tree algorithm is used to select important features, and finally, random forest is used for classification.

Benefits of technology

It has improved the accuracy and efficiency of EEG classification, promoted the improvement of medical diagnostic capabilities, and ensured a higher level of diagnostic accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118378169B_ABST
    Figure CN118378169B_ABST
Patent Text Reader

Abstract

The application discloses an electroencephalogram classification method, a storage medium and equipment, and relates to the field of data processing.The method specifically comprises the following steps: converting an original time sequence of multidimensional electroencephalogram to obtain a difference sequence between dimensions, a first-order difference sequence of each dimension and a Fourier sequence of each dimension; extracting a set number of subsequences from the difference sequence between dimensions, the first-order difference sequence of each dimension and the Fourier sequence of each dimension respectively to obtain corresponding subsequence sets; extracting subsequence features from the three subsequence sets and fusing the features to obtain fused features; performing feature selection on the fused features by using an extreme random tree algorithm to obtain important features; and classifying the important features based on a random forest to obtain electroencephalogram classification results of different health conditions.The electroencephalogram classification accuracy is improved, and the research on existing electroencephalogram classification management is promoted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing, and more particularly to an electroencephalogram (EEG) classification method, storage medium, and device. Background Technology

[0002] Electroencephalography (EEG) is a non-invasive method for recording the electrical activity of the brain, and it has broad commercial application prospects in fields such as brain-computer interface (BCI) technology, especially in healthcare, assistive devices, and virtual reality. Currently, there are methods for classifying and interpreting different types of EEG signals, such as the self-regulating signals of slow cortical potentials. Healthy subjects are asked to move a cursor up and down on a computer screen while their cortical potentials are recorded. During recording, the subject sees visual feedback of their slow cortical potentials. A positive cortical potential causes the cursor to move down on the screen, while a negative cortical potential causes the cursor to move up. Widespread application of this method in the field of EEG classification can promote the development of medical research, advance brain-computer interface technology, and unlock the enormous potential of human-computer interaction.

[0003] Currently, to improve the accuracy of clinical diagnosis through EEG classification, most studies employ numerous interval features. However, the computation of some interval features is extremely time-consuming, thus diminishing the advantage of interval classifiers in rapid classification. Furthermore, after interval feature extraction, existing classifiers almost always directly input the data into a random forest for classification. This places high demands on the quality of the interval features, making the final classification accuracy overly reliant on manually selected interval features. Consequently, the problems of high classification time and low classification accuracy persist. Summary of the Invention

[0004] The purpose of this invention is to address the problems of high classification time and low classification accuracy in existing electroencephalogram (EEG) classification technologies by proposing an EEG classification method comprising the following steps:

[0005] S1. Obtain the raw time sequence of the multidimensional electroencephalogram (EEG), wherein the raw time sequence of the multidimensional EEG is the time sequence signal of the EEG at different locations of the cerebral cortex under different conditions of the subject.

[0006] S2. The original time series of the multidimensional EEG is transformed to obtain the inter-dimensional difference sequence, the first-order difference sequence of each dimension, and the Fourier sequence of each dimension.

[0007] S3. Extract a set number of subsequences from the inter-dimensional difference sequence, the first-order difference sequence of each dimension, and the Fourier sequence of each dimension to obtain a set of inter-dimensional difference subsequences, a set of first-order difference subsequences of each dimension, and a set of Fourier sequences of each dimension.

[0008] S4. Extract features from the set of subsequences of differences between dimensions, the set of first-order difference subsequences for each dimension, and the set of Fourier sequence sets for each dimension, and fuse the features extracted from the three subsequence sets to obtain the fused features.

[0009] S5. Use the extreme random tree algorithm to select features from the fused features to obtain important features;

[0010] S6. Classify the important features based on random forest to obtain EEG classification results for different health conditions.

[0011] Furthermore, the original time series of the multidimensional EEG is transformed to obtain the inter-dimensional difference sequence as follows:

[0012] Calculate the difference between any two EEG signals in the original time series of a multidimensional EEG to obtain the interdimensional difference sequence.

[0013] Furthermore, the original time series of the multidimensional electroencephalogram is transformed to obtain the first-order difference sequence, specifically:

[0014] The difference between the EEG signals corresponding to adjacent sampling time points in each dimension of the original time series of the multidimensional EEG is calculated to obtain the first-order difference sequence of each dimension.

[0015] Furthermore, the original time series of the multidimensional electroencephalogram was transformed to obtain the Fourier sequence as follows:

[0016] Fast Fourier Transform is performed on the EEG signals of each dimension of the original time series of multidimensional EEG to obtain the Fourier sequence of each dimension.

[0017] Furthermore, step S3 specifically includes:

[0018] S31. Determine the number of subsequences in each sequence of the inter-dimensional difference sequence, the first-order difference sequence of each dimension, the Fourier sequence of each dimension, the length of each subsequence, and the starting point of each subsequence. The number of subsequences is set according to requirements, the starting point of each subsequence is the position of the first value of each subsequence in the corresponding sequence, and the starting point and length of each subsequence are random.

[0019] S32. Based on the number of subsequences, the length of each subsequence, and the starting point of each subsequence, extract a set number of subsequences from the inter-dimensional difference sequence, the first-order difference sequence of each dimension, and the Fourier sequence of each dimension.

[0020] Furthermore, in step S4, the features extracted from the three subsequence sets are:

[0021] The features include: mean, standard deviation, slope, interquartile range, maximum value, minimum value, positive 40% rate, and mutual information calculation.

[0022] Furthermore, the extreme random tree algorithm is used to select features from the fused features, resulting in the following important features:

[0023] Using extremely random trees to train the data, an importance score is calculated for each feature through the extremely random tree model. Features with an importance score greater than a threshold are considered important features.

[0024] Furthermore, the classification of important features based on random forest is specifically as follows:

[0025] Multiple subsets are created from the important feature dataset using random sampling. For each subset, a decision tree is trained. When building each decision tree, a subset of features is randomly selected. For each node of each decision tree, the best split point is found among the randomly selected features. Each tree is trained independently until the stopping condition is met. Finally, classification prediction is performed by majority voting.

[0026] The present invention also proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described electroencephalogram (EEG) classification method.

[0027] The present invention also proposes an electronic device, including a processor and a memory, wherein the processor and the memory are interconnected, wherein the memory is used to store a computer program, the computer program including computer-readable instructions, and the processor is configured to invoke the computer-readable instructions to execute the above-described electroencephalogram (EEG) classification method.

[0028] The beneficial effects of the technical solution provided by this invention are:

[0029] This invention generates three new types of sequences from the extracted multidimensional time series, extracts subsequences from each sequence in each dimension, and then represents the extracted subsequences using selected features, followed by feature fusion. Subsequently, extreme random trees are used for feature selection. Finally, random forests are used for classification. This addresses the problems of long processing times and poor classification results in traditional subsequence feature-based classification methods, improving the accuracy of EEG classification. It can advance existing research on EEG classification management, thereby improving the diagnostic level of the medical industry and ensuring patients receive more accurate and higher-level diagnoses. Attached Figure Description

[0030] Figure 1 This is a flowchart of an electroencephalogram (EEG) classification method according to an embodiment of the present invention;

[0031] Figure 2 This is a schematic diagram illustrating how the original time series is transformed into an inter-dimensional difference sequence according to an embodiment of the present invention;

[0032] Figure 3 This is a schematic diagram illustrating how the original time series is transformed into a first-order difference sequence according to an embodiment of the present invention;

[0033] Figure 4 This is a schematic diagram of the dimension-reduced interval features obtained by splicing interval features according to an embodiment of the present invention;

[0034] Figure 5 This is a block diagram of the electroencephalogram (EEG) classification method according to an embodiment of the present invention;

[0035] Figure 6 This is a block diagram of an electronic device according to an exemplary embodiment of the present invention. Detailed Implementation

[0036] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described below with reference to the accompanying drawings.

[0037] Please refer to Figure 1 , Figure 1 This is a flowchart of an electroencephalogram (EEG) classification method according to an embodiment of the present invention. The method includes the following steps:

[0038] S1. Obtain the raw time series of multidimensional electroencephalograms (EEGs). The raw time series of multidimensional EEGs are the time series signals of EEGs from different locations of the cerebral cortex under different conditions of the subject.

[0039] A further embodiment obtains an n-dimensional EEG time series signal from n test points at n locations in the cerebral cortex, and the EEG classification task is to classify different health conditions reflected by the EEG.

[0040] S2. The original time series of the multidimensional EEG is transformed to obtain the inter-dimensional difference sequence, the first-order difference sequence of each dimension, and the Fourier sequence of each dimension.

[0041] In one embodiment, the original time series of the multidimensional electroencephalogram is transformed to obtain the inter-dimensional difference sequence as follows:

[0042] Calculate the difference between any two EEG signals in the original time series of a multidimensional EEG to obtain the interdimensional difference sequence.

[0043] For details, please refer to Figure 2 For the original time series Z = {Zs1, Zs2, ..., Zs} of an n-dimensional electroencephalogram, n Any two dimensional sequences in}, such as: Zs1={z1,z2,…,z i ,…,zL} and Zs2={z1′,z2′,…,z i ′,…,z L ′}, where z i and z i Zs1 and Zs2 are EEG signals sampled at the same timestamp in different dimensions. The difference between each EEG signal in Zs1 and Zs2 is calculated to obtain the inter-dimensional difference sequence Vs = Zs2 - Zs1 = {v1, v2, ..., v}. i ,…,v L}, where v(i)=z i ′-z i Calculate the difference sequence between any two dimensions across all dimensions, resulting in n difference sequences between two dimensions {Zs2-Zs1, Zs3-Zs2, ..., Zs}. n -Zs n-1 ,Zs1-Zs n}

[0044] In one embodiment, the original time series of the multidimensional electroencephalogram is transformed to obtain a first-order difference sequence, specifically as follows:

[0045] The difference between the EEG signals corresponding to adjacent sampling time points in each dimension of the original time series of the multidimensional EEG is calculated to obtain the first-order difference sequence of each dimension.

[0046] Specifically, in the original time series Z = {Zs1, Zs2, ..., Zs} of an n-dimensional electroencephalogram n A sequence Zs = {z1, z2, ..., z} of any chosen dimension. i ,…,z L}, calculate the differences between the EEG signals corresponding to all adjacent sampling time points of Zs to obtain the corresponding difference sequence Us={u1,u2,…,u i ,…,u L-1}, where u i =z i+1 -z i The sequence Us is the desired first-order difference sequence. Calculate the first-order difference sequence for each dimension to obtain the first-order difference sequence for each dimension. For first-order difference sequence transformations, please refer to... Figure 3 ,in, Figure 3 The raw time series of EEG involving two dimensions.

[0047] In one embodiment, the original time series of the multidimensional electroencephalogram (EEG) is transformed to obtain a Fourier sequence by performing a fast Fourier transform on the EEG signal of each dimension of the original time series of the multidimensional EEG to obtain a Fourier sequence for each dimension.

[0048] Specifically, in the current embodiment, a fast Fourier transform method will be used to convert the original time series of the multidimensional EEG into a Fourier sequence for each dimension.

[0049] In the above embodiments, the original time series is expanded in dimension by transforming it into a difference sequence between dimensions, a first-order difference sequence, and a Fourier sequence, so as to facilitate the extraction of richer interval features in the future.

[0050] S3. Extract a set number of subsequences from the inter-dimensional difference sequence, the first-order difference sequence of each dimension, and the Fourier sequence of each dimension to obtain the inter-dimensional difference subsequence set, the first-order difference subsequence set of each dimension, and the Fourier sequence set of each dimension.

[0051] In one embodiment, step S3 specifically involves:

[0052] S31. Determine the difference sequence between dimensions, the first difference sequence of each dimension, the number of subsequences in each sequence of the Fourier sequence of each dimension, the length of each subsequence, and the starting point of each subsequence. The number of subsequences is set according to the requirements, the starting point of each subsequence is the position of the first value of each subsequence in the corresponding sequence, and the starting point and length of each subsequence are random.

[0053] For example: the set of subsequences of n difference sequences between two dimensions is set as follows:

[0054]

[0055] Where n is the number of dimensions in the multidimensional EEG; A1,...,A n The number of subsequences in the difference sequence between each dimension can be set by setting the length of each sequence to the corresponding number of subsequences; A is the sequence of differences between the nth dimension. n The length of each subsequence; A is the sequence of differences between the nth dimension. n The starting point of each subsequence.

[0056] S32. Based on the number of subsequences, the length of each subsequence, and the starting point of each subsequence, extract a set number of subsequences from the inter-dimensional difference sequence, the first-order difference sequence of each dimension, and the Fourier sequence of each dimension.

[0057] For example, choose any sequence from the interdimensional difference sequence: Vs = {v1, v2, ..., v i ,…,v LThe number of subsequences is set to the length L of the original sequence. The starting point and length of each subsequence are randomly set. For example, if the starting point of one of the L subsequences is the second value in the sequence and the length is 3, this subsequence is {v2,v3,v4}.

[0058] S4. Extract features from the set of subsequences representing differences between dimensions, the set of first-order difference subsequences for each dimension, and the set of Fourier sequence sets for each dimension. These features include: mean, standard deviation, slope, interquartile range, maximum value, minimum value, positive 40% rate, and mutual information calculation. Then, fuse the features extracted from the three subsequence sets to obtain the fused features.

[0059] In one embodiment, the feature fusion of the three subsequence sets is specifically performed as follows: First, the features between the n dimensions are concatenated sequentially, reducing the feature dimension from (number of intervals L, number of dimensions n, number of features 8) to (L, n*8). Then, the features of each subsequence are concatenated sequentially, and the dimension of the fused feature is (L*n*8).

[0060] For details, please refer to Figure 4 , Figure 4 First, different intervals are selected across different dimensions, such as interval 1 and interval 2, and features are extracted from all dimensions of interval 1 and interval 2. Finally, all features are concatenated and fused. In the above embodiment, the selection of intervals and the extraction and fusion of features reduce the dimensionality from three dimensions to one dimension, completing the feature fusion and facilitating subsequent feature selection and classification.

[0061] S5. Use the extreme random tree algorithm to select features from the fused features to obtain important features;

[0062] In one embodiment, step S4 involves using an Extremely Randomized Trees (ARBR) algorithm to select important features by interval selection. This process includes: using ARBR training data, calculating an importance score for each feature through the ARBR model. Features with importance scores greater than a threshold are identified as important features, thus obtaining the important features.

[0063] Specifically, in the traditional decision tree construction process, the split of each node is based on an optimal threshold for the feature. However, in extreme random trees, the split point for each node is randomly selected. This means that at each node, a feature and a feature value are randomly chosen as the split point, rather than searching for the optimal split point. Secondly, in extreme random trees, for each node's split, instead of considering all possible features, a subset of features is randomly selected, and then a feature within that subset is chosen for the split.

[0064] S6. Classify the important features based on random forest to obtain EEG classification results for different health conditions.

[0065] In one embodiment, classifying important features based on a random forest involves: creating multiple subsets from the important feature dataset using random sampling; training a decision tree for each subset; and finally making predictions using majority voting.

[0066] Specifically, first, multiple subsets are created from the original training dataset using random sampling. For each subset, a decision tree is trained. This process is repeated multiple times, generating a new decision tree each time. When building each decision tree, a subset of features is randomly selected. For each node of each decision tree, instead of searching for the optimal splitting feature, the best split point is found among the randomly selected features. Each tree is independently trained to its maximum depth or until a stopping condition is met (e.g., the number of samples in a node falls below a certain threshold). Finally, the random forest makes predictions using majority voting. Each decision tree classifies the samples, and the random forest selects the class with the most votes as the final prediction.

[0067] Taking EEG classification based on the above embodiments as an example, the entire operation process can be referred to... Figure 5 To understand. From Figure 5 As is known, the EEG classification method based on subsequence features disclosed in this application first acquires an EEG dataset and uses it as the original sequence. This dataset is then transformed into a difference sequence between dimensions, a first-order difference sequence for each dimension, and a Fourier sequence for each dimension, resulting in the corresponding difference sequence, difference sequence, and Fourier sequence. Next, subsequence sets are constructed from the original sequence, difference sequence, difference sequence, and Fourier sequence obtained in the previous step. Subsequence features are then extracted and fused. Finally, an extreme random tree algorithm is used to select important features. The selected important features are then used to output the classification results based on a random forest classifier.

[0068] For experimental validation, two different datasets belonging to the EEG data category were selected. The HandMovementDirection dataset (HMD) was set to have 4 true classes and a sequence length of 400; the SelfRegulationSCP1 dataset (SRS1) was set to have 2 true classes and a sequence length of 896. Regarding model parameter settings, the number of extreme random trees was set to 300, and the number of random forest trees was set to 500.

[0069] During the verification process, this application also compared the classification accuracy of 10 existing network models, including HIVE-COTE2.0 (HC2), Time SeriesForest (TSF), The Diverse Representation Canonical Interval Forest (DrCIF), DynamicTime Warping Adaptive (DTWA), Generalized Random Shapelet Forest (gRFS), InceptionTime (IT), The Multiple Representation Sequence Learner (MrSEQL), WEASELplus Multivariate Unsupervised Symbols and dErivatives (MUSE), The ShapeletTransform Classifier (STC), The Temporal Dictionary Ensemble (TDE), and Shapelet-Neural Network (ShapeNet), with that of the model in this application. The results are shown in Table 1 below.

[0070] Table 1 Experimental Results and Comparison

[0071] HMD 0.473 0.486 0.527 0.203 0.419 0.365 0.27 0.365 0.392 0.378 0.676 SRS1 0.891 0.84 0.877 0.785 0.823 0.84 0.761 0.696 0.84 0.812 0.9

[0072] As shown in Table 1, the classification model constructed in this application, compared with traditional algorithms that use intervals, uses an efficient interval feature extraction and fusion method and innovatively uses extreme random trees for feature selection. It can achieve very high classification accuracy while obtaining fast classification efficiency. It also achieves excellent results compared with advanced methods in different fields.

[0073] In one exemplary embodiment, a computer-readable storage medium is included, which stores a computer program that, when executed by a processor, implements the above-described electroencephalogram (EEG) classification method.

[0074] Please see Figure 6 In one exemplary embodiment, the device further includes an electronic device including at least one processor, at least one memory, and at least one communication bus.

[0075] The memory stores a computer program, which includes computer-readable instructions. The processor calls the computer-readable instructions stored in the memory through a communication bus to execute the above-mentioned EEG classification method.

[0076] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for classifying electroencephalograms (EEGs), characterized in that, Includes the following steps: S1. Obtain the raw time sequence of the multidimensional electroencephalogram (EEG), wherein the raw time sequence of the multidimensional EEG is the time sequence signal of the EEG at different locations of the cerebral cortex under different conditions of the subject. S2. The original time series of the multidimensional EEG is transformed to obtain the inter-dimensional difference sequence, the first-order difference sequence of each dimension, and the Fourier sequence of each dimension. S3. Extract a set number of subsequences from the inter-dimensional difference sequence, the first-order difference sequence of each dimension, and the Fourier sequence of each dimension to obtain a set of inter-dimensional difference subsequences, a set of first-order difference subsequences of each dimension, and a set of Fourier sequences of each dimension. S4. Extract features from the set of subsequences of differences between dimensions, the set of first-order difference subsequences for each dimension, and the set of Fourier sequence sets for each dimension, and fuse the features extracted from the three subsequence sets to obtain the fused features. S5. Use the extreme random tree algorithm to select features from the fused features to obtain important features; S6. Classify the important features based on random forest to obtain EEG classification results for different health conditions; Step S3 is as follows: S31. Determine the number of subsequences in each sequence of the inter-dimensional difference sequence, the first-order difference sequence of each dimension, the Fourier sequence of each dimension, the length of each subsequence, and the starting point of each subsequence. The number of subsequences is set according to requirements, the starting point of each subsequence is the position of the first value of each subsequence in the corresponding sequence, and the starting point and length of each subsequence are random. S32. Based on the number of subsequences, the length of each subsequence, and the starting point of each subsequence, extract a set number of subsequences from the inter-dimensional difference sequence, the first-order difference sequence of each dimension, and the Fourier sequence of each dimension. In step S4, the features extracted from the three subsequence sets include: mean, standard deviation, slope, interquartile range, maximum value, minimum value, positive 40% rate, and mutual information calculation. The extreme random tree algorithm is used to select features from the fused features, and the important features are as follows: Using extreme random trees to train the data, an importance score is calculated for each feature through the extreme random tree model. Features with an importance score greater than a threshold are considered important features. The classification of important features based on random forest is specifically as follows: Multiple subsets are created from the important feature dataset using random sampling. For each subset, a decision tree is trained. When building each decision tree, a subset of features is randomly selected. For each node of each decision tree, the best split point is found among the randomly selected features. Each tree is trained independently until the stopping condition is met. Finally, classification prediction is performed by majority voting.

2. The electroencephalogram (EEG) classification method according to claim 1, characterized in that, The original time series of the multidimensional electroencephalogram was transformed to obtain the interdimensional difference sequence as follows: Calculate the difference between any two EEG signals in the original time series of a multidimensional EEG to obtain the interdimensional difference sequence.

3. The electroencephalogram (EEG) classification method according to claim 1, characterized in that, The original time series of the multidimensional electroencephalogram was transformed to obtain the first-order difference sequence as follows: The difference between the EEG signals corresponding to adjacent sampling time points in each dimension of the original time series of the multidimensional EEG is calculated to obtain the first-order difference sequence of each dimension.

4. The electroencephalogram (EEG) classification method according to claim 1, characterized in that, The original time series of the multidimensional electroencephalogram was transformed to obtain the Fourier sequence as follows: Fast Fourier Transform is performed on the EEG signals of each dimension of the original time series of multidimensional EEG to obtain the Fourier sequence of each dimension.

5. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the method as described in any one of claims 1-4.

6. An electronic device, characterized in that, The device includes a processor and a memory interconnected thereto, wherein the memory is used to store a computer program, the computer program including computer-readable instructions, and the processor is configured to invoke the computer-readable instructions to perform the method as described in any one of claims 1-4.