Electroencephalogram signal generative adversarial network model and training method thereof

By introducing an adversarial training mechanism of generator and discriminator into the EEG signal generation adversarial network model, the gap in the simulation of human EEG signals in the prior art is solved, and the high similarity of the generated EEG signals in the time and frequency domains is achieved, and the simulation effect is more realistic.

CN119646761APending Publication Date: 2025-03-18TIANJIN TELLYES SCI INC +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411743558.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-30
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

The prior art has not yet achieved success in simulating human EEG signals and lacks an effective generative adversarial network model.

Method used

An adversarial network model for electroencephalogram generation is proposed, including a generator and a discriminator. The generator is composed of a coding layer, a fully connected layer, a deconvolution subnet, a channel transformation layer and an output layer. The discriminator is composed of a time domain convolution subnet, a frequency domain convolution subnet, a feature fusion layer, a discriminant layer and a regression layer. Through adversarial training, the generator learns to generate realistic EEG signals.

Benefits of technology

The generational adversarial network model of EEG signal through time domain and frequency domain data is trained, taking into account the time and space coherence of EEG data, and the similarity between the generated data in the time domain and frequency domain is improved. The simulated brain waves are more realistic, filling the gap in brain wave simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119646761A_ABST
    Figure CN119646761A_ABST
Patent Text Reader

Abstract

The invention relates to the field of electroencephalogram signals, in particular to an electroencephalogram signal generative adversarial network model and a training method thereof. The electroencephalogram signal generative adversarial network model comprises a generator and a discriminator, the training method of the electroencephalogram signal generative adversarial network model is realized on the basis of the electroencephalogram signal generative adversarial network model, and comprises the following steps: S1, obtaining an electroencephalogram data training set with a BIS tag, and carrying out data preprocessing for training by an input layer; s2, forward calculation is carried out by the generator to obtain one-dimensional vector electroencephalogram data; s3, updating generator parameters; s4, performing forward calculation by a discriminator to obtain a discrimination result and a regression result; s5, parameters of the discriminator are updated; s6, every five times of execution, S5, discriminator parameters are updated, and S3, generator parameters are updated. According to the method, the electroencephalogram signal generative adversarial network model is trained through the time domain and frequency domain data, and the blank of electroencephalogram simulation is filled.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electroencephalogram (EEG) signals, and in particular to an EEG signal generative adversarial network model and a training method thereof. Background Art

[0002] Nowadays, the output of electrophysiological signals is an important basis for reflecting the patient's current condition. Modern medical equipment collects electrical signals such as the human body's electrocardiogram, electrooculogram, and electroencephalogram to detect the functional status of the corresponding human organs.

[0003] Among them, electroencephalogram (EEG) uses scalp electrodes to capture the brain's electrical activity, which can reflect the brain's electrophysiological activity, monitor changes in consciousness, and provide important information about the level of consciousness and response to anesthetic drugs.

[0004] GAN (Generative Adversarial Network), proposed by Ian Goodfellow et al. in 2014, has achieved success in many generative fields, including image generation, style transfer, super-resolution image generation, etc. Generative Adversarial Network consists of two main parts: Generator and Discriminator. These two parts compete with each other through adversarial training, so that the generator learns to generate realistic data. The core idea of ​​GAN is to let the generator and the discriminator compete and improve with each other through adversarial training. During the training process, the generator tries to deceive the discriminator and generate realistic samples, while the discriminator strives to improve the accuracy to distinguish between real and generated samples. This competitive process eventually leads to the generator generating more realistic samples.

[0005] However, there is still a gap in simulating human EEG signals. Summary of the invention

[0006] In order to solve the aforementioned problems, the present invention provides an EEG signal generative adversarial network model and a training method thereof.

[0007] Firstly, a generative adversarial network model for EEG signals is provided, including a generator and a discriminator.

[0008] Among them, the generator includes: encoding layer, fully connected layer, deconvolution sub-network, channel transformation layer and output layer.

[0009] Preferably, the encoding layer is used to convert a single input data BIS value into a semantic vector containing semantic information through a linear transformation.

[0010] Further, preferably, the encoding layer includes 3 sub-networks; wherein, preferably, the first two sub-networks include fully connected layers and activation function LeakyRelu, and the third sub-network includes a fully connected layer and activation function Tanh.

[0011] Preferably, the fully connected layer is used to multiply the semantic vector obtained from the encoding layer with the noise data and then multiply it with the matrix to obtain weighted feature data of the semantic vector.

[0012] Preferably, the deconvolution subnetwork is used to successively process the weighted feature data obtained from the fully connected layer through: multiplication with the deconvolution kernel, and batch normalization to obtain a reconstructed feature vector.

[0013] Further, preferably, the deconvolution subnetwork includes: at least 5 deconvolution blocks; wherein, preferably each deconvolution block includes: a deconvolution layer, a batch normalization layer and a PRelu activation layer.

[0014] Preferably, the channel transformation layer is used to multiply the reconstructed feature vector obtained from the deconvolution subnetwork with the convolution kernel to obtain single-channel EEG signal feature data.

[0015] Furthermore, preferably, the channel transformation layer is composed of a deconvolution layer and a Tanh activation function, which transforms the feature map output by the deconvolution subnetwork into a single-channel EEG signal and outputs it.

[0016] Preferably, the output layer: the EEG signal feature data obtained by the channel transformation layer is multiplied by the deconvolution kernel to obtain the EEG waveform feature data.

[0017] Further, preferably, the output layer of the generator includes: at least one deconvolution layer and at least one Tanh activation layer.

[0018] Among them, the discriminator includes: time domain convolution subnetwork, frequency domain convolution subnetwork, feature fusion layer, discriminant layer and regression layer.

[0019] Preferably, the time domain convolution subnetwork is used to multiply the EEG waveform feature data in the time domain with the convolution kernel to obtain the time domain feature vector of the time domain convolution subnetwork.

[0020] Further, preferably, the time domain convolution subnetwork and the frequency domain convolution subnetwork of the discriminator include at least 5 convolution blocks respectively. Preferably, each convolution block includes a convolution layer and a LeakyRelu activation layer; and each convolution layer includes a batch normalization layer and a nonlinear transformation.

[0021] Preferably, the frequency domain convolution subnetwork is used to multiply the EEG waveform feature data in the frequency domain with the convolution kernel to obtain the frequency domain feature vector of the frequency domain convolution subnetwork.

[0022] Preferably, the feature fusion layer is used to successively process the time domain feature vector and the frequency domain feature vector obtained from the time domain convolution subnetwork and the frequency domain convolution subnetwork: the time domain feature vector is multiplied by a matrix, and then multiplied by the frequency domain feature vector to obtain bilinear feature data.

[0023] Further, preferably, the feature fusion layer is a bilinear transformation network, which fuses the features from the time domain and frequency domain convolution subnetworks, and its function expression is: ; Among them, f(A) represents the feature fusion function, A is the trainable parameter matrix, b is the bias, and Represent the characteristic vectors of the EEG waveform in the time domain and frequency domain respectively.

[0024] Preferably, the discriminant layer and the regression layer: the bilinear feature data obtained from the feature fusion layer are input into the discriminant layer and the regression layer respectively, and then multiplied with the weight matrix to map the data to the classification result.

[0025] Further, preferably, the output result of the discrimination layer is true or false; and the output result of the regression layer is a simulated BIS value.

[0026] Further, preferably, the discriminant layer and the regression layer respectively include: a fully connected layer.

[0027] The present application also provides a method for training an EEG signal generative adversarial network model, comprising the following steps: The present application also provides a training method for an EEG signal generative adversarial network model, which is based on the implementation of the aforementioned EEG signal generative adversarial network model: by inputting the pre-processed data of the input layer into the discriminator and the randomly generated data into the generator, the mutual game learning between the generator and the discriminator produces a good output, and the training steps include: S1. Obtain the EEG data training set with BIS labels, and perform data preprocessing for training at the input layer, including: S1.1. Capture a continuous 60-second EEG waveform with BIS value, and the waveform data obtained is represented by one-dimensional data of at least 7680 points in the 60-second duration; The average BIS value within the same time period and the corresponding EEG waveform data are stored in the same text file, and each text file contains at least 1000 EEG waveform data as time domain data; The average BIS value is based on 1S as the basic unit, one BIS value corresponds to each second, and the average value of the corresponding BIS values ​​in the multiple of 1S is continuously intercepted; S1.2. Further, preferably, each column of data in the text file corresponds to a label, and the label meaning of each column of data is: BIS, patient number, start, end and EEG waveform characteristic value; S1.3. Normalize the final data of S1.1. to the range of (-1,1); S1.4. The data in S1.3. were converted into frequency domain data by fast Fourier transform, and one-dimensional data of 7680 points of 60-second EEG waveform were obtained.

[0028] S2. The generator performs forward calculation to obtain one-dimensional vector EEG data, including: S2.1. Initialize the generator and discriminator parameters with random numbers: Wherein, the model parameters include: weight, deconvolution kernel, convolution kernel and bias; Wherein, the random number conforms to normal distribution; S2.2. Generator forward calculation, including: S2.2.1. Randomly generate a batch of 128-dimensional vectors that conform to the normal distribution, including: defining the randomly generated 128-dimensional feature vector as noise, i.e., a noise vector; S2.2.2. Randomly generate a batch of random numbers in the range of (0,98), including: defining the random numbers as fake_BIS; S2.2.3. The fake_BIS obtained in S2.2.2. is used as input data and input into the encoding layer. After three linear transformations and activation functions, a 128-dimensional semantic vector is obtained. S2.2.4. The 128-dimensional semantic vector obtained in S2.2.3. is cross-multiplied with the 128-dimensional noise vector in S2.2.1. as the input data of the fully connected layer, and after multiplying with the matrix of the fully connected layer, weighted feature data containing weight information is obtained; S2.2.5. The weighted feature data obtained in S2.2.4. is input into the deconvolution subnetwork as input data, and is successively multiplied with the deconvolution kernel and batch normalized to obtain the reconstructed feature vector; S2.2.6. Input the reconstructed feature vector obtained in S2.2.5. as input data to the channel transformation layer, and obtain the single-channel EEG signal feature data after multiplying it with the convolution kernel; S2.2.7. S2.2.6. The obtained EEG signal characteristic data is multiplied by the deconvolution kernel to obtain the EEG waveform characteristic data; This data is subjected to fast Fourier transform to obtain the corresponding frequency domain data, and then the generated frequency domain data and the corresponding time domain data are subjected to S4. discriminator forward calculation operation to obtain the discrimination result (g_fake_val) and regression result (g_fake_reg); Finally, the obtained result is input into the loss function (G_loss) to obtain the loss value, calculate the generator training parameter gradient and update the parameters.

[0029] S3. Update the generator parameters, including: S3.1. Perform the forward calculation step of the generator S2.2 to obtain the EEG waveform time domain data; S3.2. Perform data preprocessing of S1. on the EEG data obtained in S3.1; S3.3. Input the time domain data and frequency domain data obtained in S3.2. into the discriminator, and perform S4. (use the time domain and frequency domain data obtained in S3.2 as the input data of step S4.1) discriminator forward calculation operation to obtain the discrimination result, defined as g_fake_val; and the regression result, defined as g_fake_reg; S3.4. Input the discrimination results and regression results obtained in S3.3. into the generator loss function. The loss function is as follows: ; ; in: represents the mean; MAE() is the generator error function; n represents the number of input samples; is the true value of the i-th sample; is the simulated value of the model; Then, through the back-propagation algorithm, the gradient of the weight is obtained and updated. The calculation formula is as follows: ; ; in: Represents the trainable parameters in the discriminator, including weights and biases ( ); represents the gradient of the trainable parameters in the discriminator; Represents the learning rate (i.e., the step size of each parameter update); Represents the updated training parameters.

[0030] S4. The discriminator performs forward calculations to obtain the discrimination results and regression results, including: S4.1. The time domain data obtained in S1.3 and the frequency domain data obtained in S1.4 are respectively input into the time domain convolution subnetwork and frequency domain convolution subnetwork in the discriminator at the same time: the convolution kernel is multiplied with the time domain and frequency domain data; then, batch normalization and nonlinear transformation are performed; finally, feature extraction is performed to obtain a time domain feature vector and a frequency domain feature vector, and the two feature vectors have the same dimensions.

[0031] S4.2. The time domain feature vector and the frequency domain feature vector obtained in S4.1. are used as input data of the feature fusion layer, and the time domain feature vector is multiplied by the matrix and then multiplied by the frequency domain feature vector to obtain bilinear feature data; S4.3. The bilinear feature data obtained in S4.2 are input into the discriminant layer and the regression layer respectively: after multiplication with the convolution kernel, the discriminant result is obtained, which is defined as: real_val; and the regression result is defined as: real_reg.

[0032] S5. Update the discriminator parameters, including: S5.1. Input the time domain data obtained in S1.3 and the frequency domain data obtained in S1.4. into the discriminator to perform the forward calculation process of S4. discriminator and obtain the discrimination result; The value of the BIS label corresponding to the input EEG waveform is defined as real_BIS; S5.2. Perform the forward calculation step of the generator in S2.2 to obtain one-dimensional vector EEG data; S5.3. Preprocess the EEG data S1 obtained in S5.2 to obtain time domain data and frequency domain data; S5.4. Input the time domain data and frequency domain data obtained in S5.3 into the discriminator and perform S4. (the time domain and frequency domain data of S5.3 are used as the input of step S4.1). The discriminator performs forward calculation operation to obtain the discrimination result, defined as: fake_val; and the regression result, defined as: fake_reg; S5.5. Input the discrimination results and regression results obtained in S5.1 and S5.4 into the discriminator loss function respectively. The loss function is as follows: ; in: ; ; in: represents the mean; represents gradient penalty; MAE() is the discriminator error function; Indicates that the input is The discriminator output of All the real data and generated data in a certain training batch, as well as the random mixture of all the real data and generated data; n represents the number of input data in a batch; is the true value of the i-th sample; is the simulated value of the model; Then, through the back-propagation algorithm, the gradient of the weight is obtained and updated. The calculation formula is as follows: ; ; in: Represents the trainable parameters in the discriminator, including weights and biases; represents the gradient of the trainable parameters in the discriminator; Represents the learning rate (i.e., the step size of each parameter update); Represents the updated training parameters.

[0033] S6. Further, preferably, the ratio of the number of times S6. executes S5. to update the discriminator parameters and the number of times S3. executes S3. to update the generator parameters is 3:1-10:1.

[0034] Among them, S2. Generator forward calculation and S4. Discriminator forward calculation are not in order and are performed simultaneously in the computer.

[0035] S7. Generate a batch of EEG data using the trained EEG signal generative adversarial network model, and compare it with the real EEG data in the frequency domain to evaluate the model effect.

[0036] The beneficial effects are: training the EEG signal generative adversarial network model through time domain and frequency domain data takes into account the temporal and spatial coherence of EEG data, and improves the similarity between the data generated by the EEG signal generative adversarial network model and the original data in the time domain and frequency domain. When simulating brain waves, it is more realistic, filling the gap in brain wave simulation. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 .Schematic diagram of the structure of the EEG signal generation adversarial network model generator; Figure 2 .Schematic diagram of the discriminator structure of the EEG signal generation adversarial network model; Figure 3 .Frequency domain comparison of EEG data generated by the trained model and real EEG data. DETAILED DESCRIPTION

[0038] Those skilled in the art will understand that, unless otherwise stated, the terms used in this application have the following meanings: Time domain: describes the relationship between mathematical functions or physical signals and time.

[0039] Frequency domain: describes the frequency structure of the signal and the relationship between the frequency and the amplitude of the signal at that frequency.

[0040] Fourier transform: Utilizes the directly measured original signal to calculate the frequency, amplitude and phase of different sinusoidal signals in the signal in an accumulative manner, thus converting the originally difficult-to-process time domain signal into an easily analyzed frequency domain signal (signal spectrum).

[0041] Semantic information vector: The role of the encoding layer is to generate a feature vector with semantic information. The BIS value is used as the central word, and the word vector of the context is used to infer the central word. In this way, the semantic information expressed by the central word is passed into the representation of the context, thereby achieving the purpose of learning semantic information.

[0042] Weighted feature data: The encoding layer adds semantic information to the input data, and the fully connected layer assigns a weight to each value of the semantic vector.

[0043] Reconstructing feature vector: The role of the encoding layer is to generate a feature vector containing semantic information. The role of the deconvolution subnetwork is to decode the encoded semantic information vector into the sample space required by the output layer, so as to achieve the purpose of reconstructing the data and obtain the reconstructed feature vector.

[0044] like Figure 1 , Figure 2 , this embodiment provides an EEG signal generative adversarial network model, including: a generator and a discriminator.

[0045] Among them, the generator includes: encoding layer, fully connected layer, deconvolution subnetwork, channel transformation layer and output layer.

[0046] The encoding layer of the generator includes a subnetwork, preferably, in this embodiment, includes 3 subnetworks, wherein the first two subnetworks include a fully connected layer and an activation function LeakyRelu, and the third subnetwork includes a fully connected layer and an activation function Tanh. It is used to convert a single input data BIS value into a 128-dimensional semantic vector containing semantic information through a linear transformation.

[0047] Preferably, the fully connected layer is used to multiply the 128-dimensional semantic vector containing semantic information obtained from the encoding layer with the noise data, and then multiply it with the matrix to obtain weighted feature data of the semantic vector.

[0048] In this embodiment, preferably, the deconvolution subnetwork of the generator is used to successively process the weighted feature data obtained from the fully connected layer through: multiplication with the deconvolution kernel, batch normalization to obtain a reconstructed feature vector. The deconvolution subnetwork of the generator includes: at least 5 deconvolution blocks. Preferably, each deconvolution block includes at least one deconvolution layer, one batch normalization layer and one PRelu activation layer; wherein the PRelu activation function formula is as follows: ; is a trainable parameter; are the output values ​​of different channels during network training.

[0049] Furthermore, preferably, the deconvolution subnetwork of the generator has a feature map of 64 channels after the first deconvolution block, has a feature map of 32 channels after the second deconvolution block, and has a feature map of 16 channels after the third, fourth, and fifth deconvolution blocks, respectively.

[0050] Preferably, the output layer of the generator includes: at least one deconvolution layer and at least one Tanh activation layer.

[0051] Preferably, Figure 1 , the input of the generator is a 128-dimensional noise vector and control information (i.e., BIS value).

[0052] Preferably, the channel transformation layer is composed of a deconvolution layer and a Tanh activation function, which transforms the feature map output by the deconvolution subnetwork into a single-channel EEG signal and outputs it.

[0053] Preferably, the channel transformation layer is composed of at least one deconvolution layer and at least one Tanh activation function, which transforms the feature map of 16 channels output by the deconvolution subnetwork into a single-channel EEG signal and outputs it.

[0054] Among them, the discriminator includes: time domain convolution subnetwork, frequency domain convolution subnetwork, feature fusion layer, discriminant layer and regression layer.

[0055] Preferably, the time domain convolution subnetwork and the frequency domain convolution subnetwork of the discriminator include at least 5 convolution blocks respectively. Preferably, each convolution block includes a convolution layer and a LeakyRelu activation layer; and each convolution layer includes at least one batch normalization layer and one nonlinear transformation.

[0056] Among them, the LeakyRelu activation function formula is: ; is a non-trainable parameter; are the output values ​​of different channels during network training.

[0057] Further, preferably, the data is input into the time domain convolution subnetwork and the frequency domain convolution subnetwork, and after the first, second, and third convolution layers, there are feature maps with 16 channels respectively, after the fourth convolution layer, there are feature maps with 32 channels, and after the fifth convolution layer, there are feature maps with 32 channels; Further, preferably, the input of the time domain convolution subnetwork and the frequency domain convolution subnetwork is a one-dimensional feature point of the image; Preferably, the feature fusion layer uses a bilinear transformation network to fuse the features from the time domain and frequency domain convolution subnetworks, and its function expression is: ; Where: A is the trainable parameter matrix; b is the bias; and Represent the feature maps from the time domain and frequency domain convolutional sub-networks, respectively.

[0058] Preferably, the discriminant layer and the regression layer respectively include: a fully connected layer, In some other embodiments, preferably, the discriminant layer and the regression layer each include: a fully connected layer.

[0059] In some other embodiments, preferably, the discriminant layer and the regression layer respectively include: at least two fully connected layers, and a LeakyRelu activation layer is included between the two fully connected layers.

[0060] This embodiment also provides a training method for an EEG signal generative adversarial network model. Preferably, during training, the generator inputs a randomly generated noise vector and a BIS value, wherein the BIS value is input into the coding layer; wherein the randomly generated noise vector is input into the fully connected layer after being cross-multiplied with the data output by the coding layer.

[0061] The steps include: S1. Obtain the EEG data training set with BIS labels, and perform data preprocessing for training at the input layer, including: S1.1. Capture a continuous 60-second EEG waveform with BIS value, and the waveform data obtained is represented by one-dimensional data of at least 7680 points in the 60-second duration; The average BIS value within the same time period and the corresponding EEG waveform data are stored in the same text file, and each text file contains at least 1000 EEG waveform data as time domain data; The average BIS value is based on 1S as the basic unit, one BIS value corresponds to each second, and the average value of the corresponding BIS values ​​in the multiple of 1S is continuously intercepted; Extract the EEG data of clinical patients after anesthesia, and identify at least 7680 feature points in 60 seconds; in this embodiment, intercept the continuous 60S EEG waveform with BIS value, obtain 1×7680 feature points, and express these feature points with one-dimensional data; and store these data with BIS tags in a text file.

[0062] S1.2. Further, preferably, each line of data in the text file corresponds to a label. In this embodiment, the label of each line of data means: BIS, patient number, start, end and EEG waveform characteristic value; the specific data structure is as shown in Table 1:

[0063] It should be noted that in Table 1: BIS represents the electroencephalogram index; Start and End represent the start and end positions of the recording respectively; “…” represents the subsequent data until at least the 1000th corresponding data.

[0064] S1.3. Take the final data of S1.1. as time domain data and normalize it to the range of (-1,1); S1.4. Convert the data in S1.3. into frequency domain data by fast Fourier transform, and obtain one-dimensional data of 7680 points for 60 seconds; S2. The generator performs forward calculations to train the generator model. The training method includes: S2.1. Initializing the generator and discriminator parameters with random numbers: Wherein, the model parameters include: weight, deconvolution kernel, convolution kernel and bias; Wherein, the random number conforms to normal distribution; S2.2. The generator performs forward calculation and outputs one-dimensional vector EEG data. The steps include: S2.2.1. Randomly generate a batch of 128-dimensional vectors that conform to the normal distribution, including: defining the randomly generated 128-dimensional feature vector as noise, that is, a noise vector.

[0065] S2.2.2. Randomly generate a batch of numbers in the range of (0,98), including: defining the random numbers as fake_BIS.

[0066] S2.2.3. The fake_BIS obtained in S2.2.2. is used as input data and input into the encoding layer. After three linear transformations and activation functions, a 128-dimensional semantic vector is obtained.

[0067] S2.2.4. The 128-dimensional semantic vector obtained in S2.2.3. is cross-multiplied with the 128-dimensional noise vector in S2.2.1. as the input data of the fully connected layer. After multiplying it with the matrix of the fully connected layer, weighted feature data containing weight information is obtained.

[0068] S2.2.5. The semantic information vector obtained in S2.2.4. is input as input data into the deconvolution subnetwork, and then goes through the following steps: multiplication with the deconvolution kernel and batch normalization to obtain the reconstructed feature vector.

[0069] S2.2.6. The reconstructed feature vector obtained in S2.2.5. is input as input data to the channel transformation layer, and after multiplication with the convolution kernel, the single-channel EEG signal feature data is obtained.

[0070] S2.2.7. Multiply the EEG signal characteristic data obtained in S2.2.6. by the deconvolution kernel to obtain the EEG waveform characteristic data.

[0071] This data is subjected to fast Fourier transform to obtain the corresponding frequency domain data, and then the generated frequency domain data and the corresponding time domain data are subjected to step S4. to obtain the discrimination result (g_fake_val) and the regression result (g_fake_reg); Finally, the obtained result is input into the loss function (D_loss) to obtain the loss value, calculate the generator training parameter gradient and update the parameters.

[0072] as follows: S3. The generator parameter update step includes: S3.1. Perform the forward calculation step of the generator in S2.2 to obtain the EEG waveform time domain data.

[0073] S3.2. Perform data preprocessing on the EEG data obtained in S3.1 in S1.

[0074] S3.3. Input the time domain data and frequency domain data obtained in S3.2. into the discriminator, and perform S4. (use the time domain and frequency domain data obtained in S3.2 as the input data of step S4.1) discriminator forward calculation operation to obtain the discrimination result, defined as g_fake_val; and the regression result, defined as g_fake_reg.

[0075] S3.4. Input the discrimination results and regression results obtained in S3.3. into the generator loss function. The loss function is as follows: ; ; in: represents the mean; MAE() is the generator error function; n represents the number of input samples; is the true value of the i-th sample, which is: fake_BIS in this patent; It is the simulated value of the model, in this patent it is: g_fake_val.

[0076] Then, through the back-propagation algorithm, the gradient of the weight is obtained and updated. The calculation formula is as follows: ; ; in: Represents the trainable parameters in the discriminator, including weights and biases ( ); represents the gradient of the trainable parameters in the discriminator; represents the learning rate (i.e. the step size of each parameter update); Represents the updated training parameters.

[0077] S4. The discriminator performs forward calculation to obtain the discrimination result and regression result. The steps include: S4.1. The time domain data obtained in S1.3 and the frequency domain data obtained in S1.4 are simultaneously input into the time domain convolution subnetwork and the frequency domain convolution subnetwork in the discriminator: the convolution kernel is multiplied with the time domain and frequency domain data; then, batch normalization and nonlinear transformation are performed; finally, feature extraction is performed to obtain a time domain feature vector and a frequency domain feature vector, and the two feature vectors have the same dimensions; S4.2. Use the time domain feature vector and frequency domain feature vector obtained in S4.1. as input data of the feature fusion layer: after bilinear feature fusion, obtain the feature fusion vector.

[0078] S4.3. Input the feature fusion vector obtained in S4.2 into the discrimination layer and regression layer respectively: after multiplication with the convolution kernel, the discrimination result, defined as: real_val; and the regression result, defined as: real_reg; S5. The discriminator parameter updating step includes: S5.1. Input the time domain data obtained in S1.3 and the frequency domain data obtained in S1.4. into the discriminator to perform the forward calculation process of the discriminator and obtain the discrimination result.

[0079] The value of the BIS label corresponding to the input EEG waveform is defined as real_BIS.

[0080] S5.2. Perform the forward calculation step of the generator in S2.2 to obtain one-dimensional vector EEG data; S5.3. Preprocess the EEG data S1 obtained in S5.2 to obtain time domain data and frequency domain data; S5.4. Input the time domain data and frequency domain data obtained in S5.3 into the discriminator and perform S4. (The time domain and frequency domain data of S5.3 are used as the input of step S4.1). Perform the forward calculation process and obtain the discrimination result, defined as: fake_val; and the regression result, defined as: fake_reg; S5.5. Input the discrimination results and regression results obtained in S5.1 and S5.4 into the discriminator loss function respectively. The loss function is as follows: ; in: ; ; in: represents the mean; represents gradient penalty; MAE() is the discriminator error function; Indicates that the input is The discriminator output of All real data and generated data from a training mini-batch, as well as their random mixture, can be calculated by the discriminator; n represents the number of input data in a batch; is the true value of the i-th sample; is the simulated value of the model.

[0081] Then, through the back-propagation algorithm, the gradient of the weight is obtained and updated. The calculation formula is as follows: ; ; in: Represents the trainable parameters in the discriminator, including weights and biases; represents the gradient of the trainable parameters in the discriminator; Represents the learning rate (i.e., the step size of each parameter update); Represents the updated training parameters.

[0082] S6.S6. The ratio of the number of executing S5. updating the discriminator parameters and executing S3. updating the generator parameters is 3:1-10:1; Further, preferably, in this embodiment, S5. Discriminator parameter update is performed 5 times and S3. Generator parameter update is performed once.

[0083] Among them, S2. Generator forward calculation and S4. Discriminator forward calculation are not in order and are performed simultaneously in the computer.

[0084] S7. Generate a batch of EEG data using the trained EEG signal generation adversarial network model, and compare it with the real EEG data in the frequency domain to evaluate the model effect. And use the frequency domain Frequency (HZ) as the horizontal axis and the energy Power (dB) as the vertical axis to output the comparison chart of the EEG data generated by the trained EEG signal generation adversarial network model in the frequency domain. Figure 3 Model effect diagram. Among them, the right curve (right: fake) is the frequency domain curve of the EEG data generated by the trained EEG signal generation adversarial network model, the left curve (left: real) is the frequency domain curve of the real data, and the number in the upper right corner indicates the BIS value of the current sub-graph.

[0085] The specific implementation methods described above provide a detailed description of the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific implementation method of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, etc. made on the basis of the technical solutions of the present application should be included in the scope of protection of the present application.

Claims

1. A generative adversarial network model for EEG signals, characterized in that: include: Generator and Discriminator; Among them, the generator includes: Encoding layer: used to convert a single input data BIS value into a semantic vector containing semantic information through linear transformation; Fully connected layer: used to multiply the semantic vector obtained from the encoding layer with the noise data, and then multiply it with the matrix to obtain the weighted feature data of the semantic vector; Deconvolution subnetwork: used to pass the weighted feature data obtained from the fully connected layer through: multiplication with the deconvolution kernel, batch normalization to obtain the reconstructed feature vector; Channel transformation layer: used to multiply the reconstructed feature vector obtained from the deconvolution subnetwork with the convolution kernel to obtain the single-channel EEG signal feature data; Output layer: used to obtain brain wave waveform feature data by multiplying the brain wave signal feature data obtained from the channel transformation layer with the deconvolution kernel; Among them, the discriminator includes: Time domain convolution sub-network: used to multiply the EEG waveform feature data in the time domain with the convolution kernel to obtain the time domain feature vector of the time domain convolution sub-network; Frequency domain convolution sub-network: used to multiply the EEG waveform feature data in the frequency domain with the convolution kernel to obtain the frequency domain feature vector of the frequency domain convolution sub-network; Feature fusion layer: used to obtain the time domain feature vector and frequency domain feature vector from the time domain convolution sub-network and the frequency domain convolution sub-network by: multiplying the time domain feature vector by the matrix, and then multiplying it by the frequency domain feature vector to obtain bilinear feature data; Discriminant layer and regression layer: The bilinear feature data obtained from the feature fusion layer is input into the discriminant layer and regression layer respectively, and then multiplied with the weight matrix to map the data to the classification result.

2. The EEG signal generative adversarial network model according to claim 1, characterized in that: The encoding layer includes three sub-networks; wherein the first two sub-networks include fully connected layers and activation function LeakyRelu, and the third sub-network includes a fully connected layer and activation function Tanh.

3. The EEG signal generative adversarial network model according to claim 1, characterized in that: The deconvolution subnetwork includes: at least 5 deconvolution blocks; wherein, preferably each deconvolution block includes: a deconvolution layer, a batch normalization layer and a PRelu activation layer.

4. The EEG signal generative adversarial network model according to claim 1, characterized in that: The channel transformation layer consists of a deconvolution layer and a Tanh activation function, which transforms the feature map output by the deconvolution subnetwork into a single-channel EEG signal and outputs it.

5. The EEG signal generative adversarial network model according to claim 1, characterized in that: The output layer of the generator includes: at least one deconvolution layer and at least one Tanh activation layer.

6. The EEG signal generative adversarial network model according to claim 1, characterized in that: The time domain convolution subnetwork and frequency domain convolution subnetwork of the discriminator respectively include at least 5 convolution blocks; wherein, preferably each convolution block includes a convolution layer and a LeakyRelu activation layer; wherein, each convolution layer includes a batch normalization layer and a nonlinear transformation.

7. The EEG signal generative adversarial network model according to claim 1, characterized in that: The feature fusion layer is a bilinear transformation network that fuses the features from the time domain and frequency domain convolution subnetworks. Its function expression is: ; Where f(A) represents the feature fusion function; A is the trainable parameter matrix; b is the bias; and Represent the characteristic vectors of the EEG waveform in the time domain and frequency domain respectively.

8. The EEG signal generative adversarial network model according to claim 1, characterized in that: The output of the discriminant layer is true or false; the output of the regression layer is the simulated BIS value.

9. The EEG signal generative adversarial network model according to claim 1, characterized in that: The discriminant layer and the regression layer include: a fully connected layer.

10. A training method for an EEG signal generative adversarial network model, characterized by: A generative adversarial network model for EEG signals according to any one of claims 1 to 9 is implemented, comprising: S1. Obtain the EEG data training set with BIS labels, and perform data preprocessing for training by the input layer, including: S1.

1. Intercept the EEG waveform with BIS value for 60 seconds, and the waveform data obtained is represented by one-dimensional data of at least 7680 points in 60 seconds; The average BIS value within the same time period and the corresponding EEG waveform data are stored in the same text file, and each text file contains at least 1000 EEG waveform data as time domain data; The average BIS value is based on 1S as the basic unit, one BIS value corresponds to each second, and the average value of the corresponding BIS values ​​in the multiple of 1S is continuously intercepted; S1.

2. Further, preferably, each column of data in the text file corresponds to a label, and the label meaning of each column of data is: BIS, patient number, start, end and EEG waveform characteristic value; S1.

3. Normalize the final data of S1.

1. to the range of (-1,1); S1.

4. The data in S1.

3. are converted into frequency domain data by fast Fourier transform to obtain one-dimensional data of 7680 points of 60-second EEG waveform; S2. The generator performs forward calculation to obtain one-dimensional vector EEG data; S3. Update generator parameters; S4. The discriminator performs forward calculation to obtain the discrimination result and regression result; S5. Update the discriminator parameters; S6. The ratio of the number of executing S5. updating the discriminator parameters and executing S3. updating the generator parameters is 3:1-10:

1.

11. The method for training an EEG signal generative adversarial network model according to claim 10, characterized in that: S2. The generator performs forward calculation to obtain one-dimensional vector EEG data, including: S2.

1. Initialize the generator and discriminator parameters with random numbers: Wherein, the model parameters include: weight, deconvolution kernel, convolution kernel and bias; Wherein, the random number conforms to normal distribution; S2.

2. Generator forward calculation, including: S2.2.

1. Randomly generate a batch of 128-dimensional vectors that conform to the normal distribution, including: defining the randomly generated 128-dimensional feature vector as noise, i.e., a noise vector; S2.2.

2. Randomly generate a batch of random numbers in the range of (0,98), including: defining the random numbers as fake_BIS; S2.2.

3. The fake_BIS obtained in S2.2.

2. is used as input data and input into the encoding layer. After three linear transformations and activation functions, a 128-dimensional semantic vector is obtained. S2.2.

4. The 128-dimensional semantic vector obtained in S2.2.

3. is cross-multiplied with the 128-dimensional noise vector in S2.2.

1. as the input data of the fully connected layer, and after multiplying with the matrix of the fully connected layer, weighted feature data containing weight information is obtained; S2.2.

5. The weighted feature data obtained in S2.2.

4. is input into the deconvolution subnetwork as input data, and is successively multiplied with the deconvolution kernel and batch normalized to obtain the reconstructed feature vector; S2.2.

6. Input the reconstructed feature vector obtained in S2.2.

5. as input data to the channel transformation layer, and obtain the single-channel EEG signal feature data after multiplying it with the convolution kernel; S2.2.

7. S2.2.

6. The obtained EEG signal characteristic data is multiplied by the deconvolution kernel to obtain the EEG waveform characteristic data; This data is subjected to fast Fourier transform to obtain the corresponding frequency domain data, and then the generated frequency domain data and the corresponding time domain data are subjected to S4. discriminator forward calculation operation to obtain the discrimination result (g_fake_val) and regression result (g_fake_reg); Finally, the obtained result is input into the loss function (G_loss) to obtain the loss value, calculate the generator training parameter gradient and update the parameters.

12. The method for training an EEG signal generative adversarial network model according to claim 10, characterized in that: S3. Update the generator parameters, including: S3.

1. Perform the forward calculation step of the generator S2.2 to obtain the EEG waveform time domain data; S3.

2. Perform data preprocessing of S1. on the EEG data obtained in S3.1; S3.

3. Input the time domain data and frequency domain data obtained in S3.

2. into the discriminator, and perform the forward calculation operation of the discriminator in S4. to obtain the discrimination result, defined as g_fake_val; and the regression result, defined as g_fake_reg; S3.

4. Input the discrimination results and regression results obtained in S3.

3. into the generator loss function. The loss function is as follows: ; ; in: represents the mean; MAE() is the generator error function; n represents the number of input samples; is the true value of the i-th sample; is the simulated value of the model; Then, through the back-propagation algorithm, the gradient of the weight is obtained and updated. The calculation formula is as follows: ; ; in: Represents the trainable parameters in the discriminator, including weights and biases ( ); represents the gradient of the trainable parameters in the discriminator; Represents the learning rate (i.e., the step size of each parameter update); Represents the updated training parameters.

13. The method for training an EEG signal generative adversarial network model according to claim 10, characterized in that: S4. The discriminator performs forward calculation to obtain the discrimination result and regression result. The steps include: S4.

1. The time domain data obtained in S1.3 and the frequency domain data obtained in S1.4 are respectively input into the time domain convolution subnetwork and the frequency domain convolution subnetwork in the discriminator: the convolution kernel is multiplied with the time domain and frequency domain data; then, batch normalization and nonlinear transformation are performed; finally, feature extraction is performed to obtain a time domain feature vector and a frequency domain feature vector, and the two feature vectors have the same dimensions; S4.

2. The time domain feature vector and the frequency domain feature vector obtained in S4.

1. are used as input data of the feature fusion layer, and the time domain feature vector is multiplied by the matrix and then multiplied by the frequency domain feature vector to obtain bilinear feature data; S4.

3. The bilinear feature data obtained in S4.2 are input into the discriminant layer and the regression layer respectively: after multiplication with the convolution kernel, the discriminant result is obtained, which is defined as: real_val; and the regression result is defined as: real_reg.

14. The method for training an EEG signal generative adversarial network model according to claim 10, characterized in that: S5. Update the discriminator parameters, including: S5.

1. Input the time domain data obtained in S1.3 and the frequency domain data obtained in S1.

4. into the discriminator to perform the forward calculation process of S4. discriminator and obtain the discrimination result; The value of the BIS label corresponding to the input EEG waveform is defined as real_BIS; S5.

2. Perform the forward calculation step of the generator in S2.2 to obtain one-dimensional vector EEG data; S5.

3. Preprocess the EEG data S1 obtained in S5.2 to obtain time domain data and frequency domain data; S5.

4. Input the time domain data and frequency domain data obtained in S5.3 into the discriminator together, and perform the forward calculation operation of the discriminator in S4. to obtain the discrimination result, which is defined as: fake_val; and the regression result, which is defined as: fake_reg; S5.

5. Input the discrimination results and regression results obtained in S5.1 and S5.4 into the discriminator loss function respectively. The loss function is as follows: ; in: ; ; in: represents the mean; represents gradient penalty; MAE() is the discriminator error function; Indicates that the input is The discriminator output of All the real data and generated data in a training mini-batch, as well as the random mixture of all the real data and generated data; n represents the number of input data in a batch; is the true value of the i-th sample; is the simulated value of the model; Then, through the back-propagation algorithm, the gradient of the weight is obtained and updated. The calculation formula is as follows: ; ; in: Represents the trainable parameters in the discriminator, including weights and biases; represents the gradient of the trainable parameters in the discriminator; Represents the learning rate (i.e., the step size of each parameter update); Represents the updated training parameters.

15. The method for training an EEG signal generative adversarial network model according to claim 10, characterized in that: S2. Generator forward calculation and S4. Discriminator forward calculation are not performed in order and are performed simultaneously in the computer.

16. A method for training an EEG signal generative adversarial network model according to any one of claims 10 to 15, characterized in that: It also includes, S7. Using the trained EEG signal to generate an adversarial network model to generate a batch of EEG data, and compare it with the real EEG data in the frequency domain to evaluate the model effect.