EEG-based emotion recognition methods and systems based on multi-task and attention mechanisms
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-09
- Publication Date
- 2026-08-14
AI Technical Summary
其中,基于卷积神经网络和递归神经网络的模型被用于脑电情绪识别中,然而以往的模型只关注单一的特征与单一的识别任务,这使得EEG的时间信息和空间信息不能被充分利用,模型的准确度与泛化能力欠提高
[0020]本发明的优点在于,通过对采集的信号进行全面的预处理,包括带通滤波、工频陷波滤波、降采样、基线校正、伪迹去除和信号分割等步骤,有效去除了原始信号中的噪声和干扰,通过提取功率谱密度和微分熵特征并将其用二维脑图表示,并在三维空间进行堆叠,综合考虑了时域、频域和空间域的信息,整合卷积模块进一步捕获频域和空间域的信息,使模型能够更好地理解信号的空间分布和频率分布特征,引入了长短期记忆网络变体模块和注意力模块,用于捕获时间序列中的关系和时域信息,从而更准确地描述信号的时序特性,通过多任务学习策略,并使用SOFTMAX函数,使单个模型能够同时对情绪的唤醒和效价进行分类,从而提高了模型的泛化能力和分类准确率。
Smart Images

Figure CN118576206B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of brain-computer interface and emotion recognition technology, specifically to an EEG emotion recognition method and system based on multi-task and attention mechanisms. Background Technology
[0002] With the inclusion of brain science as a key national frontier science and technology project in the 14th Five-Year Plan and the 2035 Vision Outline, an increasing number of researchers are focusing on emotion recognition technology in the field of brain-computer interfaces. Emotion recognition data can be mainly divided into two categories: non-physiological signals, such as facial expressions and voice tone; and physiological signals, including physiological signals based on the autonomic nervous system such as skin impedance, heart rate, respiration, and eye movements, as well as electroencephalograms (EEGs) based on the central nervous system. The advantage of non-physiological signal-based recognition methods is their simplicity, requiring no special equipment; however, their disadvantage is the inability to guarantee the reliability of emotion recognition, as individuals can disguise their true emotions through facial expressions and voice tone, which is often difficult to detect. Furthermore, for some disabled individuals with specific illnesses, non-physiological signal-based recognition methods are often difficult to implement. While physiological signals based on the autonomic nervous system cannot be faked, their low accuracy, lack of reasonable evaluation standards, and technological limitations make them unsuitable for direct application to emotion recognition and other tasks in real-world scenarios. Electroencephalogram (EEG) signals based on the central nervous system are spatially discrete, non-stationary, random signals that can directly reflect changes in scalp electrical potential. Compared with other physiological signal recognition methods, they can more reliably reflect a person's emotional state and have attracted increasing attention from researchers.
[0003] Machine learning methods based on EEG have made some progress in emotion recognition. The process includes four stages: acquisition of EEG signals, preprocessing of the acquired signals (interference removal), feature extraction, and classification. This method manually extracts features from the EEG signals to reduce the amount of data, and then uses support vector machines, K-nearest neighbors, random forests, Naive Bayes, and other classifiers to classify and recognize emotions. However, this manual feature extraction method is time-consuming and labor-intensive when dealing with large amounts of EEG data, is prone to information loss, and the accuracy of the classification method is difficult to achieve optimal results.
[0004] Deep learning methods based on EEG can achieve end-to-end mapping, directly inputting preprocessed EEG signals into deep neural networks for training, eliminating the need for complex feature extraction methods and helping to solve nonlinear problems. Among these, models based on convolutional neural networks and recurrent neural networks have been used in EEG emotion recognition. However, previous models only focused on single features and single recognition tasks, which meant that the temporal and spatial information of EEG could not be fully utilized, resulting in poor model accuracy and generalization ability. Summary of the Invention
[0005] The present invention aims to overcome the above-mentioned shortcomings of the prior art by designing a brainwave emotion recognition method and system based on multi-task and attention mechanisms.
[0006] By collecting multi-channel EEG signals from users after emotional induction, the collected EEG signals undergo preprocessing steps such as bandpass filtering, power frequency notch filtering, downsampling, baseline correction, artifact removal, and signal segmentation to optimize signal quality and reduce noise interference. The power spectral density and differential entropy features of each time slice of EEG data obtained from the preprocessing are extracted, and the features are converted into brain maps to preserve spatial information. Brain maps of all bands and features are stacked in three-dimensional space, and each map is used as input to the model. The model integrates convolutional modules, long short-term memory network variant modules, and attention modules, and adopts a multi-task learning strategy to accurately identify the arousal and valence of emotions in the EEG signals.
[0007] This invention provides a brainwave emotion recognition method based on multi-task and attention mechanisms, mainly including the following steps:
[0008] S1. Collect EEG signal data; The user watches video clips with emotions, and then subjectively evaluates and marks the emotional characteristics of the video, such as valence, arousal, and dominance. According to the location of the EEG channels related to emotions in the international standard 10-20 electrode placement system, the corresponding EEG signal data is collected.
[0009] S2. Preprocessing data; The acquired EEG signals are preprocessed by using a 0.5Hz-45Hz bandpass filter to remove low-frequency and high-frequency noise and ECG signals, a power line notch filter to remove power line frequency interference, downsampling to 128Hz to reduce data volume and computational burden while retaining the main information of the signal, baseline correction to eliminate DC offset to ensure that the zero baseline of the signal is consistent with the reference electrode, artifact removal methods such as independent component analysis to remove interference signals such as electrooculography and electromyography, and signal segmentation to divide the signal into windows with a duration of 0.5 seconds.
[0010] S3. Feature extraction and transformation: Power spectral density and differential entropy are extracted from the preprocessed EEG signal. The feature vector is represented by a two-dimensional brain map, and brain maps of all bands and features are stacked in three-dimensional space. Each map is used as the input of the model and input into the MA-CNN-LSTnet model.
[0011] S4. Model Building and Training: Integrating convolutional modules, long short-term memory network variant modules, and attention modules, the model effectively extracts and weights EEG signal features. Through a multi-task learning strategy and using the SOFTMAX function, a single model can simultaneously classify emotional arousal and valence. The Adam optimizer is used to optimize model parameters, and the learning rate is dynamically adjusted through a learning rate decay strategy. Early stopping and model checkpointing techniques are used to monitor model performance and save the optimal model weights during training.
[0012] This invention also provides an EEG emotion recognition system based on multi-task and attention mechanisms, comprising the following modules:
[0013] The emotion EEG data acquisition module is responsible for recording and storing EEG signal data for subsequent analysis and processing.
[0014] The data preprocessing module preprocesses the acquired EEG signals, including bandpass filtering, noise reduction, power frequency notch filtering, downsampling, baseline correction, artifact removal, signal segmentation, and other operations, in order to prepare the data for subsequent feature extraction and transformation.
[0015] The feature extraction and conversion module extracts features such as power spectral density and differential entropy from the EEG signal and converts them into a two-dimensional brain map, which is then stacked in three-dimensional space to serve as input to the model.
[0016] The model building and training module is responsible for integrating the convolution module, the long short-term memory network variant module, and the attention module. It uses the extracted feature brain map to train and save the best model weights for subsequent emotion recognition tasks.
[0017] The multi-task emotion recognition module accurately identifies the arousal and valence of emotions in EEG signals and displays the recognition results.
[0018] The present invention also provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the EEG emotion recognition method of the present invention based on multitasking and attention mechanisms.
[0019] The present invention also provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the EEG emotion recognition method of the present invention based on multi-tasking and attention mechanisms.
[0020] The advantages of this invention are that by performing comprehensive preprocessing on the acquired signals, including bandpass filtering, power frequency notch filtering, downsampling, baseline correction, artifact removal, and signal segmentation, noise and interference in the original signals are effectively removed. By extracting power spectral density and differential entropy features and representing them with a two-dimensional mind map, and stacking them in three-dimensional space, information from the time, frequency, and spatial domains is comprehensively considered. The convolution module is integrated to further capture information from the frequency and spatial domains, enabling the model to better understand the spatial and frequency distribution characteristics of the signal. A variant module of long short-term memory network and an attention module are introduced to capture relationships and temporal information in the time series, thereby more accurately describing the temporal characteristics of the signal. Through a multi-task learning strategy and using the SOFTMAX function, a single model can simultaneously classify emotional arousal and valence, thereby improving the model's generalization ability and classification accuracy. Attached Figure Description
[0021] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart illustrating the method of the present invention.
[0023] Figure 2 This is a schematic diagram of the 32-channel electrode distribution of the present invention.
[0024] Figure 3 This is a schematic diagram of the EEG signal feature extraction and conversion method of the present invention.
[0025] Figure 4 This is a schematic diagram of the MA-CNN-LSTnet model framework of the present invention. Detailed Implementation
[0026] The following will describe clearly and completely a method and system for EEG emotion recognition based on multi-task and attention mechanisms according to the embodiments of the present invention, with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0027] Example 1
[0028] The present invention provides an EEG emotion recognition method based on multi-task and attention mechanisms, the implementation process of which is as follows: Figure 1 As shown, it mainly includes the following steps:
[0029] S1. Collecting electroencephalogram (EEG) signal data;
[0030] Electrodes were placed at different locations on the scalp of healthy subjects according to the international 10-20 system, such as... Figure 2 As shown, the device contains 32 EEG channels. Subjects watch emotionally evoked videos. A 2-second countdown is performed before each video, and a baseline record of 5 seconds is retained. After the video finishes playing, users perform a 15-second self-assessment, marking the valence, arousal, and dominance of the video they watched according to a scale of 1 to 9.
[0031] S2. Preprocessing data;
[0032] The acquired EEG signals were preprocessed by using a bandpass filter (0.5Hz-45Hz) to remove low-frequency and high-frequency noise and ECG signals, a power line notch filter to remove power line frequency interference, downsampling to 128Hz to reduce data volume and computational burden while retaining the main information of the signal, baseline correction to eliminate DC offset to ensure that the zero baseline of the signal is consistent with the reference electrode, artifact removal methods such as independent component analysis to remove interference signals such as electrooculography and electromyography, and signal segmentation to divide the signal into windows with a duration of 0.5 seconds.
[0033] S3. Feature extraction and transformation;
[0034] Feature extraction and transformation are performed on the preprocessed EEG signals. For example... Figure 3 As shown, the 32 channels of EEG data in each 0.5s time slice are divided into five frequency bands: Delta (0.5–4Hz), Theta (4–8Hz), Alpha (8–14Hz), Beta (14–31Hz), and Gamma (31–45Hz). The DE eigenvalue for each band is calculated. The DE eigenvalue is equal to the logarithmic spectral energy of a fixed-length EEG sequence within a given frequency band. The calculation formula is as follows:
[0035]
[0036] Wherein, the time series X approximately follows a Gaussian distribution. π is a constant, and e and σ are the Euler constant and standard deviation of the time series, respectively.
[0037] Power spectral density (PSD) is the average power per unit frequency. x(n) is an infinitely long random sequence; truncating it to a finite-length sequence of length N is called x. N (n). Calculate x N (n) Autocorrelation function at point 2m-1 The formula is as follows:
[0038]
[0039] Where m = -(M-1), ..., -1, 0, 1, ..., M-1, M ≤ N. The power spectrum is obtained by taking the Fourier transform of the correlation function, i.e.:
[0040]
[0041] Among them, e jω It is a complex exponent representing the phase angle at frequency ω. Let be the Fourier transform of the power spectral density, representing the energy distribution of the sequence at frequency ω.
[0042] Power spectral density (PSD) and differential entropy (DE) features were extracted from the five frequency bands of 32 EEG channels. The feature vectors of the 32 EEG channels were mapped onto an 8*9 two-dimensional brain map according to the international standard 10-20 electrode placement system to preserve the spatial information of the electrode positions. Brain maps of all bands and features were then stacked in three-dimensional space, resulting in an 8*9*10 feature map with a height of 8, a width of 9, and a depth of 10. This map was then input into the MA-CNN-LSTnet model.
[0043] S4. Model Building and Training
[0044] By integrating convolutional modules, long short-term memory network variants, and attention modules, effective extraction and weighted combination of EEG signal features are achieved. For example... Figure 4 As shown, the convolutional module first consists of four 2D convolutional layers, one max-pooling layer, one flattening layer, one fully connected layer, and a random deactivation layer and a batch normalization layer following each of the above layers. The four 2D convolutional layers sequentially contain 64 5*5 convolutional kernels, 128 4*4 convolutional kernels, 256 4*4 convolutional kernels, and 64 1*1 convolutional kernels, responsible for feature extraction from the input 3D EEG signal data. Different kernel sizes are used to capture feature information at different scales. Each convolutional layer is followed by a random deactivation layer with a 20% dropout probability and a batch normalization layer to enhance the model's generalization ability and prevent overfitting. Features with a height of 8, width of 9, and depth of 10 (8*9*10) are convolved and then input into a max-pooling layer with a window size of 2*2 to reduce the spatial size of the feature map while retaining the most salient features. The flattened features are then input into a fully connected layer with 512 neurons, resulting in 1*512 features. During model training, six time blocks containing 8*9*10 features are processed through a convolutional module and then input into a Long Short-Term Memory network variant module.
[0045] The Long Short-Term Memory (LSTM) variant module consists of a one-dimensional convolutional neural network (CNN), a recurrent neural network (RNN), fully connected layers, and an autoregressive component. The RNN includes recursive component units and recursive skip component units, while the CNN contains 128 1x1 convolutional kernels, designed to extract dependency patterns from short-term, localized temporal data. The output of the CNN is simultaneously fed into the recursive component units and the recursive skip component units. The recursive component unit is a gated recurrent unit designed to extract temporal features from the time-ordered features extracted by the convolutional layers. The recursive skip component unit also uses a gated recurrent unit. The specific update process of its hidden state at time t is as follows:
[0046] R t =σ(W rx X t +W rh H t-p (4)
[0047] Z t =σ(W zx X t +W zh H t-p (5)
[0048]
[0049] Where ⊙ is the element-wise multiplication operator, σ is the sigmoid activation function, and X t Let R represent the input vector at time t. t Z represents the reset vector. t H represents updating the gate vector. t This represents the hidden layer output vector. W represents the candidate hidden vector. rx W rh W zx W zh W sh W sx This represents the learnable parameters. p is the number of hidden units to skip, set to 6 based on EEG signal characteristics to correspond to 6 time blocks. H t-p This is the output value of the recursive jump component at time tp.
[0050] An attention module is added after the hidden states of the last recursive component and the recursive jump component to adjust the feature weights of the hidden states. Its implementation is as follows:
[0051] a i =W T x i +b (8)
[0052] β i=softmax(α) i (9)
[0053]
[0054] Among them, a i x represents the output of the fully connected layer in the attention module. i Indicates input, W T Let β represent the learnable weight parameters, b represent bias, softmax is the activation function, and β is the weight parameter. i Represents a similarity matrix. Represents the Kronecker product, y i This represents the output of the attention module.
[0055] The fully connected layer combines the outputs of the two attention modules and the hidden states of the recursive jump component. Its formula can be expressed as:
[0056]
[0057] in, and W represents the output of the two attention modules. RA and W SA Let be the weight coefficients of the two attention modules at time t. This indicates the hidden state of the recursive component at time ti. Let be the weight coefficient of the recursive jump component at time i, and b be the bias of the fully connected layer. This represents the output of the fully connected layer at time t.
[0058] The autoregressive component provides the linear component, which helps improve the model's predictive performance on large-scale EEG data. It is described as follows:
[0059]
[0060] in, Let y be the output of the autoregressive layer at time t in a specific dimension i. t-k,i Let q be the observation value under feature dimension i at time tk. ar The size of the input window applied to the input sequence. and b ar These are the weight coefficients and biases of the autoregressive layer, respectively.
[0061] The final output prediction is the superposition of the neural network output and the linear components of the autoregressive layer. During training, 5-fold cross-validation was used, dividing the EEG emotion dataset into training and test sets at a 4:1 ratio, and training was performed 5 times across 5 folds. A multi-task learning strategy was adopted, with the model using the softmax function to simultaneously classify EEG emotion arousal and valence. By sharing network layers and parameters, the model can better generalize and learn the correlations between tasks while handling multiple tasks simultaneously. The Adam optimizer was used to optimize model parameters, and the learning rate was dynamically adjusted using a learning rate decay strategy. The epochs were set to 220, the batch size to 64, and early stopping and model checkpointing techniques were used to monitor model performance and preserve the optimal model weights.
[0062] Example 2
[0063] This invention provides an EEG emotion recognition system based on multi-task and attention mechanisms. The functional modules / units in this system can be hardware modules / units or software modules / units, and mainly include:
[0064] The emotion EEG data acquisition module is responsible for recording and storing EEG signal data for subsequent analysis and processing.
[0065] The data preprocessing module preprocesses the acquired EEG signals, including bandpass filtering, noise reduction, power frequency notch filtering, downsampling, baseline correction, artifact removal, signal segmentation, and other operations, in order to prepare the data for subsequent feature extraction and transformation.
[0066] The feature extraction and conversion module extracts features such as power spectral density and differential entropy from the EEG signal and converts them into a two-dimensional brain map, which is then stacked in three-dimensional space to serve as input to the model.
[0067] The model building and training module is responsible for integrating the convolution module, the long short-term memory network variant module, and the attention module. It uses the extracted feature brain map to train and save the best model weights for subsequent emotion recognition tasks.
[0068] The multi-task emotion recognition module accurately identifies the arousal and valence of emotions in EEG signals and displays the recognition results.
[0069] Example 3
[0070] This embodiment provides a computer-readable storage medium on which a computer program can be stored. The computer program can be called and loaded by a processor to implement the EEG emotion recognition method based on multi-task and attention mechanisms in Embodiment 1.
[0071] Example 4
[0072] This embodiment provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the EEG emotion recognition method based on multi-tasking and attention mechanisms of the present invention.
[0073] The above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is not necessary to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A brainwave-based emotion recognition method based on multi-task and attention mechanisms, comprising the following steps: S1. Collect EEG signal data; The user watches video clips with emotions, and then subjectively labels the emotional characteristics of the video watched. According to the location of the EEG channels related to emotions in the international standard 10-20 electrode placement system, the corresponding EEG signal data is collected. S2. Preprocessing data; The acquired EEG signals are preprocessed by removing low-frequency and high-frequency noise and ECG signals through a 0.5Hz-45Hz bandpass filter, removing power line frequency interference through a power frequency notch filter, reducing data volume and computational burden by downsampling to 128Hz while retaining the main information of the signal, eliminating DC offset through baseline correction to ensure that the zero baseline of the signal is consistent with the reference electrode, removing interference signals from electrooculography and electromyography, and dividing the signal into windows with a duration of 0.5 seconds through signal segmentation. S3. Feature extraction and transformation: Power spectral density and differential entropy are extracted from the preprocessed EEG signal. The feature vector is represented by a two-dimensional brain map, and brain maps of all bands and features are stacked in three-dimensional space. Each map is used as the input of the model and input into the MA-CNN-LSTnet model. S4. Model Building and Training: Integrating convolutional modules, long short-term memory network variant modules, and attention modules, the model effectively extracts and weights EEG signal features. Through a multi-task learning strategy and using the SOFTMAX function, a single model can simultaneously classify emotional arousal and valence. The Adam optimizer is used to optimize model parameters, and the learning rate is dynamically adjusted through a learning rate decay strategy. Early stopping and model checkpointing techniques are used to monitor model performance and save the optimal model weights during training. Specifically, it includes: First, the convolutional module consists of four 2D convolutional layers, one max-pooling layer, one flattened layer, one fully connected layer, and a random deactivation layer and a batch normalization layer following each of the above layers. The four 2D convolutional layers contain 64 5x5 convolutional kernels, 128 4x4 convolutional kernels, 256 4x4 convolutional kernels, and 64 1x1 convolutional kernels, respectively, responsible for feature extraction from the input 3D EEG signal data. Different kernel sizes are used to capture feature information at different scales. Each convolutional layer is followed by a kernel with a dropout probability of 20%. Random deactivation layers and batch normalization layers are used to enhance the model's generalization ability and prevent overfitting; 8*9*10 features with a height of 8, a width of 9, and a depth of 10 are convolved and then input into a max pooling layer with a window size of 2*2 to reduce the spatial size of the feature map while retaining the most salient features; the flattened features are then input into a fully connected layer with 512 neurons to obtain 1*512 features; during model training, six time blocks containing 8*9*10 features are processed through a convolutional module and then input into a Long Short-Term Memory network variant module. The Long Short-Term Memory (LSTM) variant module consists of a one-dimensional convolutional neural network (CNN), a recurrent neural network (RNN), fully connected layers, and an autoregressive component. The RNN includes recursive component components and recursive skip component components, while the CNN contains 128 1x1 convolutional kernels, designed to extract dependency patterns from short-term, local temporal data. The output of the CNN is simultaneously fed into the recursive component components and the recursive skip component components. The recursive component component is a gated recurrent unit designed to extract temporal features from the time-ordered features extracted by the convolutional layers. The recursive skip component component also uses a gated recurrent unit. The specific update process of its hidden state at time t is as follows: in, It is the element-wise multiplication operator. It is the sigmoid activation function. This represents the input vector at time t. Represents the reset vector. This indicates updating the gate vector. This represents the hidden layer output vector. Represents the candidate hidden vector. , , , , , This represents the learnable parameters; p is the number of hidden units to skip, set to 6 based on the characteristics of EEG signals to correspond to 6 time blocks. The output value of the recursive jump component at time tp; The attention module is added after the hidden states of the last recursive component and the recursive jump component to adjust the feature weights of the hidden states; its implementation is as follows: in, This represents the output of the fully connected layer in the attention module. Indicates input, This represents the learnable weight parameters. Indicates paranoia. For activation function, Represents a similarity matrix. Indicates the Kronecker product. This represents the output of the attention module; The fully connected layer is used to combine the outputs of the two attention modules and the hidden state of the recursive jump component, and its formula can be expressed as: in, and This represents the output of two attention modules. and Let be the weight coefficients of the two attention modules at time t. This indicates the hidden state of the recursive component at time ti. Let be the weight coefficient of the recursive jump component at time i. For the bias of the fully connected layer, This represents the output of the fully connected layer at time t; The autoregressive component provides the linear component, which helps improve the model's predictive performance on large-scale EEG data. It is described below: in, The output of the autoregressive layer at time t in a specific dimension i. For each time step tk, the observation value is in feature dimension i. The size of the input window applied to the input sequence. and These are the weight coefficients and biases of the autoregressive layer, respectively; The final output prediction is the superposition of the neural network output and the linear components of the autoregressive layer. During training, 5-fold cross-validation is used, and the EEG emotion dataset is divided into training and test sets in a 4:1 ratio, with training performed 5 times in 5 folds. A multi-task learning strategy is adopted, and the model uses the softmax function to classify both arousal and valence of EEG emotions simultaneously. By sharing network layers and parameters, the model can better generalize and learn the correlation between tasks while handling multiple tasks simultaneously. The Adam optimizer is used to optimize model parameters, and the learning rate is dynamically adjusted using a learning rate decay strategy. The epoch is set to 220, the batch size to 64, and early stopping and model checkpointing techniques are used to monitor model performance and save the optimal model weights.
2. The EEG emotion recognition method based on multi-task and attention mechanisms as described in claim 1, characterized in that, Step S1 specifically includes: placing electrodes at different locations on the scalp of healthy subjects according to the international 10-20 system, containing 32 EEG channels; having subjects watch emotion-evoking videos; a 2-second countdown before each emotion-evoking video, with a 5-second baseline record; and after the video finishes playing, having the user conduct a 15-second self-assessment, marking the valence, arousal, and dominance of the watched video according to a scale from 1 to 9.
3. The EEG emotion recognition method based on multi-task and attention mechanisms as described in claim 1, characterized in that, Step S2 specifically includes: preprocessing the acquired EEG signals by using a 0.5Hz-45Hz bandpass filter to remove low-frequency and high-frequency noise and ECG signals, using a power line notch filter to remove power line frequency interference, downsampling to 128Hz to reduce data volume and computational burden while retaining the main information of the signal, eliminating DC offset through baseline correction to ensure that the zero baseline of the signal is consistent with the reference electrode, removing electrooculography and electromyography interference signals through independent component analysis artifact removal, and dividing the signal into windows with a duration of 0.5 seconds through signal segmentation.
4. The EEG emotion recognition method based on multi-task and attention mechanisms as described in claim 1, characterized in that, Step S3 specifically includes: Feature extraction and transformation were performed on the preprocessed EEG signals: the 32 channels of EEG data in each 0.5s time slice were divided into five frequency bands: Delta (0.5~4Hz), Theta (4~8Hz), Alpha (8~14Hz), Beta (14~31Hz), and Gamma (31~45Hz). The DE feature value of each frequency band was calculated. The DE feature value is equal to the logarithmic spectral energy of a fixed-length EEG sequence within a certain frequency band. The calculation formula is as follows: Among them, time series It approximately follows a Gaussian distribution , It is a constant. and These are the Euler constant and standard deviation of the time series, respectively; Power spectral density (PSD) is the average power per unit frequency. Given an infinitely long random sequence, cutting it down to a finite-length sequence by a length N is called... ;calculate Autocorrelation function at 2m-1 The formula is as follows: in, The power spectrum is obtained by taking the Fourier transform of the correlation function, i.e.: in, It is a complex exponent representing the phase angle at frequency ω. The Fourier transform of the power spectral density represents the energy distribution of the sequence at frequency ω. Power spectral density (PSD) and differential entropy (DE) features were extracted from the five frequency bands of the 32 EEG channels. The feature vectors of the 32 EEG channels were mapped onto an 8*9 two-dimensional brain map according to the international standard 10-20 electrode placement system to preserve the spatial information of the electrode positions. The brain map of all bands and features was stacked in three-dimensional space, and finally an 8*9*10 feature map with a height of 8, a width of 9, and a depth of 10 was obtained, which was then input into the MA-CNN-LSTnet model.
5. A brainwave emotion recognition system based on multi-task and attention mechanisms, used to implement the brainwave emotion recognition method based on multi-task and attention mechanisms as described in claim 1, comprising the following modules connected in sequence: The emotion EEG data acquisition module is responsible for recording and storing EEG signal data for subsequent analysis and processing. The data preprocessing module preprocesses the acquired EEG signals, including bandpass filtering, noise reduction, power frequency notch filtering, downsampling, baseline correction, artifact removal, and signal segmentation, in order to prepare the data for subsequent feature extraction and transformation. The feature extraction and conversion module extracts power spectral density and differential entropy features from EEG signals and converts them into two-dimensional brain maps, which are then stacked in three-dimensional space to serve as input to the model. The model building and training module is responsible for integrating the convolution module, the long short-term memory network variant module, and the attention module. It uses the extracted feature brain map to train and save the best model weights for subsequent emotion recognition tasks. The multi-task emotion recognition module accurately identifies the arousal and valence of emotions in EEG signals and displays the recognition results.
6. A computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the EEG emotion recognition method based on multitasking and attention mechanisms as described in any one of claims 1-4.
7. A computing device comprising a memory and a processor, wherein, The memory stores executable code, and when the processor executes the executable code, it implements the EEG emotion recognition method based on multi-task and attention mechanism as described in any one of claims 1-4.
Citation Information
Patent Citations
Attention mechanism-based end-to-end electroencephalogram emotion recognition method
CN113297981A
Neonatal convulsion electroencephalogram signal classification system of time-frequency-space domain CNN-LSTM introducing attention mechanism
CN115211871A