EEG signal representation method, classification method, visualization method and medium

文档序号:1161202 发布日期:2020-09-18 浏览:8次 中文

阅读说明:本技术 一种eeg信号的表示方法、分类方法、可视化方法及介质 (EEG signal representation method, classification method, visualization method and medium ) 是由 张军鹏 于 2020-06-18 设计创作,主要内容包括:本发明涉及脑电信号分析与识别技术领域,并公开了一种EEG信号的表示方法、分类方法、可视化方法及介质,该EEG信号的表示方法,通过对需要表示的多个通道的EEG信号进行预处理,再将经过预处理后各个通道的EEG信号由时域转换至频域,并根据各个通道的EGG信号在不同频率值下对应功率数据,得到需要表示的多个通道的EEG信号对应的灰度图。因此,本发明能够将杂乱的EEG信号转换成灰度图,从而以灰度图的形式完整地体现精神分裂症和抑郁症在EEG信号中的隐含信息与差异。(The invention relates to the technical field of EEG signal analysis and identification, and discloses an EEG signal representation method, a classification method, a visualization method and a medium. Thus, the present invention is able to convert a cluttered EEG signal into a gray scale map, thereby fully embodying the underlying information and differences in the EEG signal for schizophrenia and depression in the form of a gray scale map.)

1. A method of representing an EEG signal, comprising:

preprocessing EEG signals of a plurality of channels to be represented; and converting the EEG signals of each channel after the pretreatment from a time domain to a frequency domain, and obtaining gray-scale maps corresponding to the EEG signals of the channels to be expressed according to the corresponding power data of the EGG signals of each channel under different frequency values.

2. A method of representation of an EEG signal as claimed in claim 1, wherein the pre-processing comprises: carrying out filtering operation on EEG signals of a plurality of channels to be expressed to obtain signals of each channel in a corresponding frequency range; and performing artifact removal operation on the signals of the channels in the corresponding frequency range.

3. A method of representing an EEG signal as claimed in claim 2, wherein the artifact removal operation is performed on the signal for each channel in the respective frequency range using independent component analysis.

4. A method of representing an EEG signal as claimed in claim 2, wherein the EEG signals of each channel after said pre-processing is converted from the time domain to the frequency domain using a fast fourier transform.

5. A method of representing an EEG signal as claimed in claim 1, wherein the grey scale map is obtained by:

i=p'×255

wherein p ismax、pminRespectively represent eachAnd the maximum power and the minimum power of the EEG signal of each channel, p is the power of the corresponding frequency of each channel, p' is the power after p normalization, and i is the gray value of the pixel point of the gray map corresponding to p.

6. A method of classifying an EEG signal, comprising:

collecting EEG signals of a plurality of channels, and representing the collected EEG signals of the plurality of channels by adopting the EEG signal representation method of any one of claims 1-5 to obtain corresponding gray-scale maps;

and inputting the gray scale map into a pre-trained convolutional neural network for classification and identification to obtain a classification result.

7. The method of classifying an EEG signal according to claim 6 wherein said convolutional neural network is trained using a five-fold cross-validation method.

8. The method of classifying an EEG signal according to claim 7, wherein said sample gray scale map is processed using image processing means comprising at least one of translation, rotation, flipping and scaling to increase the amount of training samples.

9. A method for visualizing an EGG signal, comprising:

the EEG signal classification method according to any one of claims 6 to 8, wherein a plurality of channels of EEG signals are obtained by obtaining a thermodynamic diagram corresponding to the EEG signals of the plurality of channels based on the gradient of a feature map output by a final convolution layer of a convolutional neural network; and superposing the gray-scale map and the thermodynamic map corresponding to the EEG signals of all the channels to visually display the EGG signals.

10. A computer readable storage medium having one or more programs stored thereon, which when executed by one or more processors implement the method of representing an EEG signal according to any one of claims 1 to 5 or the method of classifying an EEG signal according to any one of claims 6 to 8 or the method of visualizing an EGG signal according to claim 9.

Technical Field

The invention relates to the technical field of electroencephalogram signal analysis and identification, in particular to an EEG signal representation method, a classification method, a visualization method and a medium.

Background

The electrophysiological marker is a method for recording brain activity by using electrophysiological indexes, has the characteristics of non-invasiveness and low cost, and is an ideal mode for distinguishing schizophrenia from depression. At present, the representation method of the EEG signal is mainly based on the frequency band power characteristic and the time point characteristic, but considering that the clinical manifestations of patients with schizophrenia and depression have similarity and the complexity of the electroencephalogram signal of the patients, in order to fully represent the implicit information and difference of schizophrenia and depression in the EEG signal, a representation method of the EGG signal more suitable for distinguishing the situations of schizophrenia and depression is needed.

Disclosure of Invention

The invention aims to: the method for representing the EGG signal is more suitable for distinguishing the situations of schizophrenia and depression, and can completely reflect the implicit information and difference of schizophrenia and depression in the EEG signal.

In order to achieve the purpose, the invention provides the following technical scheme:

a method of representation of an EEG signal, comprising:

preprocessing EEG signals of a plurality of channels to be represented; and converting the EEG signals of each channel after the pretreatment from a time domain to a frequency domain, and obtaining gray-scale maps corresponding to the EEG signals of the channels to be expressed according to the corresponding power data of the EGG signals of each channel under different frequency values.

According to a specific embodiment, in the method for representing an EEG signal of the present invention, the preprocessing comprises: carrying out filtering operation on EEG signals of a plurality of channels to be expressed to obtain signals of each channel in a corresponding frequency range; and performing artifact removal operation on the signals of the channels in the corresponding frequency range.

According to a specific embodiment, the method for representing EEG signals of the present invention uses an independent component analysis method to perform artifact removal on the signals of each channel in the corresponding frequency range.

According to a specific embodiment, the EEG signal representation method of the present invention uses fast fourier transform to transform the EEG signals of each channel after the preprocessing from time domain to frequency domain.

According to a specific embodiment, in the EEG signal representation method of the present invention, the manner of obtaining the gray scale map is:

i=p'×255

wherein p ismax、pminRespectively representing the maximum and minimum power of the EEG signal for each channel, p being perAnd the power of the frequency corresponding to each channel, p' is the power after p normalization, and i is the gray value of the pixel point of the gray map corresponding to p.

Based on the same inventive concept, the invention also provides a method for classifying EEG signals, which comprises the following steps:

collecting EEG signals of a plurality of channels, and expressing the collected EEG signals of the plurality of channels by adopting the EEG signal expression method to obtain corresponding gray-scale maps;

and inputting the gray scale map into a pre-trained convolutional neural network for classification and identification to obtain a classification result.

According to a specific embodiment, the method for classifying EEG signals of the present invention trains the convolutional neural network using five-fold cross validation. Moreover, the sample gray-scale map is processed by an image processing means including at least one of translation, rotation, flipping, and scaling to increase the amount of training samples.

Based on the same inventive concept, the invention also provides a visualization method of the EGG signal, which comprises the following steps:

obtaining thermodynamic diagrams corresponding to EEG signals of a plurality of channels according to the gradient of a characteristic diagram output by a final convolution layer of a convolutional neural network adopted in the classification method of the EEG signals; and superposing the gray-scale map and the thermodynamic map corresponding to the EEG signals of all the channels to visually display the EGG signals.

Based on the same inventive concept, the present invention also provides a computer readable storage medium having one or more programs stored thereon, characterized in that the one or more programs, when executed by one or more processors, implement the method of representing an EEG signal or the method of classifying an EEG signal of the present invention.

In summary, compared with the prior art, the invention has the beneficial effects that:

1. the EEG signal representation method of the invention comprises the steps of preprocessing EEG signals of a plurality of channels to be represented, converting the preprocessed EEG signals of each channel from a time domain to a frequency domain, and obtaining gray-scale maps corresponding to the EEG signals of the plurality of channels to be represented according to corresponding power data of the EGG signals of each channel under different frequency values. Thus, the present invention is able to convert a cluttered EEG signal into a gray scale map, thereby fully embodying the underlying information and differences in the EEG signal for schizophrenia and depression in the form of a gray scale map.

2. The EEG signal classification method comprises the steps of collecting EEG signals of a plurality of channels, representing the collected EEG signals of the plurality of channels as corresponding gray-scale maps, and inputting the obtained gray-scale maps into a pre-trained convolutional neural network for classification and recognition to obtain a classification result. Therefore, the invention can avoid the medical staff from manually selecting the sample characteristics to be used as the diagnosis basis, reduce the labor intensity of the medical staff and improve the sample processing efficiency.

3. According to the visualization method of the EGG signals, thermodynamic diagrams corresponding to EEG signals of a plurality of channels are obtained according to the gradient of the characteristic diagram output by the last convolution layer of the convolutional neural network adopted in the classification method of the EEG signals; and superposing the gray-scale map and the thermodynamic map corresponding to the EEG signals of all the channels to visually display the EGG signals. Therefore, the invention can more intuitively present the implicit information and difference of schizophrenia and depression in the EEG signal, and is convenient for medical staff to use as the diagnosis basis.

Description of the drawings:

FIG. 1 is a schematic diagram of the acquisition of 16-lead EEG signals according to the present invention;

FIG. 2 is a flow chart of a method of representing an EEG signal in accordance with the present invention;

FIG. 3 is a graph of an EEG signal as it is converted from the time domain to the frequency domain in accordance with the present invention;

FIG. 4 is a schematic illustration of a gray scale image of the present invention;

FIG. 5 is a flow chart of a method of classifying EEG signals according to the present invention;

FIG. 6 is a schematic diagram of the training process and visualization process of the convolutional neural network of the present invention;

FIG. 7 is a flow chart of a method of visualizing an EEG signal in accordance with the present invention;

FIG. 8 is a schematic diagram of a final rendered image of the visualization method of the present invention.

Detailed Description

The invention is described in further detail below with reference to the figures and the embodiments. It should be understood that the scope of the above-described subject matter is not limited to the following examples, and any techniques implemented based on the disclosure of the present invention are within the scope of the present invention.

As shown in fig. 1, the data acquisition process is performed in a state where the patient is kept calm, and the 16-lead electroencephalogram signals of the patient in a state of successive eyes open and eyes closed are recorded, and each state is kept for 5-10 seconds.

As shown in fig. 2, the method for representing an EEG signal of the present invention includes:

preprocessing the EEG signals of 16 channels to be represented, specifically, preprocessing the EEG signals by using the EEG ab, wherein the preprocessing includes: carrying out filtering operation on EEG signals of a plurality of channels to be expressed to obtain signals of each channel in a corresponding frequency range; and performing artifact removal operation on the signals of the channels in the corresponding frequency range. The filtering operation aims at intercepting signals of 1-50Hz, meanwhile, an independent component analysis method is adopted to perform artifact removing operation on the signals of all channels in the corresponding frequency range, and artifacts needing to be removed include electro-oculogram, eye movement, head movement and the like.

Specifically, the EEG signals of the 16 channels after being preprocessed are converted from the time domain to the frequency domain by using fast fourier transform, and the result is shown in fig. 3, wherein signal samples of schizophrenia and depression in the eye closing state are converted into the frequency domain, and it can be found that the power of all electrodes of the signal samples of schizophrenia and depression appears as an obvious peak at about 10 Hz.

After converting the EEG signals of 16 channels from the time domain to the frequency domain, deriving data at 1-50Hz in the frequency domain into a matrix with 50 rows and 16 columns, where the row represents frequency, the column represents lead number, the data in the matrix represents power value of corresponding frequency under lead, and then obtaining a gray scale map corresponding to the EEG signals of 16 channels to be represented according to corresponding power data of the EGG signals of each channel under different frequency values, and the result is shown in fig. 4, where fig. 4 includes a gray scale map corresponding to 10 signal samples.

In practice, the method for representing an EEG signal according to the present invention obtains a gray scale map by:

Figure RE-GDA0002576540920000051

i=p'×255

wherein p ismax、pminRespectively representing the maximum power and the minimum power of an EEG signal of each channel, wherein p is the power of the frequency corresponding to each channel, p' is the power after p normalization, and i is the gray value of the pixel point of the gray map corresponding to p.

As shown in fig. 5, the method for classifying EEG signals of the present invention includes:

EEG signals are acquired for multiple channels, as shown in fig. 1.

Then, the EEG signals of a plurality of collected channels are expressed by adopting the EEG signal expression method of the invention, and corresponding gray-scale maps are obtained.

And finally, inputting the obtained gray-scale image into a pre-trained convolutional neural network for classification and identification to obtain a classification result.

Specifically, the classification method of the EEG signal of the invention adopts five-fold cross validation to train the convolutional neural network, namely, the training data is divided into five parts, four parts are trained each time, and the rest part is used for validating the precision of the model; the model can be independently trained five times by the method, and the precision average value of the test model is taken five times as the final verification precision of the model.

During training, based on 200 signal samples of schizophrenia and 200 signal samples of depression, the signal samples are still converted into corresponding gray-scale maps by the EEG signal representation method of the present invention, and a total of 400 gray-scale maps labeled with corresponding classification labels, such as the gray-scale map shown in fig. 4 containing 10 signal samples, where the numbers 0 and 1 below the gray-scale map are classification labels, 0 represents schizophrenia, and 1 represents depression.

Then, an 8-layer shallow convolutional neural network is constructed, and the specific structure is shown in table 1. Moreover, the entire convolutional network contains five different types of layers, specifically: a cavitation layer, a posing layer, a flat layer, a dropout layer, a dense layer.

Table 1: detailed table of convolutional neural network construction

Figure RE-GDA0002576540920000061

Specifically, the convergence layer: this layer consists of a number of kernel. Each kernel is a matrix, and can convolve the input data, and stride of each convolution is 1. Each kernel convolution yields a feature map.

Pooling layer: the layer is used for down-sampling of data so as to reduce the data dimensionality after the convolution layer outputs, effectively reduce the calculated amount and prevent over-fitting. max-pooling layer is the largest value selected in a 2 x 2 window to be input to the next layer.

The Flatten layer that can spread the output data of the last connected layer into a column.

Dropout layer can temporarily hide part of the neurons during training so as to achieve the purpose of reducing overfitting. After many trials, the model sets the dropout rate to 0.5.

And a Dense layer, wherein all the previously extracted features can be associated and mapped into an output space.

During training, the flow is shown in fig. 6, and the convolutional neural network of the present invention uses two activation functions, namely Relu and Sigmoid, wherein the Relu function can increase the nonlinearity of the model, so that the model learns the linear transformation and the nonlinear transformation of the input data at the same time, and the model has more robustness to the noise of the input data. The Relu function is calculated as:

the activation function of the last layer selects a Sigmoid function for calculating the probability value of the last model outputting a certain category, wherein ycThe output of the last layer of the representation model for a class c, p, represents the probability of outputting that class c. The Sigmoid function is calculated as:

Figure RE-GDA0002576540920000072

after the convolutional neural network is constructed, training the model, dividing the sample into 320 training sets and 80 verification sets, and setting parameters during model training as follows after a plurality of tests: the optimizer was selected as RMSProp with the learning rate set to 10-4Each time the sample batch of the input model is 32, the loss function selects a binary cross entropy.

In addition, the classification result for the model is generally expressed by a confusion matrix, which is specifically shown in table 2. The confusion matrix is an m x m number table, where m represents the number of classes, the rows of the list represent the true sample classes, and the columns represent the predicted sample classes. For example, for a binary classification problem, the confusion matrix is 2 × 2, and instead of merely calculating the accuracy of the model, we can obtain the indexes of sensitivity, specificity, precision, and recycle, so the indexes of sensitivity, specificity, F1-score, and accuracy are often used to comprehensively consider the model. The specific calculation formula is as follows:

Figure RE-GDA0002576540920000073

Figure RE-GDA0002576540920000074

in the formula, TP represents true positive, FP represents false positive, TN represents true negative, and FN represents false negative.

Table 2: detailed table of convolutional neural network construction

Figure RE-GDA0002576540920000081

In order to increase the sample amount of convolutional neural network training and avoid the over-fitting problem, the invention also processes the sample gray-scale image by adopting an image processing means of at least one of translation, rotation, turnover and scaling to generate more credible images, so that the convolutional neural network learns more local information in the training samples.

Although the EGG signal representation method provided by the invention can completely represent the implicit information and difference of schizophrenia and depression in the EEG signal in the form of gray scale maps, the gray scale maps are difficult to distinguish by naked eyes and are difficult to directly serve as a diagnosis basis.

Therefore, the present invention further provides a method for visualizing an EGG signal, as shown in fig. 7, which includes:

obtaining thermodynamic diagrams corresponding to EEG signals of a plurality of channels according to the gradient of a characteristic diagram output by a final convolution layer of a convolutional neural network adopted in the classification method of the EEG signals; the grayscale and thermodynamic diagrams corresponding to the EEG signals of the respective channels are superimposed together to obtain a final presented image to visually display the EGG signal, as shown in fig. 8.

As shown in fig. 6, the method of the present invention visualizes the convolutional neural network by using the Grad-cam (gradient class activation map) to find out the basis of the convolutional neural network for making a final classification decision, in other words, the finally obtained visualized image can also be directly used as the diagnosis basis of the medical staff.

Wherein, to obtain the CAM for the intersecting class C, the gradient value of the score for class C (i.e., the value before the softmax layer is input) with respect to the last convolutional layer output feature map is first calculated. And the gradient value can be understood as the importance of the feature map finally output by the convolutional layer on the last decision of class C made by the model, i.e. the weight of the feature map on class C can be calculated.

Figure RE-GDA0002576540920000091

Wherein, ycIs the score corresponding to the intersecting class C (i.e. the value before entering the softmax layer),is the pixel of the (i, j) th position corresponding to k feature maps, Z is the pixel number of the feature maps,the weight of the kth feature map corresponding to class C.

All weights are weightedCharacteristic diagram A corresponding to the characteristic diagramkMultiplying and summing the products, and taking the positive value to obtain the Grad-CAM of class C.

The pixels which only have positive influence on class C are extracted by adopting the Relu function, and pixel points related to other categories cannot be doped after the CAM is superposed with the original image.

In addition, the present invention also provides a readable storage medium, such as a ROM storage device, a removable hard disk, a usb disk, or an optical disk, etc., wherein one or more programs are written into the memory and executed by one or more processors. The program in the memory thus realizes, when executed by the processor, the inventive EEG signal representation method or the inventive EEG signal classification method or the inventive EGG signal visualization method.

The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种模块化设计便携式人体闭合伤电阻抗成像检测设备

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!