CN113688952A - Brain-computer interface decoding acceleration method and system based on self-adaptive electroencephalogram channel selection - Google Patents
Brain-computer interface decoding acceleration method and system based on self-adaptive electroencephalogram channel selection Download PDFInfo
- Publication number
- CN113688952A CN113688952A CN202111237839.3A CN202111237839A CN113688952A CN 113688952 A CN113688952 A CN 113688952A CN 202111237839 A CN202111237839 A CN 202111237839A CN 113688952 A CN113688952 A CN 113688952A
- Authority
- CN
- China
- Prior art keywords
- decoding
- data
- decoded
- channel
- optimal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 63
- 230000001133 acceleration Effects 0.000 title claims abstract description 33
- 230000003044 adaptive effect Effects 0.000 claims abstract description 42
- 238000006243 chemical reaction Methods 0.000 claims abstract description 18
- 238000000605 extraction Methods 0.000 claims abstract description 16
- 230000006870 function Effects 0.000 claims description 38
- 238000012549 training Methods 0.000 claims description 27
- 239000011159 matrix material Substances 0.000 claims description 25
- 230000009466 transformation Effects 0.000 claims description 23
- 238000013144 data compression Methods 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 18
- 210000004556 brain Anatomy 0.000 claims description 17
- 238000013145 classification model Methods 0.000 claims description 11
- 230000004913 activation Effects 0.000 claims description 10
- 238000004364 calculation method Methods 0.000 claims description 10
- 238000012935 Averaging Methods 0.000 claims description 6
- 230000001174 ascending effect Effects 0.000 claims description 4
- 230000007547 defect Effects 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 5
- 208000028389 Nerve injury Diseases 0.000 description 3
- 230000003542 behavioural effect Effects 0.000 description 3
- 238000007906 compression Methods 0.000 description 3
- 230000006835 compression Effects 0.000 description 3
- 230000008764 nerve damage Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000004422 calculation algorithm Methods 0.000 description 2
- 238000010276 construction Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000007177 brain activity Effects 0.000 description 1
- 210000004958 brain cell Anatomy 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000005764 inhibitory process Effects 0.000 description 1
- 230000003447 ipsilateral effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 210000000337 motor cortex Anatomy 0.000 description 1
- 230000001537 neural effect Effects 0.000 description 1
- 230000000926 neurological effect Effects 0.000 description 1
- 231100000878 neurological injury Toxicity 0.000 description 1
- 210000000869 occipital lobe Anatomy 0.000 description 1
- 230000037361 pathway Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 208000020431 spinal cord injury Diseases 0.000 description 1
- 238000009827 uniform distribution Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
- G06F18/2415—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/011—Arrangements for interaction with the human body, e.g. for user immersion in virtual reality
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2218/00—Aspects of pattern recognition specially adapted for signal processing
- G06F2218/08—Feature extraction
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2218/00—Aspects of pattern recognition specially adapted for signal processing
- G06F2218/12—Classification; Matching
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Artificial Intelligence (AREA)
- Probability & Statistics with Applications (AREA)
- Human Computer Interaction (AREA)
- Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)
Abstract
本发明提供一种基于自适应脑电通道选择的脑机接口解码加速方法及系统,包括:获取待解码脑电数据;将所述待解码脑电数据输入解码模型,输出对所述待解码脑电数据进行意图解码的解码结果;其中,所述解码模型用于基于所述待解码脑电数据压缩为的最少通道数据进行特征提取得到策略特征,并根据所述策略特征选择最优通道数目以获取最优通道数据后,通过所述最优通道数据对所述待解码脑电数据进行意图解码。用以解决现有技术利用多通道进行脑电数据解码,造成解码效率低下的缺陷,实现通过解码模型进行待解码脑电数据解码通道的转换和选择,在不降低甚至提高解码精度的前提下,提高解码效率。
The present invention provides a brain-computer interface decoding acceleration method and system based on adaptive EEG channel selection, comprising: acquiring EEG data to be decoded; inputting the EEG data to be decoded into a decoding model, and outputting the EEG data to be decoded The decoding result of the intended decoding of the electrical data; wherein, the decoding model is used to perform feature extraction based on the minimum channel data compressed into the EEG data to be decoded to obtain a strategy feature, and select the optimal number of channels according to the strategy feature to After obtaining the optimal channel data, intentionally decode the EEG data to be decoded by using the optimal channel data. In order to solve the defect of low decoding efficiency caused by the use of multi-channel decoding of EEG data in the prior art, the conversion and selection of the decoding channel of the EEG data to be decoded through the decoding model is realized, and the decoding accuracy is not reduced or even improved. Improve decoding efficiency.
Description
技术领域technical field
本发明涉及脑机接口解码技术领域,尤其涉及一种基于自适应脑电通道选择的脑机接口解码加速方法及系统。The invention relates to the technical field of brain-computer interface decoding, in particular to a brain-computer interface decoding acceleration method and system based on adaptive EEG channel selection.
背景技术Background technique
脑机接口是在人或动物脑(或者脑细胞的培养物)与外部设备间建立的直接连接通路,即直接从脑电信号中解码大脑意图,进而控制外部设备。脑机接口康复训练对由中风、脊髓损伤等导致的神经损伤患者的功能康复起到非常重要的作用,该方法已经被广泛的应用于神经康复和运动辅助领域。具体而言,通过采集神经损伤患者与主动运动意图相关的脑电信息,对该脑电信息进行分析,并基于分析结果(与主动运动意图有关)控制康复训练设备,进行神经损伤患者的肢体运动功能训练,从而实现康复。与传统康复方法以及机器人辅助康复方法相比,基于脑机接口技术的康复训练是神经损伤患者主动参与康复训练控制,通过提高神经参与度促进神经可塑性的发生,从而有效提高康复训练效果。A brain-computer interface is a direct connection pathway established between human or animal brains (or cultures of brain cells) and external devices, that is, directly decoding brain intentions from EEG signals to control external devices. Brain-computer interface rehabilitation training plays a very important role in the functional rehabilitation of patients with neurological injuries caused by stroke, spinal cord injury, etc. This method has been widely used in the fields of neurological rehabilitation and sports assistance. Specifically, by collecting the EEG information related to active movement intention of nerve injury patients, analyzing the EEG information, and controlling the rehabilitation training equipment based on the analysis results (related to active movement intention), the limb movement of nerve injury patients is carried out. functional training for rehabilitation. Compared with traditional rehabilitation methods and robot-assisted rehabilitation methods, rehabilitation training based on brain-computer interface technology is that patients with nerve injury actively participate in the control of rehabilitation training, and promote the occurrence of neuroplasticity by increasing the degree of neural participation, thereby effectively improving the effect of rehabilitation training.
脑机接口康复训练面临的主要挑战之一是脑电信号解码效率低下。具体而言,输入数据量是影响脑机接口解码效率的关键因素。然而,为了保证解码精度,一个典型的脑机接口系统一般包含32到128个脑电通道。使用多个通道虽然能一定程度上提高解码精度,但是由此导致的高额的脑电数据量、较高的计算资源需求使得脑机接口解码效率低下,并且限制了脑机接口系统的部署平台,即很难在一些计算力欠缺的设备上部署。One of the main challenges faced by brain-computer interface rehabilitation training is the low decoding efficiency of EEG signals. Specifically, the amount of input data is a key factor affecting the decoding efficiency of brain-computer interfaces. However, in order to ensure the decoding accuracy, a typical brain-computer interface system generally contains 32 to 128 EEG channels. Although the use of multiple channels can improve the decoding accuracy to a certain extent, the resulting high amount of EEG data and high computing resource requirements make the decoding efficiency of the brain-computer interface low, and limit the deployment platform of the brain-computer interface system. , that is, it is difficult to deploy on some devices that lack computing power.
发明内容SUMMARY OF THE INVENTION
在本发明提供一种基于自适应脑电通道选择的基于自适应脑电通道选择的脑机接口解码加速方法及系统,用以解决现有技术利用多通道进行脑电数据解码,造成解码效率低下的缺陷,实现通过解码模型进行待解码脑电数据解码通道的转换和选择,在不降低甚至提高解码精度的前提下,提高解码效率。The present invention provides a brain-computer interface decoding acceleration method and system based on adaptive EEG channel selection based on adaptive EEG channel selection, to solve the problem of low decoding efficiency caused by the use of multiple channels to decode EEG data in the prior art It realizes the conversion and selection of the decoding channel of the EEG data to be decoded through the decoding model, and improves the decoding efficiency without reducing or even improving the decoding accuracy.
本发明提供一种基于自适应脑电通道选择的脑机接口解码加速方法,包括:The present invention provides a brain-computer interface decoding acceleration method based on adaptive EEG channel selection, comprising:
获取待解码脑电数据;Obtain the EEG data to be decoded;
将所述待解码脑电数据输入解码模型,输出对所述待解码脑电数据进行意图解码的解码结果;Inputting the EEG data to be decoded into a decoding model, and outputting a decoding result of intentionally decoding the EEG data to be decoded;
其中,所述解码模型用于基于所述待解码脑电数据压缩为的最少通道数据进行特征提取得到策略特征,并根据所述策略特征选择最优通道数目以获取最优通道数据后,通过所述最优通道数据对所述待解码脑电数据进行意图解码。Wherein, the decoding model is used to perform feature extraction based on the minimum channel data compressed into the EEG data to be decoded to obtain strategy features, and select the optimal number of channels according to the strategy features to obtain the optimal channel data. The optimal channel data is intended to decode the EEG data to be decoded.
根据所述的基于自适应脑电通道选择的脑机接口解码加速方法,所述将所述待解码脑电数据输入解码模型,输出对所述待解码脑电数据进行意图解码的解码结果,具体包括:According to the brain-computer interface decoding acceleration method based on adaptive EEG channel selection, inputting the EEG data to be decoded into a decoding model, and outputting a decoding result of intentionally decoding the EEG data to be decoded, specifically include:
基于输入的待解码脑电数据,进行对通道数据的压缩处理,得到所述待解码脑电数据的最少通道数据;Based on the input EEG data to be decoded, compress the channel data to obtain the minimum channel data of the EEG data to be decoded;
基于所述最少通道数据,进行与最优通道数目相关的策略特征提取,得到与最优通道数目相关的策略特征;Based on the minimum channel data, the strategy feature extraction related to the optimal channel number is performed to obtain the strategy feature related to the optimal channel number;
基于所述策略特征,对所述待解码脑电数据进行决策概率计算,得到所述待解码脑电数据中各最优通道数目被选择的决策概率值;Based on the strategy feature, a decision probability calculation is performed on the to-be-decoded EEG data to obtain a decision-probability value in which each optimal number of channels in the to-be-decoded EEG data is selected;
基于所述决策概率值,得到选择的最优通道数目;Based on the decision probability value, obtain the optimal number of channels selected;
基于选择的所述最优通道数目,将所述待解码脑电数据转换为选择的所述最优通道数目对应的数据格式,得到将所述待解码脑电数据以最优通道数目对应的数据格式进行意图解码的解码结果。Based on the selected optimal number of channels, the EEG data to be decoded is converted into a data format corresponding to the selected optimal number of channels, and the data corresponding to the optimal channel number of the EEG data to be decoded is obtained Format decoding result of intent decoding.
本发明还提供一种基于自适应脑电通道选择的脑机接口解码加速系统,包括:The present invention also provides a brain-computer interface decoding acceleration system based on adaptive EEG channel selection, including:
获取模块,用于获取待解码脑电数据;The acquisition module is used to acquire the EEG data to be decoded;
执行模块,用于将所述待解码脑电数据输入解码模型,输出对所述待解码脑电数据进行意图解码的解码结果;an execution module, for inputting the EEG data to be decoded into a decoding model, and outputting a decoding result of intentionally decoding the EEG data to be decoded;
其中,所述解码模型用于基于所述待解码脑电数据压缩为的最少通道数据进行特征提取得到策略特征,并根据所述策略特征选择最优通道数目以获取最优通道数据后,通过所述最优通道数据对所述待解码脑电数据进行意图解码。Wherein, the decoding model is used to perform feature extraction based on the minimum channel data compressed into the EEG data to be decoded to obtain strategy features, and select the optimal number of channels according to the strategy features to obtain the optimal channel data. The optimal channel data is intended to decode the EEG data to be decoded.
本发明还提供一种解码模型的训练方法,具体包括:The present invention also provides a training method for the decoding model, which specifically includes:
输入待解码脑电数据样本;Input the EEG data sample to be decoded;
将所述待解码脑电数据样本通过根据预设的通道转换规则构建的多个候选转换矩阵进行通道数据压缩,形成多个最优通道数据候选;Perform channel data compression on the EEG data samples to be decoded through multiple candidate transformation matrices constructed according to preset channel transformation rules to form multiple optimal channel data candidates;
将所述最优通道数据候选以通道数目升序排列构建最优通道数据候选库;Arranging the optimal channel data candidates in ascending order of the number of channels to construct an optimal channel data candidate library;
获取所述最优通道数据候选库中通道数目最少的最优通道数据候选与最优通道数目候选相关的策略特征后,根据所述策略特征得到多个所述最优通道数目候选被选择的决策概率值;After obtaining the policy features related to the optimal channel data candidate with the least number of channels in the optimal channel data candidate database and the optimal channel number candidate, obtain a decision for a plurality of the optimal channel number candidates to be selected according to the policy features probability value;
利用argmax函数基于所述决策概率值选择所述最优通道数目候选中待解码脑电数据样本的最优通道数目;Using the argmax function to select the optimal channel number of the EEG data samples to be decoded in the optimal channel number candidate based on the decision probability value;
将所述待解码脑电数据样本转换为所述最优通道数目对应的数据格式后,进行意图解码;After converting the EEG data samples to be decoded into a data format corresponding to the optimal number of channels, perform intention decoding;
利用预先构建的损失函数计算所述待解码脑电数据样本的解码损失,并判断所述解码损失是否满足预设的损失标准;Calculate the decoding loss of the EEG data sample to be decoded by using a pre-built loss function, and determine whether the decoding loss satisfies a preset loss standard;
若是,则将所述候选转换矩阵作为最优转换矩阵,并得到训练完成的解码模型;If so, then use the candidate transformation matrix as the optimal transformation matrix, and obtain the decoding model that has been trained;
若否,则对所述候选转换矩阵进行更新,并返回重新将所述待解码脑电数据样本通过更新后的候选转换矩阵进行通道数据压缩。If not, the candidate transformation matrix is updated, and the EEG data sample to be decoded is returned to perform channel data compression through the updated candidate transformation matrix.
根据所述的解码模型的训练方法,所述预设的通道转换规则具体包括:差值规则、均值规则和选择性激活规则;其中,According to the training method of the decoding model, the preset channel conversion rules specifically include: a difference rule, an average rule, and a selective activation rule; wherein,
所述差值规则通过计算两侧脑区对应电极所采集的脑电数据的差值实现通道数据压缩;The difference rule realizes channel data compression by calculating the difference between the EEG data collected by the corresponding electrodes in the two brain regions;
所述均值规则通过将相邻通道的脑电数据进行平均实现通道数据压缩;The mean value rule realizes channel data compression by averaging the EEG data of adjacent channels;
所述选择性激活规则通过将与待分类任务无关的脑电数据对应的通道去除,实现通道数据压缩。The selective activation rule realizes channel data compression by removing the channel corresponding to the EEG data irrelevant to the task to be classified.
根据所述的解码模型的训练方法,所述损失函数为解码精度损失函数和解码效率损失函数的加权和;其中,According to the training method of the decoding model, the loss function is the weighted sum of the decoding accuracy loss function and the decoding efficiency loss function; wherein,
所述解码精度损失函数为基于所述待解码脑电数据样本和真实标签,在ShallowConvNet分类模型上构建的交叉熵损失函数;The decoding accuracy loss function is a cross-entropy loss function constructed on the ShallowConvNet classification model based on the EEG data samples to be decoded and the real label;
所述解码效率损失函数为在ShallowConvNet分类模型上,通过对输入所述解码模型的待解码脑电数据样本的浮点运算次数进行平均,构建的损失函数。The decoding efficiency loss function is a loss function constructed on the ShallowConvNet classification model by averaging the number of floating-point operations of the EEG data samples input to the decoding model to be decoded.
根据所述的解码模型的训练方法,所述对所述候选转换矩阵进行更新,具体包括:According to the training method of the decoding model, the updating of the candidate transformation matrix specifically includes:
利用Gumbel-Softmax对基于所述决策概率值的argmax函数进行近似,根据近似结果对所述候选转换矩阵进行更新。The argmax function based on the decision probability value is approximated by Gumbel-Softmax, and the candidate transformation matrix is updated according to the approximation result.
本发明还提供一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现如上述任一种所述基于自适应脑电通道选择的脑机接口解码加速方法或所述解码模型的训练方法的步骤。The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored on the memory and running on the processor, characterized in that, when the processor executes the program, the above-mentioned program is implemented Steps of any one of the methods for accelerating the decoding of brain-computer interface based on adaptive EEG channel selection or the method for training the decoding model.
本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上述任一种所述基于自适应脑电通道选择的脑机接口解码加速方法所述解码模型的训练方法的步骤。The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the brain-computer interface based on any one of the above-mentioned adaptive EEG channel selection The steps of the decoding acceleration method of the decoding model training method.
本发明还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上述任一种所述基于自适应脑电通道选择的脑机接口解码加速方法所述解码模型的训练方法的步骤。The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the decoding model of any of the above-mentioned methods for accelerating brain-computer interface decoding based on adaptive EEG channel selection. The steps of the training method.
本发明提供的一种基于自适应脑电通道选择的基于自适应脑电通道选择的脑机接口解码加速方法及系统,将待解码脑电数据输入解码模型中,通过解码模型将所述待解码脑电数据转化为最少通道数据,并进行策略特征的提取,通过策略特征选择最优通道数目以获取最优通道数据后,通过所述最优通道数据对所述待解码脑电数据进行意图解码,通过解码模型得到的最优通道数据是由将待解码脑电数据的通道数据进行压缩得到的最少通道数据中选择的解码通道数据,避免了多通道解码导致的高额脑电数据量和较高计算资源需求的弊端,提高了解码效率。The invention provides a brain-computer interface decoding acceleration method and system based on adaptive EEG channel selection based on adaptive EEG channel selection. The EEG data is converted into the minimum channel data, and the strategy features are extracted. After selecting the optimal channel number through the strategy features to obtain the optimal channel data, the EEG data to be decoded is intentionally decoded through the optimal channel data. , the optimal channel data obtained by the decoding model is the decoding channel data selected from the minimum channel data obtained by compressing the channel data of the EEG data to be decoded, which avoids the high amount of EEG data caused by multi-channel decoding. The disadvantage of high computing resource requirements improves the decoding efficiency.
附图说明Description of drawings
为了更清楚地说明本发明或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the present invention or the technical solutions in the prior art more clearly, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are the For some embodiments of the invention, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without any creative effort.
图1是本发明提供的一种基于自适应脑电通道选择的脑机接口解码加速方法的流程示意图;1 is a schematic flowchart of a brain-computer interface decoding acceleration method based on adaptive EEG channel selection provided by the present invention;
图2是本发明提供的一种基于自适应脑电通道选择的脑机接口解码加速系统的结构示意图;2 is a schematic structural diagram of a brain-computer interface decoding acceleration system based on adaptive EEG channel selection provided by the present invention;
图3是本发明提供的解码模型的训练过程的流程示意图;3 is a schematic flowchart of a training process of a decoding model provided by the present invention;
图4是本发明提供的解码模型的构建原理图;Fig. 4 is the construction principle diagram of decoding model provided by the present invention;
图5是本发明提供的插值规则的示例图;Fig. 5 is the example diagram of the interpolation rule provided by the present invention;
图6是本发明提供的均值规则的示例图;Fig. 6 is the example diagram of the mean value rule provided by the present invention;
图7是本发明提供的选择性激活规则的示例图;7 is an exemplary diagram of a selective activation rule provided by the present invention;
图8是本发明所述的解码模型的一个实例生成的脑解码效率和解码精度曲线图;8 is a graph of brain decoding efficiency and decoding accuracy generated by an example of the decoding model of the present invention;
图9是将数据源BCI competition IV dataset 2a (BCIC IV 2a)中的10名被试采用本发明提供的解码模型与采用现有的ShallowConvNet模型进行解码的性能对比图;FIG. 9 is a performance comparison diagram of 10 subjects in the data source BCI competition IV dataset 2a (BCIC IV 2a) using the decoding model provided by the present invention and the existing ShallowConvNet model for decoding;
图10是本发明提供的电子设备的结构示意图。FIG. 10 is a schematic structural diagram of an electronic device provided by the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明中的附图,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention. , not all examples. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
从高密度脑电通道中获取的信息一般高度冗余(互相关),且识别不同类型的大脑意图所涉及的关键脑电通道也是不同的。例如,对于基于稳态视觉诱发的脑机接口范式,分布在枕叶的脑电通道采集的信息对意图解码至关重要,而对于运动想象脑机接口范式,则可能只需要分布在运动皮层的CZ、C3和C4通道即可实现高效精准解码。可见,经多通道解码的脑电数据并非完全必要,基于此,本发明从压缩输入数据量的角度出发,提出了一种基于自适应脑电通道选择的基于自适应脑电通道选择的脑机接口解码加速方法。同时,为了便于理解,在这里先对发明技术方案中提及的名词进行解释,即“通道数目”指通道的个数;“最优通道数目”指最优通道的个数,即通过策略特征选择的用于解码所述待解码脑电数据所需要的最优通道的个数,如本发明下述实施例提及的6通道、9通道等;“通道数据”指通道的具体数据内容;“最优通道数据”指基于策略网络学习到的最优转换矩阵,作用于所述待解码脑电数据得到的用于意图解码的最终通道数据。Information obtained from high-density EEG channels is generally highly redundant (cross-correlated), and the key EEG channels involved in recognizing different types of brain intentions are also different. For example, for the BCI paradigm based on steady-state visual evokation, the information collected by the EEG channels distributed in the occipital lobe is crucial for intention decoding, while for the motor imagery BCI paradigm, only the information collected in the EEG channels distributed in the motor cortex may be required. CZ, C3 and C4 channels can achieve efficient and accurate decoding. It can be seen that EEG data decoded by multiple channels is not completely necessary. Based on this, the present invention proposes a brain computer based on adaptive EEG channel selection from the perspective of compressing the amount of input data. Interface decoding acceleration method. At the same time, for ease of understanding, the terms mentioned in the technical solution of the invention are explained here first, that is, "number of channels" refers to the number of channels; "number of optimal channels" refers to the number of optimal channels, that is, through the strategy feature The number of optimal channels selected for decoding the EEG data to be decoded, such as 6 channels, 9 channels, etc. mentioned in the following embodiments of the present invention; "channel data" refers to the specific data content of the channel; "Optimal channel data" refers to the optimal transformation matrix learned based on the policy network, which acts on the EEG data to be decoded and obtains the final channel data for intended decoding.
下面结合图1描述本发明的一种基于自适应脑电通道选择的脑机接口解码加速方法,如图1所示,该方法包括以下步骤:A brain-computer interface decoding acceleration method based on adaptive EEG channel selection of the present invention is described below in conjunction with FIG. 1. As shown in FIG. 1, the method includes the following steps:
101、获取待解码脑电数据;101. Obtain the EEG data to be decoded;
102、将所述待解码脑电数据输入解码模型,输出对所述待解码脑电数据进行意图解码的解码结果;102. Inputting the EEG data to be decoded into a decoding model, and outputting a decoding result of intentionally decoding the EEG data to be decoded;
需要说明的是,解码模型是基于待解码脑电数据样本和样本对应的解码结果训练得到的,而利用所述解码模型进行通道选择时,是通过对待解码脑电数据转化为的最少通道数据进行特征提取得到的策略特征,由所述待解码脑电数据中选择最优通道数据,所以待解码脑电数据在输入解码模型后,能够先进行压缩,从而去除掉冗余或其他无关的通道数据,减少了通道数据量,然后利用由压缩后的数据中提取的策略特征选择最优通道数目以获取最优通道数据,提高了解码的效率,即实现在不同的待解码脑电数据输入所述解码模型后,能够自适应的选择所需要的最优通道数据来提高解码效率。It should be noted that the decoding model is obtained by training based on the EEG data samples to be decoded and the decoding results corresponding to the samples, and when using the decoding model for channel selection, the decoding model is used to convert the EEG data into the minimum channel data. For the strategy features obtained by feature extraction, the optimal channel data is selected from the EEG data to be decoded, so the EEG data to be decoded can be compressed first after being input into the decoding model, thereby removing redundant or other irrelevant channel data , reduce the amount of channel data, and then use the strategy features extracted from the compressed data to select the optimal number of channels to obtain the optimal channel data, which improves the decoding efficiency, that is, realizes the input of different EEG data to be decoded. After decoding the model, the required optimal channel data can be adaptively selected to improve the decoding efficiency.
在本发明的一个实施例中,所述将所述待解码脑电数据输入解码模型,输出对所述待解码脑电数据进行意图解码的解码结果,具体包括:In an embodiment of the present invention, inputting the EEG data to be decoded into a decoding model and outputting a decoding result of intentionally decoding the EEG data to be decoded specifically includes:
基于输入的待解码脑电数据,进行对通道数据的压缩处理,得到所述待解码脑电数据的最少通道数据;Based on the input EEG data to be decoded, compress the channel data to obtain the minimum channel data of the EEG data to be decoded;
基于所述最少通道数据,进行与最优通道数目相关的策略特征提取,得到与最优通道数目相关的策略特征;Based on the minimum channel data, the strategy feature extraction related to the optimal channel number is performed to obtain the strategy feature related to the optimal channel number;
基于所述策略特征,对所述待解码脑电数据进行决策概率计算,得到所述待解码脑电数据中各最优通道数目被选择的决策概率值;Based on the strategy feature, a decision probability calculation is performed on the to-be-decoded EEG data to obtain a decision-probability value in which each optimal number of channels in the to-be-decoded EEG data is selected;
基于所述决策概率值,得到选择的最优通道数目;Based on the decision probability value, obtain the optimal number of channels selected;
基于选择的所述最优通道数目,将所述待解码脑电数据转换为选择的所述最优通道数目对应的数据格式,得到将所述待解码脑电数据以最优通道数目对应的数据格式进行意图解码的解码结果。Based on the selected optimal number of channels, the EEG data to be decoded is converted into a data format corresponding to the selected optimal number of channels, and the data corresponding to the optimal channel number of the EEG data to be decoded is obtained Format decoding result of intent decoding.
需要说明的是,在应用所述解码模型进行待解码脑电数据的最优通道数据获取时,解码模型先将待解码脑电数据的通道数据压缩为最少通道数据,即去除掉冗余的、无用的等通道数据,实现初始输入数据量的减少,而后对最少通道数据进行与最优通道数目相关的策略特征提取,并根据提取到的策略特征进行待解码脑电数据中与最优通道数目相关的决策概率计算,即得到所述待解码脑电数据中各最优通道数目被选择的决策概率值,最后根据决策概率值由待解码脑电数据中选择出适宜所述待解码脑电数据解码的最优通道数目,以获得用于所述待解码脑电数据解码的最优通道数据。其中,通过最少通道数据提取策略特征,能够利用较少的通道数据得到较为全面涵盖所述待解码脑电数据中所有通道的策略特征,使得在策略特征的提取过程中,显著减少了计算量,有效提高了解码速率。It should be noted that when applying the decoding model to obtain the optimal channel data of the EEG data to be decoded, the decoding model first compresses the channel data of the EEG data to be decoded into the minimum channel data, that is, removes redundant, Useless equal-channel data to reduce the amount of initial input data, and then extract the strategy features related to the optimal number of channels for the minimum channel data, and according to the extracted strategy features, the EEG data to be decoded and the optimal number of channels are extracted. The relevant decision probability calculation is to obtain the decision probability value of each optimal number of channels in the EEG data to be decoded, and finally select the EEG data suitable for the EEG data to be decoded from the EEG data to be decoded according to the decision probability value. The number of optimal channels for decoding to obtain optimal channel data for decoding the EEG data to be decoded. Among them, by extracting strategy features from the least channel data, it is possible to use less channel data to obtain strategy features that comprehensively cover all channels in the EEG data to be decoded, so that in the process of strategy feature extraction, the amount of computation is significantly reduced. Effectively improve the decoding rate.
下面结合图2对本发明提供的一种基于自适应脑电通道选择的脑机接口解码加速系统进行描述,下文描述的一种基于自适应脑电通道选择的脑机接口解码加速系统与上文描述的一种基于自适应脑电通道选择的脑机接口解码加速方法可相互对应参照。A brain-computer interface decoding acceleration system based on adaptive EEG channel selection provided by the present invention will be described below with reference to FIG. A brain-computer interface decoding acceleration method based on adaptive EEG channel selection can be referred to each other.
如图2所示,本发明提供的一种基于自适应脑电通道选择的脑机接口解码加速系统包括获取模块210和执行模块220;其中,As shown in FIG. 2, a brain-computer interface decoding acceleration system based on adaptive EEG channel selection provided by the present invention includes an
获取模块210用于获取待解码脑电数据;The obtaining
执行模块220用于将所述待解码脑电数据输入解码模型,得到所述待解码脑电数据解码的最优通道;The
其中,所述解码模型用于基于所述待解码脑电数据压缩为的最少通道数据进行特征提取得到策略特征,并根据所述策略特征选择最优通道数目以获取最优通道数据后,通过所述最优通道数据对所述待解码脑电数据进行意图解码。Wherein, the decoding model is used to perform feature extraction based on the minimum channel data compressed into the EEG data to be decoded to obtain strategy features, and select the optimal number of channels according to the strategy features to obtain the optimal channel data. The optimal channel data is intended to decode the EEG data to be decoded.
需要说明的是,本发明的一种基于自适应脑电通道选择的脑机接口解码加速系统是利用解码模型进行通道数据选择,具体地,是通过对待解码脑电数据转化为的最少通道数据进行特征提取得到的策略特征,由所述待解码脑电数据中选择最优通道数据,所以待解码脑电数据在输入解码模型后,能够先进行压缩,从而去除掉冗余或其他无关的通道数据,减少了通道数据量,然后从压缩后的通道数据中选择最优通道数据,提高了解码的效率,即实现在不同的待解码脑电数据输入所述解码模型后,能够自适应的选择所需要的最优通道数据来提高解码效率。It should be noted that a brain-computer interface decoding acceleration system based on adaptive EEG channel selection of the present invention uses a decoding model to select channel data, and specifically, performs channel data selection by converting EEG data to be decoded into the minimum channel data. For the strategy features obtained by feature extraction, the optimal channel data is selected from the EEG data to be decoded, so the EEG data to be decoded can be compressed first after being input into the decoding model, thereby removing redundant or other irrelevant channel data , reduces the amount of channel data, and then selects the optimal channel data from the compressed channel data, which improves the decoding efficiency, that is, after different EEG data to be decoded is input into the decoding model, it can be adaptively selected. The optimal channel data required to improve decoding efficiency.
在一个优选方案中,所述执行模块220基于输入的待解码脑电数据,进行对通道数据的压缩处理,得到所述待解码脑电数据的最少通道数据;In a preferred solution, the
基于所述最少通道数据,进行与最优通道数目相关的策略特征提取,得到与最优通道数目相关的策略特征;Based on the minimum channel data, the strategy feature extraction related to the optimal channel number is performed to obtain the strategy feature related to the optimal channel number;
基于所述策略特征,对所述待解码脑电数据进行决策概率计算,得到所述待解码脑电数据中各最优通道数目被选择的决策概率值;Based on the strategy feature, a decision probability calculation is performed on the to-be-decoded EEG data to obtain a decision-probability value in which each optimal number of channels in the to-be-decoded EEG data is selected;
基于所述决策概率值,得到选择的最优通道数目;Based on the decision probability value, obtain the optimal number of channels selected;
基于选择的所述最优通道数目,将所述待解码脑电数据转换为选择的所述最优通道数目对应的数据格式,得到将所述待解码脑电数据以最优通道数目对应的数据格式进行意图解码的解码结果。Based on the selected optimal number of channels, the EEG data to be decoded is converted into a data format corresponding to the selected optimal number of channels, and the data corresponding to the optimal channel number of the EEG data to be decoded is obtained Format decoding result of intent decoding.
本发明实施例提供的一种基于自适应脑电通道选择的脑机接口解码加速系统用于签署各实施例的基于自适应脑电通道选择的脑机接口解码加速方法。该基于自适应脑电通道选择的脑机接口解码加速系统包括的各模块实现相应功能的具体方法和流程详见上述基于自适应脑电通道选择的脑机接口解码加速方法的实施例,此处不再赘述。A brain-computer interface decoding acceleration system based on adaptive EEG channel selection provided by an embodiment of the present invention is used to sign the brain-computer interface decoding acceleration method based on adaptive EEG channel selection of various embodiments. For the specific methods and processes of the respective modules included in the brain-computer interface decoding acceleration system based on adaptive EEG channel selection, please refer to the above-mentioned embodiment of the brain-computer interface decoding acceleration method based on adaptive EEG channel selection, here No longer.
本发明的一种基于自适应脑电通道选择的脑机接口解码加速系统用于前述各实施例的基于自适应脑电通道选择的脑机接口解码加速方法。因此,在前述各实施例中的基于自适应脑电通道选择的脑机接口解码加速方法中的描述和定义,可以用于本发明实施例中各执行模块的理解。A brain-computer interface decoding acceleration system based on adaptive EEG channel selection of the present invention is used in the brain-computer interface decoding acceleration methods based on adaptive EEG channel selection in the foregoing embodiments. Therefore, the descriptions and definitions in the method for accelerating brain-computer interface decoding based on adaptive EEG channel selection in the foregoing embodiments can be used for the understanding of each execution module in the embodiments of the present invention.
下面结合图3-图9描述本发明的一种解码模型的训练方法,可以理解的是,采用该方法训练的解码模型能够应用于前述提供的基于自适应脑电通道选择的脑机接口解码加速方法或基于自适应脑电通道选择的脑机接口解码加速系统中;如图3所示,该方法包括以下步骤:A method for training a decoding model of the present invention will be described below with reference to FIGS. 3 to 9 . It can be understood that the decoding model trained by this method can be applied to the aforementioned acceleration of brain-computer interface decoding based on adaptive EEG channel selection. method or a brain-computer interface decoding acceleration system based on adaptive EEG channel selection; as shown in Figure 3, the method includes the following steps:
301、输入待解码脑电数据样本;301. Input the EEG data sample to be decoded;
302、将所述待解码脑电数据样本通过根据预设的通道转换规则构建的多个候选转换矩阵进行通道数据压缩,形成多个最优通道数据候选;302. Perform channel data compression on the EEG data samples to be decoded through multiple candidate transformation matrices constructed according to preset channel transformation rules to form multiple optimal channel data candidates;
303、将所述最优通道数据候选以通道数目升序排列构建最优通道数据候选库;303. Arrange the optimal channel data candidates in ascending order of the number of channels to construct an optimal channel data candidate library;
304、获取所述最优通道数据候选库中通道数目最少的最优通道数据候选与最优通道数目候选相关的策略特征后,根据所述策略特征得到多个所述最优通道数目候选被选择的决策概率值;304. After obtaining the policy features related to the optimal channel data candidate with the least number of channels in the optimal channel data candidate database and the optimal channel number candidate, obtain a plurality of the optimal channel number candidates to be selected according to the policy features. The decision probability value of ;
305、利用argmax函数基于所述决策概率值选择所述最优通道数目候选中待解码脑电数据样本的最优通道数目;305. Use the argmax function to select the optimal channel number of the EEG data sample to be decoded in the optimal channel number candidate based on the decision probability value;
306、将所述待解码脑电数据样本转换为所述最优通道数目对应的数据格式后,进行意图解码;306. After converting the EEG data samples to be decoded into a data format corresponding to the optimal number of channels, perform intention decoding;
307、利用预先构建的损失函数计算所述待解码脑电数据样本的解码损失,并判断所述解码损失是否满足预设的损失标准;若是,则进入308;若否,则跳转到309;307. Calculate the decoding loss of the EEG data samples to be decoded using a pre-built loss function, and determine whether the decoding loss satisfies a preset loss standard; if so, go to 308; if not, jump to 309;
308、将所述候选转换矩阵作为最优转换矩阵,并得到训练完成的解码模型;308. Use the candidate conversion matrix as the optimal conversion matrix, and obtain the decoding model that has been trained;
309、对所述候选转换矩阵进行更新,并返回重新将所述待解码脑电数据样本通过更新后的候选转换矩阵进行通道数据压缩,形成新的最优通道数据候选后,返回303。309 . Update the candidate transformation matrix, and return to compress the EEG data samples to be decoded by channel data compression through the updated candidate transformation matrix to form a new optimal channel data candidate, and then return to 303 .
需要说明的是,参考图4所示的解码模型的原理图,所述解码模型通过不断选择待解码脑电数据样本的最优解码通道数据训练得到,其中,待解码脑电数据样本为全通道待解码脑电数据。It should be noted that, referring to the schematic diagram of the decoding model shown in FIG. 4 , the decoding model is obtained by continuously selecting the optimal decoding channel data of the EEG data samples to be decoded, wherein the EEG data samples to be decoded are all channels. EEG data to be decoded.
具体地,先将原始输入的待解码脑电数据样本定义为,即每个试次X包
含N个脑电通道,T个时序样本。通过上述公式1,候选转换矩阵将所述待解码脑电数据样本
的通道数据压缩,形成多个最优通道数据候选,最优通道数据候选库以通道数目升序排列
定义为:
Specifically, the original input EEG data samples to be decoded are first defined as , that is, each trial X contains N EEG channels and T time series samples. By above-mentioned
公式1;
其中,,。 in, , .
进一步地,为了降低策略网络层的计算量,最优通道数据候选库中的通道数目最 少的最优通道数据候选的通道数据形式被输入到策略网络层中,用于提取策略特征, 计算方法如下: Further, in order to reduce the calculation amount of the policy network layer, the channel data form of the optimal channel data candidate with the least number of channels in the optimal channel data candidate database is is input into the policy network layer to extract policy features. The calculation method is as follows:
公式2;
其中,PM代表策略特征提取模型,主要是由两层构成,第一层为时域卷积层,第二层为空域卷积层。Among them, PM represents the policy feature extraction model, which is mainly composed of two layers, the first layer is the time domain convolution layer, and the second layer is the spatial domain convolution layer.
所提取的策略特征,通过全连接层输出不同行为决策概率,即最优通道数据候选库中每个最优通道数目候选被选择的概率P:The extracted policy features output different behavioral decision probabilities through the fully connected layer, that is, the probability P that each optimal channel number candidate in the optimal channel data candidate database is selected:
公式3;
在常规的策略网络层的训练过程中,需要通过argmax操作获取离散行为A,即最优通道数目候选对应的通道样本标签:In the training process of the conventional strategy network layer, it is necessary to obtain the discrete behavior A through the argmax operation, that is, the channel sample label corresponding to the optimal channel number candidate:
公式4;
其中,i代表最优通道数目候选索引;代表Gumbel分布;代表均匀分布。 Among them, i represents the optimal channel number candidate index; Represents the Gumbel distribution; represents a uniform distribution.
即通过策略网络层选择到最优通道数目,将所述待解码脑电数据样本以所述最优通道数目对应的数据格式进行意图解码,最后利用解码损失函数计算所述待解码脑电数据样本的解码损失,以通过损失函数不断训练并优化所述解码模型。That is, the optimal number of channels is selected through the strategy network layer, the EEG data samples to be decoded are intentionally decoded in the data format corresponding to the optimal number of channels, and finally the decoding loss function is used to calculate the EEG data samples to be decoded. The decoding loss to continuously train and optimize the decoding model through the loss function.
进一步地,在解码模型的训练开始,首先需要根据预设的通道转换规则构建的多个候选转换矩阵,以便于待解码脑电数据的首次通道数据压缩,可以理解的是,首次构建的候选转换矩阵越符合脑电数据解码规则,越容易得到最优转换矩阵,所以在本申请中对待解码脑电数据样本进行压缩的预设的通道转换规则以脑电信号解码领域的先验知识为依据,即在本发明的另一个实施例中,所述预设的通道转换规则具体包括:差值规则、均值规则和选择性激活规则;其中,Further, at the beginning of the training of the decoding model, a plurality of candidate transformation matrices need to be constructed according to the preset channel transformation rules, so as to facilitate the first channel data compression of the EEG data to be decoded. It can be understood that the first constructed candidate transformation matrix The more the matrix conforms to the EEG data decoding rules, the easier it is to obtain the optimal conversion matrix. Therefore, the preset channel conversion rules for compressing the EEG data samples to be decoded in this application are based on prior knowledge in the field of EEG signal decoding. That is, in another embodiment of the present invention, the preset channel conversion rule specifically includes: a difference rule, an average rule, and a selective activation rule; wherein,
所述差值规则通过计算两侧脑区对应电极所采集的脑电数据的差值实现通道数据压缩;The difference rule realizes channel data compression by calculating the difference between the EEG data collected by the corresponding electrodes in the two brain regions;
所述均值规则通过将相邻通道的脑电数据进行平均实现通道数据压缩;The mean value rule realizes channel data compression by averaging the EEG data of adjacent channels;
所述选择性激活规则通过将与待分类任务无关的脑电数据对应的通道去除,实现通道数据压缩。The selective activation rule realizes channel data compression by removing the channel corresponding to the EEG data irrelevant to the task to be classified.
需要说明的是,脑活动,尤其是由运动或运动想象激发的脑信号,一般会呈现运动(运动想象)肢体同侧脑区脑电信号幅值的增强和对侧脑区脑电信号抑制现象。因此可以通过计算两侧脑区对应电极所采集的脑电信号的差值,即差值规则来实现通道数据压缩;而考虑到相邻脑电信息的相似性和冗余性,可以基于相邻通道信号的平均原则,即均值规则来实现通道数据压缩;同时,有些脑区的脑电信号可能与待分类任务无关,这时候可以直接去掉该通道数据,所以,以选择性激活规则来实现通道数据的压缩。It should be noted that brain activity, especially the brain signals stimulated by movement or motor imagery, generally shows the enhancement of the EEG signal amplitude in the ipsilateral brain area of the motor (motor imagery) limb and the inhibition of the EEG signal in the contralateral brain area. . Therefore, channel data compression can be achieved by calculating the difference between the EEG signals collected by the corresponding electrodes in the brain regions on both sides, that is, the difference rule; and considering the similarity and redundancy of adjacent EEG information, the The average principle of channel signals, that is, the mean value rule, is used to realize channel data compression; at the same time, the EEG signals of some brain areas may not be related to the task to be classified. In this case, the channel data can be directly removed. Therefore, the selective activation rule is used to realize the channel data. Compression of data.
具体地,例如,如图5-图7所示,示例了一个以22导脑电图为例,采用本发明的通道转换规则进行通道数据压缩的实例,其中,图5、6和7分别为采用差值规则、均值规则和选择性激活规则将22条通道压缩为12通道、9通道和6通道。Specifically, for example, as shown in FIG. 5-FIG. 7, an example of channel data compression using the channel conversion rule of the present invention is exemplified by taking 22-lead EEG as an example, wherein FIG. 5, FIG. 6 and FIG. 7 are respectively The 22 channels are compressed into 12 channels, 9 channels and 6 channels using difference rule, mean value rule and selective activation rule.
进一步地,以预设的通道转换规则构建候选转换矩阵,以上述图7的 采用选择性激活规则将22条通道压缩为6通道为例,其对应的转化矩阵T6如公式5所示: Further, construct candidate conversion matrix with preset channel conversion rule , taking the selective activation rule in Figure 7 to compress 22 channels into 6 channels as an example, the corresponding transformation matrix T6 is shown in formula 5:
公式5; formula 5;
通过下述公式6,待解码脑电数据X就可以被转化为包含N i 个输入通道的数据格式:Through the following formula 6, the EEG data X to be decoded can be converted into a data format containing N i input channels:
公式6; formula 6;
其中,X*表示包含*个输入通道的待解码脑电数据。Among them, X* represents the EEG data to be decoded containing the * input channels.
可以理解的是,损失函数的构建,能够保证由训练的解码模型得到的最优通道数能够满足解码的要求,而解码最主要的要求就是解码精度和解码效率两个方面,然而,当用户对解码精度和解码效率的要求不尽相同时,如果能够根据用户的不同需求,实现相应的解码模型构建,则会使得本发明的基于自适应脑电通道选择的基于自适应脑电通道选择的脑机接口解码加速方法使用更加灵活,因而在本发明的又一实施例中,所述损失函数为解码精度损失函数和解码效率损失函数的加权和;其中,It can be understood that the construction of the loss function can ensure that the optimal number of channels obtained by the trained decoding model can meet the decoding requirements, and the most important requirements for decoding are decoding accuracy and decoding efficiency. When the requirements for decoding accuracy and decoding efficiency are not the same, if the corresponding decoding model can be constructed according to the different needs of users, it will make the brain based on adaptive EEG channel selection of the present invention based on adaptive EEG channel selection. The machine interface decoding acceleration method is more flexible to use, so in another embodiment of the present invention, the loss function is the weighted sum of the decoding accuracy loss function and the decoding efficiency loss function; wherein,
所述解码精度损失函数为基于所述待解码脑电数据样本和真实标签,在ShallowConvNet分类模型上构建的交叉熵损失函数;The decoding accuracy loss function is a cross-entropy loss function constructed on the ShallowConvNet classification model based on the EEG data samples to be decoded and the real label;
所述解码效率损失函数为在ShallowConvNet分类模型上,通过对输入所述解码模型的待解码脑电数据样本的浮点运算次数进行平均,构建的损失函数。The decoding efficiency loss function is a loss function constructed on the ShallowConvNet classification model by averaging the number of floating-point operations of the EEG data samples input to the decoding model to be decoded.
需要说明的是,ShallowConvNet分类模型本身具有高效的脑电信号解码速度,因而,在本发明的方法中采用ShallowConvNet进行脑电数据解码。It should be noted that the ShallowConvNet classification model itself has an efficient decoding speed of EEG signals. Therefore, in the method of the present invention, ShallowConvNet is used to decode EEG data.
更具体地,所述解码精度损失函数和解码效率损失函数均在ShallowConvNet分类模型上进行构建,精度损失函数为:More specifically, both the decoding accuracy loss function and the decoding efficiency loss function are constructed on the ShallowConvNet classification model, and the accuracy loss function is:
公式7; formula 7;
其中,代表原始输入的脑电数据样本和决策网络层输出的行为标签; 代表ShallowConvNet分类模型,代表模型参数。 in, EEG data samples representing the original input and behavioral labels output by the decision network layer; represents the ShallowConvNet classification model, represents the model parameters.
对于不同的输入,基于策略网络层的行为决策,分类模型输入数据的通道数是不同的,从而导致不同的GFLOPs,在本发明中,对训练数据的GFLOPs进行平均,作为最终的解码损失函数。For different inputs, based on the behavioral decision of the policy network layer, the number of channels of the input data of the classification model is different, resulting in different GFLOPs . In the present invention, the GFLOPs of the training data are averaged as the final decoding loss function.
公式8; formula 8;
最终构建的损失函数是解码精度损失和解码效率损失的加权和:The final constructed loss function is the weighted sum of decoding accuracy loss and decoding efficiency loss:
公式9;
其中,代表权重系数,用于权衡解码效率和解码精度,即越大,解码效率越高。 in, represents the weight coefficient, which is used to trade off decoding efficiency and decoding accuracy, namely The larger the value, the higher the decoding efficiency.
可以理解的是,由于argmax操作是不可微分的,无法使用传统的梯度反传算法进行训练,所以在本发明的另一个实施例中,所述对所述候选转换矩阵进行更新,具体包括:It can be understood that since the argmax operation is non-differentiable, the traditional gradient backpropagation algorithm cannot be used for training, so in another embodiment of the present invention, the updating of the candidate transformation matrix specifically includes:
利用Gumbel-Softmax对基于所述决策概率值的argmax函数进行近似,根据近似结果对所述候选转换矩阵进行更新。The argmax function based on the decision probability value is approximated by Gumbel-Softmax, and the candidate transformation matrix is updated according to the approximation result.
需要说明的是,使用Gumbel-Softmax对argmax进行近似,如下述公式10所示:It should be noted that argmax is approximated using Gumbel-Softmax, as shown in
公式10。
下面,以数据源BCI competition IV dataset 2a (BCIC IV 2a)为例,并结合上 述提供的以22导脑电图为例,采用本发明的通道转换规则进行通道压缩的实例利用10名被 试,对权重系数取不同值时,测试所述解码模型的性能,结果如表1所示: In the following, taking the data source BCI competition IV dataset 2a (BCIC IV 2a) as an example, combined with the 22-lead EEG provided above as an example, an example of channel compression using the channel conversion rule of the present invention uses 10 subjects, pair weight factor When different values are taken, the performance of the decoding model is tested, and the results are shown in Table 1:
表1 权重系数取不同值时解码模型性能的对照表 Table 1 Weight coefficient Comparison table of decoding model performance when taking different values
对应于表1的所述解码模型的性能如图8所示,其中,星号为不同取值下的计算 量,实线为解码精度和计算量的拟合曲线。 The performance of the decoding model corresponding to Table 1 is shown in Figure 8, where the asterisks are different The calculation amount under the value, the solid line is the fitting curve of the decoding accuracy and the calculation amount.
进一步地,将数据源BCI competition IV dataset 2a (BCIC IV 2a)中的10名被试采用本发明提供的解码模型与采用现有解码速度最优的ShallowConvNet分类模型进行解码的性能进行对比,结果如图9所示,可见,相比与ShallowConvNet, 本发明提供的解码模型可以在精度不降低(甚至略微提升)的前提下,降低35%的计算量,所以,本发明所述的一种基于自适应脑电通道选择的基于自适应脑电通道选择的脑机接口解码加速方法具有明显的优势。Further, comparing the performance of 10 subjects in the data source BCI competition IV dataset 2a (BCIC IV 2a) using the decoding model provided by the present invention and using the existing ShallowConvNet classification model with the best decoding speed for decoding, the results are as follows: As shown in Figure 9, it can be seen that compared with ShallowConvNet, the decoding model provided by the present invention can reduce the calculation amount by 35% without reducing the accuracy (or even slightly improving). The BCI decoding acceleration method based on adaptive EEG channel selection has obvious advantages.
图10示例了一种电子设备的实体结构示意图,如图10所示,该电子设备可以包括:处理器(processor)810、通信接口(Communications Interface)820、存储器(memory)830和通信总线840,其中,处理器810,通信接口820,存储器830通过通信总线840完成相互间的通信。处理器810可以调用存储器830中的逻辑指令,以执行基于自适应脑电通道选择的基于自适应脑电通道选择的脑机接口解码加速方法,该方法包括:FIG. 10 illustrates a schematic diagram of the physical structure of an electronic device. As shown in FIG. 10 , the electronic device may include: a processor (processor) 810, a communication interface (Communications Interface) 820, a memory (memory) 830, and a
101、获取待解码脑电数据;101. Obtain the EEG data to be decoded;
102、将所述待解码脑电数据输入解码模型,输出对所述待解码脑电数据进行意图解码的解码结果;102. Inputting the EEG data to be decoded into a decoding model, and outputting a decoding result of intentionally decoding the EEG data to be decoded;
其中,所述解码模型用于基于所述待解码脑电数据压缩为的最少通道数据进行特征提取得到策略特征,并根据所述策略特征选择最优通道数目以获取最优通道数据后,通过所述最优通道数据对所述待解码脑电数据进行意图解码。Wherein, the decoding model is used to perform feature extraction based on the minimum channel data compressed into the EEG data to be decoded to obtain strategy features, and select the optimal number of channels according to the strategy features to obtain the optimal channel data. The optimal channel data is intended to decode the EEG data to be decoded.
此外,上述的存储器830中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above-mentioned logic instructions in the
另一方面,本发明还提供一种计算机程序产品,所述计算机程序产品包括计算机程序,计算机程序可存储在非暂态计算机可读存储介质上,所述计算机程序被处理器执行时,计算机能够执行上述各方法所提供的基于自适应脑电通道选择的基于自适应脑电通道选择的脑机接口解码加速方法,该方法包括:In another aspect, the present invention also provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer can Execute the brain-computer interface decoding acceleration method based on adaptive EEG channel selection based on adaptive EEG channel selection provided by the above methods, and the method includes:
101、获取待解码脑电数据;101. Obtain the EEG data to be decoded;
102、将所述待解码脑电数据输入解码模型,输出对所述待解码脑电数据进行意图解码的解码结果;102. Inputting the EEG data to be decoded into a decoding model, and outputting a decoding result of intentionally decoding the EEG data to be decoded;
其中,所述解码模型用于基于所述待解码脑电数据压缩为的最少通道数据进行特征提取得到策略特征,并根据所述策略特征选择最优通道数目以获取最优通道数据后,通过所述最优通道数据对所述待解码脑电数据进行意图解码。Wherein, the decoding model is used to perform feature extraction based on the minimum channel data compressed into the EEG data to be decoded to obtain strategy features, and select the optimal number of channels according to the strategy features to obtain the optimal channel data. The optimal channel data is intended to decode the EEG data to be decoded.
又一方面,本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各方法提供的基于自适应脑电通道选择的基于自适应脑电通道选择的脑机接口解码加速方法,该方法包括:In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, is implemented to perform the adaptive EEG channel selection-based algorithm provided by the above methods. A brain-computer interface decoding acceleration method based on adaptive EEG channel selection, the method includes:
101、获取待解码脑电数据;101. Obtain the EEG data to be decoded;
102、将所述待解码脑电数据输入解码模型,输出对所述待解码脑电数据进行意图解码的解码结果;102. Inputting the EEG data to be decoded into a decoding model, and outputting a decoding result of intentionally decoding the EEG data to be decoded;
其中,所述解码模型用于基于所述待解码脑电数据压缩为的最少通道数据进行特征提取得到策略特征,并根据所述策略特征选择最优通道数目以获取最优通道数据后,通过所述最优通道数据对所述待解码脑电数据进行意图解码。Wherein, the decoding model is used to perform feature extraction based on the minimum channel data compressed into the EEG data to be decoded to obtain strategy features, and select the optimal number of channels according to the strategy features to obtain the optimal channel data. The optimal channel data is intended to decode the EEG data to be decoded.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in One place, or it can be distributed over multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Based on this understanding, the above-mentioned technical solutions can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic A disc, an optical disc, etc., includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments or some parts of the embodiments.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that it can still be The technical solutions described in the foregoing embodiments are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111237839.3A CN113688952B (en) | 2021-10-25 | 2021-10-25 | Brain-computer interface decoding acceleration method and system based on self-adaptive electroencephalogram channel selection |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111237839.3A CN113688952B (en) | 2021-10-25 | 2021-10-25 | Brain-computer interface decoding acceleration method and system based on self-adaptive electroencephalogram channel selection |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113688952A true CN113688952A (en) | 2021-11-23 |
CN113688952B CN113688952B (en) | 2022-01-25 |
Family
ID=78587789
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111237839.3A Active CN113688952B (en) | 2021-10-25 | 2021-10-25 | Brain-computer interface decoding acceleration method and system based on self-adaptive electroencephalogram channel selection |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113688952B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2015164300A1 (en) * | 2014-04-21 | 2015-10-29 | The General Hospital Corporation | Biomedical system variably configured based on estimation of information content of input signals |
CN108805953A (en) * | 2018-06-15 | 2018-11-13 | 郑州布恩科技有限公司 | A kind of simple image method for reconstructing based on LFP phase properties and k nearest neighbor algorithm |
CN112001306A (en) * | 2020-08-21 | 2020-11-27 | 西安交通大学 | Electroencephalogram signal decoding method for generating neural network based on deep convolution countermeasure |
CN112861625A (en) * | 2021-01-05 | 2021-05-28 | 深圳技术大学 | Method for determining stacking denoising autoencoder model |
CN113486794A (en) * | 2021-07-06 | 2021-10-08 | 燕山大学 | Motor imagery electroencephalogram signal classification method based on hybrid model |
-
2021
- 2021-10-25 CN CN202111237839.3A patent/CN113688952B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2015164300A1 (en) * | 2014-04-21 | 2015-10-29 | The General Hospital Corporation | Biomedical system variably configured based on estimation of information content of input signals |
CN108805953A (en) * | 2018-06-15 | 2018-11-13 | 郑州布恩科技有限公司 | A kind of simple image method for reconstructing based on LFP phase properties and k nearest neighbor algorithm |
CN112001306A (en) * | 2020-08-21 | 2020-11-27 | 西安交通大学 | Electroencephalogram signal decoding method for generating neural network based on deep convolution countermeasure |
CN112861625A (en) * | 2021-01-05 | 2021-05-28 | 深圳技术大学 | Method for determining stacking denoising autoencoder model |
CN113486794A (en) * | 2021-07-06 | 2021-10-08 | 燕山大学 | Motor imagery electroencephalogram signal classification method based on hybrid model |
Non-Patent Citations (2)
Title |
---|
JIAXING WANG等: ""Toward Improving Engagement in Neural Rehabilitation: Attention Enhancement Based on Brain–Computer Interface and Audiovisual Feedback"", 《IEEE TRANSACTIONS ON COGNITIVE AND DEVELOPMENTAL SYSTEMS》 * |
任士鑫等: ""基于改进共空间模式与视觉反馈的闭环脑机接口"", 《机械工程学报》 * |
Also Published As
Publication number | Publication date |
---|---|
CN113688952B (en) | 2022-01-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Li et al. | Genetic algorithm for the optimization of features and neural networks in ECG signals classification | |
EP4212100A1 (en) | Electroencephalogram signal classification method and apparatus, and device, storage medium and program product | |
CN110018739B (en) | An EEG feature optimization method based on dimensionality reduction mechanism | |
CN113052099B (en) | A SSVEP Classification Method Based on Convolutional Neural Networks | |
CN117332300A (en) | Motor imagery electroencephalogram classification method based on self-attention improved domain adaptation network | |
CN117708570B (en) | Epilepsy prediction method, device, electronic device and storage medium | |
CN113761220A (en) | Information acquisition method, device, equipment and storage medium | |
CN114548262A (en) | A Feature-Level Fusion Method for Multimodal Physiological Signals in Affective Computing | |
Lin et al. | MDD-TSVM: A novel semisupervised-based method for major depressive disorder detection using electroencephalogram signals | |
CN108712397A (en) | Communication protocol recognition methods based on deep learning | |
CN118035816A (en) | Electroencephalogram signal classification method, device and storage medium | |
Gómez-Tapia et al. | On the minimal amount of EEG data required for learning distinctive human features for task-dependent biometric applications | |
Venu et al. | Optimized deep learning model using modified whale’s optimization algorithm for EEG signal classification | |
CN116919422A (en) | Method and device for establishing multi-feature emotional EEG recognition model based on graph convolution | |
Luo et al. | Pruning method for dendritic neuron model based on dendrite layer significance constraints | |
CN113688952B (en) | Brain-computer interface decoding acceleration method and system based on self-adaptive electroencephalogram channel selection | |
CN116796223A (en) | Electroencephalogram signal decoding method and device, electronic equipment and storage medium | |
CN114781441A (en) | EEG motor imagery classification method and multi-spatial convolutional neural network model | |
CN113392868A (en) | Model training method, related device, equipment and storage medium | |
CN118173260A (en) | Auditory attention direction detection method based on brain lateral theory | |
Tang et al. | Dynamic pruning group equivariant network for motor imagery EEG recognition | |
Sarić et al. | Implementation of neural network-based classification approach on embedded platform | |
CN116665261A (en) | Image processing method, device and equipment | |
Contreras et al. | Tiny dLIF: a dendritic spiking neural network enabling a time-domain energy-efficient seizure detection system | |
Wang et al. | EEG emotion classification using 2D-3DCNN |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |