Emotion sample selection and recognition method based on data and emotion mechanism fusion measurement
By integrating enhanced class activation mapping and attention prototype network, combined with regional alignment scoring mechanism and semi-supervised training, the problems of data scarcity and sample imbalance in EEG emotion classification are solved, and high-precision and low-cost emotion recognition is achieved.
Patent Information
- Application Number
- CN202510806231.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-06-17
AI Technical Summary
EEG emotion classification faces the problems of scarcity of high-quality data, small sample learning, and uneven sample quality, resulting in low classification accuracy and difficulty in effective improvement in practical applications.
An enhanced class activation mapping sampling strategy is deeply integrated with the attention-enhanced prototype network, combined with a regional alignment scoring mechanism and a semi-supervised training framework, to intelligently screen key electrodes and frequency bands, adaptively identify emotion-related patterns through instance-level and feature-level attention modules, and efficiently label unlabeled samples.
It significantly improves the accuracy of EEG emotion classification, reduces data annotation costs, enhances the robustness and interpretability of the model, and is suitable for high-performance classification under data-scarce conditions.
Smart Images

Figure CN120744573A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electroencephalogram (EEG) signal processing, and in particular to a method for selecting and identifying emotion samples based on the fusion measurement of data and emotion mechanisms. Background Art
[0002] EEG emotion classification is a key research area in brain-computer interface technology, aiming to identify and decode human emotional states by analyzing brain electrical activity signals. This technology has broad application prospects in fields such as human-computer interaction, affective computing, mental health monitoring, and clinical diagnosis. However, current EEG emotion classification research faces several key challenges, which severely limit its practical application.
[0003] The primary challenge is the scarcity of high-quality emotion EEG datasets. Acquiring emotion EEG data requires carefully designed experimental paradigms, specialized acquisition equipment, and rigorous experimental control, resulting in high data acquisition costs. Furthermore, the large individual differences among subjects and the difficulty in accurately inducing and labeling emotional states make the construction of large-scale, high-quality emotion EEG datasets extremely difficult. Current research generally faces the problem of small-sample learning: how to build high-performance emotion classification models with limited sample sizes.
[0004] Secondly, EEG signals themselves are highly complex and non-stationary. Emotion-related EEG activity patterns are distributed across different frequency bands, time windows, and spatial locations, and exhibit significant individual differences. The quality of collected EEG samples varies greatly; some samples may contain rich emotion-related information, while others may consist primarily of noise or neural activity unrelated to emotion. This imbalance in sample quality means that simply increasing the sample size will not effectively improve model performance. An intelligent sample screening mechanism is urgently needed to identify and prioritize the most informative samples from limited data.
[0005] Therefore, studying an EEG emotion recognition method that can adaptively focus on key electrodes and frequency bands, integrate neuroscience knowledge, and intelligently screen important samples is of great significance for improving classification accuracy and practical application value under conditions of data scarcity. Summary of the Invention
[0006] The present invention proposes an active learning small-sample emotion recognition method based on the fusion measurement of data and emotion mechanism, deeply integrates the enhanced class activation mapping sampling strategy with the attention-enhanced prototype network, and realizes the accurate identification of key electrodes and frequency bands for emotion classification in EEG signals by constructing a guided gradient weighted class activation mapping technology. The regional alignment scoring mechanism based on the importance weights of five brain regions is combined to intelligently screen the most informative labeled samples. The prototype network architecture integrating instance-level attention module and feature-level attention module captures emotion-related patterns in EEG signals through adaptive weighted prototype calculation and feature importance learning. A semi-supervised training framework combining prototype loss and consistency loss is established to effectively utilize unlabeled samples through data enhancement strategy, thereby achieving high-precision, strong robustness and interpretability of EEG emotion classification effects while significantly reducing the labeling cost.
[0007] In order to achieve the above object, the technical solution adopted by the present invention is:
[0008] A method for selecting and identifying emotion samples based on the fusion measurement of data and emotion mechanism includes the following steps:
[0009] Step S1: collecting and preprocessing raw EEG data to generate EEG samples;
[0010] Step S2: extracting features from the EEG samples to generate a feature vector set; the EEG samples include labeled samples and unlabeled samples; the labeled samples are the EEG samples assigned emotion category labels;
[0011] Step S3: construct and train an attention prototype network model; the attention prototype network model includes a feature extractor, an instance-level attention module, and a feature-level attention module;
[0012] The instance-level attention module dynamically weights different EEG samples by calculating the similarity between the query sample and the support set sample to generate attention weights; the support set sample is the labeled sample; the query sample is the unlabeled sample;
[0013] The feature-level attention module generates feature importance weights based on the deep feature representation extracted by the feature extractor, so as to adjust attention to different EEG feature dimensions;
[0014] Step S4: calculating a class activation map heat map of each unlabeled sample in the unlabeled samples to generate a guided class activation map;
[0015] Calculate the regional importance score of each brain region based on neuroscience knowledge and the guided class activation map;
[0016] Generate enhanced samples by adding noise and masks to the unlabeled samples, and then calculate the sample consistency loss;
[0017] Calculating and generating a comprehensive sampling score for each of the unlabeled samples according to the region importance score and the sample consistency loss;
[0018] The unlabeled samples are screened according to the comprehensive sampling score.
[0019] Preferably, in step S3, the similarity calculation formula is as follows:
[0020] sim(q,s)=q·s
[0021] Where q is the query sample feature, and s is the support set sample feature;
[0022] Calculate the attention score α(s), which represents the importance weight of the support set sample features for the current query sample classification decision. The calculation formula is as follows:
[0023] α(s)=f attention (s)
[0024] Among them, f attention is the attention prototype network model;
[0025] Calculate the combined score score(q,s) using the following formula:
[0026] score(q,s)=sim(q,s)×α(s)
[0027] The attention weight w(q,s) is calculated as follows:
[0028] w(q,s)=softmax(score(q,s))
[0029] Where softmax is a normalization function.
[0030] Preferably, the step S3 further includes generating a class prototype vector and a distance measurement result based on the support set samples and the attention weight.
[0031] Preferably, in step S4, calculating the comprehensive sampling score includes:
[0032] Calculate the adaptive weight coefficient α(i):
[0033]
[0034] Where α0 is the initial weight (set to 0.7), i is the number of unlabeled samples currently selected, and n is the number of target samples;
[0035] Normalized importance score I norm :
[0036]
[0037] Among them, I is the original importance score, I min , I max are the minimum and maximum values of the importance score, respectively, and ε is a small constant to prevent division by zero;
[0038] Normalized consistency score C norm :
[0039]
[0040] Where C is the original consistency loss, C min ,C max are the minimum and maximum values of the consistency scores, respectively;
[0041] The comprehensive sampling score S combined The calculation formula is as follows:
[0042] S combined =α(i)×I norm +(1-α(i))×C norm .
[0043] Preferably, in step S4, screening the unlabeled samples according to the comprehensive sampling score includes:
[0044] Select the importance score I norm The highest unlabeled sample is used as the first labeled sample;
[0045] The remaining unlabeled samples are selected in descending order of their comprehensive sampling scores until the target number of samples is reached;
[0046] The adaptive weight α(i) is updated after each round of selection.
[0047] Preferably, the method further includes step S5, visualizing electrode importance, including:
[0048] Projecting electrode importance onto a 9×9 grid highlights key electrode locations;
[0049] Visualize the activation patterns of important electrodes separately by frequency band and present the interaction between frequency band and electrode.
[0050] Compared with the prior art, the beneficial effects of the present invention are embodied in:
[0051] 1. Different from traditional EEG emotion recognition technology that adopts global feature extraction and static weight allocation scheme, the present invention adopts an attention-enhanced prototype network model, dynamically adjusts the weights of samples in different support sets through instance-level attention, and adaptively identifies key frequency bands and electrode positions through feature-level attention, so that the model can automatically focus on EEG features related to emotions. Compared with traditional methods, the classification accuracy is improved by 14 percentage points, significantly enhancing the reliability of the brain-computer interface system.
[0052] 2. Unlike traditional active learning strategies that use a single uncertainty measure, this paper adopts an enhanced class activation mapping (CAM) sampling strategy, innovatively applies guided Grad-CAM technology to EEG signal analysis, and integrates neuroscience prior knowledge to calculate regional importance scores, enabling the system to intelligently identify the most informative samples for sentiment classification. It can achieve classification performance comparable to that of the full dataset using only 30% labeled data, significantly reducing data labeling costs.
[0053] 3. Different from traditional supervised learning solutions that only use labeled data, this invention adopts a semi-supervised learning framework and effectively utilizes a large amount of unlabeled data through consistency regularization constraints, so that the model can still maintain good generalization ability under data scarcity conditions. It is particularly suitable for practical application scenarios where EEG data acquisition costs are high and labeling is difficult.
[0054] 4. Unlike traditional methods that separate machine learning from neuroscience knowledge, this invention adopts a multi-level knowledge fusion mechanism, which for the first time achieves the deep coupling of prototype network small-sample learning and neuroscience knowledge-guided active learning, so that the algorithm decision-making is consistent with human understanding of the emotional brain mechanism, providing a new solution for brain-computer interface technology that is both high-performance and explainable. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 It is a schematic diagram of the method framework of Example 1 of the present invention. DETAILED DESCRIPTION
[0056] In order to make the technical means, creative features, objectives and effects of the invention easier to understand, the present invention is further described with reference to specific figures. However, the present invention is not limited to the following implementation cases.
[0057] It should be noted that the structures, proportions, sizes, etc. illustrated in the drawings in this specification are only used to match the contents disclosed in the specification so that people familiar with this technology can understand and read them. They are not used to limit the conditions under which the present invention can be implemented. Therefore, they have no substantive technical significance. Any structural modification, change in proportional relationship or adjustment of size should still fall within the scope of the technical content disclosed in the present invention without affecting the efficacy and purpose that can be achieved by the present invention.
[0058] Example 1:
[0059] like Figure 1 The method for selecting and identifying emotion samples by integrating data and emotion mechanism is shown, and includes the following steps:
[0060] Step S1: Collect and preprocess raw EEG data, generate EEG samples, and construct an emotion classification dataset;
[0061] This experiment uses the SEED-IV emotion dataset, which contains EEG data from 15 subjects watching emotion-inducing videos, covering four emotional states: neutral, sad, fearful, and happy. EEG signals were collected using a 62-channel EEG cap from the international 10-20 system. A bandpass filter (0.5-70 Hz) was applied to the raw EEG data to remove power supply and myoelectric noise, and independent component analysis (ICA) was used to remove oculoculographic artifacts. This generated clean EEG data, known as EEG samples.
[0062] Step S2: Extract features from EEG samples to generate time domain features, frequency domain features, and spatial domain features; fuse the time domain features, frequency domain features, and spatial domain features into a feature vector set F combined ; and assign emotion category labels to some EEG samples. The collected EEG samples are divided into two parts: (1) labeled samples L: EEG samples containing known emotion category labels, which are used for the initial training of the model; (2) unlabeled samples U: EEG samples containing unassigned emotion category labels. These samples will be selectively labeled through intelligent sampling strategies in the subsequent active learning process.
[0063] Time domain features: including statistical features such as zero-crossing rate, variance, approximate entropy, sample entropy, skewness and kurtosis of each EEG cap electrode signal.
[0064] Frequency domain features: Perform short-time Fourier transform on the data and extract the power spectral density features of five frequency bands (δ, θ, α, β, γ).
[0065] Spatial domain features include inter-electrode correlation, calculating the correlation coefficient between electrodes, and capturing spatial connection features.
[0066] Step S3: construct and train an attention prototype network model;
[0067] The attention prototype network model of the present invention includes a feature extractor, an instance-level attention module and a feature-level attention module; the trained attention prototype network model will be used for the sample sampling strategy of step S4 and the semi-supervised training of step S6.
[0068] Step S31: The feature extractor uses a multi-layer neural network structure to extract deep feature representations of the EEG sample;
[0069] The input of the feature extractor is the feature vector set F combined This set is a comprehensive feature vector generated after feature extraction of EEG samples in step S2, which contains the fusion representation of time domain features, frequency domain features and spatial domain features, and the output is a deep feature representation vector.
[0070] The feature extractor consists of a moderately large, multi-layer, fully connected network. Each layer is equipped with nonlinear activation functions, normalization, and overfitting prevention mechanisms to extract hierarchical, deep feature representations from EEG signals. The network structure is pyramidal, compressing input features layer by layer into a lower-dimensional feature space.
[0071] Step S32: The instance-level attention module calculates the similarity between the query sample and the support set sample, generates attention weights, and implements dynamic weighting of different EEG samples; the input of the instance-level attention module is the query sample feature vector q and the support set sample feature vector S = {s1, s2, ..., s k}, the output is the attention weight vector W.
[0072] Support set sample definition: The support set samples are always labeled training samples, which are used to construct prototype vectors of each category. Its feature vector set S is extracted from the comprehensive features F of the labeled training samples by the feature extractor. combined It can be extracted from .
[0073] Query sample definition: Query samples have different meanings depending on the application stage:
[0074] Model training phase: query samples are validation samples randomly split from labeled samples and used to calculate prototype loss and train model parameters;
[0075] Active learning sampling stage: query samples are candidate samples selected from the unlabeled sample pool and used to evaluate the importance score and consistency loss of the samples;
[0076] Model inference stage: The query sample is an unclassified test sample, and the classification result is obtained by calculating the distance with the prototype constructed by the support set.
[0077] The feature vectors q of all query samples are extracted from the comprehensive features F_combined of the corresponding samples through the feature extractor.
[0078] The similarity between the query sample and the support set sample is calculated and the weights are generated through a learnable attention network.
[0079] The similarity calculation formula is as follows:
[0080] sim(q,s)=q·s
[0081] Where q is the query sample feature, s is the support set sample feature, and sim(q, s) is the dot product similarity between the two samples.
[0082] Attention score: This score represents the importance of the support set sample s to the classification decision of the current query sample. The higher the score, the greater the contribution of the support set sample to the classification. The calculation formula is as follows:
[0083] α(s)=f attention (s)
[0084] Here, f_attention is the attention network, which starts from the output dimension of the feature extractor, undergoes dimensionality reduction processing in the intermediate layers, and finally outputs a single-dimensional attention score. The network's intermediate layers apply nonlinear activation functions to enhance the model's ability to capture complex attention patterns. α(s) is the attention score for sample s.
[0085] The formula for calculating the combined score is as follows:
[0086] score(q,s)=sim(q,s)×α(s)
[0087] Where score(q,s) is the comprehensive score of the query sample q and the support sample s.
[0088] The attention weights are normalized by the softmax function:
[0089] w(q,s)=softmax(score(q,s))
[0090] Where w(q,s) is the normalized attention weight.
[0091] Step S33: The feature-level attention module assigns weights to different feature dimensions, highlighting the frequency bands and electrode features related to emotions.
[0092] The feature-level attention module takes as input a deep feature representation vector and outputs a feature importance weight vector. Utilizing existing feature attention mechanisms, the module consists of multiple fully connected layers of the same dimension, with a range-limiting function applied at the end to generate importance weights that match the feature dimensions. This module enables the attention prototype network model to adaptively adjust its focus on different EEG feature dimensions, highlighting emotion-related frequency bands and electrode location information, thereby improving classification performance and interpretability.
[0093] Step S34: Prototype calculation and distance measurement:
[0094] Input: support set sample features and attention weights
[0095] Output: class prototype vector and distance metric results
[0096] The class prototype is calculated in a weighted manner, and the similarity between the query sample and the class prototype is measured using the Euclidean distance:
[0097] Weighted prototype calculation:
[0098]
[0099] where s i is the i-th support set sample of category c, w(q,s i ) is the attention weight, p c is the weighted prototype vector of category c
[0100] Euclidean distance calculation:
[0101]
[0102] where q i is the i-th element of the query sample feature vector, is the i-th element of the prototype vector of category c, d(q,p c ) is the Euclidean distance between the query sample and the prototype of category c
[0103] Feature weighted distance:
[0104]
[0105] in The i-th feature weight generated by the feature-level attention module, is the weighted distance metric.
[0106] Step S4: Based on the trained attention prototype network model and unlabeled samples, the unlabeled samples are selected by combining gradient weighted class activation mapping and neuroscience knowledge, including:
[0107] Step S41: Calculate a class activation map heat map for each unlabeled sample to screen brain regions and frequency bands that have a high contribution to the emotion classification task; the determination of the high contribution is achieved by the following steps:
[0108] First, the ReLU activation function is used to filter positive contribution features and remove negative activations. Then, the samples are normalized relative to the maximum activation value within the sample to obtain a normalized activation value between 0 and 1. Finally, a regional importance scoring mechanism is used to identify key brain regions and frequency bands.
[0109] The channel weight calculation formula is as follows:
[0110]
[0111] Among them, y c is the score of the predicted category c, A k is the feature map of the k-band, Z is the normalization factor, The weight of category c on the kth channel.
[0112] Weighted feature map calculation:
[0113]
[0114] Applying ReLU highlights the positive contribution:
[0115]
[0116] in is the feature map after ReLU activation, where ReLU is the rectified linear unit function.
[0117] Guided Activation Combination:
[0118]
[0119] in is the positive part of the derivative of the prediction with respect to the input, Activates the mapping for the guided class.
[0120] The guided class activation map It will be used as the input of the subsequent electrode importance calculation I(e), the feature importance vector feature map .
[0121] Step S42: Calculate the regional importance score of each brain region based on neuroscience knowledge;
[0122] The electrode features are reshaped into a 9×9 grid layout, and the position matrix M is defined according to the mapping rule of the international 10-20 system:
[0123] M(e)=(row(e),col(e))
[0124] Where e is the electrode index, row(e) and col(e) are the row and column indices of the electrode in the 9×9 grid, respectively, and M(e) is the grid position coordinate of electrode e.
[0125] Regional importance score calculation: Based on neuroscience knowledge, the importance weights of five key brain regions for emotion processing are defined:
[0126] Regional weight definition:
[0127] W region ={frontal lobe: 0.35, frontal lobe: 0.25, temporal lobe: 0.25, parietal lobe: 0.10, occipital lobe: 0.05}
[0128] The electrode importance I(e) is the importance of electrode e and is calculated by the following steps:
[0129] First, the feature importance vector is calculated by guided gradient weighted class activation mapping technology;
[0130] The feature importance vector is grouped by electrode, and each electrode corresponds to the feature values of multiple frequency bands;
[0131] Importance of calculating electrode e:
[0132]
[0133] Where F is the number of frequency bands, feature map The feature importance vector generated by the guided class activation map; W r(e) is a binary indicator variable indicating whether electrode e belongs to region r. When electrode e is located in brain region r, W r(e) =1, otherwise 0. r is the brain region index (prefrontal lobe, frontal lobe, temporal lobe, parietal lobe, occipital lobe), e is the electrode index (1 to 62)
[0134] Region alignment score calculation:
[0135]
[0136] Regional Weighted Score:
[0137] S align =∑(A(r)×W region (r))
[0138] Electrode importance variance calculation:
[0139] S var =Var(I(e))
[0140] Where Var is the variance function, S {var} is the variance of electrode importance.
[0141] Final regional importance score:
[0142] S region =0.7×S align +0.3×S var
[0143] Among them, 0.7 and 0.3 are the weight coefficients of regional alignment and variance, S {region} The final regional importance score.
[0144] Sample consistency loss calculation: Generate enhanced samples by adding noise and masks, and evaluate the prediction consistency:
[0145] Enhanced sample generation:
[0146]
[0147] Where x is the original sample, n1,n2: Gaussian noise, m: Bernoulli random mask, ⊙: element-wise multiplication, For two enhanced samples
[0148] Consistency loss calculation:
[0149]
[0150] Where f(x) represents the model's predicted probability distribution for input x, and MSE is the mean square error.
[0151] Step S43: Calculate and generate a comprehensive sampling score for each unlabeled sample based on the region importance score and the sample consistency loss; and filter the unlabeled samples based on the comprehensive sampling score.
[0152] Comprehensive sampling score calculation: combining region importance and consistency loss, using adaptive weights:
[0153] Adaptive weight coefficient:
[0154]
[0155] where α o is the initial weight (set to 0.7), i is the number of currently selected samples, and n is the target number of samples.
[0156] Normalized importance score:
[0157]
[0158] Where I is the original importance score, I min , I max is the minimum and maximum value of the importance score -ε: a small constant to prevent division by zero, I norm is the normalized importance score.
[0159] Normalized consistency score (smaller is better):
[0160]
[0161] Where C is the original consistency loss, C min ,C max are the minimum and maximum values of the consistency score, respectively, C norm is the normalized consistency score
[0162] Comprehensive sampling score:
[0163] Scombined =α(i)×I norm +(1-α(i))×C norm
[0164] High-value sample screening strategy: Based on the comprehensive sampling score, a greedy selection algorithm is used to screen samples to be marked, including:
[0165] First round selection: Select Importance Score I norm The highest sample is used as the first labeled sample:
[0166] idx1=argmax(I norm )
[0167] Subsequent selection: For the remaining unlabeled samples, select in descending order of comprehensive sampling scores:
[0168] idx i =argmax(S combined )for remaining samples
[0169] Iterative selection: Repeat the subsequent selection until the target number of samples n is completed:
[0170] Selected indices ={idx1,idx2,…,idx n}
[0171] The adaptive weight α(i) is updated after each round of selection, so that as the number of selected samples increases, the consistency weight gradually increases and the importance weight gradually decreases, ensuring that the selected samples have both high information value and maintain prediction consistency.
[0172] The high-value sample selection result output by step S4 will be used for the active learning iteration of step S6.
[0173] Step S5: Outputting an electrode importance visualization chart based on the electrode importance score I(e) calculated in step 4, including:
[0174] S51. 62-channel electrodes are placed on a 9×9 grid, and the position mapping is based on the topological structure of the international 10-20 system to form a more intuitive representation of brain areas.
[0175] S52. Based on the electrode importance score, the electrode importance is presented in the form of a heat map, and the color depth represents the degree of contribution to the sentiment classification.
[0176] S53. Simultaneously display the activation patterns of each frequency band of the top important electrodes, revealing the contribution of different frequency activities to emotion recognition.
[0177] Step S6: semi-supervised training framework implementation.
[0178] According to the attention prototype network model output in step S3, the high-value samples selected in step S4, the labeled samples L and the unlabeled samples U, the optimized model parameters θ and the final sentiment classification results are output.
[0179] The present invention adopts an alternating iterative semi-supervised training method, and the specific implementation steps are:
[0180] S61, initialize network parameters θ and optimizer, set basic learning rate η = 0.0005, weight decay coefficient λ w =1e-3, batch size b=128.
[0181] S62. Prototype network training: Calculate the prototype loss function:
[0182]
[0183] Where Q is the query set, p(y q |x q ; θ) is the model for the query sample x q Predict the correct category y q The probability of y q is the true label of the query sample, x q is the feature vector of the query sample, L {proto}(θ) is the prototype network loss;
[0184] S63, consistency regularization:
[0185] Calculate the consistency regularization loss:
[0186]
[0187] Where U is an unlabeled sample, f(x;θ) is the model’s prediction for the input x, is the enhanced sample pair generated by step S43;
[0188] S64. Joint optimization objective function:
[0189] L total (θ)=L proto (θ)+λ u ×L cons (θ)
[0190] where λ u =2.0 is the consistency loss weight, L total (θ) is the overall optimization objective function;
[0191] Parameter update rules:
[0192]
[0193] in is the gradient of the total loss function with respect to the parameters θ, η is the learning rate, and the schedule is learned: every t = 100 iterations,
[0194] η←η×γ
[0195] Where γ = 0.9 is the attenuation coefficient.
[0196] S65, Active Learning Iteration: After each round of active learning, use the enhanced class activation mapping sampling strategy to select b new samples, and use the greedy algorithm to select the samples with the highest comprehensive sampling scores from the unlabeled samples in turn to update the labeled dataset:
[0197] L←L∪{(x i ,y i )|i∈I b}
[0198] Where L is the labeled dataset, I b ={i1,i2,…,i b} indicates that the comprehensive sampling score S combined The first b sample indices selected after descending sorting.
[0199] The experimental results are shown in Table 1. Compared with the traditional random sampling method, the method proposed in this paper can significantly improve the accuracy of sentiment classification. After 10 rounds of active learning, the average accuracy of the enhanced class activation mapping sampling strategy reaches 68%, which is 14 percentage points higher than the random sampling strategy.
[0200] Table 1: Sentiment classification accuracy of each method
[0201] Subject number Random Sampling Entropy sampling K cluster sampling This method S01 0.46 0.57 0.61 0.58 S02 0.60 0.75 0.65 0.59 S03 0.44 0.51 0.52 0.56 S04 0.50 0.61 0.64 0.67 S05 0.32 0.59 0.57 0.55 S06 0.48 0.64 0.59 0.59 S07 0.69 0.82 0.78 0.87 S08 0.61 0.83 0.84 0.85 S09 0.56 0.61 0.69 0.61 S10 0.64 0.59 0.52 0.88 S11 0.44 0.61 0.41 0.57 S12 0.34 0.59 0.64 0.44 S13 0.55 0.58 0.64 0.75 S14 0.61 0.74 0.73 0.83 S15 0.84 0.76 0.75 0.79 average 0.54 0.64 0.61 0.68
Claims
1. A method for selecting and identifying emotion samples based on the fusion of data and emotion mechanism, characterized by: The following steps are involved: Step S1: collecting and preprocessing raw EEG data to generate EEG samples; Step S2: extracting features from the EEG samples to generate a feature vector set; the EEG samples include labeled samples and unlabeled samples; the labeled samples are the EEG samples assigned emotion category labels; Step S3: construct and train an attention prototype network model; the attention prototype network model includes a feature extractor, an instance-level attention module, and a feature-level attention module; The instance-level attention module dynamically weights different EEG samples by calculating the similarity between the query sample and the support set sample to generate attention weights; The support set samples are the labeled samples; The query sample is the unlabeled sample; The feature-level attention module generates feature importance weights based on the deep feature representation extracted by the feature extractor, so as to adjust attention to different EEG feature dimensions; Step S4: calculating a class activation map heat map of each unlabeled sample in the unlabeled samples to generate a guided class activation map; Calculate the regional importance score of each brain region based on neuroscience knowledge and the guided class activation map; Generate enhanced samples by adding noise and masks to the unlabeled samples, and then calculate the sample consistency loss; Calculating and generating a comprehensive sampling score for each of the unlabeled samples according to the region importance score and the sample consistency loss; The unlabeled samples are screened according to the comprehensive sampling score.
2. The method for selecting and identifying emotion samples based on the fusion of data and emotion mechanism according to claim 1, characterized in that: In step S3, the similarity calculation formula is as follows: sim(q,s)=q·s Where q is the query sample feature, and s is the support set sample feature; Calculate the attention score α(s), which represents the importance weight of the support set sample features for the current query sample classification decision. The calculation formula is as follows: α(s)=f attention (s) Among them, f attention is the attention prototype network model; Calculate the combined score score(q,s) using the following formula: score(q,s)=sim(q,s)×α(s) The calculation formula of the attention weight w(q,s) is: w(q,s)=softmax(score(q,s)) Where softmax is a normalization function.
3. The method for selecting and identifying emotion samples based on the fusion of data and emotion mechanism according to claim 1, characterized in that: The step S3 also includes generating a class prototype vector and a distance measurement result according to the support set samples and the attention weight.
4. The method for selecting and identifying emotion samples based on the fusion of data and emotion mechanism according to claim 2, characterized in that: In step S4, calculating the comprehensive sampling score includes: Calculate the adaptive weight coefficient α(i): where α o is the initial weight (set to 0.7), i is the number of unlabeled samples currently selected, and n is the number of target samples; Normalized importance score I norm : Among them, I is the original importance score, I min , I max are the minimum and maximum values of the importance score, respectively, and ε is a small constant to prevent division by zero; the normalized consistency score C norm : Where C is the original consistency loss, C min ,C max are the minimum and maximum values of the consistency scores, respectively; The comprehensive sampling score S conbined The calculation formula is as follows: S combined =α(i)×I norm +(1-α(i))×C norm 。 5. The method for selecting and identifying emotion samples based on the fusion of data and emotion mechanism according to claim 4, characterized in that: In step S4, screening the unlabeled samples according to the comprehensive sampling score includes: Select the importance score I norm The highest unlabeled sample is used as the first labeled sample; The remaining unlabeled samples are selected in descending order of their comprehensive sampling scores until the target number of samples is reached; The adaptive weight α(i) is updated after each round of selection.
6. The method for selecting and identifying emotion samples based on the fusion of data and emotion mechanism according to claim 5, characterized in that: The method further includes step S5, visualizing electrode importance, including: Projecting electrode importance onto a 9×9 grid highlights key electrode locations; Visualize the activation patterns of important electrodes separately by frequency band and present the interaction between frequency band and electrode.
Citation Information
Patent Citations
Emotion analysis method and device for electroencephalogram signals based on capsule network model
CN115130664A
Consciousness state analysis method and equipment based on multi-scale feature fusion
CN117137499A
Driver emotional state detection method and device based on electroencephalogram data
CN117204856A
Cross-period brain grain recognition method and system based on multi-branch attention feature fusion
CN117521007A
Lightweight method for electroencephalogram signal emotion classification
CN118592957A