A method for EEG data classification based on graph representation learning model
By adaptively generating a graph representation learning model of brain functional topology, the problem of multi-feature fusion in EEG data is solved, and accurate brain network embedding and classification is achieved.
Patent Information
- Application Number
- CN202310667953.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-07
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2043-06-07
AI Technical Summary
Existing graphs represent that learning algorithms and brain network embedding models cannot adaptively construct brain functional topology of EEG data, and cannot effectively fuse multi-feature information.
The feature weight parameters are used to generate an adaptive adjacency matrix, combined with spectral coherence and geodesic distance characteristics, and aggregate multi-category features through the attention mechanism, construct a brain functional network diagram and perform multi-channel convolution, and use global attention pooling to achieve whole graph embedding.
Accurate brain network embedding based on EEG data is realized, and brain functional topology can be adaptively generated, improving the accuracy and effectiveness of classification.
Smart Images

Figure CN116687425B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of graph embedding, and in particular to an EEG data classification method based on a graph representation learning model. Background Art
[0002] Electroencephalogram (EEG) data is one of the primary methods used to diagnose neurological diseases. Brain networks are a type of complex network data, comprising structural networks composed of neurons and functional networks formed by neural activity in different brain regions. Analysis of brain network data helps reveal the structural characteristics and operating mechanisms of brain networks, enabling aided diagnosis of brain diseases.
[0003] In recent years, graph convolutional networks (GCNs) have emerged as a promising method for learning graph data representations and have been successfully applied to brain network analysis. Although numerous whole-graph embedding graph representation learning algorithms and models for brain network embedding exist, these methods are not well-suited for EEG data or have certain shortcomings and deficiencies, such as the inability to adaptively construct brain functional topology based on multiple EEG features and the inability to integrate multiple EEG features into whole-graph embedding. To overcome these issues, we propose an EEG data classification method based on a graph representation learning model, which can be used for whole-graph embedding of EEG data and achieve brain network classification.
[0004] The present invention introduces a feature weight parameter to balance the importance of adjacency matrices of different features when generating a unified adjacency matrix. It also uses spectral coherence and geodesic distance features to adaptively generate an adjacency matrix of functional connectivity. Furthermore, considering the multi-category features contained in EEG data, the present invention adaptively aggregates features from multiple categories based on an attention mechanism, effectively achieving holistic embedding of the brain network. Summary of the Invention
[0005] This invention mainly solves the problem that the graph representation learning algorithm for whole-graph embedding and the model for brain network embedding cannot adaptively construct brain functional topology based on multiple EEG features and cannot fuse the multi-feature information of EEG into whole-graph embedding. It proposes an EEG data classification method based on the graph representation learning model. While effectively utilizing the features of different categories in EEG data to adaptively generate brain functional topology, it takes into account the multi-category characteristics of EEG data and introduces the attention mechanism to adaptively aggregate the features of each category to generate more accurate and effective brain network embedding.
[0006] The technical solution of the present invention is an EEG data classification method based on a graph representation learning model, comprising the following steps:
[0007] Step 100, constructing a geodesic distance matrix and an adjacency matrix generated based on spectral coherence of power spectral density features;
[0008] Step 101: Calculate the geodesic distance matrix A based on the spatial coordinates of each node and the arc radius of the brain surface. geo , the node is the input terminal for collecting potential difference values in EEG data; the geodesic distance A from node i to node j geo,ij The calculation method is as follows:
[0009]
[0010] Among them, the spatial coordinates of node i and node j are (a i , b i , c i ) and (a j , b j , c j ), the radius of the arc on the brain surface is r;
[0011] Step 102: Calculate the adjacency matrix A generated based on the spectral coherence of the power spectral density feature according to the expectation of the cross spectral density between each node and the expectation of the power spectral density of each node. p sd, the adjacency weight A generated from node i to node j based on the spectral coherence of power spectral density characteristics psd,i,j The calculation method is as follows:
[0012]
[0013]
[0014]
[0015]
[0016] Among them, the expectation of the cross spectral density between node i and node j is expressed as The expectations of the power spectral density of node i and node j are expressed as and S i and S j denote the EEG signals of node i and node j respectively; EXP(·) is the expectation function; DFT(·) is the cross spectral density function; PSD(·) is the power spectral density function;
[0017] Step 200, calculating an adaptive adjacency matrix based on the geodesic distance matrix and the adjacency matrix generated based on the spectral coherence of the power spectral density feature;
[0018] Step 201: concatenate the geodesic distance matrix and the adjacency matrix generated based on the spectral coherence of the power spectral density feature to obtain a concatenated matrix (A geo ||A psd ); where Ageo is the geodesic distance matrix calculated according to step 101, A psd is the adjacency matrix generated based on the spectral coherence of the power spectral density feature calculated in step 102;
[0019] Step 202: Calculate the adaptive adjacency matrix A. The calculation method is as follows:
[0020] A=(A geo ||A psd )*W Cat ;
[0021] Among them, W Cat It is the parameter matrix that realizes the adaptive aggregation of geodesic distance matrix and adjacency matrix;
[0022] Step 203: Use the power spectrum density of EEG data as the input node feature, x i represents the node feature of node i in step 101 above, x i The calculation method is as follows:
[0023] x i =PSD(S i );
[0024] Wherein, PSD(·) is the power spectral density function described in step 102, S i is the EEG signal of node i in step 102;
[0025] Step 300: construct a brain function network diagram using the adjacency matrix of the nodes in step 101 and the nodes in step 200, perform multi-channel attention convolution on the brain function network diagram, and obtain the final multi-channel attention convolution parameters:
[0026] Step 301: The node feature x i Convert to a vector z of a specific length i , the vector of node i on layer l The calculation method is as follows:
[0027]
[0028] in, is the feature of node i on layer l, W (l) is the parameter matrix on the lth layer;
[0029] Step 302: Each node contains m features, corresponding to the power spectrum features in different frequency bands, respectively represented by z im Representation; calculate the attention coefficient corresponding to each feature
[0030]
[0031] Among them, LeakyReLU(·) is the activation function, It is a learnable parameter used to realize the length conversion of the feature vector zi;
[0032] Step 303: Calculate the attention value under the corresponding feature
[0033]
[0034] Among them, the number of feature categories is k;
[0035] Step 304: From step 301 to step 303, the embedding of the node under the multi-channel attention mechanism is obtained.
[0036]
[0037] Where σ(·) represents the Sigmoid function;
[0038] Step 305: Calculate the final feature vector of the node:
[0039]
[0040] Where Aggregate(·) represents the aggregation function; is the neighbor set of node i; is the learnable graph convolution parameter of layer l; Cat(·) represents the vector connection function;
[0041] Step 306: Use the global attention pooling mechanism to coarsen the node features and achieve whole-graph embedding. The calculation method is:
[0042]
[0043] Among them, Softmax(f gate (·)) represents a soft attention mechanism, which is equivalent to the attention mechanism and determines the importance of the node to the current graph embedding task; f feat (·) function uses a layer of neural network, output -dimensional feature vector; is the label category, including normal and abnormal labels;
[0044] Step 307: Define the loss function based on the whole image classification task
[0045]
[0046] in, is the sample label, when the sample is a positive example When the sample is a negative example represents the embedding vector of the positive sample, Embedding vector representing negative samples;
[0047] Step 308, back propagate the loss calculated in step 307 Update the parameters W of each layer in step 301 (l) , the parameters of each layer in step 302 The parameters of each layer in step 305 and the whole picture embedded in step 306 If the current number of loops is less than the total number of loops, the process returns to step 301 and continues looping; otherwise, the process ends.
[0048] Step 309: Use the multi-channel attention convolution parameters W of each layer obtained in step 308 (l) 、 and And whole image embedding Realize the classification of EEG.
[0049] Furthermore, the power spectral density function PSD(·) describes the distribution of signal power in the frequency domain. When calculating the input features of a node, considering that the power spectral density contains multiple bands and therefore contains multiple categories of input features, the multiple categories of features of the node are calculated based on the power spectral density of multiple bands and the EEG signal S.
[0050] Beneficial effects of the present invention: The present invention provides an EEG data classification method based on a graph representation learning model, which constructs an adjacency matrix between nodes according to the features between the nodes. First, a geodesic distance matrix and an adjacency matrix generated based on spectral coherence of power spectral density features are constructed. An adaptive adjacency matrix is calculated based on the geodesic distance matrix and the adjacency matrix generated based on spectral coherence of power spectral density features. The power spectral density of EEG data is obtained as the input node feature, and considering that the power spectral density contains multiple bands, it contains features of multiple categories. According to the multi-channel attention mechanism, effective aggregation of features is achieved, and combined with the structural information of the graph, the final feature vector of the node can be obtained. The present invention adopts a global attention pooling mechanism to coarsen the node features and realize the embedding of the entire graph. According to the entire graph classification task, the constructed loss function is used to perform graph convolution training, back-propagation loss, and update parameters and embedding. Finally, the obtained model is used to implement the EGG classification task. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 This is a flowchart of an implementation method of an EEG data classification method based on a graph representation learning model provided by the present invention;
[0052] Figure 2 is a flowchart for implementing step 100;
[0053] Figure 3 is a flowchart for implementing step 200;
[0054] Figure 4 is a flowchart for implementing step 300;
[0055] Figure 5 It is a processing flow chart of the multi-channel attention mechanism. DETAILED DESCRIPTION
[0056] To make the technical problems solved, the technical solutions adopted, and the technical effects achieved by the present invention more clearly apparent, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, rather than all of the contents.
[0057] Figure 1 This is a flowchart of an EEG data classification method based on a graph representation learning model provided by the present invention. Figure 1 As shown, an embodiment of the present invention provides an EEG data classification method based on a graph representation learning model, comprising:
[0058] Step 100: construct a geodesic distance matrix and an adjacency matrix generated based on spectral coherence of power spectral density features.
[0059] In this step, the EEG uses two input terminals that collect potential differences to represent channels, typically 32, 64, 128, or 256 channels. Channels can be thought of as nodes in the constructed brain functional network, with different channels being considered different nodes. The EEG uses an analog-to-digital converter to sample continuous signals.
[0060] like Figure 2 As shown, step 100 includes the following steps 101 and 102:
[0061] Step 101: Calculate the geodesic distance matrix A based on the spatial coordinates of each node (the coordinates of the channel electrode) and the radius of the arc surface. geo , the geodesic distance A from node i to node j geo,ij The calculation method is as follows:
[0062]
[0063] The spatial coordinates of node i and node j are (a i , b i , c i ) and (aj , b j , c j ), the radius of the arc on the brain surface is r.
[0064] Step 102: Calculate the adjacency matrix A generated based on the spectral coherence of the power spectral density feature according to the expectation of the cross spectral density between each node and the expectation of the power spectral density of each node. psd , A psd The calculation method is as follows:
[0065]
[0066] The expectation of the cross spectral density between node i and node j is The expectations of the power spectral density are and
[0067] In this step, the channel electrode coordinates and power spectral density of the EEG data are converted into a geodesic distance matrix and an adjacency matrix generated based on the spectral coherence of the power spectral density features.
[0068] Step 200: Calculate an adaptive adjacency matrix based on the geodesic distance matrix and the adjacency matrix generated based on the spectral coherence of the power spectral density feature. Figure 3 As shown, step 200 includes the following steps 201 to 203:
[0069] Step 201: concatenate the geodesic distance matrix and the adjacency matrix generated based on the spectral coherence of the power spectral density feature to obtain a concatenated matrix (A geo ||A psd ). Among them, A geo is the geodesic distance matrix calculated according to step 101, A psd is the adjacency matrix generated based on the spectral coherence of the power spectral density feature calculated in step 102.
[0070] Step 202: Calculate the adaptive adjacency matrix A. The calculation method is as follows:
[0071] A=(A geo ||A psd )*W Cat ;
[0072] Where W Cat is a parameter matrix that implements the adaptive aggregation of two adjacency matrices.
[0073] This step effectively utilizes different categories of features in EEG data to adaptively generate brain functional topology through the adaptive aggregation of geodesic distance matrix and adjacency matrix generated based on spectral coherence of power spectral density features.
[0074] Step 203: Use the power spectrum density of EEG data as the input node feature, and use x i represents the node feature of node i, x i The calculation method is as follows:
[0075] x i =PSD(S i );
[0076] Where PSD(·) is the power spectral density function, S i is the EEG signal of node i; considering that the power spectrum density contains multiple bands, the node feature x i Features that contain multiple categories.
[0077] In this step, the power spectral density function describes the distribution of signal power in the frequency domain. Considering that the power spectral density contains multiple bands and therefore contains features of multiple categories, the step uses a multi-channel attention mechanism to achieve effective aggregation of features.
[0078] Step 300: Perform multi-channel attention convolution on the brain function network diagram to obtain the final multi-channel attention convolution parameters. Figure 4 As shown, step 300 includes the following steps 301 to 309:
[0079] Step 301: The node feature x i Convert to a vector z of a specific length i , the vector of node i on layer l The calculation method is as follows:
[0080]
[0081] in, is the feature of node i on layer l, W (l) is the parameter matrix on the lth layer.
[0082] Step 302: Each node contains m features, corresponding to the power spectrum features in different frequency bands, respectively represented by z im Representation; use the following method to calculate the attention coefficient corresponding to each feature
[0083]
[0084] Where LeakyReLU(·) is the activation function, It is a learnable parameter used to achieve the conversion of feature vector length.
[0085] Step 303: Calculate the attention value of the corresponding feature using the following method:
[0086]
[0087] The number of feature categories is set to k.
[0088] Step 304: Get the embedding of the node under the multi-channel attention mechanism from steps 301 to 303 It can be expressed as follows:
[0089]
[0090] Where σ represents the Sigmoid function.
[0091] In steps 301 to 304, a multi-feature attention mechanism is used to calculate node embedding features, realizing feature aggregation under different categories of features and attention weights.
[0092] Step 305: Calculate the final feature vector of the node using the following method:
[0093]
[0094] Aggregate(·) represents the aggregation function, and various aggregation strategies such as LSTM, MAX, and SUM can be used. is the neighbor set of node i; are the learnable graph convolution parameters of layer l.
[0095] Step 306: Use the global attention pooling mechanism to coarsen the node features and achieve whole-graph embedding. The calculation method is:
[0096]
[0097] Where Softmax(·) represents the normalized exponential function. feat (·) function can use a layer of neural network to output -dimensional feature vector. It is a label category, including normal and abnormal labels.
[0098] Step 307: Based on the whole image classification task, define the loss function using the following method:
[0099]
[0100] in is the sample label, which takes 1 if the sample is a positive example and 0 otherwise. represents the embedding vector of the positive sample, Represents the embedding vector of the negative sample.
[0101] In steps 306 and 307, a global attention pooling mechanism is used to embed the entire image Softmax (f gate (·)) represents a soft attention mechanism, which is equivalent to the attention mechanism and determines the importance of a node to the current graph embedding task.
[0102] Step 308, back propagate the loss calculated in step 307 Update the parameters and embedding. If the current number of loops is less than the total number of loops, return to step 301 to continue looping. Otherwise, end the convolution loop process.
[0103] Step 309 : Use the model obtained in step 308 to classify the EEG.
[0104] like Figure 5 As shown in Figure 1, the power spectral density function (PSD) describes the distribution of signal power in the frequency domain. When calculating the input features of a node, the power spectral density (PSD) contains multiple bands and, therefore, multiple categories of input features. Multiple categories of node features are calculated based on the EEG signal and multiple bands. A multi-channel attention mechanism is used to differentiate features and obtain more accurate node representation.
[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications to the technical solutions described in the above embodiments, or equivalent replacement of some or all of the technical features therein, do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for EEG data classification based on a graph representation learning model, characterized in that: The following steps are involved: Step 100, constructing a geodesic distance matrix and an adjacency matrix generated based on spectral coherence of power spectral density features; Step 101: Calculate the geodesic distance matrix A based on the spatial coordinates of each node and the arc radius of the brain surface. geo , the node is the input terminal for collecting potential difference values in EEG data; the geodesic distance A from node i to node j geo,ij The calculation method is as follows: Among them, the spatial coordinates of node i and node j are (a i ,b i ,c i ) and (a j ,b j ,c j ), the radius of the arc on the brain surface is r; Step 102: Calculate the adjacency matrix A generated based on the spectral coherence of the power spectral density feature according to the expectation of the cross spectral density between each node and the expectation of the power spectral density of each node. psd , the adjacency weight A generated from node i to node j based on the spectral coherence of power spectral density characteristics psd,i,j The calculation method is as follows: Among them, the expectation of the cross spectral density between node i and node j is expressed as The expectations of the power spectral density of node i and node j are expressed as and S i and S j denote the EEG signals of node i and node j respectively; EXP(·) is the expectation function; DFT(·) is the cross spectral density function; PSD(·) is the power spectral density function; Step 200, calculating an adaptive adjacency matrix based on the geodesic distance matrix and the adjacency matrix generated based on the spectral coherence of the power spectral density feature; Step 201: concatenate the geodesic distance matrix and the adjacency matrix generated based on the spectral coherence of the power spectral density feature to obtain a concatenated matrix (A geo ||A psd ); where A geo is the geodesic distance matrix calculated according to step 101, A psd is the adjacency matrix generated based on the spectral coherence of the power spectral density feature calculated in step 102; Step 202: Calculate the adaptive adjacency matrix A. The calculation method is as follows: A=(A geo ||A psd )*W Cat ; Among them, W Cat It is the parameter matrix that realizes the adaptive aggregation of geodesic distance matrix and adjacency matrix; Step 203: Use the power spectrum density of EEG data as the input node feature, x i represents the node feature of node i in step 101 above, x i The calculation method is as follows: x i =PSD(S i ); Wherein, PSD(·) is the power spectral density function described in step 102, S i is the EEG signal of node i in step 102; Step 300: construct a brain function network diagram using the adaptive adjacency matrix A of the nodes described in step 101 and the nodes described in step 200, perform multi-channel attention convolution on the brain function network diagram, and obtain the final multi-channel attention convolution parameters: Step 301: The node feature x i Convert to a vector z of a specific length i , the vector of node i on layer l The calculation method is as follows: in, is the feature of node i on layer l, W (l) is the parameter matrix on the lth layer; Step 302: Each node contains m features, corresponding to the power spectrum features in different frequency bands, respectively represented by z im Representation; calculate the attention coefficient corresponding to each feature Among them, LeakyReLU(·) is the activation function, It is used to realize the eigenvector z i The learnable parameters of the length conversion; Step 303: Calculate the attention value under the corresponding feature Among them, the number of feature categories is k; Step 304: From step 301 to step 303, the embedding of the node under the multi-channel attention mechanism is obtained. Where σ(·) represents the Sigmoid function; Step 305: Calculate the final feature vector of the node: Where Aggregate(·) represents the aggregation function; is the neighbor set of node i; is the learnable graph convolution parameter of layer l; Cat(·) represents the vector connection function; Step 306: Use the global attention pooling mechanism to coarsen the node features and achieve whole-graph embedding. The calculation method is: Among them, Softmax(f gate (·)) represents a soft attention mechanism, which is equivalent to the attention mechanism and determines the importance of the node to the current graph embedding task; f feat (·) function uses a layer of neural network, output -dimensional feature vector; is the label category, including normal and abnormal labels; Step 307: Define the loss function based on the whole image classification task in, is the sample label, when the sample is a positive example When the sample is a negative example represents the embedding vector of the positive sample, Embedding vector representing negative samples; Step 308, back propagate the loss calculated in step 307 Update step 301: each layer's parameters W (l) , Step 302 Parameters of each layer Step 305: Parameters of each layer and the whole picture embedded in step 306 If the current number of loops is less than the total number of loops, the process returns to step 301 and continues looping; otherwise, the process ends. Step 309: Use the multi-channel attention convolution parameters W of each layer obtained in step 308 (l) 、 and And whole image embedding Realize the classification of EEG.