+

CN110796175A - An online classification method of EEG data based on lightweight convolutional neural network - Google Patents

An online classification method of EEG data based on lightweight convolutional neural network Download PDF

Info

Publication number
CN110796175A
CN110796175A CN201910940546.8A CN201910940546A CN110796175A CN 110796175 A CN110796175 A CN 110796175A CN 201910940546 A CN201910940546 A CN 201910940546A CN 110796175 A CN110796175 A CN 110796175A
Authority
CN
China
Prior art keywords
layer
data
gateway
cloud
neural network
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.)
Pending
Application number
CN201910940546.8A
Other languages
Chinese (zh)
Inventor
陈丹
柯亨进
李小俚
陈培璐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan University WHU
Original Assignee
Wuhan University WHU
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Wuhan University WHU filed Critical Wuhan University WHU
Priority to CN201910940546.8A priority Critical patent/CN110796175A/en
Publication of CN110796175A publication Critical patent/CN110796175A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • G06F18/2148Generating training patterns; Bootstrap methods, e.g. bagging or boosting characterised by the process organisation or structure, e.g. boosting cascade
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/24Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
    • A61B5/316Modalities, i.e. specific diagnostic methods
    • A61B5/369Electroencephalography [EEG]
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7235Details of waveform analysis
    • A61B5/7264Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems
    • A61B5/7267Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems involving training the classification device
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent

Landscapes

  • Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Biophysics (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Mathematical Physics (AREA)
  • Medical Informatics (AREA)
  • Computing Systems (AREA)
  • Surgery (AREA)
  • Animal Behavior & Ethology (AREA)
  • Pathology (AREA)
  • Public Health (AREA)
  • Veterinary Medicine (AREA)
  • Computational Linguistics (AREA)
  • Evolutionary Biology (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Psychiatry (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Software Systems (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Fuzzy Systems (AREA)
  • Physiology (AREA)
  • Signal Processing (AREA)
  • Psychology (AREA)
  • Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)

Abstract

The invention discloses an electroencephalogram data online classification method based on a light-weight convolutional neural network, which is applied to a cloud service platform, wherein the cloud service platform comprises a sensing layer, a gateway and a cloud end, and firstly, electroencephalogram data of a user are collected through the sensing layer; then, transmitting the acquired electroencephalogram data into a gateway, and downloading a trained classifier model from a cloud end through the gateway; and then, carrying out online classification on the acquired electroencephalogram data based on the trained classifier model, and uploading the EEG segments to a cloud server after being calibrated by a doctor for an incremental training model. The method can be directly applied to the original EEG without preprocessing and feature extraction, and has high classification result precision and real-time performance.

Description

一种基于轻量卷积神经网络的脑电数据的在线分类方法An online classification method of EEG data based on lightweight convolutional neural network

技术领域technical field

本发明涉及计算机技术领域,具体涉及一种基于轻量卷积神经网络的脑电数据的在线分类方法。The invention relates to the technical field of computers, in particular to an online classification method of EEG data based on a lightweight convolutional neural network.

背景技术Background technique

快速准确的脑电(EEG)在线分类是脑机接口、神经反馈应用一级脑疾病监测系统的先决条件。准确的评估和对大脑状态的及时评判能极大的降低大脑疾病患者的风险。因此在线EEG分类一直以来是神经科学研究人员和临床工作者的研究热点。Fast and accurate online classification of electroencephalogram (EEG) is a prerequisite for brain-computer interface, neurofeedback application level-1 brain disease monitoring system. Accurate assessment and timely assessment of brain status can greatly reduce the risk of patients with brain disorders. Therefore, online EEG classification has always been a research hotspot for neuroscience researchers and clinicians.

现有技术中,通常通过对采集的脑电数据进行去噪和特征提取后,再进行分类。In the prior art, the collected EEG data is usually classified after denoising and feature extraction.

本申请发明人在实施本发明的过程中,发现现有技术的方法,至少存在如下技术问题:In the process of implementing the present invention, the inventor of the present application found that the method of the prior art has at least the following technical problems:

脑电数据由于易受噪声干扰,且脑状态演化具有非平稳性,导致分类性能强依赖于数据预处理(去除噪声和人为干扰)和特征提取(提取EEG关键信息)。如何将有强噪声干扰的高维微弱EEG信号进行分类是一个巨大的挑战。Because EEG data is susceptible to noise interference and the evolution of brain states is non-stationary, the classification performance strongly depends on data preprocessing (removing noise and human interference) and feature extraction (extracting EEG key information). How to classify high-dimensional weak EEG signals with strong noise interference is a huge challenge.

由此可知,现有技术中的方法存在实现复杂、分类速度较慢的技术问题。It can be seen from this that the methods in the prior art have technical problems of complex implementation and slow classification speed.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本发明提供了一种基于轻量卷积神经网络的脑电数据的在线分类方法,用以解决或者至少部分解决现有技术中的方法存在的实现复杂、分类速度较慢的技术问题。In view of this, the present invention provides an online classification method for EEG data based on a lightweight convolutional neural network, to solve or at least partially solve the technology in the prior art with complex implementation and slow classification speed. question.

为了解决上述技术问题,本发明提供了一种基于轻量卷积神经网络的脑电数据的在线分类方法,应用于云服务平台,云服务平台包括传感层、网关和云端,所述在线分类方法包括:In order to solve the above technical problems, the present invention provides an online classification method of EEG data based on a lightweight convolutional neural network, which is applied to a cloud service platform. The cloud service platform includes a sensor layer, a gateway and a cloud. The online classification method Methods include:

步骤S1:通过传感层采集用户的脑电数据;Step S1: collecting the user's EEG data through the sensing layer;

步骤S2:将采集的脑电数据传入网关,通过网关从云端下载训练好的分类器模型,其中,训练好的分类器模型通过设计轻量卷积神经网络结构后,采用基于反向传播的小批量随机梯度下降方法训练得到;Step S2: The collected EEG data is transmitted to the gateway, and the trained classifier model is downloaded from the cloud through the gateway. After designing the lightweight convolutional neural network structure, the trained classifier model adopts the back-propagation-based method. The mini-batch stochastic gradient descent method is trained;

步骤S3:基于训练好的分类器模型对采集的脑电数据进行在线分类。Step S3: online classification of the collected EEG data based on the trained classifier model.

在一种实施方式中,步骤S2中设计轻量卷积神经网络的结构包括一个Dropout层、两个具有相同卷积域的卷积层、一个池化层以及三个全连接层,其中,三个全连接层中的神经元数量按照预设方式减少。In one embodiment, the structure of designing a lightweight convolutional neural network in step S2 includes one dropout layer, two convolutional layers with the same convolutional domain, one pooling layer and three fully connected layers, wherein three The number of neurons in each fully connected layer is reduced in a preset manner.

在一种实施方式中,Dropout层和第一个卷积层使用的激活函数为Relu,In one embodiment, the activation function used by the Dropout layer and the first convolutional layer is Relu,

relu(x)=max(0,x)relu(x)=max(0,x)

其中,x为变量;Among them, x is a variable;

第二个卷积层、池化层以及三个全连接层均使用Sigmoid激活函数,Lightweight的最后一个激活函数Sigmoid识别特定脑电片段的分类结果,Sigmoid激活函数的形式如下:The second convolutional layer, pooling layer, and three fully connected layers all use the Sigmoid activation function. The last activation function of Lightweight, Sigmoid, identifies the classification results of specific EEG segments. The form of the Sigmoid activation function is as follows:

Figure BDA0002222756740000021
Figure BDA0002222756740000021

其中,x为变量。where x is a variable.

在一种实施方式中,所述方法还包括:取消第二个卷积层的激活函数。In one embodiment, the method further includes canceling the activation function of the second convolutional layer.

在一种实施方式中,步骤S2中采用基于反向传播的小批量随机梯度下降方法训练,包括:In one embodiment, in step S2, a back-propagation-based mini-batch stochastic gradient descent method is used for training, including:

预先将样本空间按照预设比例划分为训练集、验证集和测试集,其中,训练集和验证集保存在云端,测试集保存在网关;The sample space is divided into training set, validation set and test set in advance according to a preset ratio, among which, the training set and validation set are stored in the cloud, and the test set is stored in the gateway;

通过训练集对神经网络结构进行训练,其中,训练过程中采用的权值更新规则为:The neural network structure is trained through the training set, wherein the weight update rules used in the training process are:

Figure BDA0002222756740000022
Figure BDA0002222756740000022

其中,i表示迭代次数,ν表示动量项变量,ε表示学习率,表示在权值为ωi时,第i批Di的目标导数平均值,ωi表示第i次迭代过程中的权值,ωi+1表示第i+1次迭代过程中的权值。where i is the number of iterations, ν is the momentum term variable, ε is the learning rate, Represents the average value of the target derivative of the i -th batch Di when the weight is ω i , ω i represents the weight in the i-th iteration process, and ω i+1 represents the i+1-th iteration. The weight in the process.

在一种实施方式中,所述方法还包括:云端通过从网关收集经过医生校准的脑电数据,用于增量地离线训练分类器模型。In one embodiment, the method further includes: the cloud is used to incrementally train the classifier model offline by collecting the doctor-calibrated EEG data from the gateway.

在一种实施方式中,步骤S3具体包括:In one embodiment, step S3 specifically includes:

步骤S3.1:将采集的脑电数据分段后,组织成通道级联的三维格式;Step S3.1: After segmenting the collected EEG data, organize it into a three-dimensional format of channel cascade;

步骤S3.2:通过Dropout层对通道级联的三维格式的数据进行处理;Step S3.2: Process the data in the three-dimensional format of the channel cascade through the Dropout layer;

步骤S3.3:通过两个具有相同卷积域的卷积层对步骤S3.2处理后的数据进行卷积操作,其中,两个卷积层的卷积核均为3×3,卷积操作表示为:Step S3.3: Perform a convolution operation on the data processed in step S3.2 through two convolution layers with the same convolution domain, wherein the convolution kernels of the two convolution layers are both 3×3, and the convolution The operation is expressed as:

Figure BDA0002222756740000031
Figure BDA0002222756740000031

式中,ai (l)和ai (l-1)分别表示第l层的第i个输出通道和第l-1层的第i个输出通道;

Figure BDA0002222756740000032
表示第l层中第i个和第j个特征图之间的卷积核;bi (l)代表第l层中的第i个特征图的偏置项;In the formula, a i (l) and a i (l-1) represent the ith output channel of the lth layer and the ith output channel of the l-1th layer, respectively;
Figure BDA0002222756740000032
represents the convolution kernel between the i-th and j-th feature maps in the l-th layer; b i (l) represents the bias term of the i-th feature map in the l-th layer;

步骤S3.4:通过池化层对卷积后的数据进行池化操作;Step S3.4: perform a pooling operation on the convolved data through a pooling layer;

步骤S3.5:对池化后的数据展开为1*14112的向量后,通过三个全连接层进行处理,其中,三个全连接层的输出大小分别为250,60和1,相应的全连接操作表达如下:Step S3.5: After the pooled data is expanded into a 1*14112 vector, it is processed through three fully connected layers, wherein the output sizes of the three fully connected layers are 250, 60 and 1, respectively. The join operation is expressed as follows:

aj (l)和aj (l-1)分别表示第l层和第l-1层的第i个神经元的输出;

Figure BDA0002222756740000034
表示第l-1层的第k个神经元连接到第l层的第j个神经元的权重;bj (l)表示第l层的第j个神经元的偏置,在全连接层使用的激活函数为sigmoid,最后一层激活函数的输出为对用户脑电数据片段的分类结果。a j (l) and a j (l-1) represent the output of the ith neuron in the lth layer and the l-1th layer, respectively;
Figure BDA0002222756740000034
Represents the weight of the kth neuron in the l-1th layer connected to the jth neuron in the lth layer; b j (l) represents the bias of the jth neuron in the lth layer, used in the fully connected layer The activation function of sigmoid is sigmoid, and the output of the last layer of activation function is the classification result of the user's EEG data segment.

本申请实施例中的上述一个或多个技术方案,至少具有如下一种或多种技术效果:The above-mentioned one or more technical solutions in the embodiments of the present application have at least one or more of the following technical effects:

由于本发明提供的方法,通过传感层采集用户的脑电数据后,将采集的脑电数据传入网关,通过网关从云端下载训练好的分类器模型;再基于训练好的分类器模型对采集的脑电数据进行在线分类,云端的训练好的分类器模型是基于通过设计轻量卷积神经网络结构后,采用基于反向传播的小批量随机梯度下降方法训练得到。由于轻量卷积神经网络(LightweightCNN)使用尽可能少的层次,并可以获得较高的分类精度,并且云端保存有训练好的分类器模型,网关可以直接从云端下载对应的分类器模型实现在线分类,从而不需要经过复杂的预处理和特征处理过程,提高了分类效率,实现了实时性。Thanks to the method provided by the present invention, after collecting the user's EEG data through the sensing layer, the collected EEG data is transmitted to the gateway, and the trained classifier model is downloaded from the cloud through the gateway; The collected EEG data is classified online. The trained classifier model in the cloud is based on the design of a lightweight convolutional neural network structure and then trained using the back-propagation-based mini-batch stochastic gradient descent method. Since the Lightweight Convolutional Neural Network (LightweightCNN) uses as few layers as possible and can obtain high classification accuracy, and the trained classifier model is stored in the cloud, the gateway can directly download the corresponding classifier model from the cloud to achieve online Therefore, it does not need to go through complex preprocessing and feature processing, which improves the classification efficiency and realizes real-time performance.

进一步地,通过设计高卷积层来处理高维脑电信号,最小化CNN隐藏层的数量,并设置沙漏型全连接层,越靠近输出层,全连接层的神经元个数以近线性的方式下降,像沙漏的边一样,以快速减少神经网络的连接参数,提高训练性能。Further, by designing high convolutional layers to process high-dimensional EEG signals, minimizing the number of CNN hidden layers, and setting an hourglass-type fully connected layer, the closer to the output layer, the number of neurons in the fully connected layer is nearly linear. Drop, like the edge of an hourglass, to quickly reduce the connection parameters of the neural network and improve training performance.

进一步地,针对神经网络由于样本不平衡而出现分类不平衡问题,利用调整激活函数的个数来解决。Further, to solve the problem of unbalanced classification due to unbalanced samples in the neural network, it is solved by adjusting the number of activation functions.

进一步地,云端通过从网关收集经过医生校准的脑电数据,用于增量地离线训练分类器模型,从而可以持续地优化分类器。Further, the cloud can continuously optimize the classifier by collecting doctor-calibrated EEG data from the gateway for incremental offline training of the classifier model.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are For some embodiments of the present invention, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.

图1为本发明提供的一种基于轻量卷积神经网络的脑电数据的在线分类方法的流程示意图;1 is a schematic flowchart of an online classification method for EEG data based on a lightweight convolutional neural network provided by the present invention;

图2为本发明实施例中在线EEG分类的脑保健云平台工作流程图;Fig. 2 is the working flow chart of the brain health care cloud platform of online EEG classification in the embodiment of the present invention;

图3为本发明实施例中轻量卷积神经网络结构示意图。FIG. 3 is a schematic structural diagram of a lightweight convolutional neural network in an embodiment of the present invention.

具体实施方式Detailed ways

本发明的目的在于针对现有技术分类方法强依赖于数据预处理(去除噪声和人为干扰)和特征提取(提取EEG关键信息)从而导致的脑电数据分类方法实现复杂、分类速度较慢的的技术问题,提出一种基于轻量卷积神经网络的EEG在线分类方法,旨在不需要进行预处理和特征提取,直接对原始EEG信号进行快速准确的分类。The purpose of the present invention is to realize the complex and slow classification method for EEG data classification method caused by the prior art classification method which strongly relies on data preprocessing (removing noise and human interference) and feature extraction (extracting EEG key information). In order to solve the technical problem, an online classification method of EEG based on lightweight convolutional neural network is proposed, which aims to directly classify the original EEG signal quickly and accurately without preprocessing and feature extraction.

为达到上述目的,本发明的主要构思如下:For achieving the above object, main design of the present invention is as follows:

设计轻量卷积神经网络,通过高卷积层来处理高维脑电信号,通过最小化CNN隐藏层的数量,同时设计一个“沙漏式”全连接层块来快速减少输出端神经元的数量。针对神经网络由于样本不平衡而出现分类不平衡问题,本发明利用调整激活函数的个数加以解决。云平台包括传感层、云端和网关三个部分,传感层用于直接采集用户的脑电数据,云端负责对分类器的训练,而网关从云端下载训练好的分类器,输入EEG片段直接在线分类,并将分类结果实时显示在智能设备。EEG片段经医生校准后上传到云端服务器,用于增量式训练模型。本发明能够直接应用于原始EEG,无需进行预处理和特征提取,分类结果精度高且具有实时性。Design a lightweight convolutional neural network, process high-dimensional EEG signals through high convolutional layers, minimize the number of CNN hidden layers, and design an "hourglass" fully connected layer block to quickly reduce the number of output neurons. . Aiming at the problem of unbalanced classification of the neural network due to unbalanced samples, the present invention solves the problem by adjusting the number of activation functions. The cloud platform includes three parts: the sensing layer, the cloud and the gateway. The sensing layer is used to directly collect the user's EEG data, the cloud is responsible for training the classifier, and the gateway downloads the trained classifier from the cloud and enters the EEG segment directly. Online classification and real-time display of classification results on smart devices. The EEG clips are calibrated by doctors and uploaded to the cloud server for incremental training of the model. The invention can be directly applied to the original EEG without preprocessing and feature extraction, and the classification result has high precision and real-time performance.

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purposes, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments These are some embodiments of the present invention, but not all embodiments. 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.

本实施例提供了一种基于轻量卷积神经网络的脑电数据的在线分类方法,请参见图1,该方法包括:This embodiment provides an online classification method for EEG data based on a lightweight convolutional neural network, see FIG. 1 , and the method includes:

步骤S1:通过传感层采集用户的脑电数据。Step S1: Collect the user's EEG data through the sensing layer.

具体来说,传感层可以设置采集设备来进行数据采集,脑电数据即EEG,例如传感器等。Specifically, the sensing layer can be equipped with a collection device to collect data, such as EEG data, such as sensors.

步骤S2:将采集的脑电数据传入网关,通过网关从云端下载训练好的分类器模型,其中,训练好的分类器模型通过设计轻量卷积神经网络结构后,采用基于反向传播的小批量随机梯度下降方法训练得到。Step S2: The collected EEG data is transmitted to the gateway, and the trained classifier model is downloaded from the cloud through the gateway. After designing the lightweight convolutional neural network structure, the trained classifier model adopts the back-propagation-based method. Trained with mini-batch stochastic gradient descent.

具体来说,本发明实施例中的网关用于与用户进行交互,传感层采集的脑电数据传入网关后,网关还从云端下载训练好的分类器模型。轻量卷积神经网络(LightweightCNN)为结构层次精简的神经网络,通过使用尽可能少的层次,同时获得较高的分类精度。Specifically, the gateway in the embodiment of the present invention is used to interact with the user. After the EEG data collected by the sensor layer is transmitted to the gateway, the gateway also downloads the trained classifier model from the cloud. Lightweight Convolutional Neural Network (LightweightCNN) is a neural network with a simplified structure, which uses as few layers as possible to obtain high classification accuracy at the same time.

步骤S3:基于训练好的分类器模型对采集的脑电数据进行在线分类。Step S3: online classification of the collected EEG data based on the trained classifier model.

具体来说,在线分类是在网关进行的,在线分类后,还可以通过电脑、平板、手机等将结果可视化,并实时提醒用户。本申请中的网关为智能网关,智能网关必须能够满足实时响应、处理数据缓存、负载平衡等高级功能,这也对其设计提出的挑战。Specifically, online classification is carried out at the gateway. After online classification, the results can be visualized through computers, tablets, mobile phones, etc., and users can be reminded in real time. The gateway in this application is an intelligent gateway, and the intelligent gateway must be able to satisfy advanced functions such as real-time response, processing data cache, and load balancing, which also poses a challenge to its design.

具体实施过程中,智能网关的基础结构主要包括三个部分,操作系统、流动的EEG数据库和网络协议来为雾计算层提供支持。雾计算层是智能网关的重要组成部分,它包含了脑健康服务面向用户的API。这些服务主要包括用户管理(针对不同的用户群体开放不同的权限)、在线EEG分类(从云端下载最新的分类器进行状态实时划分)、可视化、实时提醒等。In the specific implementation process, the infrastructure of the intelligent gateway mainly includes three parts, the operating system, the flowing EEG database and the network protocol to provide support for the fog computing layer. The fog computing layer is an important part of the intelligent gateway, which contains the user-facing API of the brain health service. These services mainly include user management (opening different permissions for different user groups), online EEG classification (downloading the latest classifier from the cloud for real-time status classification), visualization, real-time reminders, etc.

在一种实施方式中,步骤S2中设计轻量卷积神经网络的结构包括一个Dropout层、两个具有相同卷积域的卷积层、一个池化层以及三个全连接层,其中,三个全连接层中的神经元数量按照预设方式减少。In one embodiment, the structure of designing a lightweight convolutional neural network in step S2 includes one dropout layer, two convolutional layers with the same convolutional domain, one pooling layer and three fully connected layers, wherein three The number of neurons in each fully connected layer is reduced in a preset manner.

具体来说,请参见图3,为轻量卷积神经网络的结构图,Conv1表示第一个卷积层,Conv2表示第二个卷积层,Maxpooling表示池化层,FC1、FC2、FC3分别表示全连接层,本申请中的轻量卷积神经网络,整个神经网络只有7层,远少于现有的深度CNN模型。Specifically, please refer to Figure 3, which is the structure diagram of the lightweight convolutional neural network, Conv1 represents the first convolutional layer, Conv2 represents the second convolutional layer, Maxpooling represents the pooling layer, FC1, FC2, FC3 respectively Indicates the fully connected layer, the lightweight convolutional neural network in this application, the entire neural network has only 7 layers, far less than the existing deep CNN model.

在一种实施方式中,Dropout层和第一个卷积层使用的激活函数为Relu,In one embodiment, the activation function used by the Dropout layer and the first convolutional layer is Relu,

relu(x)=max(0,x)(1)relu(x)=max(0,x)(1)

其中,x为变量;Among them, x is a variable;

第二个卷积层、池化层以及三个全连接层均使用Sigmoid激活函数,Lightweight的最后一个激活函数Sigmoid识别特定脑电片段的分类结果,Sigmoid激活函数的形式如下:The second convolutional layer, pooling layer, and three fully connected layers all use the Sigmoid activation function. The last activation function of Lightweight, Sigmoid, identifies the classification results of specific EEG segments. The form of the Sigmoid activation function is as follows:

Figure BDA0002222756740000061
Figure BDA0002222756740000061

其中,x为变量。where x is a variable.

具体来说,高卷积层通过在一个卷积层上放置深度卷积过滤器来处理高维的EEG片段。对于每一个时间窗,将每个电极的数据序列(X)矩阵化为一个矩阵(A×B),然后将整段脑电数据(通道个数为Z)通过通道级联组织成一个三维数据块(A×B×Z),放进卷积层中。LightweightCNN开始于一个Dropout层,然后连接两个具有相同卷积域(3×3)的卷积层和一个Maxpooling层(1×1),最后是三个全连接层。Specifically, high convolutional layers handle high-dimensional EEG segments by placing depthwise convolutional filters on one convolutional layer. For each time window, the data sequence (X) of each electrode is matrixed into a matrix (A×B), and then the entire EEG data (the number of channels is Z) is organized into a three-dimensional data through channel cascade Blocks (A×B×Z), put into convolutional layers. LightweightCNN starts with a dropout layer, then connects two convolutional layers with the same convolutional domain (3×3) and a Maxpooling layer (1×1), and finally three fully connected layers.

在一种实施方式中,所述方法还包括:取消第二个卷积层的激活函数。In one embodiment, the method further includes canceling the activation function of the second convolutional layer.

具体来说,在脑电分类中,训练样本不能总是保证均衡,影响分类的性能。在神经网络中,非线性拟合能力很大程度上取决于多重激活函数。本申请发明人通过大量的实验与研究发现,取消第二层卷积层的激活函数,能够达到最好的非平衡学习的性能。一般来说,验证分类器处理不平衡样本的能力有两个指标,F-score和GMEAN。Specifically, in EEG classification, training samples cannot always be guaranteed to be balanced, which affects the performance of classification. In neural networks, nonlinear fitting ability is largely dependent on multiple activation functions. The inventor of the present application has found through a large number of experiments and research that the best performance of unbalanced learning can be achieved by canceling the activation function of the second convolutional layer. Generally speaking, there are two metrics to verify the ability of a classifier to handle imbalanced samples, F-score and GMEAN.

其中F-score的公式为:The formula of F-score is:

Figure BDA0002222756740000071
Figure BDA0002222756740000071

其中,precision表示精确度,recall表示召回率,β表示决定召回率和精确度的加权重要性的参数,GMEAN的公式为:Among them, precision represents precision, recall represents recall, and β represents a parameter that determines the weighted importance of recall and precision. The formula of GMEAN is:

Figure BDA0002222756740000072
Figure BDA0002222756740000072

Sensitivity表示敏感度,Specificity表示特异度。Sensitivity means sensitivity and Specificity means specificity.

通过取消第二个卷积层的激活函数后,通过上述两个指标的计算,可以得到最好的非平衡学习的性能。By canceling the activation function of the second convolutional layer, the best unbalanced learning performance can be obtained through the calculation of the above two indicators.

本发明实施例中,将卷积层的卷积核的大小设置为3×3,目的是与每个元素最近的邻居进行卷积,从而有利于更好地保持脑电数据的结构信息。In the embodiment of the present invention, the size of the convolution kernel of the convolution layer is set to 3×3, the purpose is to perform convolution with the nearest neighbor of each element, so as to better maintain the structural information of the EEG data.

神经网络的时间复杂度与隐藏神经元个数N和层数L的乘积成正比。所有卷积层的时间复杂度可以表示为:The time complexity of a neural network is proportional to the product of the number of hidden neurons N and the number of layers L. The time complexity of all convolutional layers can be expressed as:

Figure BDA0002222756740000073
Figure BDA0002222756740000073

1表示卷积层数量标志,d表示层数,nl表示第1层的卷积核个数,nl-1表示第1层的输入通道数,

Figure BDA0002222756740000075
分别表示卷积核和feature map(特征图)的空间大小。1 indicates the number of convolution layers, d indicates the number of layers, n l indicates the number of convolution kernels in the first layer, n l-1 indicates the number of input channels in the first layer, and
Figure BDA0002222756740000075
Represent the spatial size of the convolution kernel and feature map (feature map), respectively.

需要说明的是,脑电数据中包含多个通道,每个通道在一个时间点采集一个数据(每一个数据被称为一个元素),一段时间内就采集一个时间序列的数据。It should be noted that the EEG data contains multiple channels, each channel collects one data at a time point (each data is called an element), and a time series of data is collected within a period of time.

在一种实施方式中,步骤S2中采用基于反向传播的小批量随机梯度下降方法训练,包括:In one embodiment, in step S2, a back-propagation-based mini-batch stochastic gradient descent method is used for training, including:

预先将样本空间按照预设比例划分为训练集、验证集和测试集,其中,训练集和验证集保存在云端,测试集保存在网关;The sample space is divided into training set, validation set and test set in advance according to a preset ratio, among which, the training set and validation set are stored in the cloud, and the test set is stored in the gateway;

通过训练集对神经网络结构进行训练,其中,训练过程中采用的权值更新规则为:The neural network structure is trained through the training set, wherein the weight update rules used in the training process are:

Figure BDA0002222756740000076
Figure BDA0002222756740000076

其中,i表示迭代次数,ν表示动量项变量,ε表示学习率,

Figure BDA0002222756740000077
表示在权值为ωi时,第i批Di的目标导数平均值,ωi表示第i次迭代过程中的权值,ωi+1表示第i+1次迭代过程中的权值。where i is the number of iterations, ν is the momentum term variable, ε is the learning rate,
Figure BDA0002222756740000077
Represents the average value of the target derivative of the i -th batch Di when the weight is ω i , ω i represents the weight in the i-th iteration process, and ω i+1 represents the i+1-th iteration. The weight in the process.

具体来说,训练过程中,前馈网络通过连接拓扑结构和激活函数获得当前层的输出,反馈网络依据拓扑结构运用BP算法根据输出与目标之间的残差,基于随机梯度下降调节模型连接权重进行优化;连接权值的学习的链式法则是输出到当前的连接开始点进行链式更新方式,而偏移量只采用相邻层之间的链式法则进行更新,不考虑跨层之间的影响。Specifically, during the training process, the feedforward network obtains the output of the current layer by connecting the topology structure and the activation function, and the feedback network uses the BP algorithm according to the topology structure to adjust the model connection weight based on the residual between the output and the target based on stochastic gradient descent. Optimize; the chain rule for the learning of connection weights is to output to the current connection start point for chain update, and the offset is only updated by the chain rule between adjacent layers, regardless of the cross-layer Impact.

此外,训练后得到优化的分类模型,测试数据放入模型后可以利用已学习参数进行学习特征,最后根据各个特征进行脑电数据(例如癫痫病发作期等)的预测分类。In addition, the optimized classification model is obtained after training. After the test data is put into the model, the learned parameters can be used to learn features, and finally the EEG data (such as epilepsy seizure period, etc.) can be predicted and classified according to each feature.

在一种实施方式中,所述方法还包括:云端通过从网关收集经过医生校准的脑电数据,用于增量地离线训练分类器模型。In one embodiment, the method further includes: the cloud is used to incrementally train the classifier model offline by collecting the doctor-calibrated EEG data from the gateway.

模型经过训练之后,智能网关可以从云端下载最新的分类器,在不需要修改参数的情况下,对测试集进行测试。云服务器从网关增量地训练新的校正EEG数据,来不断优化新的模型。通过增量第离线训练分类器模型,从而可以持续地优化分类器,得到更为精确的分类预测结果。After the model is trained, the smart gateway can download the latest classifier from the cloud and test it on the test set without modifying the parameters. The cloud server incrementally trains new corrected EEG data from the gateway to continuously optimize new models. Through incremental offline training of the classifier model, the classifier can be continuously optimized to obtain more accurate classification prediction results.

在一种实施方式中,步骤S3具体包括:In one embodiment, step S3 specifically includes:

步骤S3.1:将采集的脑电数据分段后,组织成通道级联的三维格式;Step S3.1: After segmenting the collected EEG data, organize it into a three-dimensional format of channel cascade;

步骤S3.2:通过Dropout层对通道级联的三维格式的数据进行处理;Step S3.2: Process the data in the three-dimensional format of the channel cascade through the Dropout layer;

步骤S3.3:通过两个具有相同卷积域的卷积层对步骤S3.2处理后的数据进行卷积操作,其中,两个卷积层的卷积核均为3×3,卷积操作表示为:Step S3.3: Perform a convolution operation on the data processed in step S3.2 through two convolution layers with the same convolution domain, wherein the convolution kernels of the two convolution layers are both 3×3, and the convolution The operation is expressed as:

Figure BDA0002222756740000081
Figure BDA0002222756740000081

式中,ai (l)和ai (l-1)分别表示第l层的第i个输出通道和第l-1层的第i个输出通道;

Figure BDA0002222756740000082
表示第l层中第i个和第j个特征图之间的卷积核;bi (l)代表第l层中的第i个特征图的偏置项;In the formula, a i (l) and a i (l-1) represent the ith output channel of the lth layer and the ith output channel of the l-1th layer, respectively;
Figure BDA0002222756740000082
represents the convolution kernel between the i-th and j-th feature maps in the l-th layer; b i (l) represents the bias term of the i-th feature map in the l-th layer;

步骤S3.4:通过池化层对卷积后的数据进行池化操作;Step S3.4: perform a pooling operation on the convolved data through a pooling layer;

步骤S3.5:对池化后的数据展开为1*14112的向量后,通过三个全连接层进行处理,其中,三个全连接层的输出大小分别为250,60和1,相应的全连接操作表达如下:Step S3.5: After the pooled data is expanded into a 1*14112 vector, it is processed through three fully connected layers, wherein the output sizes of the three fully connected layers are 250, 60 and 1, respectively. The join operation is expressed as follows:

Figure BDA0002222756740000091
Figure BDA0002222756740000091

aj (l)和aj (l-1)分别表示第l层和第l-1层的第i个神经元的输出;

Figure BDA0002222756740000092
表示第l-1层的第k个神经元连接到第l层的第j个神经元的权重;bj (l)表示第l层的第j个神经元的偏置,在全连接层使用的激活函数为sigmoid,最后一层激活函数的输出为对用户脑电数据片段的分类结果。a j (l) and a j (l-1) represent the output of the ith neuron in the lth layer and the l-1th layer, respectively;
Figure BDA0002222756740000092
Represents the weight of the kth neuron in the l-1th layer connected to the jth neuron in the lth layer; b j (l) represents the bias of the jth neuron in the lth layer, used in the fully connected layer The activation function of sigmoid is sigmoid, and the output of the last layer of activation function is the classification result of the user's EEG data segment.

在深度神经网络应用于EEG分类之后,在识别癫痫发作和帕金森症上,与传统的机器学习如SVM相比,取得了一定的成效。但是目前这种高数据和计算密集型的方法只能用于线下EEG分类。本发明中采用的技术方案为应用于云平台的轻量卷积神经网络,可以实现对非平稳EEG信号的分类结果实施响应。具体实施时,将采集到的脑电信号放入到智能网关中,在各种基础架构的支持下,使用在云端训练成熟的轻量CNN分类器,对EEG进行分类,并将分类结果可视化,实时通知给用户。After deep neural network is applied to EEG classification, it has achieved certain results compared with traditional machine learning such as SVM in identifying epileptic seizures and Parkinson's disease. But currently this highly data- and computationally-intensive method can only be used for offline EEG classification. The technical solution adopted in the present invention is a lightweight convolutional neural network applied to a cloud platform, which can implement a response to the classification result of the non-stationary EEG signal. In the specific implementation, the collected EEG signals are put into the intelligent gateway, and with the support of various infrastructures, the mature lightweight CNN classifier trained in the cloud is used to classify the EEG, and the classification results are visualized. Notify users in real time.

具体的实施过程中,步骤S3.1可以将20*1024格式的数据组织成20*32*32的格式,其中的20表示EEG数据的20个通道。In a specific implementation process, step S3.1 may organize the data in the 20*1024 format into a 20*32*32 format, where 20 represents 20 channels of EEG data.

步骤S3.3中,第一个卷积层的输出数据为20*30*30,将该数据放入第二个卷积层中,输出数据为18*28*28。In step S3.3, the output data of the first convolutional layer is 20*30*30, the data is put into the second convolutional layer, and the output data is 18*28*28.

步骤S3.4中可以使用flatten将18*28*28的数据展开为1*14112的向量。然后使用“沙漏”型的三个全连接层,减少神经元的数量。“沙漏”型的三个全连接层是指:越靠近输出层,全连接层的神经元个数以近线性的方式下降,像沙漏的边一样,以快速减少神经网络的连接参数,从而提高训练性能。In step S3.4, flatten can be used to expand the 18*28*28 data into a 1*14112 vector. Then use the "hourglass" type of three fully connected layers to reduce the number of neurons. The three fully connected layers of the "hourglass" type refer to: the closer to the output layer, the number of neurons in the fully connected layer decreases in a near-linear manner, like the edge of an hourglass, to rapidly reduce the connection parameters of the neural network, thereby improving training. performance.

下面通过具体示例,对本发明提供的在线分类方法进行介绍与说明。The online classification method provided by the present invention will be introduced and described below through specific examples.

参照图2,实施例应用本发明对抑郁症患者原始EEG的脑状态进行分类,用到是数据集为抑郁症公共数据集MPHC EEG Data,20个通道,采样率为256Hz。将数据窗口设置为1024(4秒),所有样本空间为18442个片段,其中抑郁症片段为9789段,健康片段为8653段。使用的云服务器是Google Colaboratory,分类器是基于深度学习框架Keras,传感层采集的数据存储在ongoing数据库中。将20×1024数据转化成20×32×32的三维格式,在输入数据经过dropout层、两个卷积层、一个Maxpooling(池化)层之后,中间过程中的三维数据块将被平铺成一个向量,向量被传递到最后的三个全连接层,输出大小分别是250、60和1,最后识别出EEG片段的状态是抑郁症还是健康。Referring to FIG. 2 , the embodiment applies the present invention to classify the brain state of the original EEG of patients with depression. The data set used is MPHC EEG Data, a public data set for depression, with 20 channels and a sampling rate of 256 Hz. With the data window set to 1024 (4 seconds), all sample spaces are 18442 segments, including 9789 segments for depression and 8653 segments for healthy. The cloud server used is Google Colaboratory, the classifier is based on the deep learning framework Keras, and the data collected by the sensing layer is stored in the ongoing database. Convert 20×1024 data into 20×32×32 3D format. After the input data passes through the dropout layer, two convolution layers, and a Maxpooling (pooling) layer, the 3D data blocks in the middle process will be tiled into A vector, the vector is passed to the last three fully connected layers with output sizes of 250, 60 and 1, which finally identify whether the state of the EEG segment is depression or health.

轻量CNN使用SGD(随机梯度下降)的方法进行了最小批量为80的训练。学习率设置为0.01,dropout设为0.1。分类器设计完成后要对其性能进行评估。在本实施例中,将数据分为训练集、验证集和测试集,分别占64%、16%和20%。在训练阶段使用5折交叉验证算法,同迭代10次。所有训练集中的样品片段均分为5份,在每次迭代中,4份用于训练,剩下的一份作为验证。将10次迭代输出(测试集)的平均值作为结果。抑郁症分类的准确率为98.59%±0.28%,敏感度为98.59%±0.28%,特异性为99.51%±0.19%。Lightweight CNN is trained with a mini-batch size of 80 using SGD (Stochastic Gradient Descent). The learning rate is set to 0.01, and the dropout is set to 0.1. After the classifier is designed, its performance is evaluated. In this embodiment, the data is divided into training set, validation set and test set, which account for 64%, 16% and 20% respectively. In the training phase, a 5-fold cross-validation algorithm is used, with 10 iterations. All sample fragments in the training set are divided into 5 copies, and in each iteration, 4 copies are used for training and the remaining one is used for validation. Take the average of 10 iteration outputs (test set) as the result. The accuracy of the classification of depression was 98.59% ± 0.28%, the sensitivity was 98.59% ± 0.28%, and the specificity was 99.51% ± 0.19%.

运行效率是通过训练和在线分类来衡量的。模型训练在一个小时内完成,模型训练完成之后被下载到网关中,对正在输入的原始EEG片段(长度大约为4秒)进行分类,用时不到0.01秒,可知本发明提供对在线分类方法大大提高了分类效率。Operational efficiency is measured by training and online classification. The model training is completed within one hour. After the model training is completed, it is downloaded to the gateway to classify the original EEG segment (about 4 seconds in length) that is being input, and it takes less than 0.01 seconds. Improved classification efficiency.

具体实施时,本领域技术人员可采用计算机软件技术实现以上流程的自动运行。During specific implementation, those skilled in the art can use computer software technology to realize the automatic operation of the above process.

应当理解的是,本说明书未详细阐述的部分均属于现有技术。上述针对较佳实施例的描述较为详细,并不能因此而认为是对本发明专利保护范围的限制,本领域的普通技术人员在本发明的启示下,在不脱离本发明权利要求所保护的范围情况下,还可以做出替换或变形,均落入本发明的保护范围之内,本发明的请求保护范围应以所附权利要求为准。It should be understood that the parts not described in detail in this specification belong to the prior art. The above description of the preferred embodiment is relatively detailed, and therefore should not be considered as a limitation on the scope of protection of the patent of the present invention. Those of ordinary skill in the art, under the inspiration of the present invention, do not deviate from the scope of protection of the claims of the present invention. Below, alternatives or modifications can also be made, which all fall within the protection scope of the present invention, and the claimed protection scope of the present invention shall be subject to the appended claims.

Claims (7)

1.一种基于轻量卷积神经网络的脑电数据的在线分类方法,其特征在于,应用于云服务平台,云服务平台包括传感层、网关和云端,所述在线分类方法包括:1. an online classification method based on the EEG data of lightweight convolutional neural network, is characterized in that, is applied to cloud service platform, cloud service platform comprises sensor layer, gateway and cloud, and described online classification method comprises: 步骤S1:通过传感层采集用户的脑电数据;Step S1: collecting the user's EEG data through the sensing layer; 步骤S2:将采集的脑电数据传入网关,通过网关从云端下载训练好的分类器模型,其中,训练好的分类器模型通过设计轻量卷积神经网络结构后,采用基于反向传播的小批量随机梯度下降方法训练得到;Step S2: The collected EEG data is transmitted to the gateway, and the trained classifier model is downloaded from the cloud through the gateway. After designing the lightweight convolutional neural network structure, the trained classifier model adopts the back-propagation-based method. The mini-batch stochastic gradient descent method is trained; 步骤S3:基于训练好的分类器模型对采集的脑电数据进行在线分类。Step S3: online classification of the collected EEG data based on the trained classifier model. 2.如权利要求1所述的方法,其特征在于,步骤S2中设计轻量卷积神经网络的结构包括一个Dropout层、两个具有相同卷积域的卷积层、一个池化层以及三个全连接层,其中,三个全连接层中的神经元数量按照预设方式减少。2. The method of claim 1, wherein the structure of designing a lightweight convolutional neural network in step S2 comprises a dropout layer, two convolutional layers with the same convolutional domain, a pooling layer, and three convolutional layers. A fully connected layer, wherein the number of neurons in the three fully connected layers is reduced in a preset manner. 3.如权利要求2所述的方法,其特征在于,Dropout层和第一个卷积层使用的激活函数为Relu,3. method as claimed in claim 2, is characterized in that, the activation function that Dropout layer and first convolution layer use is Relu, relu(x)=max(0,x)relu(x)=max(0,x) 其中,x为变量;Among them, x is a variable; 第二个卷积层、池化层以及三个全连接层均使用Sigmoid激活函数,Lightweight的最后一个激活函数Sigmoid识别特定脑电片段的分类结果,Sigmoid激活函数的形式如下:The second convolutional layer, pooling layer, and three fully connected layers all use the Sigmoid activation function. The last activation function of Lightweight, Sigmoid, identifies the classification results of specific EEG segments. The form of the Sigmoid activation function is as follows: 其中,x为变量。where x is a variable. 4.如权利要求3所述的方法,其特征在于,所述方法还包括:取消第二个卷积层的激活函数。4. The method of claim 3, further comprising: canceling the activation function of the second convolutional layer. 5.如权利要求1所述的方法,其特征在于,步骤S2中采用基于反向传播的小批量随机梯度下降方法训练,包括:5. The method of claim 1, wherein in step S2, a back-propagation-based mini-batch stochastic gradient descent method is used for training, comprising: 预先将样本空间按照预设比例划分为训练集、验证集和测试集,其中,训练集和验证集保存在云端,测试集保存在网关;The sample space is divided into training set, validation set and test set in advance according to a preset ratio, wherein, the training set and validation set are stored in the cloud, and the test set is stored in the gateway; 通过训练集对神经网络结构进行训练,其中,训练过程中采用的权值更新规则为:The neural network structure is trained through the training set, wherein the weight update rules used in the training process are:
Figure FDA0002222756730000021
Figure FDA0002222756730000021
ωi+1←ωii+1 ω i+1 ←ω ii+1 其中,i表示迭代次数,ν表示动量项变量,ε表示学习率,
Figure FDA0002222756730000022
表示在权值为ωi时,第i批Di的目标导数平均值,ωi表示第i次迭代过程中的权值,ωi+1表示第i+1次迭代过程中的权值。
where i is the number of iterations, ν is the momentum term variable, ε is the learning rate,
Figure FDA0002222756730000022
Represents the average value of the target derivative of the i -th batch Di when the weight is ω i , ω i represents the weight in the i-th iteration process, and ω i+1 represents the i+1-th iteration. The weight in the process.
6.如权利要求5所述的方法,其特征在于,所述方法还包括:云端通过从网关收集经过医生校准的脑电数据,用于增量地离线训练分类器模型。6 . The method of claim 5 , further comprising: the cloud is used to incrementally train the classifier model offline by collecting doctor-calibrated EEG data from the gateway. 7 . 7.如权利要求2所述的方法,其特征在于,步骤S3具体包括:7. The method of claim 2, wherein step S3 specifically comprises: 步骤S3.1:将采集的脑电数据分段后,组织成通道级联的三维格式;Step S3.1: After segmenting the collected EEG data, organize it into a three-dimensional format of channel cascade; 步骤S3.2:通过Dropout层对通道级联的三维格式的数据进行处理;Step S3.2: Process the data in the three-dimensional format of the channel cascade through the Dropout layer; 步骤S3.3:通过两个具有相同卷积域的卷积层对步骤S3.2处理后的数据进行卷积操作,其中,两个卷积层的卷积核均为3×3,卷积操作表示为:Step S3.3: Perform a convolution operation on the data processed in step S3.2 through two convolution layers with the same convolution domain, wherein the convolution kernels of the two convolution layers are both 3×3, and the convolution The operation is expressed as:
Figure FDA0002222756730000023
Figure FDA0002222756730000023
式中,ai (l)和ai (l-1)分别表示第l层的第i个输出通道和第l-1层的第i个输出通道;
Figure FDA0002222756730000024
表示第l层中第i个和第j个特征图之间的卷积核;bi (l)代表第l层中的第i个特征图的偏置项;
In the formula, a i (l) and a i (l-1) represent the ith output channel of the lth layer and the ith output channel of the l-1th layer, respectively;
Figure FDA0002222756730000024
represents the convolution kernel between the i-th and j-th feature maps in the l-th layer; b i (l) represents the bias term of the i-th feature map in the l-th layer;
步骤S3.4:通过池化层对卷积后的数据进行池化操作;Step S3.4: perform a pooling operation on the convolved data through a pooling layer; 步骤S3.5:对池化后的数据展开为1*14112的向量后,通过三个全连接层进行处理,其中,三个全连接层的输出大小分别为250,60和1,相应的全连接操作表达如下:Step S3.5: After the pooled data is expanded into a vector of 1*14112, it is processed through three fully connected layers, wherein the output sizes of the three fully connected layers are 250, 60 and 1, respectively. The join operation is expressed as follows:
Figure FDA0002222756730000025
Figure FDA0002222756730000025
aj (l)和aj (l-1)分别表示第l层和第l-1层的第i个神经元的输出;
Figure FDA0002222756730000026
表示第l-1层的第k个神经元连接到第l层的第j个神经元的权重;bj (l)表示第l层的第j个神经元的偏置,在全连接层使用的激活函数为sigmoid,最后一层激活函数的输出为对用户脑电数据片段的分类结果。
a j (l) and a j (l-1) represent the output of the ith neuron in the lth layer and the l-1th layer, respectively;
Figure FDA0002222756730000026
Represents the weight of the kth neuron in the l-1th layer connected to the jth neuron in the lth layer; b j (l) represents the bias of the jth neuron in the lth layer, used in the fully connected layer The activation function of sigmoid is sigmoid, and the output of the last layer of activation function is the classification result of the user's EEG data segment.
CN201910940546.8A 2019-09-30 2019-09-30 An online classification method of EEG data based on lightweight convolutional neural network Pending CN110796175A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910940546.8A CN110796175A (en) 2019-09-30 2019-09-30 An online classification method of EEG data based on lightweight convolutional neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910940546.8A CN110796175A (en) 2019-09-30 2019-09-30 An online classification method of EEG data based on lightweight convolutional neural network

Publications (1)

Publication Number Publication Date
CN110796175A true CN110796175A (en) 2020-02-14

Family

ID=69438781

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910940546.8A Pending CN110796175A (en) 2019-09-30 2019-09-30 An online classification method of EEG data based on lightweight convolutional neural network

Country Status (1)

Country Link
CN (1) CN110796175A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111857348A (en) * 2020-07-24 2020-10-30 张彬 System and method for realizing neural network interconnection based on brain wave big data
CN111882001A (en) * 2020-08-05 2020-11-03 武汉呵尔医疗科技发展有限公司 Cervical cell image classification method based on cell biological characteristic-convolutional neural network
CN112294341A (en) * 2020-10-29 2021-02-02 武汉大学 Sleep electroencephalogram spindle wave identification method and system based on light convolutional neural network
CN113111726A (en) * 2021-03-18 2021-07-13 浙江大学 Vibration motor equipment fingerprint extraction and identification method based on homologous signals
CN113712571A (en) * 2021-06-18 2021-11-30 陕西师范大学 Abnormal electroencephalogram signal detection method based on Rinyi phase transfer entropy and lightweight convolutional neural network
CN113712511A (en) * 2021-09-03 2021-11-30 湖北理工学院 Stable mode discrimination method for brain imaging fusion features
CN115080771A (en) * 2022-06-23 2022-09-20 康键信息技术(深圳)有限公司 Data processing method and device, medium and gateway device based on artificial intelligence
CN115721322A (en) * 2022-12-14 2023-03-03 江苏理工学院 A system and method for monitoring abnormal sleep of the elderly based on EEG signals
CN116501444A (en) * 2023-04-28 2023-07-28 重庆大学 System and method for abnormal cloud-side collaborative monitoring and recovery of intelligent networked vehicle domain controller virtual machine
CN116584956A (en) * 2023-05-26 2023-08-15 常州大学 A Single-Channel EEG Drowsiness Detection Method Based on Lightweight Neural Network

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069958A (en) * 2018-01-22 2019-07-30 北京航空航天大学 A kind of EEG signals method for quickly identifying of dense depth convolutional neural networks
CN110163180A (en) * 2019-05-29 2019-08-23 长春思帕德科技有限公司 Mental imagery eeg data classification method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069958A (en) * 2018-01-22 2019-07-30 北京航空航天大学 A kind of EEG signals method for quickly identifying of dense depth convolutional neural networks
CN110163180A (en) * 2019-05-29 2019-08-23 长春思帕德科技有限公司 Mental imagery eeg data classification method and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HENGJIN KE等: "Cloud-aided online EEG classification system for brain healthcare: A case study of depression evaluation with a lightweight CNN", 《SOFTWARE: PRACTICE AND EXPERIENCE》 *
王凤琴等: "基于跨层全连接神经网络的癫痫发作期识别", 《计算机应用研究》 *

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111857348A (en) * 2020-07-24 2020-10-30 张彬 System and method for realizing neural network interconnection based on brain wave big data
CN111882001A (en) * 2020-08-05 2020-11-03 武汉呵尔医疗科技发展有限公司 Cervical cell image classification method based on cell biological characteristic-convolutional neural network
CN112294341A (en) * 2020-10-29 2021-02-02 武汉大学 Sleep electroencephalogram spindle wave identification method and system based on light convolutional neural network
CN113111726B (en) * 2021-03-18 2022-10-28 浙江大学 Vibration motor equipment fingerprint extraction and identification method based on homologous signals
CN113111726A (en) * 2021-03-18 2021-07-13 浙江大学 Vibration motor equipment fingerprint extraction and identification method based on homologous signals
CN113712571A (en) * 2021-06-18 2021-11-30 陕西师范大学 Abnormal electroencephalogram signal detection method based on Rinyi phase transfer entropy and lightweight convolutional neural network
CN113712511B (en) * 2021-09-03 2023-05-30 湖北理工学院 A Stable Pattern Discrimination Method for Brain Imaging Fusion Features
CN113712511A (en) * 2021-09-03 2021-11-30 湖北理工学院 Stable mode discrimination method for brain imaging fusion features
CN115080771A (en) * 2022-06-23 2022-09-20 康键信息技术(深圳)有限公司 Data processing method and device, medium and gateway device based on artificial intelligence
CN115721322A (en) * 2022-12-14 2023-03-03 江苏理工学院 A system and method for monitoring abnormal sleep of the elderly based on EEG signals
CN116501444A (en) * 2023-04-28 2023-07-28 重庆大学 System and method for abnormal cloud-side collaborative monitoring and recovery of intelligent networked vehicle domain controller virtual machine
CN116501444B (en) * 2023-04-28 2024-02-27 重庆大学 Abnormal cloud edge collaborative monitoring and recovering system and method for virtual machine of intelligent network-connected automobile domain controller
CN116584956A (en) * 2023-05-26 2023-08-15 常州大学 A Single-Channel EEG Drowsiness Detection Method Based on Lightweight Neural Network

Similar Documents

Publication Publication Date Title
CN110796175A (en) An online classification method of EEG data based on lightweight convolutional neural network
EP4212100A1 (en) Electroencephalogram signal classification method and apparatus, and device, storage medium and program product
EP3933551A1 (en) Motor imagery electroencephalogram signal processing method, device, and storage medium
Malviya et al. A novel technique for stress detection from EEG signal using hybrid deep learning model
CN108319928B (en) A deep learning method and system based on multi-objective particle swarm optimization optimization
CN107451407A (en) A kind of traditional Chinese medical science intelligent diagnosing method, system and traditional medical system
Krishna et al. An effective Parkinson's disease prediction using logistic decision regression and machine learning with big data
CN116072265B (en) Sleep stage analysis system and method based on convolution of time self-attention and dynamic diagram
CN115251909B (en) Method and device for evaluating hearing by electroencephalogram signals based on space-time convolutional neural network
CN114239658B (en) Blood glucose prediction method based on wavelet decomposition and GRU neural network
Koçer et al. Classifying neuromuscular diseases using artificial neural networks with applied Autoregressive and Cepstral analysis
CN115349821A (en) A sleep staging method and system based on multimodal physiological signal fusion
CN114027786A (en) Sleep-disordered breathing detection method and system based on self-supervised memory network
CN112244868A (en) Epilepsia electroencephalogram signal classification method based on ANFIS
Alruwaili et al. Human emotion recognition based on brain signal analysis using fuzzy neural network
Dweiri et al. A novel neuroevolution model for emg-based hand gesture classification
Kan et al. A Novel PSO‐Based Optimized Lightweight Convolution Neural Network for Movements Recognizing from Multichannel Surface Electromyogram
Mouleeshuwarapprabu et al. Feature extraction and classification of EEG signal using multilayer perceptron
CN114141369B (en) Method, device, electronic device and storage medium for calculating spasticity
CN115719647A (en) Cardiovascular Disease Prediction System for Hemodialysis Complicated by Combining Active Learning and Contrastive Learning
CN115844419A (en) Electrocardiosignal quality detection method and device and computer readable medium
Parashar et al. Computer-aided diagnosis of glaucoma at early-stage using retinal fundus images
Liu et al. Modeling and Recognition of Movement-Inducing Fatigue State Based on ECG Signal
Zou et al. Embedded Cyber-Physical Systems for Monitoring and Optimization of Sports Facilities Using Consumer IoT (CIoT) and Edge Computing
CN119820582B (en) Adaptive control method and system for humanoid robot, electronic equipment and storage medium

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200214

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载