Electroencephalogram signal feature extraction method and device for motor imagery task and storage medium

文档序号:1851873 发布日期:2021-11-19 浏览:39次 中文

阅读说明:本技术 运动想象任务的脑电信号特征提取方法、装置及存储介质 (Electroencephalogram signal feature extraction method and device for motor imagery task and storage medium ) 是由 于南希 黄梦婕 杨瑞 于 2021-08-19 设计创作,主要内容包括:本申请涉及一种运动想象任务的脑电信号特征提取,属于脑-机接口领域,该方法包括:获取运动想象任务的脑电信号;对脑电信号进行预处理,得到预处理后的脑电信号;将预处理后的脑电信号输入预先构建的深度CSP算法模型进行深度CSP滤波,得到满足预设区分度要求的特征矩阵;对特征矩阵进行特征提取,得到用于特征分类的特征向量。可以解决现有的CSP算法无法实现其最优化的目标,从而导致脑电信号特征提取不准确的问题。本申请的特征提取方法通过预先构建的深度CSP算法模型,对预处理后的脑电信号进行深度CSP滤波,可以提取出更显著的脑电特征,并使提取的脑电特征逼近真实目标函数的最优解,从而提升脑电信号特征分类的准确率。(The application relates to electroencephalogram signal feature extraction of a motor imagery task, belonging to the field of brain-computer interfaces, and the method comprises the following steps: acquiring an electroencephalogram signal of a motor imagery task; preprocessing the electroencephalogram signal to obtain a preprocessed electroencephalogram signal; inputting the preprocessed electroencephalogram signals into a pre-constructed depth CSP algorithm model for depth CSP filtering to obtain a feature matrix meeting the requirement of preset discrimination; and extracting the features of the feature matrix to obtain a feature vector for feature classification. The method can solve the problem that the existing CSP algorithm can not realize the optimization target, thereby causing the inaccurate extraction of the electroencephalogram signal characteristics. According to the feature extraction method, the depth CSP filtering is carried out on the preprocessed electroencephalogram signals through the pre-constructed depth CSP algorithm model, more obvious electroencephalogram features can be extracted, the extracted electroencephalogram features are enabled to approach to the optimal solution of a real target function, and therefore the accuracy of electroencephalogram signal feature classification is improved.)

1. An electroencephalogram signal feature extraction method for a motor imagery task, the method comprising:

acquiring an electroencephalogram signal of a motor imagery task;

preprocessing the electroencephalogram signal to filter noise of the electroencephalogram signal to obtain a preprocessed electroencephalogram signal;

inputting the preprocessed electroencephalogram signals into a pre-constructed depth CSP algorithm model for depth CSP filtering to obtain a feature matrix meeting the requirement of preset discrimination;

and extracting the features of the feature matrix to obtain a feature vector for feature classification.

2. The method according to claim 1, wherein the deep CSP algorithm model includes at least three layers of CSP models, wherein each layer of the CSP models outputs as inputs to the next layer of the CSP models, and wherein each layer of the CSP models constructs a corresponding CSP spatial filter based on the corresponding inputs.

3. The method according to claim 2, wherein the inputting the preprocessed electroencephalogram signal into a pre-constructed depth CSP algorithm model for depth CSP filtering comprises:

inputting the preprocessed electroencephalogram signal into a first-layer CSP model for CSP filtering to obtain a feature matrix;

selecting data with preset discrimination for the characteristic matrix;

inputting the data with the preset distinguishability into the next CSP model to carry out CSP filtering, and obtaining a feature matrix output by the next CSP model;

executing the characteristic matrix and selecting data with preset discrimination;

until the last layer of CSP model outputs data with preset distinguishability, the data is the characteristic matrix meeting the preset distinguishability requirement.

4. The method of claim 3, wherein the selecting the data satisfying the discrimination requirement comprises:

selecting data of preset line numbers at the head and the tail of the characteristic matrix;

and merging the data with the preset line number to obtain data meeting the discrimination requirement, wherein the data meeting the discrimination requirement is the data which meets the requirement of variance difference of the electroencephalogram data input into the CSP model.

5. The method of claim 4, wherein the feature classification comprises a multi-classification task for which the inputting of the pre-processed brain electrical signal into a pre-constructed deep CSP algorithm model for deep CSP filtering comprises:

dividing electroencephalogram signal data corresponding to a plurality of classes of motor imagery tasks into a plurality of groups of electroencephalogram data, wherein the electroencephalogram data comprise first-class electroencephalogram data and second-class electroencephalogram data, the first-class electroencephalogram data comprise electroencephalogram signal data corresponding to one class of motor imagery tasks, and the second-class electroencephalogram data comprise electroencephalogram signal data of at least one class of motor imagery tasks except the first-class electroencephalogram data;

and aiming at each group of the first electroencephalogram data and the second electroencephalogram data, CSP filtering is carried out by adopting a pre-constructed CSP spatial filter to obtain a feature matrix corresponding to each group of electroencephalogram data, and after the feature matrix is used for extracting feature vectors, the feature vectors are fused to obtain the fused feature vectors for feature classification.

6. The method of claim 4, wherein the dividing the electroencephalogram signal data corresponding to the plurality of classes of motor imagery tasks into a plurality of groups of electroencephalogram data comprises:

and respectively aiming at each class of motor imagery tasks, taking the corresponding electroencephalogram data as the first class of electroencephalogram data, and combining the electroencephalogram data corresponding to other classes of motor imagery tasks to be taken as the second class of electroencephalogram data.

7. The method of claim 4, wherein the dividing the electroencephalogram signal data corresponding to the plurality of classes of motor imagery tasks into a plurality of groups of electroencephalogram data comprises:

by means of permutation and combination, the electroencephalogram signal data corresponding to the two types of motor imagery tasks are sequentially selected to serve as the first type of electroencephalogram data and the second type of electroencephalogram data respectively.

8. An electroencephalogram signal feature extraction device for a motor imagery task, characterized by comprising:

the signal acquisition module is used for acquiring an electroencephalogram signal of the motor imagery task;

the preprocessing module is used for preprocessing the electroencephalogram signal to filter noise of the electroencephalogram signal and obtain a preprocessed electroencephalogram signal;

the filtering module is used for inputting the preprocessed electroencephalogram signals into a pre-constructed depth CSP algorithm model for depth CSP filtering to obtain a feature matrix meeting the requirement of preset discrimination;

and the characteristic extraction module is used for extracting the characteristics of the characteristic matrix to obtain a characteristic vector for characteristic classification.

9. An electroencephalogram signal feature extraction device of a motor imagery task is characterized by comprising a processor and a memory; the memory stores a program which is loaded and executed by the processor to implement the electroencephalogram signal feature extraction method of a motor imagery task according to any one of claims 1 to 7.

10. A computer-readable storage medium characterized in that a program is stored in the storage medium, which when executed by a processor, is used to implement the electroencephalogram signal feature extraction method of a motor imagery task according to any one of claims 1 to 7.

Technical Field

The application relates to an electroencephalogram signal feature extraction method for a motor imagery task, and belongs to the technical field of brain-computer interfaces.

Background

The brain-computer interface technology is a technology for directly translating physiological signals of a human brain into control commands of external equipment without depending on muscle or nerve activity of a human being as output, and a brain-computer interface system based on motor imagery can provide a new control mode for dyskinesia patients and has wide application prospects in the fields of medical rehabilitation and the like.

Because electroencephalogram signals have strong individual difference, non-stationarity and time-varying difference and are easily influenced by noise, some traditional time domain, frequency domain and time frequency analysis methods have certain limitations on feature extraction and often cannot stably and accurately extract features of tasks.

Common Spatial Pattern (CSP) algorithm is used as a supervised feature extraction method, features can be stably and accurately extracted without depending on expert or experience judgment of repeated experiments, and the CSP algorithm is also applied to the field of electroencephalogram classification.

The CSP algorithm achieves the goal of maximizing the variance difference between two types of data by diagonalizing the mean covariance matrix of the two types of data simultaneously. However, the existing CSP algorithm defines the optimization objective function as

Wherein, W represents a spatial filter,mean spatial covariance matrix, W, of the electroencephalographic signal data representing the first class of motor imagery tasksTRepresenting the transpose of the spatial filter W, and in order to achieve the goal of maximum variance difference between the two types of data, the corresponding optimization objective function should actually be:

wherein the content of the first and second substances,an average spatial covariance matrix representing the filtered brain electrical signal data of the first class of motor imagery tasks,and representing the average spatial covariance matrix of the filtered electroencephalogram signal data of the second type of motor imagery task.

Therefore, the existing CSP algorithm cannot realize the optimization target, so that the problem of inaccurate electroencephalogram signal feature extraction is caused.

Disclosure of Invention

The application provides an electroencephalogram signal feature extraction method, device and storage medium for a motor imagery task, which are used for solving the problem that the electroencephalogram signal feature extraction is inaccurate due to the fact that the existing CSP algorithm cannot achieve the optimization target.

In order to solve the technical problem, the application provides the following technical scheme:

in a first aspect, a method for extracting electroencephalogram signal features of a motor imagery task is provided, and the method includes:

acquiring an electroencephalogram signal of a motor imagery task;

preprocessing the electroencephalogram signal to filter noise of the electroencephalogram signal to obtain a preprocessed electroencephalogram signal;

inputting the preprocessed electroencephalogram signals into a pre-constructed depth CSP algorithm model for depth CSP filtering to obtain a feature matrix meeting the requirement of preset discrimination;

and extracting the features of the feature matrix to obtain a feature vector for feature classification.

Optionally, the deep CSP algorithm model includes at least three layers of CSP models, where each layer of the CSP model outputs as an input to the next layer of the CSP model, and each layer of the CSP model constructs a corresponding CSP spatial filter based on the corresponding input.

Optionally, the inputting the preprocessed electroencephalogram signal into a pre-constructed depth CSP algorithm model for depth CSP filtering includes:

inputting the preprocessed electroencephalogram signal into a first-layer CSP model for CSP filtering to obtain a feature matrix;

selecting data with preset discrimination for the characteristic matrix;

inputting the data with the preset distinguishability into the next CSP model to carry out CSP filtering, and obtaining a feature matrix output by the next CSP model;

executing the characteristic matrix and selecting data with preset discrimination;

and until the data with the preset distinguishability is output by the last layer of CSP model, the obtained data with the preset distinguishability is the feature matrix meeting the preset distinguishability requirement.

Optionally, the selecting data meeting the discrimination requirement includes:

selecting data of preset line numbers at the head and the tail of the characteristic matrix;

and merging the data with the preset line number to obtain data meeting the discrimination requirement, wherein the data meeting the discrimination requirement is the data which meets the requirement of variance difference of the electroencephalogram data input into the CSP model.

Optionally, the feature classification includes a multi-classification task, and for the multi-classification task, the inputting the preprocessed electroencephalogram signal into a pre-constructed depth CSP algorithm model for performing depth CSP filtering includes:

dividing electroencephalogram signal data corresponding to a plurality of classes of motor imagery tasks into a plurality of groups of electroencephalogram data, wherein the electroencephalogram data comprise first-class electroencephalogram data and second-class electroencephalogram data, the first-class electroencephalogram data comprise electroencephalogram signal data corresponding to one class of motor imagery tasks, and the second-class electroencephalogram data comprise electroencephalogram signal data of at least one class of motor imagery tasks except the first-class electroencephalogram data;

and aiming at each group of the first electroencephalogram data and the second electroencephalogram data, CSP filtering is carried out by adopting a pre-constructed CSP spatial filter to obtain a feature matrix corresponding to each group of electroencephalogram data, and after the feature matrix is used for extracting feature vectors, the feature vectors are fused to obtain the fused feature vectors for feature classification.

Optionally, the dividing the electroencephalogram signal data corresponding to the multiple classes of motor imagery tasks into multiple groups of first-class electroencephalogram data and second-class electroencephalogram data includes:

and respectively aiming at each class of motor imagery task, taking the electroencephalogram signal data corresponding to the current motor imagery task as the first class of electroencephalogram data, and combining the electroencephalogram signal data corresponding to other classes of motor imagery tasks to obtain the second class of electroencephalogram data.

Optionally, the dividing the electroencephalogram signal data corresponding to the multiple classes of motor imagery tasks into multiple groups of first electroencephalogram signal data and second electroencephalogram signal data includes:

by means of permutation and combination, the electroencephalogram signal data corresponding to the two types of motor imagery tasks are sequentially selected to serve as the first type of electroencephalogram data and the second type of electroencephalogram data respectively.

In a second aspect, an electroencephalogram signal feature extraction device for a motor imagery task is provided, the device comprising:

the signal acquisition module is used for acquiring an electroencephalogram signal of the motor imagery task;

the preprocessing module is used for preprocessing the electroencephalogram signal to filter noise of the electroencephalogram signal and obtain a preprocessed electroencephalogram signal;

the filtering module is used for inputting the preprocessed electroencephalogram signals into a pre-constructed depth CSP algorithm model for depth CSP filtering to obtain a feature matrix meeting the requirement of preset discrimination;

and the characteristic extraction module is used for extracting the characteristics of the characteristic matrix to obtain a characteristic vector for characteristic classification.

In a third aspect, an electroencephalogram signal feature extraction device for a motor imagery task is provided, and the device comprises a processor and a memory; the memory stores a program, and the program is loaded and executed by the processor to realize the electroencephalogram signal feature extraction method of the motor imagery task of the first aspect.

In a fourth aspect, a computer-readable storage medium is provided, in which a program is stored, and the program is used for implementing the electroencephalogram feature extraction method of the motor imagery task of the first aspect when executed by a processor.

The beneficial effect of this application lies in: the method for extracting the features comprises the steps of inputting a preprocessed electroencephalogram signal into a pre-constructed deep CSP algorithm model for deep CSP filtering to obtain a feature matrix meeting the requirement of preset discrimination; and extracting the features of the feature matrix to obtain a feature vector for feature classification. The method can solve the problem that the existing CSP algorithm cannot realize the optimization target, so that the electroencephalogram signal feature extraction is inaccurate. According to the feature extraction method, the depth CSP filtering is carried out on the preprocessed electroencephalogram signals through the pre-constructed depth CSP algorithm model, more obvious electroencephalogram features can be extracted, the extracted electroencephalogram features are enabled to approach to the optimal solution of a real target function, and therefore the accuracy of electroencephalogram signal feature classification is improved.

The foregoing description is only an overview of the technical solutions of the present application, and in order to make the technical solutions of the present application more clear and clear, and to implement the technical solutions according to the content of the description, the following detailed description is made with reference to the preferred embodiments of the present application and the accompanying drawings.

Drawings

Fig. 1 is a flowchart of an electroencephalogram signal feature extraction method for a motor imagery task according to an embodiment of the present application;

FIG. 2 is a block diagram of a pre-constructed deep CSP algorithm model provided by one embodiment of the present application;

FIG. 3 is a flow chart of CSP depth filtering based on a pre-constructed deep CSP algorithm model according to an embodiment of the present application;

FIG. 4 is a flow chart of a method for constructing a CSP spatial filter by a CSP model according to an embodiment of the present application;

fig. 5 is a block diagram of an electroencephalogram signal feature extraction device of a motor imagery task according to an embodiment of the present application;

fig. 6 is a block diagram of an electroencephalogram signal feature extraction device for a motor imagery task according to another embodiment of the present application.

Detailed Description

In order to make the objects, technical solutions and advantages of the present application more apparent, the following detailed description of the embodiments of the present application is provided in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.

Optionally, an execution subject of each embodiment of the present application is an electronic device, and the electronic device has an electroencephalogram feature extraction function of a motor imagery task. Schematically, the electronic device executes the electroencephalogram signal feature extraction method of the motor imagery task provided by the application by calling electroencephalogram signal extraction software of the motor imagery task which is installed in advance.

The electronic device may be a computer, a mobile phone, or the like, and the present embodiment does not limit the device type of the electronic device.

Aiming at the problem that the electroencephalogram signal feature extraction is inaccurate because the CSP algorithm cannot realize the optimization target in the prior art, the application provides an electroencephalogram signal feature extraction method and device for a motor imagery task and a storage medium.

Fig. 1 is a flowchart of an electroencephalogram signal feature extraction method for a motor imagery task according to an embodiment of the present application. The method at least comprises the steps of 101-104:

step 101, acquiring an electroencephalogram signal of a motor imagery task.

Specifically, the motor imagery task refers to a task that does not have actual limb behaviors and uses brain ideas to imagine limb actions, such as: the brain now imagines a left-hand lifting task, but without actually doing the left-hand lifting task, the left-hand lifting at this time is a motor imagery task.

The electroencephalogram signals are important physiological signals of human bodies and are electric signals emitted by the brain. Specifically, brain electrical signals are presented through brain waves, which record the electrical wave changes during brain activities and are the general reflection of the electrophysiological activities of brain nerve cells on the surface of the cerebral cortex or scalp.

According to the embodiment, the electroencephalogram signals are acquired through the electronic equipment and can be acquired through the electroencephalogram signal acquisition equipment.

The electroencephalogram signal acquisition equipment can be, for example, an EPOC Flex rubber electrode plate manufactured by EMOTIV company. The electrodes are connected to the scalp by the colloid conductive agent as an intermediate medium, penetrating the hair.

The electrodes of the electroencephalogram signal acquisition device are placed on the scalp of a human body, and specifically, the electrodes can be placed at preset positions of the scalp, such as FPz (frontal midline), C4 (right center), FP1 (left frontal pole), FP2 (right frontal pole) and the like according to different motor imagery tasks, so as to acquire multichannel electroencephalogram signals.

Step 102, preprocessing the electroencephalogram signal data to filter noise of the electroencephalogram signal and obtain the preprocessed electroencephalogram signal.

Specifically, because the electroencephalogram signal of the motor imagery task contains a large amount of artifact components (non-electroencephalogram signals caused by internal oscillation of a human body, such as eye movement, heartbeat and the like) and external interference noise, the electroencephalogram signal of the motor imagery task needs to be preprocessed to reduce artifacts and interference in the electroencephalogram signal, reduce the influence of noise on the electroencephalogram signal, and improve the signal-to-noise ratio of data.

Optionally, the step of preprocessing the electroencephalogram signal in this embodiment includes:

and filtering the electroencephalogram signals. Because the external interference noise frequency is higher, low-pass filtering is adopted for separation, and signals higher than the preset frequency are filtered.

And (4) segmenting the electroencephalogram signals. For continuous brain electrical signals, only the part containing the motor imagery task is taken, such as: a portion of 0.5s-3s of the task with a total length of 3.5s in a single pass is selected.

And removing artifacts from the electroencephalogram signals. Aiming at the problem of interference of artifacts such as blink, electrocardio, myoelectricity and the like in the acquired electroencephalogram data, an independent component analysis method can be adopted to remove the artifacts.

And 103, inputting the preprocessed electroencephalogram signals into a pre-constructed depth CSP algorithm model for depth CSP filtering to obtain a feature matrix meeting the requirement of preset discrimination.

Optionally, as shown in fig. 2, the depth CSP algorithm model pre-constructed in this embodiment includes: and at least three layers of CSP models, wherein the output of each layer of CSP model is used as the input of the next layer of CSP model, and each layer of CSP model constructs a CSP spatial filter based on the corresponding input.

Optionally, the step of performing CSP depth filtering based on the pre-constructed depth CSP algorithm model in this embodiment with reference to fig. 3 at least includes steps 401 and 405:

step 401, inputting the preprocessed electroencephalogram signals into a first-layer CSP model to perform CSP filtering to obtain a feature matrix;

step 402: selecting data with preset discrimination from the obtained feature matrix;

step 403: whether the model is the last layer of CSP model currently or not, if not, executing a step 404; if yes, go to step 405;

step 404: and inputting the data with the preset distinguishability into the next CSP model to carry out CSP filtering to obtain a feature matrix output by the next CSP model, and returning to the step 402.

Step 405: the currently obtained data with the preset distinguishability is the feature matrix meeting the preset distinguishability requirement.

The data with the predetermined differentiation selected in this embodiment is, for example, the first m rows and the last m rows of the feature matrix. Because the CSP algorithm is to make the variance difference between the two types of input data the maximum, and the variance difference between the head and tail of the feature matrix is large, and the data in the middle section is relatively small, the embodiment selects each m rows of data at the head and tail of the feature matrix as the feature matrix to be finally extracted.

The deep CSP algorithm model is divided into a deep CSP algorithm model based on a two-classification motor imagery task and a deep CSP algorithm model based on a multi-classification motor imagery task.

Based on a depth CSP algorithm model of the two-classification motor imagery tasks, aiming at the acquired electroencephalogram sample data of the two types of motor imagery tasks, a CSP spatial filter of the two classifications is constructed.

The method comprises the steps of dividing electroencephalogram sample data of multiple classes of motor imagery tasks into multiple groups of first-class electroencephalogram data and second-class electroencephalogram data based on a deep CSP algorithm model of the multi-class motor imagery tasks, and constructing corresponding multi-class CSP spatial filters.

Optionally, when the multi-class CSP spatial filter is constructed, the electroencephalogram sample data of the multi-class motor imagery task is divided into multiple groups of electroencephalogram sample data according to a predetermined division manner, and each group of electroencephalogram sample data is composed of a first type of electroencephalogram data and a second type of electroencephalogram data. And constructing a corresponding CSP spatial filter for each group of electroencephalogram sample data by adopting a CSP algorithm, selecting data with a preset number of lines for the CSP spatial filter corresponding to each group of electroencephalogram sample data, and merging the selected data with the preset number of lines to obtain the multi-classification CSP spatial filter.

Optionally, the preset dividing manner in this embodiment includes two specific dividing manners:

firstly, taking electroencephalogram data corresponding to one type of motor imagery task as first type of electroencephalogram data, and combining electroencephalogram data corresponding to other types of motor imagery tasks to obtain second type of electroencephalogram data. For example, electroencephalogram data of a motor imagery task of four categories: m1, M2, M3 and M4, wherein M1 is used as first-class electroencephalogram data, data obtained by combining M2, M3 and M4 are used as second-class electroencephalogram data, M2 is used as first-class electroencephalogram data, M1, M3 and M4 are used as second-class electroencephalogram data, and the rest is repeated to obtain four groups of data.

And secondly, selecting electroencephalogram signal data corresponding to any two types of motor imagery tasks as first type electroencephalogram data and second type electroencephalogram data respectively. For example, electroencephalogram data of a motor imagery task of four categories: m1, M2, M3 and M4, wherein M1 and M2 are respectively used as first electroencephalogram data and second electroencephalogram data, M1 and M3 are respectively used as the first electroencephalogram data and the second electroencephalogram data, M1 and M4 are respectively used as the first electroencephalogram data and the second electroencephalogram data, M2 and M3 are respectively used as the first electroencephalogram data and the second electroencephalogram data, M2 and M4 are respectively used as the first electroencephalogram data and the second electroencephalogram data, and M3 and M4 are respectively used as the first electroencephalogram data and the second electroencephalogram data to obtain 6 groups of electroencephalogram data.

The method for performing CSP filtering on each CSP model in the embodiment comprises the following steps:

and step 31, obtaining a filtered feature matrix according to a pre-constructed CSP spatial filter.

For the two-classification motor imagery task, according to the constructed two-classification CSP spatial filter, carrying out CSP filtering on the input preprocessed electroencephalogram signals to obtain a characteristic matrix:

Zi=WXi,i=1,2

w is the constructed two-class CSP spatial filter.

For the multi-classification motor imagery task, performing CSP filtering on the multiple groups of two types of electroencephalogram data divided in the step 405 respectively based on pre-constructed multi-classification CSP spatial filters to obtain a feature matrix corresponding to each group of electroencephalogram data, namely:

Zi=W′Xi,i=1,2

w' is the CSP spatial filter of the multi-classification constructed.

Step 32: selecting data

Because the variance of each dimension of the feature matrix of the electroencephalogram data is large in the head and tail difference, the data discrimination of the middle section is relatively small, m of the head and tail of the feature matrix of the electroencephalogram data is selected for further calculation in order to simplify the calculation complexity and avoid the adverse effect of redundant data on the algorithm, wherein 2m is less than or equal to N, and N is the number of channels.

For the multi-classification motor imagery task, each group of divided electroencephalogram data is subjected to deep CSP filtering respectively to obtain corresponding feature matrixes. And during feature classification, performing feature fusion on the feature vectors extracted based on the feature matrixes to obtain the finally fused feature vectors for feature classification.

Fig. 4 is a flowchart of a method for constructing a CSP spatial filter by a CSP model in the embodiment of the present application, and referring to fig. 4, in the embodiment, each layer of CSP model constructs a CSP spatial filter in the following manner, and a specific process for constructing a CSP spatial filter by each CSP model in the embodiment includes step 301-:

step 301: and respectively calculating a spatial covariance matrix corresponding to each type of electroencephalogram data, and calculating an average spatial covariance matrix of each type of electroencephalogram data and a corresponding mixed spatial covariance matrix.

Wherein R isiRepresenting the spatial covariance matrix, X, corresponding to the i-th electroencephalogram dataiA matrix representing the acquired type i brain electrical data,represents XiThe transpose matrix of (a) is,represents XiThe sum of the elements on the diagonal. The electroencephalogram data is training set sample data.

The hybrid spatial covariance matrix R is thus obtained as:

whereinAnd (3) representing an average covariance matrix of the ith electroencephalogram data, wherein i is 1 and 2.

For the motor imagery tasks of the second classification, the electroencephalogram data of one class of the motor imagery tasks are used as the electroencephalogram data of the 1 st class, and the electroencephalogram data of the other class of the motor imagery tasks are used as the electroencephalogram data of the 2 nd class.

For the multi-classification motor imagery task, the 1 st type electroencephalogram data and the 2 nd type electroencephalogram data can be obtained through division according to the step 405.

And 302, performing eigenvalue decomposition on the mixed space covariance matrix R by using a singular value decomposition theorem, and arranging the eigenvalues in a descending order.

R=UλUT

Wherein, U is an eigenvector matrix of R, and λ is a diagonal matrix formed by corresponding eigenvalues.

Step 303: a whitening matrix is calculated.

The whitening matrix P is obtained by orthogonal whitening:

and step 304, constructing the CSP spatial filter.

For the CSP filtering algorithm of two classifications, the whitening matrix P is utilized to respectively act onObtaining two whitened matrixes S1、S2

S1=PR1PT=Bλ1BT

S2=PR2PT=Bλ2BT

Because of S1、S2With a common eigenvector matrix B, and there are two diagonal matrices λ1、λ2Lambda can be obtained by principal component decomposition12Equal to the identity matrix I.

Therefore, the CSP spatial filter W is constructed as BTP, the CSP spatial filter W satisfies: when S is1When there is the largest eigenvalue, S2There is a minimum eigenvalue.

For the CSP filtering algorithm of multi-classification, the matrix S 'is obtained similarly'1、S′2

S′1=PR1PT=B′λ′1B′T

S′2=PR′1PT=B′λ2′B′T

Because of S1、S′1With a common eigenvector matrix B' and there being two diagonal matrices λ2′、λ1', lambda can be obtained by principal component decomposition2′+λ1' equals identity matrix I.

Thus, the CSP spatial filter is constructed as: w' ═ B′TP, the CSP spatial filter satisfies: is S'2S 'when the characteristic value is maximum'1There is a minimum eigenvalue.

And 104, extracting the features of the feature matrix to obtain feature vectors for classification.

Specifically, y is calculated for the finally selected 2k (2 k. ltoreq.2 m. ltoreq.N) line dataj=log(Var(zj) Forming 2 k-dimensional features to obtain feature vectors for classification. Wherein y isjFeature vector, z, representing the jth line of the selected datajJ is 1,2, …,2k, which represents the j-th row of the selected data.

In order to more clearly understand the electroencephalogram signal feature extraction method of the motor imagery task provided by the present application, the electroencephalogram signal feature extraction method of the present application is described below with a specific example of feature extraction for performing two-classification on electroencephalogram signals.

Step 1, collecting sample data of an electroencephalogram signal of a motor imagery task.

The collected sample data contains two types of motor imagery tasks for imagining the right hand and the right foot.

Sample data was collected from 118 electrodes on the scalp surface of five healthy subjects at a sampling frequency of 100 Hz. Each subject records 280 times of sample data of electroencephalogram signals of the motor imagery tasks, wherein the right hand and the right foot are respectively 140 times, a single motor imagery task lasts for 3.5s, and a rest time with random duration of 1.75s-2.25s is arranged between two motor imagery tasks.

And 2, preprocessing the acquired electroencephalogram signal sample data of the motor imagery task.

Filtering 8-30Hz on original electroencephalogram signal sample data, selecting a part of 0.5s-3s from a motor imagery task with the total time of a single time of 3.5s, and removing artifact components such as ocular electrograms by using an independent component analysis method to obtain preprocessed electroencephalogram signal sample data, so that the dimensionality of the preprocessed sample data of the single motor imagery is 116 x 250.

And 3, inputting the sample data into a pre-constructed deep CSP algorithm model for deep CSP filtering to obtain a feature matrix, and extracting features.

In the embodiment, the dimension of each layer of selection data in the deep CSP algorithm model depends on the dimension of the finally extracted features. For example, if a 2 m-dimensional feature is finally extracted, the input data dimension of the last layer is 4m × 250, the input data dimension of the previous layer is 8m × 250, and so on.

Table 1 shows the average accuracy, the highest accuracy and the lowest accuracy of 10 experiments reflecting the performance of the model, where the results of a single layer are the results of using the CSP algorithm model, and the results of two-layer and three-layer show the results of overlapping and reusing the CSP algorithm twice and the results of overlapping and reusing the deep CSP algorithm of three-time CSP algorithm three times, respectively.

TABLE 1 summary of accuracy rates of two-class single-layer CSP algorithm model, two-layer CSP algorithm model and cubic deep CSP algorithm model

As can be seen from Table 1, the accuracy of the two-layer or three-layer CSP algorithm model is improved to a certain extent in comparison with that of a single-layer CSP algorithm model, and the highest accuracy of the subject Al is 98.93% no matter the subject uses CSP for several times. But since this accuracy is already high, it is reasonable without further improvement.

The following describes the feature extraction method of the present application with a specific example of feature extraction for multi-classification:

step 1, collecting sample data of an electroencephalogram signal of a motor imagery task.

The sample data of the electroencephalogram signals of the acquired motor imagery tasks comprise four types of motor imagery tasks for imagining the motion of the right hand, the left hand, the feet and the tongue.

Sample data of brain electrical signals were from three healthy subjects (subject B1, subject B2, and subject B3), 60 electrodes collected on the surface of the scalp, with a sampling frequency of 250 Hz. The subject B1 acquires electroencephalogram sample data of 360 motor imagery tasks, the subject B2 and the subject B3 acquire electroencephalogram sample data of 240 motor imagery tasks respectively, and the duration of a single motor imagery task is 4 s.

And 2, preprocessing the acquired electroencephalogram signals of the motor imagery task.

The pre-processing can be seen in the pre-processing step of the two-class feature extraction embodiment. And finally, selecting the information of the 100 th and 900 th sampling points of the single motor imagery task for subsequent feature extraction and classification. The sample data dimension of the preprocessed single motor imagery task is 60 × 800.

And 3, inputting the sample data into a pre-constructed deep CSP algorithm model to perform deep CSP filtering to obtain a feature matrix, and extracting features.

The sample data is based on the sample data of four motor imagery tasks of right hand, left hand, foot and tongue.

The sample data of the training set of the four types of motor imagery tasks are divided into two types of data, and two division modes given in step S376 can be adopted:

firstly, for each type of motor imagery task, taking training sample data corresponding to the motor phenomenon task as first type of electroencephalogram data, combining training sample data corresponding to the other three types of motor imagery tasks as second type of electroencephalogram data, and finally obtaining four groups of training sample data.

Taking a right-hand motor imagery task as an example, taking training set sample data corresponding to the right-hand motor imagery task as first electroencephalogram data, and combining training set sample data corresponding to the motor imagery tasks of the left hand, the feet and the tongue to serve as second electroencephalogram data.

And aiming at each class of motor imagery task, designing the CSP spatial filter based on the divided two classes of data respectively so as to obtain four corresponding CSP spatial filters, and then merging the data of the four CSP spatial filters to obtain the four-class CSP spatial filter.

Respectively inputting sample data of four types of motor imagery tasks of the right hand, the left hand, the feet and the tongue into a CSP spatial filter of four types, carrying out CSP filtering to obtain four groups of feature matrixes, finally forming four groups of features, and connecting the four groups of features in series and fusing to obtain a final extracted feature vector. If each layer of CSP model extracts 2 m-dimensional features after filtering, the feature vector finally used for classification is 8 m-dimensional.

And secondly, taking the right hand and the left hand as a first-class motor imagery task and a second-round motor imagery task, filtering the two classes of designed depth CSP algorithm models, taking the right hand and the foot as the first-class motor imagery task and the second-round motor imagery task, filtering the two classes of designed depth CSP algorithm models, repeating the steps to form six groups of features, fusing the six groups of features in series, and if 2 m-dimensional features are extracted from each layer of CSP algorithm model after filtering, finally, enabling the features for classification to be 12 m-dimensional.

Table 2 shows the results of 5 experiments with 1 to 5 m, i.e., 5 experiments with 2 to 10 dimensions of classification characteristics, and the average accuracy, the highest accuracy and the lowest accuracy of the 5 experiments are shown in the table to reflect the performance of the model, wherein the result of a single layer is the result of using the CSP algorithm model, and the results of overlapping and repeatedly using the CSP algorithm twice and the results of overlapping and repeatedly using the deep CSP algorithm three times are respectively shown in two and three layers.

TABLE 2 accuracy summary of multi-classification single-layer CSP algorithm model, two-layer CSP algorithm model and cubic depth CSP algorithm model

As can be seen from table 2, the feature extraction method performed by the deep CSP algorithm model adopted in this embodiment can extract more significant features of the electroencephalogram signal of the motor imagery task, and improve the accuracy of classification.

In summary, the electroencephalogram signal feature extraction method for the motor imagery task provided by the embodiment acquires the electroencephalogram signal of the motor imagery task; preprocessing the electroencephalogram signal to filter noise of the electroencephalogram signal to obtain a preprocessed electroencephalogram signal; inputting the preprocessed electroencephalogram signals into a pre-constructed depth CSP algorithm model for depth CSP filtering to obtain a feature matrix meeting the requirement of preset discrimination; extracting the features of the feature matrix to obtain feature vectors for feature classification; the method can solve the problem that the existing CSP algorithm can not realize the optimization target, thereby causing the inaccurate extraction of the electroencephalogram signal characteristics. According to the feature extraction method, the depth CSP filtering is carried out on the preprocessed electroencephalogram signals through the pre-constructed depth CSP algorithm model, more obvious electroencephalogram features can be extracted, the extracted electroencephalogram features are enabled to approach to the optimal solution of a real target function, and therefore the accuracy of electroencephalogram signal feature classification is improved.

Fig. 5 is a block diagram of an electroencephalogram signal feature extraction device of a motor imagery task according to an embodiment of the present application. The device at least comprises the following modules: a signal acquisition module 510, a pre-processing module 520, a filtering module 530, and a feature extraction module 540.

A signal obtaining module 510, configured to obtain an electroencephalogram signal of a motor imagery task;

the preprocessing module 520 is used for preprocessing the electroencephalogram signal to filter noise of the electroencephalogram signal and obtain a preprocessed electroencephalogram signal;

the filtering module 530 is used for inputting the preprocessed electroencephalogram signals into a pre-constructed depth CSP algorithm model for depth CSP filtering to obtain a feature matrix meeting the requirement of preset discrimination;

and the feature extraction module 540 is configured to perform feature extraction on the feature matrix to obtain a feature vector for feature classification.

For relevant details reference is made to the above-described method embodiments.

It should be noted that: in the electroencephalogram feature extraction device of the motor imagery task provided in the above embodiment, when performing electroencephalogram feature extraction, only the division of each functional module is exemplified, and in practical application, the function distribution may be completed by different functional modules as needed, that is, the internal structure of the electroencephalogram feature extraction device of the motor imagery task is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the electroencephalogram signal feature extraction device of the motor imagery task and the electroencephalogram signal feature extraction method of the motor imagery task provided by the embodiment belong to the same concept, and specific implementation processes are described in the method embodiment in detail and are not described herein again.

Fig. 6 is a block diagram of an electroencephalogram feature extraction device of a motor imagery task according to an embodiment of the present application, where the device may be: a tablet, a laptop, a desktop, or a server. The electroencephalogram feature extraction device of the motor imagery task may also be referred to as a portable terminal, a desktop terminal, a control terminal, and the like, and the present embodiment does not limit the type of the extraction device. The apparatus comprises at least a processor 601 and a memory 602.

Processor 601 includes one or more processing cores such as: 4 core processors, 8 core processors, etc. The processor 601 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 601 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, processor 601 may also include an AI (Artificial Intelligence) processor for processing computational operations related to machine learning.

The memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in the memory 602 is used to store at least one instruction for execution by the processor 601 to implement the electroencephalogram signal feature extraction method for motor imagery tasks provided by the method embodiments of the present application.

In some embodiments, the electroencephalogram signal feature extraction device operating imagination may further include: a peripheral interface and at least one peripheral. The processor 601, memory 602 and peripheral interface may be connected by bus and signal lines. Each peripheral may be connected to the peripheral interface via a bus, signal line, or circuit board.

Of course, the electroencephalogram signal feature extraction device of the motor imagery task may also include fewer or more components, which is not limited by the embodiment.

Optionally, the present application further provides a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the electroencephalogram signal feature extraction method of the motor imagery task of the above-described method embodiment.

Optionally, the present application further provides a computer product, which includes a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the electroencephalogram feature extraction method for a motor imagery task of the above-described method embodiment.

The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.

The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

18页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于神经网络的脑电图数据存储和传输方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!