Electroencephalogram classification network training method, classification method, equipment and storage medium

文档序号:441931 发布日期:2021-12-28 浏览:10次 中文

阅读说明:本技术 脑电信号分类网络训练方法、分类方法、设备及存储介质 (Electroencephalogram classification network training method, classification method, equipment and storage medium ) 是由 陈懿 黄梦婕 杨瑞 于 2021-09-28 设计创作,主要内容包括:本申请涉及一种脑电信号分类网络训练方法、分类方法、设备及存储介质,属于计算机技术领域,该方法包括:获取训练数据;将第一脑电样本信号和第二脑电样本信号输入预先创建的初始网络模型,得到脑电样本信号的分类预测信息和数据特征;基于数据特征、第一脑电样本信号的采集时间信息和第二脑电样本信号的采集时间信息,获取源数据与目标数据的时间分布差异;获取源数据与目标数据的类别分布差异;基于第一分类预测信息、分类信息、时间分布差异和类别分布差异对初始网络模型进行迭代训练,得到脑电信号分类网络;可以解决现有的脑电信号分类网络训练方法训练得到的脑电信号分类网络对于时变性很强的脑电信号分类不准确的问题。(The application relates to an electroencephalogram signal classification network training method, a classification method, equipment and a storage medium, belonging to the technical field of computers, wherein the method comprises the following steps: acquiring training data; inputting the first electroencephalogram sample signal and the second electroencephalogram sample signal into a pre-established initial network model to obtain classification prediction information and data characteristics of the electroencephalogram sample signals; acquiring time distribution difference of source data and target data based on the data characteristics, the acquisition time information of the first electroencephalogram sample signal and the acquisition time information of the second electroencephalogram sample signal; acquiring the category distribution difference of source data and target data; performing iterative training on the initial network model based on the first classification prediction information, the classification information, the time distribution difference and the class distribution difference to obtain an electroencephalogram signal classification network; the method can solve the problem that the electroencephalogram classification network obtained by training the existing electroencephalogram classification network is inaccurate in classification of electroencephalograms with strong time-varying property.)

1. An electroencephalogram signal classification network training method is characterized by comprising the following steps:

acquiring training data; the training data comprises source data and target data; the source data comprises at least one group of first electroencephalogram sample signals and first labels corresponding to the first electroencephalogram sample signals; the first label comprises acquisition time information and classification information of the first electroencephalogram sample signal; the target data comprises at least one group of second electroencephalogram sample signals and second labels corresponding to the second electroencephalogram sample signals; the second label comprises the acquisition time information of the second electroencephalogram sample signal;

inputting the first electroencephalogram sample signal and the second electroencephalogram sample signal into a pre-established initial network model to obtain classification prediction information and data characteristics of the electroencephalogram sample signals; the classification prediction information comprises first classification prediction information of the first electroencephalogram sample signal and second classification prediction information of the second electroencephalogram sample signal; the data feature comprises a first data feature of the first brain electrical sample signal and a second data feature of the second brain electrical sample signal;

acquiring the time distribution difference of the source data and the target data based on the data characteristics, the acquisition time information of the first electroencephalogram sample signal and the acquisition time information of the second electroencephalogram sample signal;

acquiring the category distribution difference of the source data and the target data based on the data characteristics, the second classification prediction information and the classification information;

and performing iterative training on the initial network model based on the first classification prediction information, the classification information, the time distribution difference and the class distribution difference to obtain the electroencephalogram signal classification network.

2. The method of claim 1, wherein said obtaining a time distribution difference of the source data and the target data based on the data feature, the acquisition time information of the first brain electrical sample signal, and the acquisition time information of the second brain electrical sample signal comprises:

calculating weights of different preset time periods based on the acquisition time information of the first electroencephalogram sample signal and the acquisition time information of the second electroencephalogram sample signal;

and calculating the maximum mean difference between the first data characteristic and the second data characteristic based on the weights of the different preset time periods to obtain the time distribution difference.

3. The method of claim 2, wherein calculating weights for different preset time periods based on the acquisition time information of the first brain electrical sample signal and the acquisition time information of the second brain electrical sample signal comprises:

determining the first sample number of the first electroencephalogram sample signals within each preset time period;

for each preset time period, determining the ratio of the number of first samples in the preset time period to the total number of samples of the first electroencephalogram sample signal in the source data as a first weight of the preset time period;

determining the second sample number of the second electroencephalogram sample signals within the preset time periods;

for each preset time period, determining the ratio of the number of second samples in the preset time period to the total number of second electroencephalogram sample signals in the target data as a second weight of the preset time period.

4. The method of claim 2, wherein the calculating the maximum mean difference between the first data feature and the second data feature based on the weights of the different preset time periods yields the time distribution difference, which is represented by the following formula:

wherein the content of the first and second substances,is the time distribution difference;distributing the source data in different preset time periods;for the target dataDistribution in different preset time periods;representing a regenerative nuclear hilbert space; t is the number of the preset time periods; τ represents the τ th of the preset time period; n issThe number of first electroencephalogram sample signals in the source data is obtained; n istThe number of second electroencephalogram sample signals in the target data is obtained;anda first weight for the τ th preset time period;anda second weight for the τ th preset time period; x is the number ofsiThe first data characteristics corresponding to the ith group of first electroencephalogram sample signals in the source data are obtained; x is the number ofsjThe first data characteristics corresponding to the jth group of first electroencephalogram sample signals in the source data are obtained; x is the number oftiThe second data characteristics corresponding to the ith group of second electroencephalogram sample signals in the target data; x is the number oftjThe second data characteristics corresponding to the jth group of second electroencephalogram sample signals in the target data; k (·, ·) is a kernel function.

5. The method of claim 1, wherein the obtaining the class distribution difference between the source data and the target data based on the data feature, the second classification prediction information, and the classification information comprises:

calculating weights of different preset categories based on second classification prediction information and the classification information;

and calculating the maximum mean difference between the first data characteristic and the second data characteristic based on the weights of different preset categories to obtain the category distribution difference.

6. The method of claim 1, wherein iteratively training the initial network model based on the first classification prediction information, the classification information, the time distribution difference, and the class distribution difference to obtain the electroencephalogram signal classification network comprises:

inputting the first classification prediction information and the classification information into a classification loss function to obtain a classification loss item;

calculating the expected value of the time distribution difference to obtain a time difference loss item;

calculating expected values of the category distribution differences to obtain category difference loss items;

calculating a total loss value for a network model based on the classification loss term, the time difference loss term, and the category difference loss term;

and iteratively updating the model parameters of the initial network model based on the total loss value so as to minimize the total loss value and obtain the electroencephalogram signal classification network.

7. The method of claim 6, wherein the calculating a total loss value for the network model based on the classification loss term, the time difference loss term, and the class difference loss term is represented by:

wherein L is the total loss value; n issIs the number of first brain sample signals in the source data; j (f (x)si),ysi) A classification loss item corresponding to the ith group of first electroencephalogram sample signals in the source data; f (x)si) The first classification prediction information corresponding to the ith group of first electroencephalogram sample signals in the source data is obtained; y issiThe ith group of first electroencephalogram sample information in the source dataCollecting time information of the number; lambda [ alpha ]〈c〉The scaling factor of the category difference loss term is a preset constant; lambda [ alpha ]〈τ〉The scaling factor of the time difference loss term is a preset constant;a loss term for the category difference;a loss term for the time difference;distributing differences for the categories;is the time distribution difference;distributing the source data in different categories;distributing the target data in different categories;the distribution of the source data in different time periods;the distribution of the target data in different time periods.

8. An electroencephalogram signal classification method, characterized in that the method comprises:

acquiring at least one group of target electroencephalogram signals;

inputting the target electroencephalogram signal into a pre-trained electroencephalogram signal classification network to obtain classification prediction information corresponding to the target electroencephalogram signal;

the electroencephalogram classification network is obtained by performing iterative training on an initial network model by using first classification prediction information, classification information, time distribution difference and class distribution difference; the first classification prediction information is obtained by inputting a first electroencephalogram sample signal into the initial network; the classification information is classification information corresponding to the first electroencephalogram sample signal; the time distribution difference is a distribution difference between the acquired source data and the target data based on data characteristics, the acquisition time information of the first electroencephalogram sample signal and the acquisition time information of the second electroencephalogram sample signal; the source data comprises at least one group of first electroencephalogram sample signals and first labels corresponding to the first electroencephalogram sample signals; the first label comprises the acquisition time information and the classification information of the first electroencephalogram sample signal; the target data comprises at least one group of second electroencephalogram sample signals and second labels corresponding to the second electroencephalogram sample signals; the second label comprises the acquisition time information of the second electroencephalogram sample signal; the data characteristics are obtained by inputting the first electroencephalogram sample signal and the second electroencephalogram sample signal into the initial network model; the data feature comprises a first data feature of the first brain electrical sample signal and a second data feature of the second brain electrical sample signal; the category distribution difference is a distribution difference between the source data and the target data obtained based on the data feature, second classification prediction information, and the classification information; and the second classification prediction information is obtained by inputting the second electroencephalogram sample signal into the initial network.

9. An electronic device, characterized in that the device comprises a processor and a memory; the memory stores a program which is loaded and executed by the processor to implement the electroencephalogram signal classification network training method of any one of claims 1 to 7; or, implementing the electroencephalogram signal classification method of claim 8.

10. A computer-readable storage medium, characterized in that the storage medium has stored therein a program which, when executed by a processor, is adapted to implement the electroencephalogram signal classification network training method of any one of claims 1 to 7; or, implementing the electroencephalogram signal classification method of claim 8.

[ technical field ] A method for producing a semiconductor device

The application relates to an electroencephalogram signal classification network training method, a classification method, equipment and a storage medium, and belongs to the technical field of computers.

[ background of the invention ]

Analysis of electroencephalograph signals can bring us with much knowledge about brain activity, and electroencephalography has the advantages of being non-invasive and convenient, and therefore, it has been widely adopted by academia and industry. Electroencephalograms may be used to assess sleep quality; it can also be used to test concentration; in addition, it is a useful tool for diagnosing diseases such as schizophrenia and epilepsy.

The traditional electroencephalogram signal identification tasks comprise steady-state visual evoked potential classification, P300 evoked potential classification, motor imagery electroencephalogram signal identification classification, error-related potential identification and emotion identification. For electroencephalogram applications, we can use classification of electroencephalogram data as a command to control an external system.

However, in the existing electroencephalogram signal classification network training method, only the overall distribution difference of electroencephalogram signals of different objects and the distribution difference of electroencephalogram signals under different types are concerned in the process of training an electroencephalogram classification network, and the influence of time factors on the electroencephalogram signals is not considered, so that the electroencephalogram signal classification network obtained by training is inaccurate in electroencephalogram signal classification with strong time variation.

[ summary of the invention ]

The application provides an electroencephalogram signal classification network training method, device, equipment and storage medium, and can solve the problem that in the existing electroencephalogram signal classification network training method, only the overall distribution difference of electroencephalograms of different objects and the distribution difference of electroencephalograms under different types are concerned in the process of training an electroencephalogram classification network, the influence of time factors on the electroencephalograms is not considered, and the electroencephalogram signal classification network obtained through training is inaccurate in electroencephalogram signal classification with strong time variability. The application provides the following technical scheme:

in a first aspect, a method for training a classification network of electroencephalogram signals is provided, the method comprising:

acquiring training data; the training data comprises source data and target data; the source data comprises at least one group of first electroencephalogram sample signals and first labels corresponding to the first electroencephalogram sample signals; the first label comprises acquisition time information and classification information of the first electroencephalogram sample signal; the target data comprises at least one group of second electroencephalogram sample signals and second labels corresponding to the second electroencephalogram sample signals; the second label comprises the acquisition time information of the second electroencephalogram sample signal;

inputting the first electroencephalogram sample signal and the second electroencephalogram sample signal into a pre-established initial network model to obtain classification prediction information and data characteristics of the electroencephalogram sample signals; the classification prediction information comprises first classification prediction information of the first electroencephalogram sample signal and second classification prediction information of the second electroencephalogram sample signal; the data feature comprises a first data feature of the first brain electrical sample signal and a second data feature of the second brain electrical sample signal;

acquiring the time distribution difference of the source data and the target data based on the data characteristics, the acquisition time information of the first electroencephalogram sample signal and the acquisition time information of the second electroencephalogram sample signal;

acquiring the category distribution difference of the source data and the target data based on the data characteristics, the second classification prediction information and the classification information;

and performing iterative training on the initial network model based on the first classification prediction information, the classification information, the time distribution difference and the class distribution difference to obtain the electroencephalogram signal classification network.

Optionally, the obtaining a time distribution difference between the source data and the target data based on the data feature, the acquisition time information of the first brain electrical sample signal, and the acquisition time information of the second brain electrical sample signal includes:

calculating weights of different preset time periods based on the acquisition time information of the first electroencephalogram sample signal and the acquisition time information of the second electroencephalogram sample signal;

and calculating the maximum mean difference between the first data characteristic and the second data characteristic based on the weights of the different preset time periods to obtain the time distribution difference.

Optionally, the calculating weights of different preset time periods based on the acquisition time information of the first electroencephalogram sample signal and the acquisition time information of the second electroencephalogram sample signal includes:

determining the first sample number of the first electroencephalogram sample signals within each preset time period;

for each preset time period, determining the ratio of the number of first samples in the preset time period to the total number of samples of the first electroencephalogram sample signal in the source data as a first weight of the preset time period;

determining the second sample number of the second electroencephalogram sample signals within the preset time periods;

for each preset time period, determining the ratio of the number of second samples in the preset time period to the total number of second electroencephalogram sample signals in the target data as a second weight of the preset time period.

Optionally, the calculating, based on the weights of the different preset time periods, a maximum mean difference between the first data feature and the second data feature to obtain the time distribution difference is represented by:

wherein the content of the first and second substances,is the time distribution difference;distribution of the source data in different preset time periods;Distributing the target data in different preset time periods;representing a regenerative nuclear hilbert space; t is the number of the preset time periods; τ represents the τ th of the preset time period; n issThe number of first electroencephalogram sample signals in the source data is obtained; n istThe number of second electroencephalogram sample signals in the target data is obtained;anda first weight for the τ th preset time period;anda second weight for the τ th preset time period; x is the number ofsiThe first data characteristics corresponding to the ith group of first electroencephalogram sample signals in the source data are obtained; x is the number ofsjThe first data characteristics corresponding to the jth group of first electroencephalogram sample signals in the source data are obtained; x is the number oftiThe second data characteristics corresponding to the ith group of second electroencephalogram sample signals in the target data; x is the number oftjThe second data characteristics corresponding to the jth group of second electroencephalogram sample signals in the target data; k (·, ·) is a kernel function.

Optionally, the obtaining the class distribution difference between the source data and the target data based on the data feature, the second classification prediction information, and the classification information includes:

calculating weights of different preset categories based on the second classification prediction information and the classification information;

and calculating the maximum mean difference between the first data characteristic and the second data characteristic based on the weights of different preset categories to obtain the category distribution difference.

Optionally, the iteratively training the initial network model based on the first classification prediction information, the classification information, the time distribution difference, and the class distribution difference to obtain the electroencephalogram signal classification network includes:

inputting the first classification prediction information and the classification information into a classification loss function to obtain a classification loss item;

calculating the expected value of the time distribution difference to obtain a time difference loss item;

calculating expected values of the category distribution differences to obtain category difference loss items;

calculating a total loss value for a network model based on the classification loss term, the time difference loss term, and the category difference loss term;

and iteratively updating the model parameters of the initial network model based on the total loss value so as to minimize the total loss value and obtain the electroencephalogram signal classification network.

Optionally, the calculating a total loss value of the network model based on the classification loss term, the time difference loss term, and the class difference loss term is represented by:

wherein L is the total loss value; n issIs the number of first brain sample signals in the source data; j (f (x)si),ysi) A classification loss item corresponding to the ith group of first electroencephalogram sample signals in the source data; f (x)si) The first classification prediction information corresponding to the ith group of first electroencephalogram sample signals in the source data is obtained; y issiAcquiring time information of an ith group of first electroencephalogram sample signals in the source data; lambda [ alpha ]<c>The scaling factor of the category difference loss term is a preset constant; lambda [ alpha ]<τ>A scaling factor for the time difference loss term is a preset constantCounting;a loss term for the category difference;a loss term for the time difference;distributing differences for the categories;is the time distribution difference;distributing the source data in different categories;distributing the target data in different categories;the distribution of the source data in different time periods;the distribution of the target data in different time periods.

In a second aspect, a method for classifying brain electrical signals is provided, the method comprising:

acquiring at least one group of target electroencephalogram signals;

inputting the target electroencephalogram signal into a pre-trained electroencephalogram signal classification network to obtain classification prediction information corresponding to the target electroencephalogram signal;

the electroencephalogram classification network is obtained by performing iterative training on an initial network model by using first classification prediction information, classification information, time distribution difference and class distribution difference; the first classification prediction information is obtained by inputting a first electroencephalogram sample signal into the initial network; the classification information is classification information corresponding to the first electroencephalogram sample signal; the time distribution difference is a distribution difference between the acquired source data and the target data based on data characteristics, the acquisition time information of the first electroencephalogram sample signal and the acquisition time information of the second electroencephalogram sample signal; the source data comprises at least one group of first electroencephalogram sample signals and first labels corresponding to the first electroencephalogram sample signals; the first label comprises the acquisition time information and the classification information of the first electroencephalogram sample signal; the target data comprises at least one group of second electroencephalogram sample signals and second labels corresponding to the second electroencephalogram sample signals; the second label comprises the acquisition time information of the second electroencephalogram sample signal; the data characteristics are obtained by inputting the first electroencephalogram sample signal and the second electroencephalogram sample signal into the initial network model; the data feature comprises a first data feature of the first brain electrical sample signal and a second data feature of the second brain electrical sample signal; the category distribution difference is a distribution difference between the source data and the target data obtained based on the data feature, second classification prediction information, and the classification information; and the second classification prediction information is obtained by inputting the second electroencephalogram sample signal into the initial network.

In a third aspect, an electronic device is provided, the device comprising a processor and a memory; the memory stores a program, and the program is loaded and executed by the processor to realize the electroencephalogram signal classification network training method provided by the first aspect; or, the electroencephalogram signal classification method provided by the second aspect is realized.

In a fourth aspect, a computer readable storage medium is provided, in which a program is stored, and the program is used for implementing the electroencephalogram signal classification network training method provided in the first aspect when being executed by a processor; or, the electroencephalogram signal classification method provided by the second aspect is realized.

The beneficial effects of this application include at least: by acquiring training data; the training data comprises source data and target data; the source data comprises at least one group of first electroencephalogram sample signals and first labels corresponding to the first electroencephalogram sample signals; the first label comprises acquisition time information and classification information of the first electroencephalogram sample signal; the target data comprises at least one group of second electroencephalogram sample signals and second labels corresponding to the second electroencephalogram sample signals; the second label comprises the acquisition time information of the second electroencephalogram sample signal; inputting a first electroencephalogram sample signal and a second electroencephalogram sample signal into a pre-established initial network model to obtain classification prediction information and data characteristics of the electroencephalogram sample signals, wherein the classification prediction information comprises first classification prediction information of the first electroencephalogram sample signal and second classification prediction information of the second electroencephalogram sample signal; the data features include a first data feature of the first brain electrical sample signal and a second data feature of the second brain electrical sample signal; acquiring time distribution difference of source data and target data based on the data characteristics, the acquisition time information of the first electroencephalogram sample signal and the acquisition time information of the second electroencephalogram sample signal; acquiring the category distribution difference of the source data and the target data based on the data characteristics, the second classification prediction information and the classification information; performing iterative training on the initial network model based on the first classification prediction information, the classification information, the time distribution difference and the class distribution difference to obtain an electroencephalogram signal classification network; the method can solve the problem that the electroencephalogram signal classification network obtained by training is inaccurate in classifying the electroencephalogram signals with strong time variability because the existing electroencephalogram signal classification network only focuses on the overall distribution difference of different electroencephalogram signals and the distribution difference of the electroencephalogram signals under different categories in the process of training the electroencephalogram classification network and does not consider the influence of time factors on the electroencephalogram signals; because the time distribution difference of the source data and the target data is calculated based on the acquisition time information of the electroencephalogram sample signals in the process of electroencephalogram classification network training, iterative training is carried out on the neural network based on the time distribution difference, and the influence of the acquisition time of the electroencephalogram sample signals on the electroencephalogram sample signals is considered in the training process, the accuracy of the electroencephalogram classification network obtained by training on electroencephalogram classification with strong time-varying property can be improved.

Meanwhile, iterative training is carried out on the initial network model based on the first classification prediction information, the classification information, the time distribution difference and the class distribution difference to obtain the electroencephalogram classification network, so that the time distribution difference and the class distribution difference between the source data and the target data can be reduced, and the problem that the classification accuracy of the classification network obtained by training is lower for other electroencephalograms except the training data in actual use when the network parameters are updated only based on the first classification prediction information and the classification information can be solved; because the time distribution difference and the category distribution difference between the source data and the target data can be reduced, the accuracy of the first classification prediction result and the accuracy of the second classification prediction result of the classification network obtained by training are ensured, the cross-object electroencephalogram signal classification of the electroencephalogram classification network obtained by training can be realized, and the accuracy of the electroencephalogram classification network obtained by training for classifying electroencephalograms of other objects except the training data acquisition object can be improved.

In addition, the proportion of the time difference loss items to the total loss value can be adjusted through the time difference loss item scaling factor, the proportion of the category difference loss items to the total loss value can be adjusted through the category difference loss item scaling factor, and therefore the composition of the network total loss value is adjusted.

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

[ description of the drawings ]

FIG. 1 is a flowchart of a method for training a classification network of electroencephalograms provided by an embodiment of the present application;

FIG. 2 is a flowchart of a method for training a classification network of electroencephalograms provided by an embodiment of the present application;

FIG. 3 is a flowchart of a method for classifying brain electrical signals according to an embodiment of the present application;

FIG. 4 is a block diagram of an electroencephalogram signal classification network training apparatus provided in one embodiment of the present application;

FIG. 5 is a block diagram of an electroencephalogram signal classification apparatus provided by one embodiment of the present application;

FIG. 6 is a block diagram of an electronic device provided in one embodiment of the present application.

[ detailed description ] embodiments

The following detailed description of embodiments of the present application will be made with reference to the accompanying drawings and examples. The following examples are intended to illustrate the present application but are not intended to limit the scope of the present application.

First, a number of terms related to embodiments of the present application will be described.

Electroencephalogram signals: is a reflection of the overall effect of electrical activity in the brain neurons on the surface of the cerebral cortex and scalp. During the research process, electroencephalograms are commonly used to represent electroencephalograms.

Electroencephalogram (Electroencephalogram, EEG): the pattern obtained by recording the spontaneous bioelectric potential of the brain from the scalp by amplifying it with a precise electronic instrument is the spontaneous and rhythmic electrical activity of the brain cell population recorded with electrodes. Electroencephalography has the advantages of being non-invasive and convenient, and thus it has been widely adopted by academia and industry.

Maximum Mean Difference (MMD): distances between distributions are measured based on kernel embedding in a regenerative kernel hilbert space, resulting in differences between different distributions.

Kernel function: taking the vector in the original space as an input vector and returning to a function of the dot product of the vector in the feature space (converted data space, possibly high-dimensional); wherein the feature space may be a regenerative nuclear hilbert space.

Optionally, the electroencephalogram signal classification network training method provided in each embodiment is used in an electronic device for example, the electronic device is a terminal or a server, the terminal may be a mobile phone, a computer, a tablet computer, or the like, and the embodiment does not limit the type of the electronic device.

Fig. 1 is a flowchart of a electroencephalogram signal classification network training method provided in an embodiment of the present application, where the method at least includes the following steps:

step 101, acquiring training data; the training data comprises source data and target data; the source data comprises at least one group of first electroencephalogram sample signals and first labels corresponding to the first electroencephalogram sample signals; the first label comprises acquisition time information and classification information of the first electroencephalogram sample signal; the target data comprises at least one group of second electroencephalogram sample signals and second labels corresponding to the second electroencephalogram sample signals; the second tag includes acquisition time information of the second brain electrical sample signal.

In this application, the classification information refers to the classification information of the first electroencephalogram sample signal.

Optionally, the first brain electrical sample signal and the second brain electrical sample signal are both represented using brain electrical images.

Optionally, the training data may be acquired through a public database, or may also be acquired by an electroencephalogram acquisition device, and the acquisition mode of the source data and the target data is not limited in this embodiment.

In one example, the training data is a BCI composition data set obtained from a public database.

In another example, the training data is acquired via a brain wave cap mounted on the head of at least one subject.

Optionally, the object of acquisition of the first brain electrical sample signal is different from the object of acquisition of the second brain electrical sample signal.

The target data does not need to carry the classification information of the second electroencephalogram sample signal, so the second electroencephalogram sample signal can be an electroencephalogram sample signal which cannot directly obtain the classification information.

In one example, the second brain electrical sample signal is a brain electrical sample signal acquired from a plant human head.

Optionally, obtaining training data comprises: acquiring an original electroencephalogram signal; preprocessing an original electroencephalogram signal to obtain an electroencephalogram sample signal; source data and target data are generated based on the brain electrical sample signals.

Optionally, preprocessing the original electroencephalogram signal to obtain an electroencephalogram sample signal, including: carrying out first-time band-pass filtering on the original electroencephalogram signal to obtain a first electroencephalogram signal; removing the artifact signal in the first computer signal to obtain a second electroencephalogram signal; carrying out second-time band-pass filtering on the second electroencephalogram signal to obtain a third electroencephalogram signal; and intercepting the third electroencephalogram data to obtain an electroencephalogram sample signal.

One part of the electroencephalogram sample signals is used as a first electroencephalogram sample signal, and the other part of the electroencephalogram sample signals is used as a second electroencephalogram sample signal. The first brain electrical sample signal and the second brain electrical sample signal are divided according to a preset proportion, such as: the ratio of 2: 1 is divided, and the number of the first electroencephalogram sample signals and the number of the second electroencephalogram sample signals in the electroencephalogram sample signals are not limited in the embodiment.

Wherein, the artifact signal refers to: the first electroencephalogram signal is a signal which cannot reflect electroencephalogram information, such as a signal generated by blinking or muscle activity of a subject due to active power line interference of acquisition equipment in an electroencephalogram acquisition process.

Optionally, removing an artifact signal in the first electroencephalogram brain signal to obtain a second electroencephalogram signal, including: and carrying out principal component analysis on the first electroencephalogram signal to obtain a second electroencephalogram signal.

In one example, the frequency range of the first brain electrical signal is 5-35 Hz; the frequency range of the second brain electrical signal is 8-30 Hz.

In one example, the duration of the brain electrical sample signal is 3 seconds.

The classification information of the first electroencephalogram sample signal represents the category of the first electroencephalogram sample signal, and the classification information can be obtained by classifying the electroencephalogram sample signal in different modes according to different application requirements.

Optionally, the classification information is obtained by classifying the electroencephalogram sample signals based on Steady-State Visual Evoked potentials (SSVEPs), or may also be obtained by classifying the electroencephalogram sample signals based on Motor imagery (MI-EEG), or may also be obtained by classifying the electroencephalogram sample signals based on Event-related potentials (ERPs), and the present embodiment does not limit the classification manner of the electroencephalogram sample signals.

Such as: the classification information obtained by classifying the electroencephalogram sample signal based on the event-related potential includes, but is not limited to, the following four types: deep sleep type, drowsiness and increased attention type, waking relaxation type, and thinking type.

Optionally, the acquisition time of the electroencephalogram sample signal is divided according to different preset time periods, and the preset time period to which the acquisition time of each electroencephalogram sample signal belongs is used for representing the acquisition time of the electroencephalogram sample signal.

In other implementation manners, the acquisition time of the electroencephalogram sample signal may also be represented by actual acquisition time, and the present embodiment does not limit the manner of representing the acquisition time of the electroencephalogram sample signal.

102, inputting a first electroencephalogram sample signal and a second electroencephalogram sample signal into a pre-established initial network model to obtain classification prediction information and data characteristics of the electroencephalogram sample signals; the classification prediction information comprises first classification prediction information of the first electroencephalogram sample signal and second classification prediction information of the second electroencephalogram sample signal; the data features include a first data feature of the first brain electrical sample signal and a second data feature of the second brain electrical sample signal.

Optionally, all the first electroencephalogram sample signals in the source data and all the second electroencephalogram sample signals in the target data are input into the initial network model at one time, or the first electroencephalogram sample signals in the source data and the second electroencephalogram sample signals in the target data are divided into a plurality of batches (each batch of data includes the first electroencephalogram sample signals and the second electroencephalogram sample signals), and the electroencephalogram sample signals of each batch are sequentially input into the initial network model.

Optionally, the initial network model comprises: a feature extraction network part and a classification prediction network part; the characteristic extraction network part is used for extracting data characteristics of the electroencephalogram sample signals, and the classification prediction network part is used for classifying the electroencephalogram sample signals based on the data characteristics of the electroencephalogram sample signals.

Optionally, the feature extraction network is a convolutional neural network, and the classification prediction network is a fully-connected network.

In one example, inputting a first electroencephalogram sample signal and a second electroencephalogram sample signal into a pre-created initial network model to obtain classification prediction information and electroencephalogram data characteristics of the electroencephalogram sample signals, including: inputting the first electroencephalogram sample signal and the second electroencephalogram sample signal into a feature extraction network to obtain data features corresponding to the electroencephalogram sample signals; and inputting the data characteristics into a classification prediction network part to obtain classification prediction information corresponding to the electroencephalogram sample signals.

Optionally, the manner of obtaining the distribution difference between the source data and the target data based on the data characteristics includes: and calculating the maximum mean difference between the first data characteristic and the second data characteristic to obtain the distribution difference between the source data and the target data.

Optionally, calculating a maximum mean difference between the first data feature and the second data feature to obtain a distribution difference between the source data and the target data, including: and calculating the maximum mean difference between the first data characteristic and the second data characteristic in a regenerative kernel Hilbert space to obtain the distribution difference between the source data and the target data.

Optionally, calculating a maximum mean difference between the first data feature and the second data feature in a regenerative kernel hilbert space to obtain a distribution difference between the source data and the target data, including: mapping the first data feature and the second data feature to a reproduction kernel hilbert space; calculating a distribution expectation of the first data characteristic and a distribution expectation of the second data characteristic under a regeneration kernel Hilbert space; and calculating the maximum mean difference between the first data characteristic and the second data characteristic according to the distribution expectation of the first data characteristic and the distribution expectation of the second data characteristic to obtain the distribution difference between the source data and the target data.

In one example, a maximum mean difference between the first data feature and the second data feature is calculated according to the distribution expectation of the first data feature and the distribution expectation of the second data feature, resulting in a distribution difference between the source data and the target data, which is represented by the following formula:

wherein the content of the first and second substances,is the distribution difference between the source data and the target data; p is a radical ofsIs the distribution of the source data; p is a radical oftIs the distribution of the target data;representing a regenerative nuclear hilbert space; x is the number ofsIs a first data characteristic; x is the number oftIs a second data characteristic; phi (-) is a mapping function that maps the original spatial data to the regenerated kernel hilbert space.

Because the mapping function phi (-) is not fixed and is difficult to select and define, the formula is firstly expanded in the calculation process to obtain the following formula;

wherein the content of the first and second substances,is the distribution difference between the source data and the target data; p is a radical ofsIs the distribution of the source data; p is a radical oftIs the distribution of the target data;representing a regenerative nuclear hilbert space; n issThe number of first electroencephalogram sample signals in the source data; n istIs the number of the second brain electrical sample signal in the target dataAn amount; x is the number ofsiThe first data characteristics corresponding to the ith group of first electroencephalogram sample signals in the source data; x is the number ofsjThe first data characteristics corresponding to the jth group of first electroencephalogram sample signals in the source data; x is the number oftiSecond data characteristics corresponding to the ith group of second electroencephalogram sample signals in the target data; x is the number oftjSecond data characteristics corresponding to the jth group of second electroencephalogram sample signals in the target data; phi (-) is a mapping function that maps the original spatial data to the regenerated kernel hilbert space.

Then, we can find a kernel function k (·,. cndot.) so that for arbitrary xsAnd xtThe method comprises the following steps:

k(xs,xt)=φ(xs)φ(xt)

wherein k (·,. cndot.) is a kernel function, xsIs a first data characteristic; x is the number oftFor the second data feature, φ (-) is a mapping function that maps the original spatial data to the regenerated kernel Hilbert space.

Optionally, the kernel function is a gaussian kernel function, or may also be a laplacian kernel, and the present embodiment does not limit the type of the kernel function.

In one example, a maximum mean difference between the first data feature and the second data feature is estimated using a kernel mean embedding method, resulting in a distribution difference between the source data and the target data, represented by:

wherein the content of the first and second substances,is the distribution difference between the source data and the target data; p is a radical ofsIs the distribution of the source data; p is a radical oftIs the distribution of the target data;representing a regenerative nuclear hilbert space; x is the number ofsIs a first data characteristic; x is the number oftSecond oneData characteristics; phi (-) is a mapping function that maps the original spatial data to the regenerated kernel hilbert space; n issThe number of first electroencephalogram sample signals in the source data; n istThe number of second electroencephalogram sample signals in the target data is obtained; x is the number ofsiThe first data characteristics corresponding to the ith group of first electroencephalogram sample signals in the source data; x is the number ofsjThe first data characteristics corresponding to the jth group of first electroencephalogram sample signals in the source data; x is the number oftiSecond data characteristics corresponding to the ith group of second electroencephalogram sample signals in the target data; x is the number oftjSecond data characteristics corresponding to the jth group of second electroencephalogram sample signals in the target data; k (·, ·) is a kernel function.

And 103, acquiring the time distribution difference between the source data and the target data based on the data characteristics, the acquisition time information of the first electroencephalogram sample signal and the acquisition time information of the second electroencephalogram sample signal.

The time distribution difference refers to a distribution difference between source data and target data calculated according to the distribution of the source data and the target data in different preset time periods.

Optionally, acquiring a time distribution difference between the source data and the target data based on the data characteristics, the acquisition time information of the first electroencephalogram sample signal, and the acquisition time information of the second electroencephalogram sample signal, including: calculating distribution expectation of the first data characteristic in different preset time periods based on the acquisition time information of the first electroencephalogram sample signal; calculating distribution expectation of second data characteristics in different preset time periods based on the acquisition time information of the second electroencephalogram sample signal; and calculating the maximum mean difference between the first data characteristic and the second data characteristic based on the distribution expectation of the first data characteristic in different preset time periods and the distribution expectation of the second data characteristic in different preset time periods to obtain the time distribution difference.

In one example, the maximum mean difference between the first data feature and the second data feature is calculated based on the distribution expectation of the first data feature and the distribution expectation of the second data feature in different preset time periods, resulting in a time distribution difference, which is represented by the following formula:

wherein the content of the first and second substances,in order to be able to time-distribute the differences,representing a regenerative nuclear hilbert space;distributing source data in different preset time periods;distributing target data in different preset time periods;distribution expectation of the first data characteristic in different preset time periods;the distribution expectation of the second data characteristics in different preset time periods.

Optionally, calculating distribution expectations of the first data features at different preset time periods based on acquisition time information of the first brain electrical sample signal; calculating distribution expectation of second data characteristics in different preset time periods based on the acquisition time information of the second electroencephalogram sample signal, and the method comprises the following steps: calculating weights of different preset time periods based on the acquisition time information of the first electroencephalogram sample signal and the acquisition time information of the second electroencephalogram sample signal; and calculating the distribution expectation of the first data characteristic in different preset time periods and the distribution expectation of the second data characteristic in different preset time periods based on the weights of the different preset time periods.

Optionally, acquiring a time distribution difference between the source data and the target data based on the data characteristics, the acquisition time information of the first electroencephalogram sample signal, and the acquisition time information of the second electroencephalogram sample signal, including: calculating weights of different preset time periods based on the acquisition time information of the first electroencephalogram sample signal and the acquisition time information of the second electroencephalogram sample signal; and calculating the maximum mean difference between the first data characteristic and the second data characteristic based on the weights of different preset time periods to obtain the time distribution difference.

Optionally, calculating weights of different preset time periods based on the acquisition time information of the first brain electrical sample signal and the acquisition time information of the second brain electrical sample signal, including: determining the first sample number of the first electroencephalogram sample signals within each preset time period; for each preset time period, determining the ratio of the number of first samples in the preset time period to the total number of samples of the first electroencephalogram sample signal in the source data as a first weight of the preset time period; determining the second sample number of the second electroencephalogram sample signals within each preset time period; for each preset time period, determining the ratio of the number of second samples in the preset time period to the total number of samples of the second electroencephalogram sample signal in the target data as a second weight of the preset time period.

Optionally, the length of the preset time period is determined according to the distribution of the sample data and the actual classification requirement, and the length of the preset time period is not limited in this embodiment.

In one example, the preset period of time is 24 hours in length.

In another example, the preset period of time is 2 hours in length.

Optionally, based on the weights of different preset time periods, calculating a maximum mean difference between the first data feature and the second data feature to obtain a time distribution difference, which is represented by the following formula:

wherein the content of the first and second substances,is the time distribution difference;distributing source data in different preset time periods;distributing target data in different preset time periods;representing a regenerative nuclear hilbert space; t is the number of preset time periods; τ represents the τ th preset time period; n issThe number of first electroencephalogram sample signals in the source data; n istThe number of second electroencephalogram sample signals in the target data is obtained;a first weight for the τ th preset time period;a second weight for the τ th preset time period; x is the number ofsiThe first data characteristics corresponding to the ith group of first electroencephalogram sample signals in the source data; x is the number oftjAnd the second data characteristic corresponding to the jth group of second electroencephalogram sample signals in the target data.

The above formula is expanded, and the kernel function is substituted by using a kernel mean value embedding method, so that the following formula can be obtained.

Optionally, based on the weights of different preset time periods, calculating a maximum mean difference between the first data feature and the second data feature to obtain a time distribution difference, which is represented by the following formula:

wherein the content of the first and second substances,is the time distribution difference;distributing source data in different preset time periods;distributing target data in different preset time periods;representing a regenerative nuclear hilbert space; t is the number of preset time periods; τ represents the τ th preset time period; n issThe number of first electroencephalogram sample signals in the source data; n istThe number of second electroencephalogram sample signals in the target data is obtained;anda first weight for the τ th preset time period;anda second weight for the τ th preset time period; x is the number ofsiThe first data characteristics corresponding to the ith group of first electroencephalogram sample signals in the source data; x is the number ofsjThe first data characteristics corresponding to the jth group of first electroencephalogram sample signals in the source data; x is the number oftiSecond data characteristics corresponding to the ith group of second electroencephalogram sample signals in the target data; x is the number oftjSecond data characteristics corresponding to the jth group of second electroencephalogram sample signals in the target data; k (·, ·) is a kernel function.

And 104, acquiring the category distribution difference of the source data and the target data based on the data characteristics, the second classification prediction information and the classification information.

The category distribution difference refers to a distribution difference between source data and target data calculated according to the distribution of the source data and the target data in different preset categories.

Optionally, obtaining a category distribution difference between the source data and the target data based on the data feature, the second classification prediction information, and the classification information includes: calculating distribution expectation of the first data characteristics in different preset categories based on the classification information; calculating distribution expectation of the second data characteristics in different preset categories based on the second classification prediction information; and calculating the maximum mean difference between the first data characteristic and the second data characteristic based on the distribution expectation of the first data characteristic in different preset categories and the distribution expectation of the second data characteristic in different preset categories to obtain the category distribution difference.

In one example, the maximum mean difference between the first data feature and the second data feature is calculated based on the distribution expectation of the first data feature in different preset categories and the distribution expectation of the second data feature in different preset categories, resulting in a category distribution difference, which is represented by the following formula:

wherein the content of the first and second substances,in order to be able to distribute the differences in the categories,representing a regenerative nuclear hilbert space;distributing source data in different preset categories;distributing target data in different preset categories;distribution expectation of the first data characteristics in different preset categories;the distribution expectations for the second data characteristic in different preset categories.

Optionally, calculating distribution expectations of the first data features in different preset categories based on the classification information; calculating distribution expectation of the second data characteristics in different preset categories based on the second classification prediction information, wherein the distribution expectation comprises the following steps: calculating weights of different preset categories based on the classification information and the second classification prediction information; and calculating the distribution expectation of the first data characteristic in different preset categories and the distribution expectation of the second data characteristic in different preset categories based on the weights of the different preset categories.

Optionally, obtaining a category distribution difference between the source data and the target data based on the data feature, the second classification prediction information, and the classification information includes: calculating weights of different preset categories based on the second classification prediction information and the classification information; and calculating the maximum mean difference between the first data characteristic and the second data characteristic based on the weights of different preset categories to obtain the category distribution difference.

Optionally, calculating weights of different preset categories based on the second classification prediction information and the classification information includes: determining the number of third samples of the first electroencephalogram sample signals of which the classification information is in each preset category; for each preset category, determining the ratio of the number of third samples in the preset category to the total number of samples of the first electroencephalogram sample signal in the source data as a third weight of a preset time period; determining the second classification prediction information as the fourth sample number of the second electroencephalogram sample signals of each preset class; for each preset category, determining the ratio of the number of fourth samples in the preset category to the total number of samples of the second electroencephalogram sample signal in the target data as a fourth weight of a preset time period.

Optionally, the number of the preset categories is determined according to the data distribution condition and the actual classification requirement, and the number of the preset categories is not limited in this embodiment.

Optionally, based on the weights of different preset classes, calculating a maximum mean difference between the first data feature and the second data feature to obtain a class distribution difference, which is represented by the following formula:

wherein the content of the first and second substances,the difference of the category distribution;distributing source data in different preset categories;distributing target data in different preset categories;representing a regenerative nuclear hilbert space; c is the number of preset categories; c represents the c-th preset time period; n issThe number of first electroencephalogram sample signals in the source data; n istThe number of second electroencephalogram sample signals in the target data is obtained;a third weight for the c-th preset category;a fourth weight for the c-th preset category; x is the number ofsiThe first data characteristics corresponding to the ith group of first electroencephalogram sample signals in the source data; x is the number oftjAnd the second data characteristic corresponding to the jth group of second electroencephalogram sample signals in the target data.

The above formula is expanded, and the kernel function is substituted by using a kernel mean value embedding method, so that the following formula can be obtained.

Optionally, based on the data features and the weights of different preset classes, calculating a maximum mean difference between the first data features and the second data features to obtain a class distribution difference, which is represented by the following formula:

wherein the content of the first and second substances,the difference of the category distribution;distributing source data in different preset categories;distributing target data in different preset categories;representing a regenerative nuclear hilbert space; c is the number of preset categories; n issThe number of first electroencephalogram sample signals in the source data; n istThe number of second electroencephalogram sample signals in the target data is obtained;anda third weight for the c-th preset category;anda fourth weight for the c-th preset category; x is the number ofsiThe first data characteristics corresponding to the ith group of first electroencephalogram sample signals in the source data; x is the number ofsjThe first data characteristics corresponding to the jth group of first electroencephalogram sample signals in the source data; x is the number oftiSecond data characteristics corresponding to the ith group of second electroencephalogram sample signals in the target data; x is the number oftjSecond data characteristics corresponding to the jth group of second electroencephalogram sample signals in the target data; k (·,. cndot.) isA kernel function.

It should be added that step 103 may be executed before step 104, or may be executed after step 104, or may also be executed simultaneously with step 104, and the execution order between step 103 and step 104 is not limited in this embodiment.

And 105, performing iterative training on the initial network model based on the first classification prediction information, the classification information, the time distribution difference and the class distribution difference to obtain the electroencephalogram signal classification network.

Optionally, the iteratively training the initial network model based on the first classification prediction information, the classification information, the class distribution difference, and the time distribution difference to obtain the electroencephalogram signal classification network includes: inputting the first classification prediction information and the classification information into a classification loss function to obtain a classification loss item; calculating expected values of category distribution differences to obtain time difference loss items; calculating expected values of time distribution differences to obtain category difference loss items; calculating a total loss value of the network model based on the classification loss term, the time difference loss term and the category difference loss term; and iteratively updating the model parameters of the initial network model based on the total loss value so as to minimize the total loss value and obtain the electroencephalogram signal classification network.

Optionally, a total loss value of the network model is calculated based on the classification loss term, the time difference loss term, and the class difference loss term, and is represented by:

wherein, L is the total loss value; n issThe number of first brain sample signals in the source data; j (f (x)si),ysi) Classifying loss items corresponding to the ith group of first electroencephalogram signal sample signals in the source data; f (x)si) The classification prediction information corresponding to the ith group of first electroencephalogram sample signals in the source data is obtained; y issiAcquiring time information of an ith group of first electroencephalogram sample signals in the source data; lambda [ alpha ]<c>The scaling factor is a preset constant of the category difference loss term; lambda [ alpha ]<τ>A scaling factor which is a time difference loss term and is a preset constant;is a category difference loss term;a time difference loss term;the difference of the category distribution;is the time distribution difference;the distribution of source data in different categories;distributing target data in different categories;distribution of source data in different time periods;is the distribution of the target data in different time periods.

Optionally, adjusting the proportion of the time difference loss term to the total loss value by the time difference loss term scaling factor; the proportion of the category difference loss items to the total loss value is adjusted by the category difference loss item scaling factor.

In one example, the time difference loss term and the category difference loss term are both 0.25.

Optionally, iteratively updating the model parameters of the initial network model based on the total loss value to minimize the total loss value, so as to obtain the electroencephalogram classification network, including: in response to the total loss value being greater than or equal to a preset threshold value, updating the model parameters by using a random gradient descent method according to the total loss value; and removing the gradient, inputting the first electroencephalogram data and the second electroencephalogram data into the pre-established initial network model again to obtain classification prediction information of the electroencephalogram data, and stopping until the total loss value is smaller than a preset threshold value or the number of iterative training reaches a preset number to obtain an electroencephalogram signal classification network.

In summary, the electroencephalogram signal classification network training method provided by the embodiment acquires training data; the training data comprises source data and target data; the source data comprises at least one group of first electroencephalogram sample signals and first labels corresponding to the first electroencephalogram sample signals; the first label comprises acquisition time information and classification information of the first electroencephalogram sample signal; the target data comprises at least one group of second electroencephalogram sample signals and second labels corresponding to the second electroencephalogram sample signals; the second label comprises the acquisition time information of the second electroencephalogram sample signal; inputting a first electroencephalogram sample signal and a second electroencephalogram sample signal into a pre-established initial network model to obtain classification prediction information and electroencephalogram data characteristics of the electroencephalogram sample signals, wherein the classification prediction information comprises first classification prediction information of the first electroencephalogram sample signal and second classification prediction information of the second electroencephalogram sample signal; the data features include a first data feature of the first brain electrical sample signal and a second data feature of the second brain electrical sample signal; acquiring time distribution difference of source data and target data based on the data characteristics, the acquisition time information of the first electroencephalogram sample signal and the acquisition time information of the second electroencephalogram sample signal; acquiring the category distribution difference of the source data and the target data based on the data characteristics, the second classification prediction information and the classification information; performing iterative training on the initial network model based on the first classification prediction information, the classification information, the time distribution difference and the class distribution difference to obtain an electroencephalogram signal classification network; the method can solve the problem that the electroencephalogram signal classification network obtained by training is inaccurate in classifying the electroencephalogram signals with strong time variability because the existing electroencephalogram signal classification network only focuses on the overall distribution difference of different electroencephalogram signals and the distribution difference of the electroencephalogram signals under different categories in the process of training the electroencephalogram classification network and does not consider the influence of time factors on the electroencephalogram signals; because the time distribution difference of the source data and the target data is calculated based on the acquisition time information of the electroencephalogram sample signals in the process of electroencephalogram classification network training, iterative training is carried out on the neural network based on the time distribution difference, and the influence of the acquisition time of the electroencephalogram sample signals on the electroencephalogram sample signals is considered in the training process, the accuracy of the electroencephalogram classification network obtained by training on electroencephalogram classification with strong time-varying property can be improved.

Meanwhile, iterative training is carried out on the initial network model based on the first classification prediction information, the classification information, the time distribution difference and the class distribution difference to obtain the electroencephalogram classification network, so that the time distribution difference and the class distribution difference between the source data and the target data can be reduced, and the problem that the classification accuracy of the classification network obtained by training is lower for other electroencephalograms except the training data in actual use when the network parameters are updated only based on the first classification prediction information and the classification information can be solved; because the time distribution difference and the category distribution difference between the source data and the target data can be reduced, the accuracy of the first classification prediction result and the accuracy of the second classification prediction result of the classification network obtained by training are ensured, the cross-object electroencephalogram signal classification of the electroencephalogram classification network obtained by training can be realized, and the accuracy of the electroencephalogram classification network obtained by training for classifying electroencephalograms of other objects except the training data acquisition object can be improved.

In addition, the proportion of the time difference loss items to the total loss value can be adjusted through the time difference loss item scaling factor, the proportion of the category difference loss items to the total loss value can be adjusted through the category difference loss item scaling factor, and therefore the composition of the network total loss value is adjusted.

In order to more clearly understand the electroencephalogram signal classification network training method provided by the present application, the method is described below by taking an example. Fig. 2 is a flowchart of a electroencephalogram signal classification network training method according to an embodiment of the present application, where the method includes at least the following steps:

firstly, acquiring training data; the training data comprises source data and target data; the source data comprises at least one group of first electroencephalogram sample signals and first labels corresponding to the first electroencephalogram sample signals; the first label comprises acquisition time information and classification information of the first electroencephalogram sample signal; the target data comprises at least one group of second electroencephalogram sample signals and second labels corresponding to the second electroencephalogram sample signals; the second tag includes acquisition time information of the second brain electrical sample signal.

Secondly, extracting a batch of first brain electrical sample signals and second brain electrical sample signals from the training data.

Then, inputting the extracted data into a feature extraction network part to obtain data features; the data features include a first data feature of the first brain electrical sample signal and a second data feature of the second brain electrical sample signal.

Then, inputting the data characteristics into a classification prediction network part to obtain classification prediction information; the classification prediction information includes: first classification prediction information of the first brain electrical sample signal and second classification prediction information of the second brain electrical sample signal. Meanwhile, the maximum mean difference between the first data characteristic and the second data characteristic is calculated based on the acquisition time information of the first electroencephalogram sample signal and the acquisition time information of the second electroencephalogram sample signal, and the time distribution difference is obtained.

And then, calculating the maximum mean difference between the first data characteristic and the second data characteristic based on the classification information and the second classification prediction information to obtain the classification distribution difference. And meanwhile, inputting the first classification prediction information and the classification information into a classification loss function to obtain a classification loss item.

Then, the expected value of the time distribution difference is calculated to obtain a time difference loss term. Meanwhile, calculating expected values of the category distribution difference to obtain category difference loss items.

Again, a total loss value for the network model is calculated based on the classification loss term, the time difference loss term, and the category difference loss term.

Finally, judging whether the total loss value meets a preset condition, and finishing the training if the total loss value meets the preset condition; otherwise, iteratively updating the model parameters of the initial network model based on the total loss value, and continuously executing the step of extracting the first electroencephalogram sample signal and the second electroencephalogram sample signal in batch from the training data until whether the total loss value meets the preset condition.

According to the above embodiments, the electroencephalogram signal classification network training method provided by the application can reduce the time distribution difference and the category distribution difference between the source data and the target data by calculating the total loss value based on the classification loss item, the time difference loss item and the category difference loss item, and updating the parameters of the initial network model according to the total loss value, so that the problem that the classification accuracy of the classification network obtained by training is low for other electroencephalograms except the training data in actual use when the network parameters are updated only according to the classification loss item can be solved; the time distribution difference and the class distribution difference between the source data and the target data can be reduced, so that the accuracy of the first classification prediction result and the accuracy of the second classification prediction result of the classification network obtained by training are ensured, the influence of the electroencephalogram sample signal acquisition time on the electroencephalogram sample signals in the training process can be considered in the accuracy of the classification network obtained by training on the classification of the electroencephalogram signals except the training data, and the accuracy of the classification network of the electroencephalogram signals obtained by training on the classification of the electroencephalogram signals with strong time variability can be improved.

Fig. 3 is a flowchart of a classification method for electroencephalogram signals according to an embodiment of the present application, where the method includes at least the following steps:

step 301, at least one group of target electroencephalogram data signals is obtained.

Step 302, inputting the target EEG signal into a pre-trained EEG signal classification network to obtain classification prediction information corresponding to the target EEG signal.

The electroencephalogram classification network is obtained by performing iterative training on an initial network model by using first classification prediction information, classification information, time distribution difference and class distribution difference; the first classification prediction information is obtained by inputting a first electroencephalogram sample signal into an initial network; the classification information is classification information corresponding to the first electroencephalogram sample signal; the time distribution difference is a distribution difference between the acquired source data and the target data based on the data characteristics, the acquisition time information of the first electroencephalogram sample signal and the acquisition time information of the second electroencephalogram sample signal; the source data comprises at least one group of first electroencephalogram sample signals and first labels corresponding to the first electroencephalogram sample signals; the first label comprises acquisition time information and classification information of the first electroencephalogram sample signal; the target data comprises at least one group of second electroencephalogram sample signals and second labels corresponding to the second electroencephalogram sample signals; the second label comprises the acquisition time information of the second electroencephalogram sample signal; the data characteristics are obtained by inputting a first electroencephalogram sample signal and a second electroencephalogram sample signal into an initial network model; the data features include a first data feature of the first brain electrical sample signal and a second data feature of the second brain electrical sample signal; the category distribution difference is a distribution difference between the source data and the target data obtained based on the data characteristics, the second classification prediction information and the classification information; and the second classification prediction information is obtained by inputting a second electroencephalogram sample signal into the initial network.

The training process of the electroencephalogram signal classification network is detailed in the above embodiment, and the details of this embodiment are not repeated herein.

According to the above embodiments, the electroencephalogram signal classification method provided by the application can solve the problem that the electroencephalogram signal classification network is inaccurate for classification of electroencephalograms with strong time-varying property due to the fact that the influence of time factors on the electroencephalograms is not considered in the training process of the existing electroencephalogram signal classification network because the electroencephalogram classification network is obtained by performing iterative training on the initial network model by using the first classification prediction information, the classification information, the time distribution difference and the category distribution difference.

FIG. 4 is a block diagram of an electroencephalogram signal classification network training apparatus according to an embodiment of the present application. The device at least comprises the following modules: a data acquisition module 401, a classification prediction module 402, a first acquisition module 403, a second acquisition module 404, and an iterative training module 405.

A data acquisition module 401, configured to acquire training data; the training data comprises source data and target data; the source data comprises at least one group of first electroencephalogram sample signals and first labels corresponding to the first electroencephalogram sample signals; the first label comprises acquisition time information and classification information of the first electroencephalogram sample signal; the target data comprises at least one group of second electroencephalogram sample signals and second labels corresponding to the second electroencephalogram sample signals; the second label comprises the acquisition time information of the second electroencephalogram sample signal;

the classification prediction module 402 is configured to input the first electroencephalogram sample signal and the second electroencephalogram sample signal into a pre-created initial network model to obtain classification prediction information and data characteristics of the electroencephalogram sample signal, where the classification prediction information includes first classification prediction information of the first electroencephalogram sample signal and second classification prediction information of the second electroencephalogram sample signal; the data features include a first data feature of the first brain electrical sample signal and a second data feature of the second brain electrical sample signal;

a first obtaining module 403, configured to obtain a time distribution difference between source data and target data based on the data characteristics, the acquisition time information of the first electroencephalogram sample signal, and the acquisition time information of the second electroencephalogram sample signal;

a second obtaining module 404, configured to obtain a category distribution difference between the source data and the target data based on the data features, the second classification prediction information, and the classification information;

and the iterative training module 405 is configured to perform iterative training on the initial network model based on the first classification prediction information, the classification information, the time distribution difference, and the class distribution difference to obtain an electroencephalogram classification network.

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

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

FIG. 5 is a block diagram of an electroencephalogram signal classification apparatus provided in one embodiment of the present application. The device at least comprises the following modules: a data acquisition module 501 and a classification prediction module 502.

A data obtaining module 501, configured to obtain at least one group of target electroencephalogram signals;

a classification prediction module 502, configured to input the target electroencephalogram signal into a pre-trained electroencephalogram signal classification network, so as to obtain classification prediction information corresponding to the target electroencephalogram signal;

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

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

FIG. 6 is a block diagram of an electronic device provided in one embodiment of the present application. The device comprises at least a processor 601 and a memory 602.

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

The memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in the memory 602 is used to store at least one instruction for execution by the processor 601 to implement a brain electrical signal classification network training method or brain electrical signal classification method provided by method embodiments herein.

In some embodiments, the electronic device may further include: a peripheral interface and at least one peripheral. The processor 601, memory 602 and peripheral interface may be connected by a bus or signal lines. Each peripheral may be connected to the peripheral interface via a bus, signal line, or circuit board. Illustratively, peripheral devices include, but are not limited to: radio frequency circuit, touch display screen, audio circuit, power supply, etc.

Of course, the electronic device may include fewer or more components, which is not limited by the embodiment.

Optionally, the present application further provides a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the electroencephalogram signal classification network training method or the electroencephalogram signal classification method of the above-described method embodiments.

Optionally, the present application further provides a computer product, which includes a computer-readable storage medium, where a program is stored in the computer-readable storage medium, and the program is loaded and executed by a processor to implement the electroencephalogram signal classification network training method or the electroencephalogram signal classification method of the above-described method embodiments.

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

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

24页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种用于脑电帽的补液装置

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!