A motor imagery prediction method and medium based on electroencephalogram signals

By performing wavelet denoising and hierarchical thresholding on EEG signals, and combining this with a graph convolutional neural network model to analyze topological relationships, the problem of insufficient accuracy in EEG signal classification in existing technologies has been solved, achieving higher classification accuracy and faster model convergence.

CN116919425BActive Publication Date: 2026-04-24CHENGDU KINESIOLOGY UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHENGDU KINESIOLOGY UNIVERSITY
Filing Date
2023-02-23
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing EEG decoding methods fail to effectively utilize the topological relationships between EEG leads, resulting in insufficient classification accuracy.

Method used

We preprocessed the raw EEG signals using a combination of wavelet denoising and hierarchical thresholding. We then analyzed the functional topological relationships of the EEG electrodes using a graph convolutional neural network model, constructed a topological graph using the Laplacian matrix, and calculated a contrastive loss function to promote unsupervised contrastive learning and improve classification accuracy.

Benefits of technology

With the same dataset and training settings, classification accuracy was improved, the number of iterations was reduced, and faster model convergence was achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116919425B_ABST
    Figure CN116919425B_ABST
Patent Text Reader

Abstract

The application discloses a motor imagery prediction method and medium based on electroencephalogram signals, and comprises the following steps: acquiring multi-channel original electroencephalogram signals based on motor imagery, inputting the reconstructed electroencephalogram signals into a graph convolutional neural network model for classification prediction; constructing a Laplacian matrix, obtaining a Laplacian graph through the Laplacian matrix, and inputting the Laplacian graph into the graph convolutional neural network model for classification prediction; calculating a contrast loss function, promoting unsupervised contrast learning by using the contrast loss function, and stopping until the model training iteration converges; and using the trained graph convolutional neural model for classification prediction. The Laplacian graph with a functional topological relationship is input into the graph convolutional neural network model for classification prediction, the information interaction between brain regions is taken as a consideration factor for classification prediction, and the classification accuracy is improved; the contrast loss function is used to promote unsupervised contrast learning, promote the learning of the behavior classifier, and accelerate the iteration convergence speed of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data processing technology, specifically relating to a method and medium for predicting motor imagery based on electroencephalogram (EEG) signals. Background Technology

[0002] Electroencephalogram (EEG) is a simple, flexible, and non-invasive method for monitoring the brain. Motor imagery recognition based on EEG signals is a key technology determining the performance of motor imagery brain-computer interface (BCI) systems. Motor imagery BCIs require collecting EEG signals from subjects performing specific motor imagery tasks, identifying the content of the motor imagery based on the EEG signals, and then converting the identification results into commands to control peripheral devices. EEG signals are characterized by low signal-to-noise ratio and low spatial resolution; therefore, extracting effective discriminative features from EEG is crucial for the success of a motor imagery recognition system.

[0003] Traditional methods for decoding motor imagery EEG signals involve manually designing features from the EEG signal, such as through analysis of intrinsic mode functions or wavelet transforms, and then using machine learning-based methods to classify these features. While these techniques have shown some performance in classification accuracy, the overall classification accuracy remains unsatisfactory. The main problem with these methods is that they do not consider the topological relationships between EEG leads when decoding EEG signals, i.e., they do not account for the information exchange between brain regions, thus resulting in classification accuracy that falls short of expectations. Summary of the Invention

[0004] The purpose of this invention is to provide a method and medium for predicting motor imagery based on electroencephalogram (EEG) signals, in order to solve the technical problem that existing EEG decoding methods do not consider the topological relationship between EEG leads when decoding EEG signals, i.e., they do not consider the information interaction between brain regions, thus resulting in the classification accuracy failing to achieve the expected results.

[0005] To achieve the above objectives, the present invention adopts the following technical solution:

[0006] The first aspect provides a method for predicting motor imagery based on electroencephalogram (EEG) signals, including:

[0007] Multi-channel raw EEG signals based on motor imagery are acquired. Wavelet denoising and hierarchical thresholding are combined to denoise and reconstruct the raw EEG signals. The reconstructed EEG signals are then used as the first signal to be input into a graph convolutional neural network model for classification and prediction.

[0008] A Laplacian matrix is ​​constructed using the reconstructed EEG signal. A Laplacian graph containing the functional topological relationships between the electrodes of the EEG is obtained through the Laplacian matrix. The Laplacian graph is then used as a second signal to be input into the graph convolutional neural network model for classification and prediction.

[0009] The contrastive loss function is calculated using the prediction results of the first signal and the prediction results of the second signal by the graph convolutional neural network model. The contrastive loss function is then used to promote unsupervised contrastive learning until the model training iteration converges.

[0010] We used a trained graph convolutional neural model to classify and predict motor imagery labels on EEG signals in the form of Laplace graphs.

[0011] In one possible design, a combination of wavelet denoising and hierarchical thresholding is used to denoise and reconstruct the original EEG signal, including:

[0012] The original EEG signal is decomposed into multiple frequency bands by wavelet transform, thereby achieving preliminary noise reduction of the original EEG signal;

[0013] Wavelet packet decomposition is performed on the local coefficients of each frequency band after preliminary noise reduction to obtain multi-layered wavelet nodes;

[0014] Thresholding is applied to each wavelet node in each layer to achieve secondary noise reduction of the EEG signal. The wavelet packet coefficients after secondary noise reduction are then reconstructed to obtain the reconstructed signal of each wavelet node.

[0015] In one possible design, the Laplace matrix is ​​constructed using the reconstructed EEG signals, including:

[0016] The linear correlation between EEG signals from each electrode channel was calculated using the Pearson correlation coefficient algorithm to obtain the absolute Pearson correlation coefficient matrix. ,in, absolute value ;

[0017] Undirected weighted graphs were constructed using the reconstructed EEG signals. ,in, This represents the number of nodes in the undirected weighted graph, i.e., the number of multi-channel electrodes. Represents the edges that connect nodes. A weighted adjacency matrix representing the correlation between pairs of nodes. , Represents the identity matrix;

[0018] The weighted adjacency matrix based on the correlation between each pair of nodes Calculate the degree matrix of an undirected weighted graph. The calculation formula is as follows:

[0019] (1)

[0020] in, The degree matrix represents the first degree. The first electrode diagonal elements, Indicates the number of electrodes. Indicates the first The node and the first A weighted adjacency matrix of correlations between nodes;

[0021] Based on the degree matrix of the undirected weighted graph The weighted adjacency matrix of correlations between pairs of nodes Construct the Laplace matrix as follows:

[0022] (2).

[0023] In one possible design, the Laplace matrix is ​​used to obtain a Laplace diagram containing the functional topological relationships between the electrodes of the electroencephalogram, including:

[0024] Normalizing the Laplace matrix yields a Laplace plot containing the functional topological relationships between the electrodes of the EEG, as follows:

[0025] (3)

[0026] in, express The identity matrix of the electrodes.

[0027] In one possible design, when the graph convolutional neural network model performs classification prediction on the Laplacian graph, the convolution formula of the graph convolutional neural network model on the Laplacian graph is as follows:

[0028] (4)

[0029] in, This represents the signal obtained by performing a Fourier transform on the Laplace plot. Represents an undirected weighted graph. Represents a nonparametric convolution filter. Represents a set of Chebyshev coefficients. Denotes the order of the Chebyshev polynomial. Indicates in Calculated in Chebyshev coefficient, This represents a diagonal matrix with scaled eigenvalues. The diag function represents the Fourier frequency. This represents a Laplace diagram.

[0030] In one possible design, when the graph convolutional neural network model performs classification prediction on the Laplacian graph, the graph convolutional neural network model uses the Graclus multi-level clustering algorithm to cluster each node of the Laplacian graph, and uses a greedy algorithm to calculate the continuity coarseness of the Laplacian graph, so as to minimize the clustering objective of each node.

[0031] In one possible design, a greedy algorithm is used to calculate the continuous coarseness of the Laplacian graph, including:

[0032] Step (1): Select an unmarked node from the Laplace graph. and the unmarked nodes With unlabeled neighboring nodes The unmarked neighbor nodes are matched. The local normalization cut needs to be maximized, and the cut formula is as follows: ,in, Represents a node and nodes The edge weights between them and These represent the coarsening nodes and the nodes respectively. and nodes The distance between them;

[0033] Step (2): Nodes and nodes Mark the nodes and use the sum of the weights of the two nodes as the weight value of the coarsened node;

[0034] Repeat steps (1) and (2) for all nodes in the Laplace graph to obtain the continuous thickness of the Laplace graph.

[0035] In one possible design, when the graph convolutional neural network model performs classification prediction on the Laplacian graph, the model derives the classification prediction result through a softmax function, the formula of which is as follows:

[0036] (5)

[0037] in, Indicates the first Predicted probability of a motion imagery task Indicates the number of motion imagery tasks;

[0038] The graph convolutional neural network model uses the L2 regularization formula to calculate the loss function, as follows:

[0039] (6)

[0040] in, This indicates a task involving imagining movement. Represents network model parameters, Indicates the number of parameters. This represents the weight decay rate.

[0041] In one possible design, a contrastive loss function is calculated using the prediction results of the first signal and the prediction results of the second signal from the graph convolutional neural network model. The calculation formula is as follows:

[0042] (7)

[0043] in, This indicates the prediction result of the first signal. This indicates the prediction result of the second signal. Let this be a set of vectors, where the vectors in the set are those extracted from the current training batch. The prediction result of the corresponding second signal, express A vector in , Indicates hyperparameters, and .

[0044] The second aspect provides a motor imagery prediction system based on electroencephalogram (EEG) signals, including:

[0045] The first prediction module is used to acquire multi-channel raw EEG signals based on motor imagery, and to perform noise reduction and signal reconstruction on the raw EEG signals using a combination of wavelet denoising and hierarchical thresholding. The reconstructed EEG signals are then used as the first signal to be input into the graph convolutional neural network model for classification and prediction.

[0046] The second prediction module is used to construct a Laplacian matrix using the reconstructed EEG signal, obtain a Laplacian graph containing the functional topological relationships between the electrodes of the EEG through the Laplacian matrix, and input the Laplacian graph as a second signal into the graph convolutional neural network model for classification prediction.

[0047] The contrastive learning module is used to calculate the contrastive loss function using the prediction results of the graph convolutional neural network model for the first signal and the prediction results for the second signal, and to use the contrastive loss function to promote unsupervised contrastive learning until the model training iteration converges.

[0048] The third prediction module is used to classify and predict the motor imagery labels of EEG signals in the form of Laplace graphs using a trained graph convolutional neural model.

[0049] Thirdly, the present invention provides a computer device comprising a memory, a processor, and a transceiver connected in sequence and communication, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the motion imagery prediction method based on electroencephalogram signals as described in any possible design of the first aspect.

[0050] Fourthly, the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, perform the motor imagery prediction method based on electroencephalogram signals as described in any possible design of the first aspect.

[0051] Fifthly, the present invention provides a computer program product containing instructions that, when the instructions are executed on a computer, cause the computer to perform the motor imagery prediction method based on electroencephalogram signals as described in any possible design of the first aspect.

[0052] The advantages of this invention compared to the prior art are as follows:

[0053] This invention acquires multi-channel raw EEG signals based on motor imagery, and uses a combination of wavelet denoising and hierarchical thresholding to denoise and reconstruct the raw EEG signals. The reconstructed EEG signals are then input as the first signal into a graph convolutional neural network (GNN) model for classification prediction. A Laplacian matrix is ​​constructed using the reconstructed EEG signals, and a Laplacian graph containing the functional topological relationships between the EEG electrodes is obtained from the Laplacian matrix. This Laplacian graph is then input as the second signal into the GNN model for classification prediction. A contrastive loss function is calculated using the prediction results of the first and second signals from the GNN model, and this contrastive loss function is used to promote unsupervised contrastive learning until the model training iteratively converges. Finally, the trained GNN model is used to classify and predict the motor imagery labels of the EEG signals in the form of the Laplacian graph. This invention preprocesses raw EEG signals and inputs them into a graph convolutional neural network (GNN) model for classification prediction. It analyzes the functional topological relationships between EEG electrodes and inputs the Laplacian graphs representing these relationships into the GNN model for classification prediction. This incorporates information interaction between brain regions as a factor in classification prediction, thereby improving accuracy. A contrastive loss function is calculated based on the predicted results, promoting unsupervised contrastive learning and accelerating the learning of the behavior classifier. This speeds up model convergence, resulting in higher classification accuracy with fewer iterations required to achieve convergence under the same dataset and training settings. Attached Figure Description

[0054] Figure 1 This is a flowchart of the motor imagery prediction method based on electroencephalogram (EEG) signals in the embodiments of this application. Detailed Implementation

[0055] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in conjunction with the accompanying drawings and descriptions of the embodiments or the prior art. Obviously, the following description of the structure of the accompanying drawings is only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. It should be noted that the description of these embodiments is for the purpose of helping to understand the present invention, but does not constitute a limitation of the present invention.

[0056] Example

[0057] To address the technical problem that existing EEG decoding methods fail to consider the topological relationships between EEG leads, i.e., the information interaction between brain regions, resulting in suboptimal classification accuracy, this application provides a motor imagery prediction method based on EEG signals. This method preprocesses the raw EEG signals and inputs them into a graph convolutional neural network (GNN) model for classification prediction. It analyzes the functional topological relationships of the EEG electrodes and inputs the Laplacian graphs representing these relationships into the GNN model for classification prediction, thus incorporating the information interaction between brain regions as a factor in classification prediction to improve accuracy. A contrastive loss function is calculated based on the predicted results, promoting unsupervised contrastive learning and accelerating the learning of the behavior classifier. This speeds up model iteration and convergence, achieving higher classification accuracy with fewer iterations under the same dataset and training settings.

[0058] The method for predicting motor imagery based on electroencephalogram (EEG) signals provided in the embodiments of this application will be described in detail below.

[0059] It should be noted that the motor imagery prediction method based on EEG signals provided in this application can be applied to any terminal device using an operating system. The operating system includes, but is not limited to, Windows, Mac, Linux, Chrome OS, UNIX, iOS, and Android systems, etc., and is not limited here. The terminal device includes, but is not limited to, iPads, personal mobile computers, industrial computers, and personal computers, etc., and is not limited here. For ease of description, unless otherwise specified, the embodiments in this application are described using an industrial computer as the execution subject. It is understood that the execution subject does not constitute a limitation on the embodiments of this application, and other types of terminal devices may be used as the execution subject in some other embodiments.

[0060] like Figure 1 As shown, the motor imagery prediction method based on EEG signals includes, but is not limited to, steps S1-S4:

[0061] Step S1. Obtain multi-channel raw EEG signals based on motor imagery, and use a combination of wavelet denoising and hierarchical thresholding to denoise and reconstruct the raw EEG signals. Then, input the reconstructed EEG signals as the first signal into the graph convolutional neural network model for classification and prediction.

[0062] In this embodiment, raw EEG signals from 64 electrodes (i.e., 64 channels) can be collected based on the international 10-10 system. These raw EEG signals include signals from multiple motor imagery tasks, such as imagining left leg movement, right leg movement, left arm movement, right arm movement, both arm movement, and both foot movement, etc., without limitation. Preferably, this embodiment sets a sampling rate of 160Hz and 4 seconds of EEG signal, or a sampling rate of 0-125Hz and 3 seconds of EEG signal, and resamples the data to 250Hz. More preferably, unlike the traditional method of sampling using time windows (i.e., segments of time points), considering the complexity of brain signals and the constant changes in brain state, this embodiment uses each time point as a sampling point to accurately map the real-time state of the brain to the motor imagery task. Compared with the traditional method of sampling using time windows, this embodiment has temporal resolution and better reflects the true motor imagery state of the brain.

[0063] In one possible design of step S1, a combination of wavelet denoising and hierarchical thresholding is used to denoise and reconstruct the original EEG signal, including:

[0064] (1) The original EEG signal is decomposed into multiple frequency bands by wavelet transform to achieve preliminary noise reduction of the original EEG signal;

[0065] It should be noted that wavelet transform can compensate for the limitation of Fourier analysis in not being able to obtain both time and frequency domain resolution simultaneously. Essentially, Fourier transform uses infinitely long trigonometric functions as basis functions to convolve with the original EEG signal and decompose it into a spectrum. Wavelet transform, on the other hand, convolves finite-length, attenuating wavelet basis functions with the signal to obtain the time spectrum of the signal.

[0066] Wavelet packet decomposition is performed on the local coefficients of each frequency band after preliminary noise reduction to obtain multi-layered wavelet nodes;

[0067] It should be noted that wavelet packet decomposition can overcome the problem that wavelet decomposition has poor frequency resolution in the high-frequency band and poor time resolution in the low-frequency band. Wavelet packet decomposition can provide a more refined decomposition of the high-frequency part, and this decomposition method has neither redundancy nor omission, making it a more refined signal analysis method.

[0068] Thresholding is applied to each wavelet node in each layer to achieve secondary noise reduction of the EEG signal. The wavelet packet coefficients after secondary noise reduction are then reconstructed to obtain the reconstructed signal of each wavelet node.

[0069] It should be noted that thresholding refers to determining the threshold of noise in wavelet coefficients, and then using a threshold function to filter the noisy wavelet coefficients. Those below the threshold are considered noise, and those above the threshold are considered signals.

[0070] Based on the above-disclosed content, after using wavelet denoising, further wavelet packet decomposition is performed on the local coefficients, and thresholding is applied hierarchically, which can achieve better denoising results while preserving necessary signal details and greatly reducing the computational workload. Preferably, the embodiments of this application use the coif4 wavelet function.

[0071] Step S2. Construct a Laplacian matrix using the reconstructed EEG signal, obtain a Laplacian graph containing the functional topological relationships between the electrodes of the EEG using the Laplacian matrix, and input the Laplacian graph as a second signal into the graph convolutional neural network model for classification and prediction;

[0072] In one possible design of step S2, the Laplace matrix is ​​constructed using the reconstructed EEG signals, including:

[0073] (1) The linear correlation between the EEG signals of each electrode channel was calculated based on the Pearson correlation coefficient algorithm to obtain the absolute Pearson correlation coefficient matrix. ,in, absolute value ;

[0074] It should be noted that the Pearson correlation coefficient algorithm used in this embodiment is an existing algorithm formula and principle. Therefore, how to use the Pearson correlation coefficient algorithm to calculate the linear correlation between the EEG signals of each electrode channel will not be described here.

[0075] (2) Using the reconstructed EEG signals to establish an undirected weighted graph ,in, This represents the number of nodes in the undirected weighted graph, i.e., the number of multi-channel electrodes. Represents the edges that connect nodes. A weighted adjacency matrix representing the correlation between pairs of nodes. , Represents the identity matrix;

[0076] (3) Weighted adjacency matrix based on the correlation between each pair of nodes Calculate the degree matrix of an undirected weighted graph. The calculation formula is as follows:

[0077] (1)

[0078] in, The degree matrix represents the first degree. The first electrode diagonal elements, Indicates the number of electrodes. Indicates the first The node and the first A weighted adjacency matrix of correlations between nodes;

[0079] (4) Based on the degree matrix of the undirected weighted graph The weighted adjacency matrix of correlations between pairs of nodes Construct the Laplace matrix as follows:

[0080] (2).

[0081] In one possible design of step S2, a Laplace diagram containing the functional topological relationships between the electrodes of the electroencephalogram is obtained through the Laplace matrix, including:

[0082] Normalizing the Laplace matrix yields a Laplace plot containing the functional topological relationships between the electrodes of the EEG, as follows:

[0083] (3)

[0084] in, express The identity matrix of the electrodes.

[0085] In one possible design of step S2, when the graph convolutional neural network model performs classification prediction on the Laplacian graph, the convolution formula of the graph convolutional neural network model on the Laplacian graph is as follows:

[0086] (4)

[0087] in, This represents the signal obtained by performing a Fourier transform on the Laplace plot. Represents an undirected weighted graph. Represents a nonparametric convolution filter. Represents a set of Chebyshev coefficients. Denotes the order of the Chebyshev polynomial. Indicates in Calculated in Chebyshev coefficient, This represents a diagonal matrix with scaled eigenvalues. The diag function represents the Fourier frequency. This represents a Laplace diagram.

[0088] It should be noted that the derivation process of the above formula (4) is as follows:

[0089] Since the Laplace graph is actually a real symmetric positive semidefinite matrix, its eigenvector set, i.e., the graph Fourier modulus... It is complete and orthogonal to the standard. The relevant eigenvalues, i.e., the graphical Fourier frequencies... These are ordered real numbers and non-negative numbers. Using Fourier basis decomposition of the Laplace graph, the decomposed expression is: Among them, Fourier base is , The diag function representing the Fourier frequency, i.e. The signal obtained by the graph Fourier transform Represented as Therefore, the Laplace plot actually represents the signal. Projected onto an orthogonal space, where the Fourier basis consists of eigenvectors of a normalized Laplace graph.

[0090] Based on the above, the figure The definition of convolution on a surface is as follows:

[0091] ;

[0092] in, Represents a convolution filter. express transpose, Let represent the element-wise Hadamard product; preferably, a non-parametric convolution filter is used, then the convolution transformation in the graph neural network model is as follows:

[0093] ;

[0094] in, A vector representing the Fourier coefficients.

[0095] We know that the difference in spectral convolution lies in the filter. The choice of nonparametric filters is problematic because they are spatially indelocalized and computationally complex. To address this issue, this application employs Chebyshev polynomials to approximate the filter's effect. It is parameterized as a truncated expansion, as follows:

[0096] ;

[0097] Among them, parameters This is now a set of Chebyshev coefficients. Denotes the order of the Chebyshev polynomial. Indicates in Calculated in Chebyshev coefficients This represents a diagonal matrix with scaled eigenvalues.

[0098] Then, the signal Through the above filter Convolution is performed using the formula (4) above.

[0099] Based on the above-mentioned information, by introducing Chebyshev polynomials to approximate the effect of the filter, the calculation of the Fourier basis can be avoided, thereby reducing the computational complexity.

[0100] In one possible design, when the graph convolutional neural network model performs classification prediction on the Laplacian graph, the graph convolutional neural network model uses the Graclus multi-level clustering algorithm to cluster each node of the Laplacian graph, and uses a greedy algorithm to calculate the continuity coarseness of the Laplacian graph, so as to minimize the clustering objective of each node.

[0101] In one possible design, a greedy algorithm is used to calculate the continuous coarseness of the Laplacian graph, including:

[0102] Step (1): Select an unmarked node from the Laplace graph. and the unmarked nodes With unlabeled neighboring nodes The unmarked neighbor nodes are matched. The local normalization cut needs to be maximized, and the cut formula is as follows: ,in, Represents a node and nodes The edge weights between them and These represent the coarsening nodes and the nodes respectively. and nodes The distance between them;

[0103] Step (2): Nodes and nodes Mark the nodes and use the sum of the weights of the two nodes as the weight value of the coarsened node;

[0104] Repeat steps (1) and (2) for all nodes in the Laplace graph to obtain the continuous thickness of the Laplace graph.

[0105] In one possible design of step S2, when the graph convolutional neural network model performs classification prediction on the Laplacian graph, the graph convolutional neural network model derives the classification prediction result through a softmax function, the formula of which is as follows:

[0106] (5)

[0107] in, Indicates the first Predicted probability of a motion imagery task Indicates the number of motion imagery tasks;

[0108] The graph convolutional neural network model uses the L2 regularization formula to calculate the loss function, as follows:

[0109] (6)

[0110] in, This indicates a task involving imagining movement. Represents network model parameters, Indicates the number of parameters. This represents the weight decay rate.

[0111] It should be noted that the maximum number of graph pooling layers in this embodiment can be log2N, where N represents the number of electrodes. Dimensionality reduction is achieved through pooling layers, and classification prediction output is performed using an FC softmax layer. If a 64-channel international 10-10 EEG system is used, the maximum number of pooling layers is set to 6. The hyperparameters of the graph convolutional neural network during training, such as the learning rate, dropout rate, and weight decay rate, can be selected and set through multiple experiments. The network parameters, i.e., weights and biases, can be updated using the Adam iterative solver. The learning rate can be set to 0.01, the dropout rate to 50%, and the bias applied to each node of the graph. The batch size is set to 1024 to maximize the use of GPU resources. Graph convolution employs batch normalization, which normalizes the input graph signal by subtracting the mean of the smaller batches and dividing by the standard deviation. The normalized signal is then scaled and shifted to align with the original distribution, thereby mitigating the problem of internal covariate shift and preventing gradient vanishing.

[0112] Step S3. Calculate the contrastive loss function using the prediction results of the first signal and the prediction results of the second signal by the graph convolutional neural network model, and use the contrastive loss function to promote unsupervised contrastive learning until the model training iteration converges.

[0113] In one possible design, a contrastive loss function is calculated using the prediction results of the first signal and the prediction results of the second signal from the graph convolutional neural network model. The calculation formula is as follows:

[0114] (7)

[0115] in, This indicates the prediction result of the first signal. This indicates the prediction result of the second signal. Let this be a set of vectors, where the vectors in the set are those extracted from the current training batch. The prediction result of the corresponding second signal, express A vector in , Indicates hyperparameters, and .

[0116] We used a trained graph convolutional neural model to classify and predict motor imagery labels on EEG signals in the form of Laplace graphs.

[0117] Based on the above disclosure, this application embodiment acquires multi-channel raw EEG signals based on motor imagery, performs noise reduction and signal reconstruction on the raw EEG signals using a combination of wavelet denoising and hierarchical thresholding, and inputs the reconstructed EEG signals as the first signal into a graph convolutional neural network model for classification prediction; constructs a Laplacian matrix using the reconstructed EEG signals, obtains a Laplacian graph containing the functional topological relationships between the electrodes of the EEG through the Laplacian matrix, and inputs the Laplacian graph as the second signal into the graph convolutional neural network model for classification prediction; calculates a contrastive loss function using the prediction results of the graph convolutional neural network model for the first signal and the prediction results for the second signal, and uses the contrastive loss function to promote unsupervised contrastive learning until the model training iterative convergence; and uses the trained graph convolutional neural network model to classify and predict the motor imagery labels of the EEG signals in the form of the Laplacian graph. This invention preprocesses raw EEG signals and inputs them into a graph convolutional neural network (GNN) model for classification prediction. It analyzes the functional topological relationships between EEG electrodes and inputs the Laplacian graphs representing these relationships into the GNN model for classification prediction. This incorporates information interaction between brain regions as a factor in classification prediction, thereby improving accuracy. A contrastive loss function is calculated based on the predicted results, promoting unsupervised contrastive learning and accelerating the learning of the behavior classifier. This speeds up model convergence, resulting in higher classification accuracy with fewer iterations required to achieve convergence under the same dataset and training settings.

[0118] The second aspect provides a motor imagery prediction system based on electroencephalogram (EEG) signals, including:

[0119] The first prediction module is used to acquire multi-channel raw EEG signals based on motor imagery, and to perform noise reduction and signal reconstruction on the raw EEG signals using a combination of wavelet denoising and hierarchical thresholding. The reconstructed EEG signals are then used as the first signal to be input into the graph convolutional neural network model for classification and prediction.

[0120] The second prediction module is used to construct a Laplacian matrix using the reconstructed EEG signal, obtain a Laplacian graph containing the functional topological relationships between the electrodes of the EEG through the Laplacian matrix, and input the Laplacian graph as a second signal into the graph convolutional neural network model for classification prediction.

[0121] The contrastive learning module is used to calculate the contrastive loss function using the prediction results of the graph convolutional neural network model for the first signal and the prediction results for the second signal, and to use the contrastive loss function to promote unsupervised contrastive learning until the model training iteration converges.

[0122] The third prediction module is used to classify and predict the motor imagery labels of EEG signals in the form of Laplace graphs using a trained graph convolutional neural model.

[0123] The working process, working details and technical effects of the aforementioned system provided in the second aspect of this embodiment can be found in the method described in the first aspect or any possible design of the first aspect, and will not be repeated here.

[0124] Thirdly, the present invention provides a computer device comprising a memory, a processor, and a transceiver connected in sequence and communication, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the method described in any possible design of the first aspect.

[0125] Specifically, the memory may include, but is not limited to, Random-Access Memory (RAM), Read-Only Memory (ROM), Flash Memory, First-In-First-Out (FIFO) Memory, and / or First-In-Last-Out (FILO) Memory, etc.; the processor may not be limited to the STM32F105 series microprocessor; the transceiver may be, but is not limited to, a WiFi (Wireless Fidelity) wireless transceiver, a Bluetooth wireless transceiver, a GPRS (General Packet Radio Service) wireless transceiver, and / or a ZigBee (a low-power LAN protocol based on the IEEE 802.15.4 standard) wireless transceiver, etc. Furthermore, the computer device may also include, but is not limited to, a power module, a display screen, and other necessary components.

[0126] The working process, working details and technical effects of the aforementioned computer device provided in the third aspect of this embodiment can be found in the method described in the first aspect or any possible design of the first aspect, and will not be repeated here.

[0127] Fourthly, the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, perform the method described in any possible design of the first aspect.

[0128] The computer-readable storage medium refers to a carrier for storing data, which may include, but is not limited to, floppy disks, optical disks, hard disks, flash memory, USB flash drives and / or memory sticks, etc. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.

[0129] The working process, working details and technical effects of the aforementioned computer-readable storage medium provided in the fourth aspect of this embodiment can be found in the method described in the first aspect or any possible design of the first aspect, and will not be repeated here.

[0130] Fifthly, the present invention provides a computer program product comprising instructions that, when executed on a computer, cause the computer to perform the method described in any possible design of the first aspect.

[0131] The working process, working details and technical effects of the aforementioned computer program product containing instructions provided in the fifth aspect of this embodiment can be found in the method described in the first aspect or any possible design of the first aspect, and will not be repeated here.

[0132] Finally, it should be noted that the above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for predicting motor imagery based on electroencephalogram (EEG) signals, characterized in that, include: Multi-channel raw EEG signals based on motor imagery are acquired. Wavelet denoising and hierarchical thresholding are combined to denoise and reconstruct the raw EEG signals. The reconstructed EEG signals are then used as the first signal to be input into a graph convolutional neural network model for classification and prediction. A Laplacian matrix is ​​constructed using the reconstructed EEG signal. A Laplacian graph containing the functional topological relationships between the electrodes of the EEG is obtained through the Laplacian matrix. The Laplacian graph is then used as a second signal to be input into the graph convolutional neural network model for classification and prediction. The contrastive loss function is calculated using the prediction results of the first signal and the prediction results of the second signal by the graph convolutional neural network model. The contrastive loss function is then used to promote unsupervised contrastive learning until the model training iteration converges. The trained graph convolutional neural model was used to classify and predict the motor imagery labels of EEG signals in the form of Laplace graphs. The contrastive loss function is calculated using the prediction results of the first signal and the prediction results of the second signal from the graph convolutional neural network model. The calculation formula is as follows: ;(7) in, This indicates the prediction result of the first signal. This indicates the prediction result of the second signal. Let this be a set of vectors, where the vectors in the set are those extracted from the current training batch. The prediction result of the corresponding second signal, express A vector in , Indicates hyperparameters, and .

2. The method for predicting motor imagery based on electroencephalogram (EEG) signals according to claim 1, characterized in that, The original EEG signal is denoised and reconstructed using a combination of wavelet denoising and hierarchical thresholding, including: The original EEG signal is decomposed into multiple frequency bands by wavelet transform, thereby achieving preliminary noise reduction of the original EEG signal; Wavelet packet decomposition is performed on the local coefficients of each frequency band after preliminary noise reduction to obtain multi-layered wavelet nodes; Thresholding is applied to each wavelet node in each layer to achieve secondary noise reduction of the EEG signal. The wavelet packet coefficients after secondary noise reduction are then reconstructed to obtain the reconstructed signal of each wavelet node.

3. The method for predicting motor imagery based on electroencephalogram (EEG) signals according to claim 1, characterized in that, Constructing a Laplace matrix using the reconstructed EEG signals includes: The linear correlation between EEG signals from each electrode channel was calculated using the Pearson correlation coefficient algorithm to obtain the absolute Pearson correlation coefficient matrix. ,in, absolute value ; Undirected weighted graphs were constructed using the reconstructed EEG signals. ,in, This represents the number of nodes in the undirected weighted graph, i.e., the number of multi-channel electrodes. Represents the edges that connect nodes. A weighted adjacency matrix representing the correlation between pairs of nodes. , Represents the identity matrix; The weighted adjacency matrix based on the correlation between each pair of nodes Calculate the degree matrix of an undirected weighted graph. The calculation formula is as follows: ;(1) in, The degree matrix represents the first degree. The first electrode diagonal elements, Indicates the number of electrodes. Indicates the first The node and the first A weighted adjacency matrix of correlations between nodes; Based on the degree matrix of the undirected weighted graph The weighted adjacency matrix of correlations between pairs of nodes Construct the Laplace matrix as follows: (2)。 4. The method for predicting motor imagery based on electroencephalogram (EEG) signals according to claim 3, characterized in that, The Laplace matrix is ​​used to obtain a Laplace diagram containing the functional topological relationships between the electrodes of the electroencephalogram, including: Normalizing the Laplace matrix yields a Laplace plot containing the functional topological relationships between the electrodes of the EEG, as follows: ;(3) in, express The identity matrix of the electrodes.

5. The method for predicting motor imagery based on electroencephalogram (EEG) signals according to claim 1, characterized in that, When the graph convolutional neural network model performs classification prediction on the Laplacian graph, the convolution formula of the graph convolutional neural network model on the Laplacian graph is as follows: ;(4) in, This represents the signal obtained by performing a Fourier transform on the Laplace plot. Represents an undirected weighted graph. Represents a nonparametric convolution filter. Represents a set of Chebyshev coefficients. Denotes the order of the Chebyshev polynomial. Indicates in Calculated in Chebyshev coefficient, This represents a diagonal matrix with scaled eigenvalues. The diag function represents the Fourier frequency. This represents a Laplace diagram.

6. The method for predicting motor imagery based on electroencephalogram (EEG) signals according to claim 1, characterized in that, When classifying and predicting the Laplacian graph, the graph convolutional neural network model uses the Graclus multi-level clustering algorithm to cluster each node of the Laplacian graph, and uses a greedy algorithm to calculate the continuity coarseness of the Laplacian graph to minimize the clustering objective of each node.

7. The method for predicting motor imagery based on electroencephalogram (EEG) signals according to claim 6, characterized in that, The continuous coarseness of the Laplacian graph is calculated using a greedy algorithm, including: Step (1): Select an unmarked node from the Laplace graph. and the unmarked nodes With unlabeled neighboring nodes The unmarked neighbor nodes are matched. The local normalization cut needs to be maximized, and the cut formula is as follows: ,in, Represents a node and nodes The edge weights between them and These represent the coarsening nodes and the nodes respectively. and nodes The distance between them; Step (2): Nodes and nodes Mark the nodes and use the sum of the weights of the two nodes as the weight value of the coarsened node; Repeat steps (1) and (2) for all nodes in the Laplace graph to obtain the continuous thickness of the Laplace graph.

8. The method for predicting motor imagery based on electroencephalogram (EEG) signals according to claim 1, characterized in that, When performing classification prediction on the Laplacian graph, the graph convolutional neural network model derives the classification prediction result using a softmax function, the formula of which is as follows: (5) in, Indicates the first Predicted probability of a motion imagery task Indicates the number of motion imagery tasks; The graph convolutional neural network model uses the L2 regularization formula to calculate the loss function, as follows: ;(6) in, This indicates a task involving imagining movement. Represents network model parameters, Indicates the number of parameters. This represents the weight decay rate.

9. A storage medium, characterized in that, The storage medium stores instructions that, when executed on a computer, perform the motor imagery prediction method based on electroencephalogram signals as described in any one of claims 1 to 8.