Motor imagery EEG signal recognition method, device, terminal equipment and storage medium
By performing spatial and temporal similarity calculations on the EEG data, constructing a graph convolution network, and extracting the spatial and temporal characteristics of the EEG signal, the problem of low EEG signal recognition accuracy in the existing technology is solved, and more accurate movements are achieved. Imagine EEG signal recognition.
Patent Information
- Application Number
- CN202210892135.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-27
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-07-27
AI Technical Summary
Existing motor imagination EEG signal analysis methods cannot effectively extract feature similarities between EEG signal channels and feature similarities between time segments, resulting in low signal-to-noise ratio and low classification accuracy of motor imagination EEG signals. Motor imagery EEG signals cannot be accurately identified.
By performing spatial similarity calculation and temporal similarity calculation on the original EEG data, the channel feature similarity matrix and the time period feature similarity matrix are obtained. Based on these matrices, a spatial map and a time map are constructed, and a graph convolution operation is performed to obtain the spatial features. and temporal feature maps, and fuse and splice them to form a spatio-temporal feature map, which is used to identify motor imagery EEG signals.
It improves the classification accuracy of motor imagination EEG signals, achieves accurate identification of motor imagination EEG signals, and enhances the reliability of controlling auxiliary equipment for patients with motor dysfunction.
Smart Images

Figure CN115251953B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of motor imagery EEG signal processing, and in particular to a motor imagery EEG signal recognition method, device, terminal equipment and storage medium. Background Art
[0002] As an emerging technology, brain-computer interface (BCI) technology allows people with motor dysfunction to control assistive devices (such as wheelchairs, robotic arms, etc.) through motor imagery (MI; for example, imagining the movements of the left hand, right hand, feet and tongue) and electroencephalogram (EEG) signals without the help of traditional interfaces such as mouse or keyboard, thereby improving the quality of daily life.
[0003] Therefore, it is of great significance to correctly identify motor imagery EEG signals (MI-EEG). Existing methods for analyzing motor imagery EEG signals mainly include machine learning-based methods and deep learning-based methods. However, existing methods cannot effectively extract the feature similarity between EEG signal channels and the feature similarity between time segments, and thus the classification accuracy is low due to the low signal-to-noise ratio of motor imagery EEG signals, and motor imagery EEG signals cannot be accurately identified. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a method, apparatus, terminal device and storage medium for identifying motor imagery EEG signals to improve the classification accuracy of motor imagery EEG signals and accurately identify motor imagery EEG signals.
[0005] In a first aspect, an embodiment of the present application provides a method for identifying motor imagery EEG signals, comprising: obtaining original EEG data corresponding to motor imagery EEG signals of a single subject detected by multiple channels, performing spatial similarity calculations and temporal similarity calculations on the original EEG data to obtain a channel feature similarity matrix and a time period feature similarity matrix; obtaining a binary spatial adjacency matrix based on the channel feature similarity matrix, and constructing a spatial graph representation based on the binary spatial adjacency matrix; obtaining a binary temporal adjacency matrix based on the time period feature similarity matrix, and constructing a temporal graph representation based on the binary temporal adjacency matrix; performing a spatial graph convolution operation on the original EEG data and the spatial graph representation to obtain a spatial feature graph; performing a temporal graph convolution operation on the original EEG data and the temporal graph representation to obtain a temporal feature graph; fusing and splicing the spatial feature graph and the temporal feature graph according to the depth dimension to obtain a spatiotemporal feature graph containing spatial features and temporal features, identifying motor imagery EEG signals based on the spatiotemporal feature graph, and obtaining a motor imagery EEG signal recognition result.
[0006] In a possible implementation of the first aspect, spatial similarity calculation is performed on the original EEG data to obtain a channel feature similarity matrix, including: performing a convolution operation on the original EEG data to obtain a first feature map and a second feature map; performing a dot product operation and normalization processing on the first feature map and the second feature map to obtain a channel feature similarity matrix, wherein the channel feature similarity matrix represents the similarity between any two channels.
[0007] In a possible implementation of the first aspect, time similarity calculation is performed on the original EEG data to obtain a time period feature similarity matrix, including: segmenting the original EEG data along the time dimension to obtain multiple time periods, stacking the multiple time periods to obtain a three-dimensional matrix of the original EEG data; performing dimensionality transformation on the three-dimensional matrix of the original EEG data to obtain a third feature map and a fourth feature map; performing dot product operation and normalization on the third feature map and the fourth feature map to obtain a time period feature similarity matrix, wherein the time period feature similarity matrix represents the similarity between any two time periods.
[0008] In a possible implementation of the first aspect, a binary space adjacency matrix is obtained based on a channel feature similarity matrix, and a spatial graph representation is constructed according to the binary space adjacency matrix, including: summing each row of elements in the channel feature similarity matrix to obtain the sum of similarities between each channel and other channels; determining the binary space adjacency matrix according to an average value of the channel feature similarity matrix and the sum of similarities between each channel and other channels, and constructing a spatial graph representation according to the binary space adjacency matrix.
[0009] In a possible implementation of the first aspect, a binary time adjacency matrix is obtained based on a time period feature similarity matrix, and a spatial graph representation is constructed according to the binary spatial adjacency matrix, including: summing up each row of elements in the time period feature similarity matrix to obtain the sum of similarities between each time period and other time periods; determining a binary time adjacency matrix according to an average value of the time period feature similarity matrix and the sum of similarities between each time period and other time periods, and constructing a time graph representation according to the binary time adjacency matrix.
[0010] In a possible implementation of the first aspect, the matrix form of the spatial graph representation is a binary spatial adjacency matrix; a spatial graph convolution operation is performed on the original EEG data and the spatial graph representation to obtain a spatial feature map, including: obtaining a first degree matrix based on the binary spatial adjacency matrix; calculating the original EEG data, the binary spatial adjacency matrix and the first degree matrix based on the Fourier transform of the graph and the normalized Laplace transform of the graph to obtain a first spatial feature map; adding the first spatial feature map to the original EEG data to obtain the spatial feature map.
[0011] In a possible implementation of the first aspect, the matrix form of the time graph representation is a binary time adjacency matrix; a time graph convolution operation is performed on the original EEG data and the time graph representation to obtain a time feature graph, including: obtaining a second degree matrix based on the binary time adjacency matrix; calculating the three-dimensional matrix of the original EEG data, the binary time adjacency matrix and the second degree matrix based on the Fourier transform of the graph and the normalized Laplace transform of the graph to obtain a first time feature graph; and adding the first time feature graph to the three-dimensional matrix of the original EEG data to obtain the time feature graph.
[0012] In a second aspect, an embodiment of the present application provides a motor imagery EEG signal recognition device, comprising:
[0013] The spatial adaptive graph convolution module is used to obtain the original EEG data corresponding to the motor imagery EEG signals of a single subject detected by multiple channels, perform spatial similarity calculation on the original EEG data to obtain a channel feature similarity matrix; obtain a binary spatial adjacency matrix based on the channel feature similarity matrix, and construct a spatial graph representation based on the binary spatial adjacency matrix; perform a spatial graph convolution operation on the original EEG data and the spatial graph representation to obtain a spatial feature map.
[0014] The time-adaptive graph convolution module is used to obtain the original EEG data corresponding to the motor imagery EEG signals of a single subject detected by multiple channels, perform time similarity calculation on the original EEG data, and obtain a time period feature similarity matrix; obtain a binary time adjacency matrix based on the time period feature similarity matrix, and construct a time graph representation based on the binary time adjacency matrix; perform a time graph convolution operation on the original EEG data and the time graph representation to obtain a time feature graph.
[0015] The feature fusion module is used to fuse and splice the spatial feature map with the temporal feature map according to the depth dimension to obtain a spatiotemporal feature map containing spatial features and temporal features.
[0016] The feature classification module is used to identify the motor imagery EEG signal based on the spatiotemporal feature graph to obtain the motor imagery EEG signal recognition result.
[0017] In a third aspect, an embodiment of the present application provides a terminal device including a memory and a processor, wherein the memory stores a computer program that can be executed on the processor, and when the processor executes the computer program, the method for recognizing motor imagery EEG signals as described in any one of the first aspects is implemented.
[0018] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method for identifying motor imagery EEG signals as described in any one of the first aspects.
[0019] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the motor imagery EEG signal recognition method described in any one of the first aspects above.
[0020] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0021] The motor imagery EEG signal recognition method, apparatus, terminal device and storage medium provided in the embodiments of the present application respectively perform spatial similarity calculation and temporal similarity calculation on the acquired original EEG data to obtain a channel feature similarity matrix and a time period feature similarity matrix, and respectively obtain a spatial graph representation and a time graph representation based on the channel feature similarity matrix and the time period feature similarity matrix, and then perform a spatial graph convolution operation on the original EEG data and the spatial graph representation to obtain a spatial feature graph, and perform a temporal graph convolution operation on the original EEG data and the time graph representation to obtain a temporal feature graph, and fuse and splice the spatial feature graph with the temporal feature graph to obtain a spatiotemporal feature graph including spatial features and temporal features, and then recognize the motor imagery EEG signal based on the spatiotemporal feature graph to obtain a motor imagery EEG signal recognition result, which can improve the classification accuracy of the motor imagery EEG signal and accurately recognize the motor imagery EEG signal.
[0022] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0024] Figure 1 It is a flowchart of a method for identifying motor imagery EEG signals provided in one embodiment of the present application;
[0025] Figure 2 It is a flowchart of a method for identifying motor imagery EEG signals provided in one embodiment of the present application;
[0026] Figure 3 It is a flowchart of a method for identifying motor imagery EEG signals provided in one embodiment of the present application;
[0027] Figure 4This is a schematic diagram of the network architecture of a network model constructed based on a method for recognizing electroencephalographic signals of motor imagery provided in one embodiment of the present application;
[0028] Figure 5 It is a line chart comparing the average accuracy of the single-subject classification experiment of the BCICIV2a dataset provided in an embodiment of the present application;
[0029] Figure 6 It is a bar chart of the accuracy of a single-subject classification experiment of an HGD dataset provided in an embodiment of the present application;
[0030] Figure 7 This is a bar chart comparing the accuracy of using and not using transfer learning on the BCICIV2a dataset provided in an embodiment of the present application;
[0031] Figure 8 It is a line chart comparing the accuracy of the BCICIV2a dataset classification experiment across subjects provided in an embodiment of the present application;
[0032] Fig. 9 It is a structural schematic diagram of a motor imagery EEG signal recognition device provided in one embodiment of the present application;
[0033] Fig.10 It is a structural diagram of a terminal device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0034] The present application is described more clearly below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the effects of the present application, but are not intended to limit the present application in any form. It should be noted that, for those of ordinary skill in the art, several variations and improvements may be made without departing from the concept of the present application. These all fall within the scope of protection of the present application.
[0035] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0036] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0037] In the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0038] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0039] In addition, the “plurality” mentioned in the embodiments of the present application should be interpreted as two or more.
[0040] As an emerging technology, brain-computer interface (BCI) technology can enable people with motor dysfunction (such as stroke patients, who have motor dysfunction or partial motor dysfunction, but whose brains still work normally) to control assistive devices (such as wheelchairs, robotic arms, etc.) through motor imagery (MI; for example, imagining the movement of the left hand, right hand, feet, and tongue) electroencephalogram (EEG) signals without the help of traditional interfaces such as mice or keyboards, thereby improving the quality of daily life. Among them, motor imagery electroencephalogram (MI-EEG) signals are non-invasive, low-cost, high-temporal resolution, and spontaneous, and the motor imagery ability of patients with motor dysfunction is basically the same as that of normal people. Therefore, brain-computer interface systems based on motor imagery electroencephalogram signals have received extensive attention and research in medical and non-medical applications.
[0041] Therefore, it is of great significance to correctly identify the motor imagery EEG signals. Existing methods for analyzing motor imagery EEG signals mainly include machine learning-based methods and deep learning-based methods. However, the existing methods cannot effectively extract the feature similarity between EEG signal channels and the feature similarity between EEG signal time segments. As a result, due to the low signal-to-noise ratio of motor imagery EEG signals, the classification accuracy is low and the motor imagery EEG signals cannot be accurately identified.
[0042] Based on the above problems, the inventors have discovered through research that a graph convolutional network (GCN) can be used to capture the hidden relationships between EEG signals from different EEG signal channels, as well as the hidden relationships between EEG signals in different time segments, and then effectively extract spatial and temporal features, thereby achieving accurate recognition of motor imagery EEG signals.
[0043] That is to say, the embodiment of the present application performs spatial similarity calculations and temporal similarity calculations on the acquired original EEG data to obtain a channel feature similarity matrix and a time period feature similarity matrix, and obtains a spatial graph representation and a temporal graph representation based on the channel feature similarity matrix and the time period feature similarity matrix, respectively, and then performs a spatial graph convolution operation on the original EEG data and the spatial graph representation to obtain a spatial feature graph, and performs a temporal graph convolution operation on the original EEG data and the temporal graph representation to obtain a temporal feature graph, and fuses and splices the spatial feature graph with the temporal feature graph to obtain a spatiotemporal feature graph containing spatial features and temporal features, and then identifies motor imagery EEG signals based on the spatiotemporal feature graph to obtain a motor imagery EEG signal recognition result, which can improve the classification accuracy of motor imagery EEG signals and accurately identify motor imagery EEG signals.
[0044] Figure 1 FIG. 1 is a flow chart of a method for identifying motor imagery EEG signals provided in an embodiment of the present application. Figure 1 As shown, the method in the embodiment of the present application may include:
[0045] Step 101: Obtain original EEG data corresponding to the motor imagery EEG signals of a single subject detected by multiple channels.
[0046] Optionally, the above-mentioned channel (that is, node) is an EEG signal channel, that is, an electrode for collecting motor imagery EEG signals in various regions of the brain of a single subject. The electrodes are used to collect motor imagery EEG signals in various regions of the brain of a single subject to obtain raw EEG data corresponding to the motor imagery EEG signals. The raw EEG data is in the form of a 2D matrix, and the raw EEG data can be expressed as:
[0047]
[0048] Where C is the number of channels and T is the number of time sampling points.
[0049] Step 102: perform spatial similarity calculation on the original EEG data to obtain a channel feature similarity matrix.
[0050] In a possible implementation, step 102 may specifically include:
[0051] Step 1021: Perform a convolution operation on the original EEG data to obtain a first feature map and a second feature map.
[0052] Specifically, the original EEG data I is input into the convolution layers Conv1 and Conv2 with a convolution kernel of 1×1, respectively, to obtain the first feature map S1 and the second feature map S2 of the same size, and Among them, C is the number of channels, T is the number of time sampling points, and F is the number of feature maps.
[0053] Step 1022: perform dot product operation and normalization processing on the first feature map and the second feature map to obtain a channel feature similarity matrix.
[0054] Optionally, a channel feature similarity matrix represents the similarity between any two channels.
[0055] Specifically, since the correlation between a channel and other channels is calculated by dot product, the dimensions of the first feature map S1 and the second feature map S2 need to be converted. The specific conversion process is:
[0056]
[0057]
[0058] The converted first feature map S1′ and the converted second feature map S2′ are obtained, so that the second dimension (i.e., column) of the converted first feature map S1′ is the same as the first dimension (i.e., row) of the converted second feature map S2′, and then the converted first feature map S1′ and the converted second feature map S2′ are subjected to dot product operation and normalization processing to obtain the channel feature similarity matrix S3.
[0059] The calculation formula of the channel feature similarity matrix is:
[0060]
[0061] Among them, S ij is the channel feature similarity matrix The element in the i-th row and j-th column in represents the i-th channel s i With the jth channel s j The similarity between ij The value of is between 0 and 1, where 0 means no similarity and 1 means complete similarity), f means dot product operation, Softmax means normalization operation, is the i-th row of the first feature map S1′ after conversion, is the j-th column of the converted second feature map S2′.
[0062] For any channel, the higher the similarity with the channel, the more it is considered that there is a connection relationship (adjacent relationship) between the two channels, that is, the neighboring channels. By aggregating the features of adjacent channels to represent the central channel, the spatial features of the motor imagery signal can be enhanced and the impact of noise on each channel can be reduced.
[0063] Exemplarily, various parameters of the channel feature similarity matrix calculation part can refer to those shown in Table 1.
[0064] Table 1
[0065]
[0066] Step 103: obtain a binary space adjacency matrix based on the channel feature similarity matrix, and construct a spatial graph representation according to the binary space adjacency matrix.
[0067] In one possible implementation, see Figure 2 In step 103, the following may be specifically included:
[0068] Step 1031: sum each row of elements in the channel feature similarity matrix to obtain the sum of similarities between each channel and other channels.
[0069] Step 1032: determine a binary space adjacency matrix based on the channel feature similarity matrix and the average value of the sum of similarities between each channel and other channels, and construct a spatial graph representation based on the binary space adjacency matrix.
[0070] Optionally, an adjacency matrix used to represent the topological relationship between each channel can be obtained based on the similarity between any two channels. Since the spatial distribution of ERD / ERS (event-related desynchronization / event-related synchronization) phenomena of different motor imagery tasks is different, the obtained adjacency matrix is also different. That is, the adjacency matrix can be adaptively constructed according to the similarity between channels of different motor imagery tasks. The adjacency matrix is automatically adjusted according to the feature similarity matrix, that is, it has strong adaptability, which is different from the fixed adjacency matrix constructed through prior knowledge or artificially. Therefore, it can get rid of the limitations of the fixed adjacency matrix constructed through prior knowledge or artificially.
[0071] Specifically, if channel s i With channels j The similarity between them is greater than that between channels s i The average of the sum of similarities with other channels, then channel s i With channels j are adjacent (the similarity of the channel itself is set to 0).
[0072] The spatial adjacency matrix is:
[0073]
[0074] Among them, E i (S3) represents channel s i The average of the sum of similarities with other channels, is the spatial adjacency matrix The element in the i-th row and j-th column in represents the i-th channel s i With the jth channel s jThe connection weights between them, where two channels with small connection weights (i.e., small similarity) are far apart, and two channels with large connection weights (i.e., large similarity) are close together. Adjacent channels that are far apart have little influence on the central channel, while adjacent channels that are close have a greater influence on the central channel. According to the spatial adjacency matrix, a binary spatial adjacency matrix can be obtained.
[0075] The binary space adjacency matrix is:
[0076]
[0077] in, is the binary space adjacency matrix The element in the i-th row and j-th column in represents the i-th channel s i With the jth channel s j The adjacent relationship between them, that is, channel s i With channels j Whether they are adjacent, where 1 indicates adjacent and 0 indicates not adjacent. It should be noted that the adjacent relationship is not the physical spatial position, but the functional proximity.
[0078] The corresponding spatial graph representation can be constructed based on the binary spatial adjacency matrix. Automatically constructing the spatial graph representation through the feature similarity between channels can get rid of the limitations of constructing the graph representation through prior knowledge or artificially.
[0079] Step 104: Perform a spatial graph convolution operation on the original EEG data and the spatial graph representation to obtain a spatial feature graph.
[0080] Optionally, the matrix form of the spatial graph representation is a binary spatial adjacency matrix. In calculations involving the spatial graph representation, the binary spatial adjacency matrix form of the spatial graph representation is usually used for calculations.
[0081] In a possible implementation, step 104 may specifically include:
[0082] Step 1041: Obtain a first degree matrix based on the binary space adjacency matrix.
[0083] Optionally, the corresponding first degree matrix can be calculated based on the binary space adjacency matrix.
[0084] The first degree matrix is:
[0085]
[0086] in, is the first degree matrix The elements in the first degree matrix D s is a diagonal matrix, that is, Except for , all other elements are 0.
[0087] Step 1042: Based on the Fourier transform of the graph and the normalized Laplace transform of the graph, the original EEG data, the binary space adjacency matrix and the first degree matrix are calculated to obtain a first spatial feature map.
[0088] The normalized Laplace transform of the graph is:
[0089]
[0090] in, is the normalized Laplacian matrix of the graph, It represents adding self-loops to the binary space adjacency matrix, It means adding self-loops to the first degree matrix. is the unit matrix. The reason why the Laplacian matrix of the graph is normalized is that when the addition rule is used, the features of channels with large degrees become larger and larger, while the opposite is true for channels with small degrees. This may cause the gradient of the network model to explode or disappear during training. Normalizing the Laplacian matrix of the graph can avoid this problem.
[0091] In a graph convolutional network (GCN) layer, the propagation rule is defined as follows:
[0092]
[0093] in, is the Fourier transform of the graph, H l and H l+1 They represent the input of the lth and l+1th convolutional layers respectively. When l=0, the input is the original EEG data, i.e., H 0 =I;W l is the weight parameter matrix learned by the lth convolutional layer, σ(·) represents the activation function, and the linear rectification function (ReLU) is used here.
[0094] The matrix corresponding to the first spatial feature map is:
[0095]
[0096] in, is the matrix corresponding to the first spatial feature map, W s is the first parameter matrix. The first spatial feature map S4 is obtained after each channel aggregates the information of all related channels through the GCN layer.
[0097] Step 1043: Add the first spatial feature map to the original EEG data to obtain a spatial feature map.
[0098] The spatial feature map is:
[0099]
[0100] Among them, F S is the spatial feature map, α is the first learning parameter, and its initial value is 0. It should be noted that in practical applications, α and W s As the graph convolutional network is trained, more appropriate weight values are gradually learned. The feature representation of the channel itself is enhanced by aggregating the features of the adjacent channels of the channel, that is, the spatial features are enhanced by the topological relationship between channels, and the spatial feature map F with enhanced spatial information is obtained. S , that is, the spatial feature map F S Aggregates features from different channels.
[0101] Step 105: perform temporal similarity calculation on the original EEG data to obtain a time segment feature similarity matrix.
[0102] In a possible implementation, step 105 may specifically include:
[0103] Step 1051: segment the original EEG data along the time dimension to obtain multiple time periods, and stack the multiple time periods to obtain a three-dimensional matrix of the original EEG data.
[0104] Optionally, since the motor imagery EEG signal is continuous and has a low signal-to-noise ratio, the motor imagery EEG signal, i.e., the original EEG data, is segmented into time periods to eliminate the influence of noise, while the correlation between time periods does not disappear due to the segmentation process. In addition, since the motor imagery EEG signal is the imagination of the subject for a long time (e.g., 4s), any time period is not similar only to its two adjacent time periods, so the features between different time periods can be aggregated.
[0105] Specifically, the original EEG data I is divided into N slices along the time dimension, that is, divided into N time periods. For example, N can be 25, and the size of each time period is (C, T N ), where T N The above multiple time periods are stacked to form a three-dimensional matrix of the original EEG data.
[0106] Step 1052: perform dimension transformation on the three-dimensional matrix of the original EEG data to obtain a third feature map and a fourth feature map.
[0107] Optionally, in order to calculate the similarity between different time periods, the three-dimensional matrix of the original EEG data is transformed in dimension, that is, The third feature map T1 and the fourth feature map T2 are obtained, where C is the number of channels, T N is the time period obtained after segmentation, and N is the number of time periods.
[0108] Step 1053: perform a dot product operation and normalization processing on the third feature map and the fourth feature map to obtain a time period feature similarity matrix.
[0109] Optionally, the time period feature similarity matrix represents the similarity between any two time periods.
[0110] The calculation formula of the time period feature similarity matrix is:
[0111]
[0112] Among them, T mn is the time period feature similarity matrix The element in the mth row and nth column in represents the mth time period t m With the nth time period t n The similarity between mn The value is between 0 and 1, where 0 means no similarity and 1 means complete similarity), f means dot product operation, Softmax means normalization operation, T 1m is the mth row of the third feature map T1, It is the nth column of the fourth feature map T2.
[0113] For any time period, the higher the similarity with the time period, the more it is considered that there is a connection relationship (adjacent relationship) between the two time periods, that is, they are neighboring time periods. By aggregating the features of adjacent time periods to represent the central time period, the temporal features of the motor imagery signal can be enhanced and the impact of noise on each time period can be reduced.
[0114] Exemplarily, various parameters of the time period feature similarity matrix calculation part can refer to those shown in Table 2.
[0115] Table 2
[0116]
[0117] Step 106: Obtain a binary time adjacency matrix based on the time period feature similarity matrix, and construct a time graph representation based on the binary time adjacency matrix.
[0118] In one possible implementation, see Figure 3 In step 106, the following may be specifically included:
[0119] Step 1061: sum each row of elements in the time period feature similarity matrix to obtain the sum of similarities between each time period and other time periods.
[0120] Step 1062: Determine a binary time adjacency matrix based on the time period feature similarity matrix and the average value of the sum of similarities between each time period and other time periods, and construct a time graph representation based on the binary time adjacency matrix.
[0121] Specifically, if the time period t m With time period t n The similarity between them is greater than the time period t m The average value of the sum of similarities with other time periods, then time period t m With time period t n are adjacent (the similarity of the time period itself is set to 0).
[0122] The temporal adjacency matrix is:
[0123]
[0124] Among them, E m (T3) represents the time period t m The average of the sum of similarities with other time periods, is the time adjacency matrix The element in the mth row and nth column in represents the mth time period t m With the nth time period t n The connection weights between them, where two time periods with small connection weights (i.e., small similarity) are far apart, and two time periods with large connection weights (i.e., large similarity) are close together. Adjacent time periods far apart have little influence on the central time period, while adjacent time periods close together have a great influence on the central time period. Based on the time adjacency matrix, a binary time adjacency matrix can be obtained.
[0125] The binary time adjacency matrix is:
[0126]
[0127] in, is the binary time adjacency matrix The element in the mth row and nth column in represents the mth time period t m With the nth time period t n The adjacent relationship between them, that is, time period t m With time period t n Whether they are adjacent, where 1 indicates adjacent and 0 indicates not adjacent. It should be noted that the adjacent relationship is not the physical spatial position, but the functional proximity.
[0128] The corresponding time graph representation can be constructed based on the binary time adjacency matrix. The time graph representation can be automatically constructed based on the feature similarity between time periods, which can eliminate the influence of noise.
[0129] Step 107: Perform a time graph convolution operation on the original EEG data and the time graph representation to obtain a time feature graph.
[0130] Optionally, the matrix form of the time graph representation is a binary time adjacency matrix. In calculations involving the time graph representation, the binary time adjacency matrix form of the time graph representation is usually used for calculation.
[0131] In a possible implementation, step 107 may specifically include:
[0132] Step 1071: Obtain a second degree matrix based on the binary time adjacency matrix.
[0133] Optionally, the corresponding second degree matrix can be calculated based on the binary time adjacency matrix.
[0134] The second degree matrix is:
[0135]
[0136] in, is the second degree matrix The elements in the second degree matrix D t is a diagonal matrix, that is, Except for , all other elements are 0.
[0137] Step 1072: Based on the Fourier transform of the graph and the normalized Laplace transform of the graph, the three-dimensional matrix, the binary time adjacency matrix and the second degree matrix of the original EEG data are calculated to obtain a first time feature map.
[0138] The normalized Laplace transform of the graph is:
[0139]
[0140] in, is the normalized Laplacian matrix of the graph, Represents the addition of self-loops to the binary time adjacency matrix, represents adding a self-loop to the second degree matrix, is the identity matrix.
[0141] In a graph convolutional network (GCN) layer, the propagation rule is defined as follows:
[0142]
[0143] in, is the Fourier transform of the graph, H l and H l+1 They represent the input of the lth and l+1th convolutional layers respectively. When l=0, the input is the three-dimensional matrix of the original EEG data, i.e., H 0 =I′;W l is the weight parameter matrix learned by the lth convolutional layer, σ(·) represents the activation function, and the linear rectification function (ReLU) is used here.
[0144] The matrix corresponding to the first time feature map is:
[0145]
[0146] in, is the matrix corresponding to the first time feature map, W t is the second parameter matrix. The first time feature graph T4 is obtained after each time period aggregates the information of all related time periods through the GCN layer.
[0147] Step 1073: Add the first time characteristic graph to the three-dimensional matrix of the original EEG data to obtain a time characteristic graph.
[0148] Optionally, the matrix corresponding to the first time feature graph is transformed in dimension to obtain the first time feature graph after the dimension transformation, that is, in,
[0149] The time characteristic diagram is:
[0150]
[0151] Among them, F T is the time feature diagram, β is the second learning parameter, and its initial value is 0. It should be noted that in practical applications, β and W t As the graph convolutional network is trained, more appropriate weight values are gradually learned.
[0152] The feature representation of a time period is enhanced by aggregating the features of adjacent time periods, that is, the time features are enhanced by the topological relationship between time periods, and the time feature graph F after the time information is enhanced is obtained. T , that is, the time feature graph F T Aggregates features from different time periods.
[0153] It should be noted that those skilled in the art may adjust the order of the above steps according to actual needs. For example, steps 105 to 107 may be performed before steps 102 to 104, or may be performed simultaneously.
[0154] Step 108: The spatial feature map and the temporal feature map are fused and spliced according to the depth dimension to obtain a spatiotemporal feature map including spatial features and temporal features, and the motor imagery EEG signal is identified based on the spatiotemporal feature map to obtain a motor imagery EEG signal recognition result.
[0155] Figure 4 It is a schematic diagram of the network architecture of a network model constructed based on a method for recognizing electroencephalographic signals of motor imagery provided in one embodiment of the present application.
[0156] See also Figure 4 Specifically, the spatial feature map and the temporal feature map are fused and spliced according to the depth dimension to obtain a spatiotemporal feature map ST containing spatial features and temporal features. S , F T},
[0157] Exemplarily, in practical applications, the spatiotemporal feature map ST is passed through a temporal convolution layer Conv3 using 40 convolution kernels of size (1, 25) and step size (1, 1) to obtain a second spatiotemporal feature map ST2. The convolution layer changes the dimension of the spatiotemporal feature map ST from (2, 22, 1125) to the dimension of the second spatiotemporal feature map ST2 (40, 22, 1101). Then, the second spatiotemporal feature map ST2 is passed through a spatial convolution layer Conv4 using a convolution kernel (22, 1) and step size (1, 1) to obtain a third spatiotemporal feature map ST3 (40, 1, 1101). Batch normalization (BN) is applied to the third spatiotemporal feature map ST3, and its size does not change. The batch normalized third spatiotemporal feature map ST3 is processed using a square nonlinear function (SA). Then the processed third spatiotemporal feature map ST3 is passed through an average pooling layer (AvgPool) with a convolution kernel of (1, 75) and a step size of (1, 15) and a Dropout (DP) layer to reduce the size of the feature map, and a fourth spatiotemporal feature map ST4 (40, 1, 69) is obtained, and the fourth spatiotemporal feature map ST4 is processed by a pooling nonlinear function (PA). Finally, the processed fourth spatiotemporal feature map ST4 is passed through a convolution layer Conv5 with a convolution kernel of (1, 69) and a step size of (1, 1) to obtain a fifth spatiotemporal feature map ST5 (4, 1, 1). The fifth spatiotemporal feature map ST5 is converted into the probability of four motor imagery using the LogSoftMax function to classify the original EEG data, that is, to identify the motor imagery EEG signal, wherein the four motor imagery tasks can be the left hand, the right hand, both feet and the tongue.
[0158] Optionally, various parameters of the motor imagery EEG signal recognition part based on the spatiotemporal feature map can refer to those shown in Table 3.
[0159] Table 3
[0160]
[0161] The embodiment of the present application provides a method for identifying motor imagery EEG signals, which performs spatial similarity calculations and temporal similarity calculations on original EEG data to obtain a channel feature similarity matrix and a time period feature similarity matrix, obtains a spatial graph representation based on the channel feature similarity matrix, obtains a time graph representation based on the time period feature similarity matrix, performs a spatial graph convolution operation on the original EEG data and the spatial graph representation to obtain a spatial feature graph, performs a temporal graph convolution operation on the original EEG data and the time graph representation to obtain a temporal feature graph, fuses and splices the spatial feature graph with the temporal feature graph to obtain a spatiotemporal feature graph, and identifies motor imagery EEG signals based on the spatiotemporal feature graph to obtain a recognition result, which can improve the classification accuracy of motor imagery EEG signals and accurately identify motor imagery EEG signals.
[0162] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0163] Below, in order to verify the feasibility and effectiveness of the motor imagery EEG signal recognition method provided in the embodiment of the present application, two public MI-EEG datasets (BCIIV2a dataset and HGD dataset) are used to verify the method in the embodiment of the present application.
[0164] The BCIIV2a dataset includes four types of motor imagery tasks (including left hand, right hand, feet and tongue) performed by 9 different subjects in 25 lead electrode channels (including 22 EEG signal channels), with a sampling frequency of 250Hz and a pre-processing bandpass filter of 0.5-100Hz. The EEG test data of each subject is divided into two groups. Each group contains 288 motor imagery trials, and each type of motor imagery task has 72 trials. Each trial uses the same time window [-0.5s, 4s] to extract the motor imagery EEG signals of all 22 EEG signal channels. Therefore, 22×1125 data points are obtained for each trial.
[0165] The HGD dataset includes four types of motor imagery tasks (including left hand, right hand, both feet and rest (i.e., no movement)) performed by 14 different subjects in 128 EEG signal channels, with a sampling frequency of 500Hz. Each subject was collected 13 times, each collection included 80 trials, that is, each subject collected 1040 test data, and each trial used the same time window [-0.5s, 4s] to extract the motor imagery EEG signals of all 128 EEG signal channels. When using the HGD dataset, the data collected in the first 11 times (the first 880 trials) are usually used as the training set, and the data collected in the last 2 times (the last 160 trials) are used as the test set. In order to make a fair comparison with the BCIIV2a dataset, 44 channels were selected from the 128 EEG signal channels in the HGD dataset in the embodiment of the present application, and the data were resampled with a frequency of 250Hz. Therefore, 44×1125 data points were obtained for each trial.
[0166] The Xavier algorithm is used to initialize the parameters of the network model constructed based on the motor imagery EEG signal recognition method provided in the embodiment of the present application, and the NLLLoss function in PyTorch is used as the loss function, and the Adam algorithm is used for optimization. Among them, the learning rates of the BCIIV2a data set and the HGD data set are set to 0.0001 and 0.001 respectively, and the batch size (Batch Size) is 32. In order to prevent the network model from overfitting, the Dropout layer and early stopping mechanism are used, and the hyperparameter in the Dropout layer is set to 0.5.
[0167] The loss function formula is:
[0168]
[0169] Where M represents the number of experiments, and They respectively represent the true label corresponding to the k-th motor imagery EEG signal of the p-th subject and the label output by the network model.
[0170] Accuracy is used as an evaluation indicator to evaluate the classification accuracy of the network model. The higher the accuracy, the higher the classification accuracy of the network model, that is, the higher the classification accuracy.
[0171] The accuracy formula is:
[0172]
[0173] Among them, FP represents the number of negative samples that are incorrectly predicted as positive samples; TP represents the number of positive samples that are correctly predicted; FN represents the number of positive samples that are incorrectly predicted as negative samples; TN represents the number of negative samples that are correctly predicted. Among them, negative samples are samples that are inconsistent with the true label, and positive samples are samples that are consistent with the true label.
[0174] For the BCIIV2a data set, two different data set division methods were used to train the network model constructed based on the motor imagery EEG signal recognition method provided in the embodiment of the present application. The first division method is the traditional training method, that is, for the two groups of data collected by the same subject (each group has 288 experiments), the 288 experiments collected by the first group are used as training sets, and the 288 experiments collected by the second group are used as test sets. The second division method is a cross-validation method, such as a 10-fold cross-validation method, that is, the two groups of data collected by the same subject are combined together, a total of 576 experiments, which are randomly divided into ten equal subsets, of which nine subsets (a total of 518 experiments) are used as training sets, and the remaining subset (58 experiments) are used as test sets, and the final accuracy is obtained by averaging the optimal accuracy of 10 test sets.
[0175] The BCIIV2a dataset was used to conduct a single-subject classification experiment, and the motor imagery EEG signal recognition method provided in the embodiment of the present application was compared with the accuracy of other machine learning methods and deep learning methods. The results are shown in Table 4. Comparison of the accuracy of the single-subject classification experiment of the BCICIV2a dataset. The accuracy of the experiment using the first division method is shown in Our in Table 4, and the accuracy of the experiment using the second division method is shown in Our* in Table 4. In order to more intuitively compare the effects of each network model, the average accuracy comparison line chart of the single-subject classification experiment of the BCICIV2a dataset is shown in Figure 4. Figure 5 shown.
[0176] Table 4
[0177]
[0178] It can be seen from Table 4 that the average accuracy values of other methods range from 65.43% to 84.57%, while the two average accuracy values of the motor imagery EEG signal recognition method provided in the embodiment of the present application are 77.74% and 90.45% respectively, and the single-subject classification on the BCIIV2a dataset performs well, among which the average accuracy using the second division method is significantly better than other methods.
[0179] For example, a single-subject classification experiment was conducted using the HGD dataset, and the average accuracy of the motor imagery EEG signal recognition method provided in the embodiment of the present application was compared with that of other methods. The results are shown in Table 5. Comparison of the accuracy of the single-subject classification experiment of the HGD dataset. Figure 6 shown.
[0180] Table 5
[0181]
[0182] From Table 5 and Figure 6 It can be seen that the motor imagery EEG signal recognition method provided in the embodiment of the present application is not as good as the CPMixedNet method and the Shallow ConvNet method in terms of average accuracy, but it is improved compared with other methods, and performs well in single-subject classification on the HGD dataset.
[0183] In addition, in order to verify the robustness of the network model constructed based on the motor imagery EEG signal recognition method provided in the embodiment of the present application (hereinafter referred to as the first network model), the first network model was verified by transfer learning (Transfer Learning, TL for short). The transfer learning method refers to using the data of other subjects to train the network model, and using the weights of the trained network model as the initial weights of the network model when training with the data of new subjects, thereby reducing the calibration workload when different users use the BCI system. Specifically, the first network model trained with the data of the previous subject is used as the first network model pre-trained with the data of the next subject. For example, the initial weights of the first network model when trained with the data of subject 2 are the weights of the first network model after training with the data of subject 1. In this experiment, based on the BCIIV2a dataset, the robustness of the first network model was verified by transfer learning. The results are shown in Table 6. Comparison of accuracy with and without transfer learning on the BCICIV2a dataset. The bar graph of the comparison of accuracy with and without transfer learning on the BCICIV2a dataset is shown in the figure below. Figure 7 shown.
[0184] Table 6
[0185]
[0186] From Table 6 and Figure 7It can be seen that the accuracy of the first network model using transfer learning is better than that of the first network model without transfer learning, and the average accuracy has increased by 1.66%. Because the motor imagery EEG signals were collected when 9 subjects performed the same four types of motor imagery tasks, there are certain common features in the same type of motor imagery EEG signals between subjects. Therefore, when using the transfer learning method, it can be regarded as a certain degree of data enhancement. The experimental results show that data enhancement can improve the classification performance of the first network model.
[0187] The EEG signals of different subjects when performing the same motor imagery task are also different, that is, there are individual differences. In order to verify whether the network model constructed based on the motor imagery EEG signal recognition method provided in the embodiment of the present application has the ability to overcome individual differences, that is, to evaluate whether the network model has the ability to classify across subjects, the Leave-One-Subject-Out (LOSO) method was used to verify the first network model. Specifically, the Leave-One-Subject-Out method was used to re-divide the training set and test set of the BCICIV2a dataset, that is, for the data of 9 subjects in the BCICIV2a dataset, the data of 8 of the subjects were used as the training set, and the data of the remaining subject was used as the test set to train the first network model. The BCIIV2a dataset was used for a cross-subject classification experiment, and the accuracy of the motor imagery EEG signal recognition method provided in the embodiment of the present application was compared with other machine learning methods and deep learning methods. The results are shown in Table 7. Comparison of the accuracy of the BCICIV2a dataset cross-subject classification experiment. The line graph of the comparison of the accuracy of the BCICIV2a dataset cross-subject classification experiment is shown in the figure below. Figure 8 shown.
[0188] Table 7
[0189]
[0190] From Table 7 and Figure 8 It can be seen that the motor imagery EEG signal recognition method provided in the embodiment of the present application has an average accuracy of 66.07% in cross-subject classification, which is better than the other methods given in Table 7.
[0191] For different subjects, some subjects' motor imagery EEG signals are more distinguishable in time features, while some subjects' motor imagery EEG signals are more recognizable in space features. Therefore, the embodiment of the present application proposes to extract spatial features and time features. In order to evaluate the effectiveness of the spatial feature extraction part and the time feature extraction part, based on the BCICIV2a data set, an ablation experiment was used to verify the network model constructed based on the motor imagery EEG signal recognition method provided in the embodiment of the present application. The results are shown in Table 8 BCICIV2a data set single subject classification experiment accuracy comparison. Among them, model 1 represents the first network model that only includes the time feature extraction part, model 2 represents the first network model that only includes the spatial feature extraction part, and model 3 represents the first network model that includes both the time feature extraction and the spatial feature extraction parts.
[0192] Table 8
[0193]
[0194] It can be seen from Table 8 that both Model 1 and Model 2 can achieve an average accuracy of more than 70%, while the average accuracy of Model 3 is 5.94% higher than that of Model 1 and 3.24% higher than that of Model 2, indicating that the motor imagery EEG signal recognition method provided in the embodiment of the present application, which fuses and splices the extracted time features and spatial features before classification, is effective and can improve the accuracy of motor imagery EEG signal recognition.
[0195] Fig. 9 Schematic diagram of the structure of a motor imagery EEG signal recognition device provided in one embodiment of the present application. Fig. 9 As shown, the motor imagery EEG signal recognition device provided in this embodiment may include: a spatial adaptive graph convolution module 201, a temporal adaptive graph convolution module 202, a feature fusion module 203 and a feature classification module 204.
[0196] Among them, the spatial adaptive graph convolution module 201 is used to obtain the original EEG data corresponding to the motor imagery EEG signal of a single subject detected by multiple channels, perform spatial similarity calculation on the original EEG data, and obtain a channel feature similarity matrix; obtain a binary spatial adjacency matrix based on the channel feature similarity matrix, and construct a spatial graph representation according to the binary spatial adjacency matrix; perform a spatial graph convolution operation on the original EEG data and the spatial graph representation to obtain a spatial feature graph.
[0197] The time-adaptive graph convolution module 202 is used to obtain the original EEG data corresponding to the motor imagery EEG signal of a single subject detected by multiple channels, perform time similarity calculation on the original EEG data to obtain a time period feature similarity matrix; obtain a binary time adjacency matrix based on the time period feature similarity matrix, and construct a time graph representation based on the binary time adjacency matrix; perform a time graph convolution operation on the original EEG data and the time graph representation to obtain a time feature graph.
[0198] The feature fusion module 203 is used to fuse and splice the spatial feature map and the temporal feature map according to the depth dimension to obtain a spatiotemporal feature map containing spatial features and temporal features;
[0199] The feature classification module 204 is used to identify the motor imagery EEG signal based on the spatiotemporal feature graph to obtain a motor imagery EEG signal recognition result.
[0200] Optionally, the spatial adaptive graph convolution module 201 includes a spatial adaptive graph representation module and a spatial graph convolution module, and the spatial adaptive graph representation module includes a channel similarity calculation module, a spatial adaptive adjacency matrix construction module and a spatial graph representation module.
[0201] Optionally, the channel similarity calculation module is specifically used to: perform a convolution operation on the original EEG data to obtain a first feature map and a second feature map; perform a dot product operation and normalization processing on the first feature map and the second feature map to obtain a channel feature similarity matrix, and the channel feature similarity matrix represents the similarity between any two channels.
[0202] Optionally, the spatial adaptive adjacency matrix construction module is specifically used to: sum each row of elements in the channel feature similarity matrix to obtain the sum of the similarities between each channel and other channels; determine the binary spatial adjacency matrix based on the average value of the channel feature similarity matrix and the sum of the similarities between each channel and other channels.
[0203] Optionally, the spatial graph representation module is specifically used to: construct a spatial graph representation based on a binary spatial adjacency matrix.
[0204] Optionally, the spatial graph convolution module is specifically used to: obtain a first degree matrix based on a binary spatial adjacency matrix; calculate the original EEG data, the binary spatial adjacency matrix and the first degree matrix based on the Fourier transform of the graph and the normalized Laplace transform of the graph to obtain a first spatial feature map; add the first spatial feature map to the original EEG data to obtain a spatial feature map.
[0205] Optionally, the time-adaptive graph convolution module 202 includes a time-adaptive graph representation module and a time graph convolution module, and the time-adaptive graph representation module includes a time period similarity calculation module, a time-adaptive adjacency matrix construction module and a time graph representation module.
[0206] Optionally, the time period similarity calculation module is specifically used to: segment the original EEG data along the time dimension to obtain multiple time periods, stack the multiple time periods to obtain a three-dimensional matrix of the original EEG data; transform the dimension of the three-dimensional matrix of the original EEG data to obtain a third feature map and a fourth feature map; perform dot product operation and normalization on the third feature map and the fourth feature map to obtain a time period feature similarity matrix, which represents the similarity between any two time periods.
[0207] Optionally, the time adaptive adjacency matrix construction module is specifically used to: sum each row of elements in the time period feature similarity matrix to obtain the sum of similarities between each time period and other time periods; determine the binary time adjacency matrix based on the average value of the time period feature similarity matrix and the sum of similarities between each time period and other time periods.
[0208] Optionally, the time graph representation module is specifically used to: construct a time graph representation according to a binary time adjacency matrix.
[0209] Optionally, the time graph convolution module is specifically used to: obtain a second degree matrix based on a binary time adjacency matrix; calculate the three-dimensional matrix of the original EEG data, the binary time adjacency matrix and the second degree matrix based on the Fourier transform of the graph and the normalized Laplace transform of the graph to obtain a first time feature map; add the first time feature map to the three-dimensional matrix of the original EEG data to obtain a time feature map.
[0210] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0211] Fig.10 Schematic diagram of the structure of a terminal device provided by an embodiment of the present application. Fig.10 As shown, the terminal device 300 of this embodiment includes: a processor 310 and a memory 320, wherein the memory 320 stores a computer program 321 that can be run on the processor 310. When the processor 310 executes the computer program 321, the steps in any of the above method embodiments are implemented, for example Figure 1 Alternatively, when the processor 310 executes the computer program 321, the functions of each module / unit in the above-mentioned device embodiments are implemented, for example Fig. 9 Functions of modules 201 to 204 are shown.
[0212] Exemplarily, the computer program 321 may be divided into one or more modules / units, one or more modules / units are stored in the memory 320, and are executed by the processor 310 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 321 in the terminal device 300.
[0213] Those skilled in the art will understand that Fig.10 It is only an example of a terminal device and does not constitute a limitation on the terminal device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, such as input and output devices, network access devices, buses, etc.
[0214] The processor 310 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0215] The memory 320 may be an internal storage unit of the terminal device, such as a hard disk or memory of the terminal device, or an external storage device of the terminal device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal device. The above-mentioned memory 320 may also include both an internal storage unit of the terminal device and an external storage device. The above-mentioned memory 320 is used to store computer programs and other programs and data required by the terminal device. The memory 320 may also be used to temporarily store data that has been output or is to be output.
[0216] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0217] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0218] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0219] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0220] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0221] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0222] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium, etc.
[0223] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for identifying motor imagery EEG signals, characterized in that: include: Acquire original EEG data corresponding to the motor imagery EEG signals of a single subject detected by multiple channels, perform spatial similarity calculation and temporal similarity calculation on the original EEG data respectively, and obtain a channel feature similarity matrix and a time period feature similarity matrix; Obtaining a binary space adjacency matrix based on the channel feature similarity matrix, and constructing a spatial graph representation according to the binary space adjacency matrix; Obtaining a binary time adjacency matrix based on the time period feature similarity matrix, and constructing a time graph representation according to the binary time adjacency matrix; Performing a spatial graph convolution operation on the original EEG data and the spatial graph representation to obtain a spatial feature graph; performing a temporal graph convolution operation on the original EEG data and the temporal graph representation to obtain a temporal feature graph; The spatial feature map and the temporal feature map are fused and spliced according to the depth dimension to obtain a spatiotemporal feature map including spatial features and temporal features. The motor imagery EEG signal is identified based on the spatiotemporal feature map to obtain a motor imagery EEG signal recognition result.
2. The method for recognizing motor imagery EEG signals according to claim 1, characterized in that: The spatial similarity calculation is performed on the original EEG data to obtain a channel feature similarity matrix, including: Performing a convolution operation on the original EEG data to obtain a first feature map and a second feature map; A dot product operation and a normalization process are performed on the first feature map and the second feature map to obtain a channel feature similarity matrix, where the channel feature similarity matrix represents the similarity between any two channels.
3. The method for recognizing motor imagery EEG signals according to claim 1, characterized in that: The original EEG data is subjected to temporal similarity calculation to obtain a time segment feature similarity matrix, including: The original EEG data is segmented along the time dimension to obtain multiple time periods, and the multiple time periods are stacked to obtain a three-dimensional matrix of the original EEG data; Performing dimension transformation on the three-dimensional matrix of the original EEG data to obtain a third characteristic map and a fourth characteristic map; A dot product operation and a normalization process are performed on the third feature map and the fourth feature map to obtain a time period feature similarity matrix, where the time period feature similarity matrix represents the similarity between any two time periods.
4. The method for recognizing motor imagery EEG signals according to claim 2, characterized in that: The method of obtaining a binary space adjacency matrix based on the channel feature similarity matrix and constructing a spatial graph representation according to the binary space adjacency matrix includes: Summing each row of elements in the channel feature similarity matrix to obtain the sum of similarities between each channel and other channels; A binary space adjacency matrix is determined according to the average value of the channel feature similarity matrix and the sum of similarities between each channel and other channels, and a spatial graph representation is constructed according to the binary space adjacency matrix.
5. The method for recognizing motor imagery EEG signals according to claim 3, characterized in that: The step of obtaining a binary time adjacency matrix based on the time period feature similarity matrix and constructing a time graph representation according to the binary time adjacency matrix includes: Summing each row of elements in the time period feature similarity matrix to obtain the sum of similarities between each time period and other time periods; A binary time adjacency matrix is determined according to the average value of the time period feature similarity matrix and the sum of similarities between each time period and other time periods, and a time graph representation is constructed according to the binary time adjacency matrix.
6. The method for recognizing motor imagery EEG signals according to claim 4, characterized in that: The matrix form of the spatial graph representation is a binary spatial adjacency matrix; The performing a spatial graph convolution operation on the original EEG data and the spatial graph representation to obtain a spatial feature graph includes: Obtaining a first degree matrix based on the binary space adjacency matrix; Based on the Fourier transform of the graph and the normalized Laplace transform of the graph, the original EEG data, the binary space adjacency matrix and the first degree matrix are calculated to obtain a first spatial feature map; The first spatial feature map is added to the original EEG data to obtain a spatial feature map.
7. The method for recognizing motor imagery EEG signals according to claim 5, characterized in that: The matrix form of the time graph representation is a binary time adjacency matrix; The step of performing a time graph convolution operation on the original EEG data and the time graph representation to obtain a time feature graph includes: Obtaining a second degree matrix based on the binary temporal adjacency matrix; Based on the Fourier transform of the graph and the normalized Laplace transform of the graph, the three-dimensional matrix of the original EEG data, the binary time adjacency matrix and the second degree matrix are calculated to obtain a first time feature graph; The first time characteristic graph is added to the three-dimensional matrix of the original EEG data to obtain a time characteristic graph.
8. A motor imagery EEG signal recognition device, characterized in that: include: A spatial adaptive graph convolution module is used to obtain the original EEG data corresponding to the motor imagery EEG signals of a single subject detected by multiple channels, and perform spatial similarity calculation on the original EEG data to obtain a channel feature similarity matrix; Obtaining a binary space adjacency matrix based on the channel feature similarity matrix, and constructing a spatial graph representation according to the binary space adjacency matrix; Performing a spatial graph convolution operation on the original EEG data and the spatial graph representation to obtain a spatial feature graph; A time-adaptive graph convolution module is used to obtain the original EEG data corresponding to the motor imagery EEG signals of a single subject detected by multiple channels, perform time similarity calculation on the original EEG data, and obtain a time segment feature similarity matrix; Obtaining a binary time adjacency matrix based on the time period feature similarity matrix, and constructing a time graph representation according to the binary time adjacency matrix; performing a time graph convolution operation on the original EEG data and the time graph representation to obtain a time feature graph; A feature fusion module, used to fuse and splice the spatial feature map with the temporal feature map according to the depth dimension to obtain a spatiotemporal feature map containing spatial features and temporal features; The feature classification module is used to identify the motor imagery EEG signal based on the spatiotemporal feature graph to obtain a motor imagery EEG signal recognition result.
9. A terminal device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, the method for recognizing motor imagery EEG signals as described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for identifying motor imagery EEG signals as described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Touchless operating system for predicting operations using brain and body activities
TWI919832B
