Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a gender difference detection method based on electroencephalogram signal emotion recognition, which fully utilizes brain function connection information and time sequence information through a long-time memory map neural network, realizes recognition of a plurality of commonly used and representative data sets, analyzes the most common difference expressions at the same time, and verifies the gender difference characteristics in emotion-related electroencephalogram activities.
The invention is realized by the following technical scheme:
the invention relates to a brain electrical characteristic identification method based on a long-time and short-time memory diagram neural network, which comprises the following steps: the method comprises the steps of extracting differential entropy characteristics from electroencephalogram data set, converting the differential entropy characteristics into characteristic matrixes of representation diagrams, training a neural network model of a long-time diagram and a short-time diagram, simultaneously acquiring brain function connection information and time sequence relation of the characteristic data, and finally realizing emotion recognition by using the trained network model.
The training was performed using 5 common, more representative data sets to develop the experiment, the data sets involved were: china (SEED, SEED-IV, SEED-V), Europe (DEAP, DREAMER) data set. They all acquire EEG electroencephalogram modality data and all use video material to induce emotion.
The training is to extract the differential entropy frequency domain characteristics as the input data of the experiment by preprocessing the original data. Designing a universal same-sex training strategy and an opposite-sex training strategy, training a recognizer for each tested data of each data set by using a leave-one-cross verification method to obtain a corresponding same-sex model and an opposite-sex model, adjusting the hyper-parameters of each group of models in iteration, and obtaining a final experimental result.
On the basis of the method, various problems of differential expression are solved. The invention analyzes and compares the experimental results on each data set with common gender difference expression forms, such as: the neural mode, the key brain area and the key frequency band further obtain a more objective and stable conclusion, and the sex difference characteristic of the emotional experience electroencephalogram signal is verified.
The pretreatment is as follows: the baseline correction is carried out on the original data of the electroencephalogram signals in the data set, and the data are down-sampled to 200Hz, so that the data analysis process is accelerated. Then, band-pass filtering is performed in the range of 1-75Hz to filter noise and artifacts in the data.
The differential entropy feature extraction is as follows: carrying out short-time Fourier transform on the preprocessed data, and extracting differential entropy characteristics of each lead on 5 frequency bands, wherein the characteristics are as follows: delta is 1-4Hz, theta is 4-8Hz, alpha is 8-14Hz, beta is 14-31Hz, and gamma is 31-50 Hz; because the SEED, SEED-IV and SEED-V use 62-lead electroencephalogram caps, the differential entropy characteristics of 310-dimensional electroencephalogram are shared; and because the original electroencephalogram data of DEAP and DREAMER filter delta frequency range and 32-lead and 14-lead electroencephalogram caps are used, 128-dimensional and 56-dimensional differential entropy characteristics are obtained respectively. And finally, smoothing the extracted electroencephalogram characteristics by using a linear power system, and eliminating rapid jitter information irrelevant to emotion.
The characteristic transformation means that: the InMemoryDataset base class of the PyTorch Geometric tool library is used, the extracted leads of the frequency domain feature are used as points, the connection among the leads is an edge, the feature data are converted into a feature matrix in the form of g ═ v, epsilon, and then the feature matrix is converted into time sequence data through a time window T to construct input data of an experiment.
The recognizer model is a long-time and short-time memory map neural network which is a map convolution neural network added with a memory module, and the network comprises: memory module, a plurality of picture convolution module, domain classifier, gradient reversal layer, emotion perception learner, pooling layer, full tie-layer when long and short term, wherein: the long-time and short-time memory module captures time sequence dependence information among the characteristic matrixes, the image volume module extracts brain function connection characteristic information related to emotional experience, the domain classifier is used for solving the efficiency problem of a scene crossing a tested scene, the gradient of the domain classifier is reversed by the gradient reversing layer during back propagation, the emotion perception learner aims at data label noise, the pooling layer pools output characteristics, and finally the full-connection layer is used for decoding the pooled characteristics and predicting an emotion label.
The long-time and short-time memory module comprises one or more self-connected memory cells and three gate units, and for data of each time step, the memory cells of the neural network can extract information from the result of the previous step, so that the memory module can store the time sequence dependence information of the data in a long time. Because the electroencephalogram signals are also timing sequence data, the memory module can capture and utilize timing sequence information in the electroencephalogram signals, and the identification accuracy is improved.
The graph convolution module captures local connection and global connection information among different leads by adopting a sparse adjacency matrix attached to an intracerebral network structure, the sparse adjacency matrix is obtained by utilizing reciprocal calculation of physical distances among lead channels, the local connection shows the anatomical connectivity of a brain area, and the global connection shows the emotion-related functional connectivity of left and right hemispheres.
The domain classifier combines a transfer learning and confrontation training method, reduces the difference between a source domain and a target domain, enhances the generalization capability of the model, and solves the problem of poor recognition efficiency in a cross-tested scene.
The emotion perception learner is as follows: the noise level factor is used to transform the individual tags into a prior probability distribution according to the mood-evoked properties, thereby mitigating the tag noise problem inside the data set.
The training process comprises the following specific contents:
1) firstly, information packaging is carried out on each data set, experimental configuration is convenient to switch, then each data set is divided into male data and female data, and the experimental data are normalized and used as input of model training.
2) Secondly, initializing the adjacency matrix learned by the graph convolution network:
and sets the global connection initial value to: a. the
ij=A
ijAnd-1, the global connection is totally 9 pairs, and the global connection spans the left and right cerebral hemispheres and can maximize the lateralization of the brain electrical signals and find the functional connectivity between the hemispheres.
3) Training same-sex model and different-sex model of each tested data by using leave-one-out cross-validation methodSpecifically, any piece of tested data is taken as a test set, and all other tested electroencephalogram data with the same sex are taken as a training set Xi_sameTraining a same sex model, and simultaneously using all the different sex data as a training set Xi_crossAnd training a heterology model.
4) In a long-short time memory diagram neural network, a characteristic matrix sequence is formed
And a long-time input memory module. For the elements in the input sequence, the updating method of the memory module is respectively as follows: an input gate: i.e. i
t=σ(W
ixx
t+b
ii+W
ihh
t-1+b
i) And forget to close the door: f. of
t=σ(W
fxx
t+b
if+W
fhh
t-1+b
f) And a memory gate: g
t=tanh(W
cxx
t+W
chh
t-1+b
c) Memory cell status:
an output gate: o
t=σ(W
oxx
t+W
ohh
t-1+b
o),h
t=o
t*tanh(c
t) Wherein: h is
tHidden layer state at time t, corresponding to h
t-1σ refers to the logistic sigmoid function, representing the Hadamard product, at time t-1 or the initial hidden layer state.
5) For output X of long-and-short-time memory moduleiEach graph convolution module calculates: zi=SLXiW, output ZiAnd learn the importance of functional connections of the various brains.
6) Then the output of the graph convolution module passes through the pooling layer and the full-connection layer, and the emotion label Y is output
iProbability distribution of (2):
wherein,
the full connection layer takes a softmax function as an activation function, and pool (phi) represents that global sum pooling is carried out, wherein the sigma (Z)
i) Is to Z
iEach element of (a) is non-linearly transformed: σ (x) is max (0, x).
7) In the node representation learning process, a domain classifier is trained to learn domain invariant features, and the source domain X is reduced
SAnd a target domain X
TThe difference between them. The main task of the domain classifier is to minimize the cross-entropy loss function of two binary classification tasks:
the method enhances the generalization capability of the model and improves the robustness in the cross-tested experiment.
8) Then, a learning process of the gradient inversion layer auxiliary domain classifier is utilized, and a calculation function of a gradient inversion layer factor is as follows:
wherein p is [0, 1 ]]Representing the progress of model training.
9) The emotion perception learner converts a single emotion label into prior probability distribution by using the noise level factor, and replaces the optimization problem of the graph convolution module with the problem of the minimized KL divergence function:
mitigating tag noise issues within the data set.
10) To this end, the loss function of the entire model becomes a calculation: phi ″ ═ phi' + phiDAnd finally, outputting a prediction result by using a single-layer full-connection network, respectively calculating the recognition accuracy of the isotropic model and the special-shaped model, and iterating the training process.
Technical effects
The invention combines a long-time memory map neural network and a short-time memory map neural network, simultaneously captures brain function connection information and time sequence information to perform signal pattern recognition, introduces a domain classifier and an emotion perception learner, reduces the difference between a training set and a test set, reduces data label noise, enhances the performance of a network model, and improves the pattern recognition accuracy based on electroencephalogram signals. Compared with the prior art, the method and the device realize emotion recognition tasks on a plurality of commonly used representative data sets, integrally solve the problem of limitation of the existing research work, improve the recognition rate of the electroencephalogram signal mode, and verify the gender difference of the electroencephalogram activity in emotion experience.
Detailed Description
As shown in fig. 1, the present embodiment relates to a gender difference detection method based on electroencephalogram emotion recognition, which specifically includes:
the method comprises the following steps: the configuration information of 5 data sets including brain electricity cap leads, tested information, label content and the like is sorted and packaged, and experimental configuration is convenient to switch. Acquiring original data of the electroencephalogram signals in the data set.
Step two: the raw data is pre-processed, down-sampled to 200Hz and band-pass filtered at 1 to 75Hz, filtering noise and artifacts.
Step three: and (3) extracting differential entropy characteristics, calculating short-time Fourier transform on the preprocessed data, extracting the differential entropy characteristics on 5 frequency bands on each lead in a non-overlapping time window of 4 seconds, and then performing characteristic smoothing by using a linear power system to eliminate rapid jitter to obtain experimental data of 310 dimension, 128 dimension and 56 dimension respectively.
Step four: the experimental data of the 5 data sets are converted into a feature matrix of a representation diagram, and then converted into time series data of the feature matrix, wherein the time series data are used as input data of a neural network of a training long-time and short-time memory diagram, and the network structure is shown in fig. 2.
Step five: and training the same-sex model and the opposite-sex model of each tested data by using a leave-one cross verification method, and respectively outputting the result data of the two models.
Step six: and (3) iterating the model training process, adjusting the hyper-parameters of the model, correcting the neural network and optimizing the performance of the model.
Step seven: fixing the neural network parameters of the same-sex model and the opposite-sex model, inputting the tested data into the neural network, outputting a predicted emotion label, and calculating the classification accuracy.
Step eight: and (4) counting the final identification accuracy, analyzing and evaluating the experimental result, analyzing the electroencephalogram mode and the brain area of the gender difference according to the brain energy topological graph, evaluating the key brain area and the key frequency band by utilizing network weight distribution and the like.
As shown in fig. 3 and 4, the classification accuracy of the support vector machine and the long-term memory-based neural network isotropic model is generally higher than that of the opposite sex model, which indicates that the isotropic data has more consistent data distribution, and there is a misclassification between the opposite sex data and the test set. And the accuracy of the neural network based on long-time and short-time memory is generally higher than that of a support vector machine, which shows that the time sequence information is fully utilized to be beneficial to improving the performance of the recognizer, namely: with the improvement of model performance, the difference between the same-sex model and the different-sex model becomes more obvious. The graph neural network is known to realize excellent performance in emotion recognition, so that the method is combined with a long-time memory module and the graph neural network, utilizes brain function connection information and time sequence information, and is more favorable for detecting gender difference of male and female emotion electroencephalogram signals.
As shown in fig. 5, the accuracy of the same sex model is higher than that of the opposite sex model under different emotions, which indicates that the electroencephalogram signals of men and women are different under different emotions. The electroencephalogram data of men and women with different emotions can show different signal modes, and the method can be applied to scenes such as auxiliary diagnosis and treatment of affective disorder diseases of men and women.
From fig. 6, it can be seen that the brain of the male is activated more in a limited area than the brain of the female, and a larger difference in brain energy can be found in aversion to the emotion. Gender differences related to emotion recognition are more significant in high frequency bands, such as beta and gamma bands, and can assist in the development of recognition tasks.
Through specific experiments, a PyTorch neural network framework is used, the learning rate is set to be 0.01 under the specific environment setting based on a plurality of data sets and unified experimental configuration, the Adam optimization method is applied, the classification accuracy of a same-sex model in the obtained experimental data is generally higher than that of a different-sex model, and the situation of large misclassification between the different-sex model and the tested data is explained; under most emotions, the accuracy of the same-sex model is higher than that of the opposite-sex model, and the same-sex data are proved to have higher similarity.
Compared with the prior art, the performance index of the method is improved as follows: the long-time and short-time memory module is combined with the graph neural network, brain function connection information and time sequence information are collected simultaneously, network model performance is enhanced, mode identification accuracy based on electroencephalogram signals is improved, and gender difference in electroencephalogram data is highlighted.
According to the invention, the long-time memory map neural network and the short-time memory map neural network are used for simultaneously capturing brain function connection information and time sequence information, the domain classifier is introduced to reduce the difference between a source domain and a target domain, emotion labels are converted into probability distribution to reduce label noise, the emotion recognition task of a plurality of commonly used and representative data sets is realized, the limitation problem existing in the existing research work is integrally solved, and the sex difference of electroencephalogram activities in emotion experience is verified.
Compared with the prior art, the unique new functions/effects of the invention comprise:
1) firstly, the electroencephalogram feature recognition method based on the long-time memory diagram neural network is provided, brain function connection information and time sequence information of feature data are collected simultaneously, and accuracy of electroencephalogram emotion recognition is improved. Meanwhile, a support vector machine and a neural network based on long-term and short-term memory are trained to serve as experimental baselines, and the characteristics of the performance and the gender difference of a new model are highlighted and generally exist in emotion-related electroencephalogram activities.
2) Secondly, the commonly used data sets including Chinese (SEED, SEED-IV and SEED-V) and European (DEAP and DREAMER) data sets are researched by using the international emotional brain-computer interface, so that the experiment is more representative, and the generality and the feasibility of the detection method are enhanced.
3) And finally, analyzing the experimental result and the expression form of common gender difference on the basis of a plurality of data sets and a high-performance model, wherein the expression form comprises a neural mode, a key brain area and a key frequency band. More objective and stable conclusion can be obtained, and the robustness is stronger.
The foregoing embodiments may be modified in many different ways by those skilled in the art without departing from the spirit and scope of the invention, which is defined by the appended claims and all changes that come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein.