Electroencephalogram signal classification method based on ghost network and unbalanced learning and application

By combining Ghost networks and imbalanced learning methods, a class rebalancing loss function was designed and model parameters were optimized to solve the class imbalance problem in EEG signal classification, achieving more efficient feature extraction and classification accuracy.

CN115130524BActive Publication Date: 2026-01-06HEFEI UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210858327.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-20
Publication Date
2026-01-06
Estimated Expiration
2042-07-20

AI Technical Summary

Technical Problem

Existing technologies suffer from class imbalance in EEG signal classification, leading to overclassification by the classifier. Minority EEG samples are easily misclassified, and manual feature extraction is time-consuming, labor-intensive, and lacks versatility.

Method used

A brain signal classification method based on Ghost network and imbalanced learning is adopted. The model is optimized by combining a one-dimensional convolution module, a Ghost bottleneck module and a class rebalancing loss function. The integrated technical solution is as follows: a one-dimensional convolution module and a combined Ghost bottleneck module are used to design a class rebalancing loss function, adjust the logit value of the minority class, optimize the model parameters, and draw a suitable decision boundary.

Benefits of technology

It significantly improves the accuracy of EEG signal classification, solves the class imbalance problem, enhances the robustness and generalization ability of the model, and reduces the loss of feature information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115130524B_ABST
    Figure CN115130524B_ABST
Patent Text Reader

Abstract

The application discloses a kind of electroencephalogram signal classification method and application based on GhostNet and unbalanced learning, and its steps include:1, the original electroencephalogram data is preprocessed, including data selection, sliding window slicing and the selection of data input shape;2, establish the deep learning model based on unbalanced learning and Ghost network, initialize network parameter;3, embed a one-dimensional convolution layer in the head of model, establish the deep learning model of Ghost network;4, input data and through class rebalancing (CRB-loss) loss constantly optimize model parameter, obtain final classification model for the classification of electroencephalogram signal to be tested.The application combines cost-sensitive learning into GhostNet, can solve the problem of data unbalanced learning in electroencephalogram signal classification task, can significantly improve the classification accuracy of electroencephalogram signal, so as to increase the application value of electroencephalogram signal in medical field etc.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electroencephalogram (EEG) signal classification, specifically a method for predicting and classifying EEG signals using a Ghost network that incorporates imbalanced learning techniques. Background Technology

[0002] Electroencephalography (EEG) is a physiological technique used to record the electrical activity of the brain. Identifying and predicting physiological and psychological states from neural activity patterns observed in scalp and intracranial EEGs is widely used in brain-computer interface fields such as emotion recognition, motor imagery, and healthcare. Traditional machine learning methods, such as autoregressive coefficients and Lyapunov indices, have been manually extracted using linear or nonlinear features, achieving some success in strictly controlled experimental environments. However, these manually extracted features often require researchers to possess extensive expertise and conduct numerous experimental trials. Furthermore, in more realistic settings where various artifacts affect EEG recordings, manually extracted features often only cover a portion of the EEG information, resulting in poor system robustness.

[0003] Deep learning, with its excellent generalization ability and powerful capacity for automatically learning efficient features, has been widely applied in EEG signal classification and prediction. Currently, most deep learning methods for EEG signal classification rely on additional feature extraction processes before classification, such as short-time Fourier transform, wavelet transform, and common space patterns. While these preprocessing operations on the raw EEG data can yield "cleaner" data, the feature design process heavily relies on experts with extensive experience in the relevant domain and is a time-consuming and labor-intensive process. Furthermore, manually extracted features have poor generalizability.

[0004] Class imbalance occurs when a particular class of EEG samples is significantly fewer than those of other classes, a common problem in EEG applications. When class imbalance exists in the training data, the learned classifier may overclassify due to the increased prior probability of majority class EEG data, making minority class EEG samples more likely to be misclassified than majority class samples. Class imbalance has a significant negative impact on training traditional classifiers, including multilayer perceptrons. It affects convergence during training and the model's generalization on the test set. Previous studies have commonly used resampling strategies to address class imbalance; however, these methods not only require additional data processing but may also lose important information and lead to overfitting, severely limiting the performance of EEG signal classification methods. Summary of the Invention

[0005] To overcome the shortcomings mentioned above, this invention proposes a method and application for classifying EEG signals based on the Ghost model and imbalanced learning. This method aims to solve the problem of imbalanced raw EEG data in EEG signal classification tasks, facilitate the automatic extraction of efficient features by the model, significantly improve the accuracy of EEG signal classification, and increase the application value of EEG signals in fields such as medicine.

[0006] To achieve the above-mentioned objectives, the present invention adopts the following technical solution:

[0007] The present invention provides a method for classifying electroencephalogram (EEG) signals based on Ghost networks and imbalanced learning, characterized by the following steps:

[0008] Step 1: Obtain an EEG signal dataset with labeled category information, and perform channel data selection on the raw EEG signals in the dataset to obtain C channels of EEG signals. Then, slice the C channels of EEG signals using a sliding window, and reconstruct the input shape of the sliced ​​EEG signals to obtain N segments of EEG signal samples with a total duration of T, which constitute a training set D containing D types of EEG data. r And each class has N d There are 1 sample, denoted as _ .

[0009] Among them, X i,j ∈R c×w×h Y represents the i-th EEG signal sample in the j-th class. i,j For EEG signal sample X i,j The corresponding labels; c represents the number of channels in the EEG signal sample, w represents the width of the sliding window, and h represents the height of the EEG signal sample;

[0010] Step 2: Establish a Ghost network based on imbalanced model learning, including: a one-dimensional convolutional module Conv2D1, and M Ghost bottleneck modules G-bottleneck1, ..., G-bttleneck1. m G-bottlebck M Compression module, classification module; among them, G-bottleneck m This represents the m-th Ghost bottleneck module; m = 1, 2, ..., M;

[0011] The one-dimensional convolutional module Conv2D1 includes, in sequence: a first convolutional layer with stride s and kernel k×1, a first ReLU nonlinear activation function layer, a max pooling layer with kernel d, and a first batch normalization layer.

[0012] When the m-th Ghost bottleneck module G-bottleneck mWhen the stride s = 1, the backbone path is composed of two identical Ghos modules G-module1 and G-module2 connected in series. Each Ghos module consists of a standard convolution with a stride of d and a kernel of 1×1, and a grouped convolution with a stride of d′ and a kernel of 3×3.

[0013] When the m-th Ghost bottleneck module G-bottleneck m When the stride s = 2, the backbone path is composed of a channel convolution with a stride of s and a kernel of k connected in series between two identical Ghos modules G-module1 and G-module2.

[0014] The compression module sequentially includes: a convolutional layer with a 1×1 kernel and a stride of 1, a second batch normalization layer, a second ReLU nonlinear activation function, and an adaptive average pooling layer;

[0015] The classification module includes: two fully connected layers FC1 and FC2, a third batch normalization layer, and a third ReLU nonlinear activation function;

[0016] Step 2.1: Initialize the weights of all convolutional kernels in the Ghost network using kaiming_normal_.

[0017] Step 2.2: Input the i-th segment of the EEG signal sample X after shape reconstruction. i,j ∈R c×w×h The input is fed into the Ghost network, and after preliminary extraction and feature dimensionality reduction by the one-dimensional convolutional module Conv2D1, the first feature sequence is obtained. Where h′ represents the first feature sequence Height;

[0018] Step 2.3, the first feature sequence The second feature sequence is output after passing through M Ghost bottleneck modules in sequence. Where h″ represents the second feature sequence The height, and includes:

[0019] When m=1 and s=1, the first feature sequence Input the m-th Ghost bottleneck module G-bottleneck m The first Ghost module in G-module 1,m , the first feature sequence The number of channels is increased to c′ to obtain the hidden layer feature sequence. The hidden layer feature sequence Then input the m-th Ghost bottleneck module G-bottleneck m The second Ghost module, G-module 2,m ,right The dimensionality is reduced by the number of channels, so that the number of channels in the hidden layer feature sequence is restored to [value missing]. The number of channels is used to obtain the output feature map. and feature map and After splicing, the m-th Ghost bottleneck module G-bottleneck is obtained. m Output feature map

[0020] When m = 2 and s = 1, the (m-1)th Ghost bottleneck module G-bottleneck m-1 Output feature map Input the m-th Ghost bottleneck module G-bottleneck m The process is performed to obtain the output feature map.

[0021] When m = 3, 4, ..., M and s = 1, the (m-1)th Ghost bottleneck module G-bottleneck m-1 Output feature map With the (m-2)th Ghost bottleneck module G-bottleneck m-2 Output feature map Summing and then inputting the m-th Ghost bottleneck module G-bottleneck m The process is performed to obtain the output feature map.

[0022] When m=1 and s=2, the first characteristic sequence Input the m-th Ghost bottleneck module G-bottleneck m The first Ghost module in G-module 1,m , the first feature sequence The number of channels is increased to c′ to obtain the hidden layer feature sequence. The hidden layer feature sequence Then input the m-th Ghost bottleneck module G-bottleneck m The feature map is obtained by processing the channels through convolution. The feature map Then input the m-th Ghost bottleneck module T-bottleneck m The second Ghost module, G-module 2,mUsed for The dimensionality is reduced by the number of channels, so that the number of channels in the hidden layer feature sequence is restored to [value missing]. The number of channels is used to obtain the output feature map. and feature map and After splicing, the m-th Ghost bottleneck module G-bottleneck is obtained. m Output feature map

[0023] When m = 2 and s = 2, the (m-1)th Ghost bottleneck module G-bottleneck m-1 Output feature map Input the m-th Ghost bottleneck module G-bottleneck m The process is performed to obtain the output feature map.

[0024] When m = 3, 4, ..., M, and s = 2, the (m-1)th Ghost bottleneck module G-bottleneck m-1 Output feature map With the (m-2)th Ghost bottleneck module G-bottleneck m-2 Output feature map After summing, input the m-th Ghost bottleneck module G-bottleneck. m The process is performed to obtain the output feature map.

[0025] Step 2.4, the second feature sequence After being flattened by the convolutional layer, the second batch normalization layer, the second ReLU non-phenomenal activation function, and the adaptive average pooling layer in the compression module, the third feature sequence is obtained.

[0026] Step 2.5, Third Feature Sequence The input is processed by the classification module and then sequentially through the first fully connected layer Fc1 to obtain the i-th segment of EEG signal sample X. i,j ∈R c×w×h Score for each category i,j ∈R a ×b , where 'a' represents score i,j The width, b represents the score. i,j The height of the score i,jThe data is then processed sequentially through the third batch normalization layer, the third ReLU nonlinear activation function, and the second fully connected layer FC2 to obtain the final output value score′ of the Ghost network. i,j ∈R a×b Where b′ represents score′ i,j The height is such that b′ < b;

[0027] Step 2.6: Use the rebalancing loss function shown in equation (1) to establish the backpropagation loss function L:

[0028]

[0029] In equation (1), L i,j Let represent the loss of the i-th EEG signal sample in the j-th type of EEG signal, and obtain it from equation (2):

[0030]

[0031] In equation (2), α represents the first hyperparameter, p i,j X represents the i-th EEG signal sample in the j-th class. i,j The probability value belonging to class j is obtained from equation (3), and W represents the imbalance ratio of different classes of EEG signals, obtained from equation (4):

[0032]

[0033] In equation (3), z i,j X represents the i-th EEG signal sample of class j. i,j The logit value, where τ is the second hyperparameter;

[0034]

[0035] In equation (4), N max It is the training set D r The number of EEG signal samples with the most categories, N j It is the number of EEG signal samples of type j;

[0036] Step 3, Model Training:

[0037] Based on the training set D r The Ghost network is trained using the ADAM optimizer, and the loss function L is calculated. Training stops when the number of training iterations reaches a set number or the loss error is less than a set threshold, thereby obtaining the optimal classification model for classifying different EEG signals.

[0038] The present invention provides an electronic device, comprising a memory and a processor, wherein the memory is used to store a program that supports the processor in executing the electroencephalogram (EEG) signal classification method, and the processor is configured to execute the program stored in the memory.

[0039] The present invention discloses a computer-readable storage medium on which a computer program is stored, wherein the computer program is executed by a processor to perform the steps of the electroencephalogram (EEG) signal classification method.

[0040] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0041] 1. This invention proposes an end-to-end EEG signal state classification framework (GhostNet-CRBLF) that incorporates imbalanced learning techniques. Addressing the characteristic that the time dimension of raw EEG data is larger than the channel dimension, the Ghost network's structural design is improved: compared to traditional convolutional neural networks, the Ghost network structure introduces a one-dimensional convolutional module and a Ghost module. The one-dimensional convolutional layer is used to extract feature information in the time dimension of the EEG signal, while the Ghost module can more efficiently extract features at different scales of the EEG signal, avoiding the loss of feature information, thus achieving superior EEG state classification.

[0042] 2. This invention addresses the imbalance problem in EEG data by designing a class rebalancing loss function. This loss function does not require altering the distribution of the original EEG data. During the training phase, it assigns larger class weights to the classes with fewer EEG samples, forcing the model to fairly process EEG data from different classes. Furthermore, adjusting the logit values ​​of the minority classes of EEG samples helps the model draw a fairer decision boundary, resulting in better EEG signal classification performance. Attached Figure Description

[0043] Figure 1 This is a schematic diagram comparing the classification boundaries of the rebalancing loss and cross-entropy loss of this invention.

[0044] Figure 2 This is a schematic diagram of the electroencephalogram (EEG) signal classification method of the present invention;

[0045] Figure 3a This is a schematic diagram of the Ghost bottleneck with a step size of 1 in this invention;

[0046] Figure 3b This is a schematic diagram of the Ghost bottleneck structure with a step size of 2 in this invention;

[0047] Figure 4a This is a schematic diagram comparing the equivalent features generated by the Ghost module in this invention;

[0048] Figure 4b This is a schematic diagram comparing the equivalent features generated by standard convolution in existing technologies. Detailed Implementation

[0049] In this embodiment, an EEG signal classification method based on GhostNet and imbalanced learning mainly designs a class rebalancing loss function for imbalanced learning, such as... Figure 1 As shown in the diagram, this loss function, on the one hand, forces the Ghost network to fairly process pre-ictal and interictal samples by assigning larger class weights to the loss of minority samples and smaller weights to the loss of majority samples; on the other hand, it adjusts the logit value of minority class EEG samples. The class rebalancing loss function is used to calculate the loss of different classes of EEG samples, and the model parameters are continuously optimized during backpropagation to allow the model to draw more appropriate decision boundaries, thereby solving the class imbalance problem in EEG signal classification tasks and improving the model's classification performance. The implementation process of this method is as follows: Figure 2 As shown. Specifically, the method is carried out in the following steps:

[0050] Step 1: Obtain an EEG signal dataset with labeled category information, and perform channel data selection on the raw EEG signals in the dataset to obtain C channels of EEG signals. Then, slice the C channels of EEG signals using a sliding window, and reconstruct the input shape of the sliced ​​EEG signals to obtain N segments of EEG signal samples with a total duration of T, which constitute a training set D containing D types of EEG data. r And each class has N d There are 1 sample, denoted as _ .

[0051] Among them, X i,j ∈R c×w×h Y represents the i-th EEG signal sample in the j-th class. i,j For EEG signal sample X i,j The corresponding labels are: c represents the number of channels in the EEG signal sample, w represents the width of the sliding window, and h represents the height of the EEG signal sample. This method uses two publicly available EEG datasets: CHB-MIT and Kaggle. On the CHB-MIT EEG dataset, the number of channels is 22, the sliding window length is 4s, and the EEG signal sampling rate is 256Hz. On the Kaggle EEG dataset, the number of channels is 16, the sliding window length is 5.12s, and the EEG signal sampling rate is 400Hz.

[0052] Step 2: Establish a Ghost network based on model imbalance learning, including: a one-dimensional convolutional module, M Ghost bottleneck modules, a compression module, and a classification module;

[0053] The one-dimensional convolution module Cony2D1 includes: a first convolutional layer with a stride of 1 and a kernel size of 17×1, a first ReLU nonlinear activation function layer, a max pooling layer with a kernel size of d, and a first batch normalization layer;

[0054] like Figure 3a As shown, when the m-th Ghost bottleneck module G-bottleneck m When the step size s = 1, the main path consists of two identical Ghos modules G-module1 and G-module2 connected in series, where, for example Figure 4a and Figure 4b As shown, each Ghos module consists of a standard convolution with a stride of d (d = 1, 2) and a kernel of 1×1, and a grouped convolution with a stride of 1 and a kernel of 3×3.

[0055] like Figure 3b When the m-th Ghost bottleneck module G-bottleneck m When the stride s = 2, the backbone path is composed of a channel convolution with a stride of 2 and a kernel of k (k = 3, 5) connected in series between two identical Ghos modules G-module1 and G-module2.

[0056] The compression module includes, in sequence: a convolutional layer with a kernel of 1×1 and a stride of 1, a second batch normalization layer, a second ReLU nonlinear activation function, and an adaptive average pooling layer with a kernel of 1×1.

[0057] The classification module includes: two fully connected layers FC1 and FC2, a third batch normalization layer, and a third ReLU nonlinear activation function;

[0058] Step 2.1: Initialize the weights of all convolutional kernels in the Ghost network using kaiming_normal_.

[0059] Step 2.2: Input the i-th segment of the EEG signal sample X after shape reconstruction. i,j ∈R c×w×h The input is fed into the Ghost network and undergoes preliminary extraction and feature dimensionality reduction by the one-dimensional convolutional module Conv2D1 to obtain the first feature sequence. Where h′ represents the first feature sequence Height;

[0060] Step 2.3, Feature Sequence The second feature sequence is output after passing through M Ghost bottleneck modules in sequence. Where h″ represents the second feature sequence The height, and includes:

[0061] When m=1 and s=1, the first characteristic sequence Input the m-th Ghost bottleneck module G-bottleneck m The first Ghost module in G-module 1,m , the first feature sequence The number of channels is increased to c′ to obtain the hidden layer feature sequence. Hidden layer feature sequence Then input the m-th Ghost bottleneck module G-bottleneck m The second Ghost module, G-module 2,m ,right The dimensionality is reduced by the number of channels, so that the number of channels in the hidden layer feature sequence is restored to [value missing]. The number of channels is used to obtain the output feature map. and feature map and After splicing, the m-th Ghost bottleneck module G-bottleneck is obtained. m Output feature map

[0062] When m = 2 and s = 1, the (m-1)th Ghost bottleneck module G-bottleneck m-1 Output feature map Input the m-th Ghost bottleneck module G-bottleneck m The process is performed to obtain the output feature map.

[0063] When m = 3, 4, ..., M and s = 1, the (m-1)th Ghost bottleneck module G-bottleneck m-1 Output feature map With the (m-2)th Ghost bottleneck module G-bottleneck m-2 Output feature map Summing and then inputting the m-th Ghost bottleneck module G-bottleneck m The process is performed to obtain the output feature map.

[0064] When m=1 and s=2, the first characteristic sequence Input the m-th Ghost bottleneck module G-bottleneck m The first Ghost module in G-module 1,m , the first feature sequence The number of channels is increased to c′ to obtain the hidden layer feature sequence. Hidden layer feature sequence Then input the m-th Ghost bottleneck module G-bottleneck m The feature map is obtained by processing the channels through convolution. Feature map Then input the m-th Ghost bottleneck module G-bottleneck m The second Ghost module, G-module 2,m ,right The dimensionality is reduced by the number of channels, so that the number of channels in the hidden layer feature sequence is restored to [value missing]. The number of channels is used to obtain the output feature map. and feature map and After splicing, the m-th Ghost bottleneck module G-bottleneck is obtained. m Output feature map

[0065] When m = 2 and s = 2, the (m-1)th Ghost bottleneck module G-bottleneck m-1 Output feature map Input the m-th Ghost bottleneck module G-bottleneck m The process is performed to obtain the output feature map.

[0066] When m = 3, 4, ..., M, and s = 2, the (m-1)th Ghost bottleneck module G-bottleneck m-1 Output feature map With the (m-2)th Ghost bottleneck module G-bottleneck m-2 Output feature map After summing, input the m-th Ghost bottleneck module G-bottleneck. m The process is performed to obtain the output feature map.

[0067] Step 2.4, Second Feature Sequence After being flattened by the convolutional layer, the second batch normalization layer, the second ReLU non-phenomenal activation function, and the adaptive average pooling layer in the compression module, the third feature sequence is obtained.

[0068] Step 2.5, Third Feature Sequence The input is processed by the classification module and sequentially through the first fully connected layer FC1 to obtain the i-th segment of EEG signal sample X. i,j ∈R c×w×hScore for each category i,j ∈R a ×b , where 'a' represents score i,j The width, b represents the score. i,j The height of the score i,j The data is then processed sequentially through the third batch normalization layer, the third ReLU nonlinear activation function, and the second fully connected layer FC2 to obtain the final output value score′ of the Ghost network. i,j ∈R a×b Where b′ represents score′ i,j The height of b is also the number of network output categories, and b′ < b;

[0069] Step 2.6: Use the rebalancing loss function shown in equation (1) to establish the backpropagation loss function L:

[0070]

[0071] In equation (1), L i,j Let represent the loss of the i-th EEG signal sample in the j-th type of EEG signal, and obtain it from equation (2):

[0072]

[0073] In equation (2), α represents the first hyperparameter, which is typically 2 in CHB-MIT in this invention and 1.5 on the Kaggle dataset. i,j X represents the i-th EEG signal sample in the j-th class. i,j The probability value belonging to class j is obtained from equation (3), and W represents the imbalance ratio of different classes of EEG signals, obtained from equation (4):

[0074]

[0075] In equation (3), z i,j X represents the i-th EEG signal sample of class j. i,j The logit value, τ is the second hyperparameter, which is usually set to 1 and 1.2 on the CHB-MIT and Kaggle datasets in this invention, respectively;

[0076]

[0077] In equation (4), N max It is the training set D r The number of EEG signal samples with the most categories, N j It is the number of EEG signal samples of type j.

[0078] Step 3, Model Training:

[0079] This invention employs leave-one-out cross-validation to evaluate model performance based on the training set. Specifically, for a data segment containing T hours of interphase state data and N pre-EEG state markers, the entire interphase state data of the EEG signal is divided into N equal segments, each with a length of [missing information]. Hours, then, the interphase state data of each segment and the data of M pre-EEG state markers are randomly combined, each sample contains Hours of interictal EEG data and one preictal EEG state-labeled data were used to obtain N pairs of preictal and interictal segment combinations. In each experiment, one segment combination was used as the test set, and the remaining N-1 segments were used as the training set. This was repeated N times to ensure that all segment combinations were used in the experiments, until all segment combinations had served as the test set exactly once. During the model training phase, class rebalancing loss was used as the loss function, and the ADAM optimizer was used to train the Ghost network. The gradient of the loss function was calculated to update the network parameters until the maximum number of iterations was reached or the loss function converged, thus obtaining a trained EEG signal classification model. In this example, the batch size was set to 35, and the initial learning rate of the ADAM optimizer was set to 0.001. In addition, an early stopping technique was applied: if the validation error did not decrease for 10 training epochs, the model training was stopped, and the final classification model was obtained.

[0080] The imbalanced learning technique in this invention was tested on the publicly available datasets CHB-MIT and Kaggle. Based on the Ghost network, the proposed class rebalancing loss was compared with representative imbalance resampling strategies as baseline methods to verify the effectiveness of the proposed loss function in solving imbalanced classification problems. In this embodiment, four widely used evaluation metrics are used to measure model performance. Sensitivity (Sn) is the ratio of correctly predicted epilepsy cases (at least 8 out of 10 consecutive samples are identified as pre-seizure samples) to the total number of epileptic seizure cases. False positive rate (FPR) is defined as the number of incorrect predictions per hour. AUC is an important indicator of the accurate balancing model's predictive performance; a random classifier has an AUC of 0.5, while a perfect classifier can achieve an AUC of 1. The p-value measures whether the model outperforms the random classifier; a p-value less than 0.05 indicates that, at a significance level of 0.05, the model of this invention significantly outperforms the random classifier. Table 1 shows a performance comparison of class rebalancing loss and upsampling strategies on the CHMB-MIT database; Table 2 shows a performance comparison between the class rebalancing loss proposed in this invention and cross-entropy loss when applied to the Kaggle dataset. Experiments show that the class rebalancing loss proposed in this invention can effectively solve the data imbalance problem in classification prediction tasks, significantly improving classification prediction performance, verifying the effectiveness of the proposed method, and further demonstrating that this method enables the model to have better recognition ability and stronger generalization performance for subjects. Furthermore, the proposed class rebalancing loss does not require an additional training process and can be easily embedded into other models, demonstrating the versatility of the proposed method.

[0081] Table 1. Average performance of baseline models for EEG signal classification on the CHB-MIT database.

[0082]

[0083]

[0084] Table 2. Average performance of the baseline model for EEG signal classification on the raw Kaggle dataset.

[0085]

[0086] In summary, this invention fully utilizes the rich EEG information contained in the raw EEG signals, employs the efficient Ghost module to extract abundant feature information, and combines cost-sensitive learning techniques to improve the reliability and predictive performance of the model. The Ghost module in the Ghost network uses a more cost-effective method to obtain feature maps, which can significantly reduce network complexity and further improve model performance, achieving faster and more accurate EEG signal classification.

Claims

1. A method for electroencephalogram signal classification based on Ghost network and imbalanced learning, characterized in that, is performed as follows: Step 1, obtain an electroencephalogram signal dataset with labeled class information, and perform channel data selection on original electroencephalogram signals in the electroencephalogram signal dataset to obtain C-channel electroencephalogram signals, then slice the C-channel electroencephalogram signals through a sliding window, and reconstruct the input shape of the sliced electroencephalogram signals, thereby obtaining N electroencephalogram signal samples with a total time length of T and constituting a training set D of D-class electroencephalogram data r , and each class has N d samples, denoted as wherein X i,j ∈R c ×w×h represents the i-th electroencephalogram signal sample in the j-th category, Y i,j is a label corresponding to the electroencephalogram signal sample X i,j ; c represents a number of channels of the electroencephalogram signal sample, w represents a width of a sliding window, and h represents a height of the electroencephalogram signal sample. Step 2, establish a Ghost network based on model imbalance learning, including: a one-dimensional convolution module Conv2D1, M Ghost bottleneck modules G-bottleneck1,..., G-bttleneck m ,..., G-bottlebck M , a compression module, a classification module; wherein G-bottleneck m represents the mth Ghost bottleneck module; m = 1, 2,..., M; The one-dimensional convolution module Conv2D1 comprises, in sequence, a first convolution layer with a step s and a convolution kernel k x 1, a first ReLU nonlinear activation function layer, a maximum pooling layer with a convolution kernel d, and a first batch normalization layer; When the step size s = 1 of the mth Ghost bottleneck module G-bottleneck m , the main path is composed of two identical Ghost modules G-module1, G-module2 in series, wherein each Ghost module is composed of a standard convolution with a step size d and a convolution kernel of 1x1 and a grouped convolution with a step size d' and a convolution kernel of 3x3. When the step s = 2 of the mth Ghost bottleneck module G-bottleneck m The main passage is composed of a channel convolution with a step s and a convolution kernel k in series between two identical Ghost modules G-module1, G-module2. The compression module comprises, in sequence, a convolution layer with a convolution kernel 1 x 1 and a step 1, a second batch normalization layer, a second ReLU nonlinear activation function, and an adaptive average value pooling layer; The classification module comprises two fully connected layers FC1 and FC2, a third batch normalization layer, and a third ReLU nonlinear activation function; Step 2.1, using kaiming_normal_ to initialize the weights of all convolution kernels in the Ghost network; Step 2.2, reconstruct the input shape of the i-th segment of the electroencephalogram signal sample X i,j ∈R c×w×h Input into the Ghost network, and after the preliminary extraction and feature dimension reduction of the one-dimensional convolution module Conv2D1, the first feature sequence is obtained Where h' represents the height of the first feature sequence ​ Step 2.3, the first feature sequence Output the second feature sequence after sequentially passing through M Ghost bottleneck modules wherein h" represents the height of the second feature sequence and comprising: when m = 1 and s = 1, the first feature sequence input the first Ghost module G-module in the mth Ghost bottleneck module G-bottleneck m , 1,m , amplify the channel number of the first feature sequence to c', to obtain a hidden layer feature sequence , input the second Ghost module G-module in the mth Ghost bottleneck module G-bottleneck m , 2,m , reduce the channel number of , so that the channel number of the hidden layer feature sequence returns to the channel number of , to obtain an output feature map , and are spliced to form an output feature map of the mth Ghost bottleneck module G-bottleneck m ​ When m = 2 and s = 1, the output feature map of the m-1th Ghost bottleneck module G-bottleneck m-1 input the mth Ghost bottleneck module G-bottleneck m and obtain an output feature map ​ When m = 3, 4, …, M and s = 1, the output feature map of the m-1th Ghost bottleneck module G-bottleneck m-1 is input into the mth Ghost bottleneck module G-bottleneck for processing, and an output feature map is obtained m-2 When m = 3, 4, …, M and s = 1, the output feature map of the m-1th Ghost bottleneck module G-bottleneck m-1 is input into the mth Ghost bottleneck module G-bottleneck for processing, and an output feature map is obtained m When m = 3, 4, …, M and s = 1, the output feature map of the m-1th Ghost bottleneck module G-bottleneck m-1 is input into the mth Ghost bottleneck module G-bottleneck for processing, and an output feature map is obtained When m=1 and s=2, the first characteristic sequence Input the m-th Ghost bottleneck module G-bottleneck m The first Ghost module in G-module 1,m , the first feature sequence The number of channels is increased to c′ to obtain the hidden layer feature sequence. The hidden layer feature sequence Then input the m-th Ghost bottleneck module G-bottleneck m The feature map is obtained by processing the channels through convolution. The feature map Then input the m-th Ghost bottleneck module T-bottleneck m The second Ghost module, G-module 2,m Used for The dimensionality is reduced by the number of channels, so that the number of channels in the hidden layer feature sequence is restored to [value missing]. The number of channels is used to obtain the output feature map. and feature map and After splicing, the m-th Ghost bottleneck module G-bottleneck is obtained. m Output feature map When m = 2 and s = 2, the output feature map of the m-1th Ghost bottleneck module G-bottleneck m-1 is input into the mth Ghost bottleneck module G-bottleneck m for processing, and an output feature map ​ When m = 3, 4, ..., M, and s = 2, the (m-1)th Ghost bottleneck module G-bottleneck m-1 Output feature map With the (m-2)th Ghost bottleneck module G-bottleneck m-2 Output feature map After summing, input the m-th Ghost bottleneck module G-bottleneck. m The process is performed to obtain the output feature map. Step 2.4, the second feature sequence After sequentially passing through a convolutional layer, a second batch normalization layer, a second ReLU non-satiation activation function, and a flattening process of an adaptive average value pooling layer in the compression module, a third feature sequence is obtained Step 2.5, Third Feature Sequence The input is processed by the classification module and sequentially through the first fully connected layer FC1 to obtain the i-th segment of EEG signal sample X. i,j ∈R c×w×h Score for each category i,j ∈R a×b , where 'a' represents score i,j The width, b represents the score. i,j The height of the score i,j The data is then processed sequentially through the third batch normalization layer, the third ReLU nonlinear activation function, and the second fully connected layer FC2 to obtain the final output value score′ of the Ghost network. i,j ∈R a×b′ Where b′ represents score′ i,j The height is such that b′ < b; Step 2.6, using the class re-balancing loss function shown in formula (1) to establish the loss function L for back propagation: In formula (1), L i,j represents the loss of the i-th electroencephalogram signal sample in the j-th type of electroencephalogram signal, and is obtained by formula (2): In formula (2), a represents a first hyperparameter, p i,j represents the i-th electroencephalogram signal sample X in the j-th class i,j is a probability value belonging to the j-th class, and is obtained by formula (3), and W represents an imbalance ratio of different classes of electroencephalogram signals, and is obtained by formula (4): In formula (3), z i,j represents the logit value of the ith electroencephalogram signal sample X i,j of the jth type, and τ is a second hyperparameter; In formula (4), N max is the number of electroencephalogram samples of the most categories in the training set D r , N j is the number of electroencephalogram samples of the jth category. Step 3, model training: Based on the training set D r , the Ghost network is trained by using an ADAM optimizer, and a loss function L is calculated. When the number of training iterations reaches a set number or the loss error is less than a set threshold, the training stops, thereby obtaining an optimal classification model for realizing classification of different electroencephalogram signals.

2. An electronic device comprising a memory and a processor, characterized in that The memory is configured to store a program supporting the processor to execute the electroencephalogram signal classification method of claim 1, and the processor is configured to execute the program stored in the memory.

3. A computer-readable storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to perform the steps of the electroencephalogram signal classification method of claim 1.