A method for selecting and identifying emotion samples by fusing data and emotion mechanisms.
By fusing enhanced class activation mapping and attention prototype networks, and combining them with a semi-supervised learning framework, the problems of data scarcity and sample imbalance in EEG emotion classification are solved, achieving high-precision and interpretable EEG emotion recognition, which is suitable for brain-computer interface technology.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2026-03-13
AI Technical Summary
EEG emotion classification faces challenges such as scarcity of high-quality data, small sample learning, and uneven sample quality, resulting in low classification accuracy and making it difficult to effectively improve in practical applications.
By deeply integrating an enhanced class activation mapping sampling strategy with an attention-enhanced prototype network, and combining a region alignment scoring mechanism and a semi-supervised training framework, key electrodes and frequency bands are adaptively identified through instance-level and feature-level attention modules, and the labeled samples with the most information are intelligently selected.
It significantly improves the accuracy and robustness of EEG emotion classification under limited data conditions, reduces data annotation costs, and enables the application of high-performance and interpretable brain-computer interface technology.
Smart Images

Figure CN120744573B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electroencephalogram (EEG) signal processing technology, and in particular to a method for selecting and identifying emotion samples by fusing data and emotion mechanisms. Background Technology
[0002] EEG emotion classification is an important research direction 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 human-computer interaction, affective computing, mental health monitoring, and clinical diagnosis. However, current EEG emotion classification research faces several key challenges that severely limit its effectiveness in real-world scenarios.
[0003] The primary challenge is the scarcity of high-quality emotional EEG datasets. Acquiring emotional EEG data requires meticulously designed experimental paradigms, specialized acquisition equipment, and rigorous experimental control, resulting in high data acquisition costs. Simultaneously, significant individual variability among subjects and the difficulty in accurately inducing and labeling emotional states make the construction of large-scale, high-quality emotional EEG datasets extremely challenging. Current research commonly faces the problem of few-shot learning, namely, how to build high-performance emotion classification models under limited sample conditions.
[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 considerably; some samples may contain rich emotion-related information, while others may primarily contain noise or emotion-irrelevant neural activity. This uneven sample quality means that simply increasing the sample size is insufficient to effectively improve model performance. Therefore, an intelligent sample selection mechanism is urgently needed to identify and prioritize the most informative samples from limited data.
[0005] Therefore, researching 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 data-scarce conditions. Summary of the Invention
[0006] This invention proposes an active learning method for few-sample emotion recognition that integrates data and emotion mechanisms. It deeply integrates an enhanced class activation mapping (ENM) sampling strategy with an attention-enhanced prototype network. By constructing a guided gradient-weighted EEM technique, it achieves accurate identification of key electrodes and frequency bands for emotion classification in EEG signals. Combined with a region alignment scoring mechanism based on the importance weights of five brain regions, it intelligently selects the most informative labeled samples. The prototype network architecture, integrating instance-level and feature-level attention modules, captures emotion-related patterns in EEG signals through adaptive weighted prototype computation and feature importance learning. A semi-supervised training framework combining prototype loss and consistency loss is established, effectively utilizing unlabeled samples through data augmentation strategies. This significantly reduces labeling costs while achieving high accuracy, robustness, and interpretability in EEG emotion classification.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0008] A method for selecting and identifying emotion samples based on the fusion of data and emotion mechanisms includes the following steps:
[0009] Step S1: Collect and preprocess raw EEG data to generate EEG samples;
[0010] Step S2: Extract 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 samples to generate attention weights; the support set samples are the labeled samples; the query sample is the unlabeled sample.
[0013] The feature-level attention module generates feature importance weights based on the deep feature representations extracted by the feature extractor, which are used to adjust the attention to different EEG feature dimensions.
[0014] Step S4: Calculate the class activation map heatmap of the unlabeled samples in each of the unlabeled samples to generate a guided class activation map;
[0015] Based on neuroscience knowledge and the aforementioned guided activation mapping, a regional importance score for each brain region is calculated;
[0016] Enhanced samples are generated by adding noise and masks to the unlabeled samples, and then the sample consistency loss is calculated.
[0017] Based on the regional importance score and the sample consistency loss, a comprehensive sampling score is calculated for each of the unlabeled samples.
[0018] The unlabeled samples are filtered based on 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), where the attention score represents the importance weight of the support set sample features for the classification decision of the current query sample, and the calculation formula is as follows:
[0023] α(s)=f attention (s)
[0024] Among them, f attention This refers to the attention prototype network model;
[0025] The combined score score(q,s) is calculated using the following formula:
[0026] score(q,s) = sim(q,s) × α(s)
[0027] The formula for calculating the attention weight w(q,s) is as follows:
[0028] w(q,s)=softmax(score(q,s))
[0029] Where softmax is the normalization function.
[0030] Preferably, step S3 further includes generating class prototype vectors and distance metric results based on the support set samples and the attention weights.
[0031] Preferably, in step S4, calculating the comprehensive sampling score includes:
[0032] Calculate the adaptive weighting coefficient α(i):
[0033]
[0034] Where α0 is the initial weight (set to 0.7), i is the number of currently selected unlabeled samples, and n is the target number of samples;
[0035] Normalized Importance Score I norm :
[0036]
[0037] Where I is the original importance score, I min I max These 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 These are the minimum and maximum values of the consistency score, 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, filtering the unlabeled samples based on the comprehensive sampling score includes:
[0044] Select the importance score I norm The highest-ranking unlabeled sample is taken as the first labeled sample;
[0045] For the remaining unlabeled samples, select them in descending order of their comprehensive sampling scores until the target number of samples has been selected;
[0046] The adaptive weight α(i) is updated after each round of selection.
[0047] Preferably, the method also includes step S5, visualizing the importance of the electrodes, including:
[0048] Project the importance of electrodes onto a 9×9 grid to highlight the locations of critical electrodes;
[0049] The activation modes of important electrodes are visualized by frequency band, presenting the interaction between frequency bands and electrodes.
[0050] Compared with the prior art, the beneficial effects of the present invention are reflected in:
[0051] 1. Unlike traditional EEG emotion recognition technologies that employ global feature extraction and static weight allocation schemes, this invention uses an attention-enhanced prototype network model. By dynamically adjusting the weights of different support set samples through instance-level attention and adaptively identifying key frequency bands and electrode locations through feature-level attention, the model can automatically focus on EEG features related to emotions. Compared with traditional methods, this improves the classification accuracy by 14 percentage points and significantly enhances the reliability of the brain-computer interface system.
[0052] 2. Unlike traditional active learning strategies that use a single uncertainty measure, this invention employs an enhanced class activation mapping (CAM) sampling strategy. It innovatively applies guided Grad-CAM technology to EEG signal analysis and integrates neuroscience prior knowledge to calculate region importance scores. This enables the system to intelligently identify the samples with the most information for emotion classification. It achieves classification performance comparable to the entire dataset using only 30% labeled data, significantly reducing data labeling costs.
[0053] 3. Unlike traditional supervised learning schemes that only utilize labeled data, this invention adopts a semi-supervised learning framework, which effectively utilizes a large amount of unlabeled data through consistency regularization constraints. This enables the model to maintain good generalization ability even under data scarcity conditions, making it 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, achieving for the first time a deep coupling between prototype network small-sample learning and neuroscience knowledge-guided active learning. This ensures that algorithmic decisions are consistent with human understanding of emotional brain mechanisms, providing a novel solution for brain-computer interface technology that combines high performance and interpretability. Attached Figure Description
[0055] Figure 1 This is a schematic diagram of the method framework of Embodiment 1 of the present invention. Detailed Implementation
[0056] To make the technical means, inventive features, objectives, and effects of the invention readily understandable, the invention is further described below with reference to specific illustrations. However, the invention is not limited to the embodiments described below.
[0057] It should be noted that the structures, proportions, sizes, etc., illustrated in the accompanying drawings of this specification are only used to complement the content disclosed in the specification for those skilled in the art to understand and read, and are not intended to limit the conditions under which the present invention can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportions, or adjustments to the size, without affecting the effects and objectives that the present invention can produce, should still fall within the scope of the technical content disclosed in the present invention.
[0058] Example 1:
[0059] like Figure 1 The method for selecting and identifying emotion samples based on the fusion of data and emotion mechanisms, as shown, includes the following steps:
[0060] Step S1: Collect and preprocess raw EEG data to generate EEG samples and construct an emotion classification dataset;
[0061] This experiment used the SEED-IV emotion dataset, which contains EEG data from 15 subjects watching emotion-inducing videos, covering four emotional states: neutral, sadness, fear, and happiness. EEG signals were acquired using a 62-channel EEG cap based on the International 10-20 system. Bandpass filters (0.5-70Hz) were applied to the raw EEG data to remove power supply and electromyographic noise, and independent component analysis (ICA) was used to remove electrooculography (EOG) artifacts, generating preprocessed clean EEG data, i.e., EEG samples.
[0062] Step S2: Extract features from the EEG samples to generate time-domain, frequency-domain, and spatial-domain features; fuse these features into a feature vector set F. combined ; and assign emotion category labels to some EEG samples, and divide the collected EEG samples into two parts: (1) labeled samples L: EEG samples containing known emotion category labels, used for the initial training of the model; (2) unlabeled samples U: EEG samples containing no assigned emotion category labels, which will be selectively labeled through intelligent sampling strategy in the subsequent active learning process.
[0063] Temporal characteristics: 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 to extract the power spectral density features of five frequency bands (δ,θ,α,β,γ).
[0065] Spatial characteristics, including inter-electrode correlation, are used to calculate the correlation coefficient between electrodes and capture spatial connection characteristics.
[0066] Step S3: Construct and train the 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 in step S4 and the semi-supervised training in step S6.
[0068] Step S31: The feature extractor uses a multi-layer neural network structure to extract deep feature representations of EEG samples;
[0069] The input to the feature extractor is the set of feature vectors F. combined This set is a comprehensive feature vector generated after feature extraction of EEG samples in step S2. It contains a 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 multi-layer fully connected network with a moderate number of layers. Each layer is equipped with a non-linear activation function, normalization processing, and overfitting prevention mechanism to extract hierarchical deep feature representations from EEG signals. The network structure is pyramid-shaped, compressing the input features layer by layer to a lower-dimensional feature space.
[0071] Step S32: The instance-level attention module calculates the similarity between the query sample and the support set samples, generates attention weights, and realizes 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 used to construct prototype vectors for each category. Their feature vector set S is extracted from the combined features F of the labeled training samples using a feature extractor. combined It was extracted from [the source].
[0073] Query sample definition: Query samples have different meanings depending on the application stage:
[0074] Model training phase: Query samples are validation samples randomly segmented from labeled samples, used to calculate prototype loss and train model parameters;
[0075] Active learning sampling phase: The query sample is a candidate sample selected from the unlabeled sample pool, used to evaluate the importance score and consistency loss of the sample;
[0076] Model inference phase: The query sample is an unclassified test sample. The classification result is obtained by calculating the distance with the prototype constructed from the support set.
[0077] The feature vector q of all query samples is extracted from the comprehensive feature F_combined of the corresponding samples by the feature extractor.
[0078] The similarity between the query sample and the support set samples is calculated, and 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 represents the query sample features and s represents the support set sample features. sim(q, s) is the dot product similarity between the two samples.
[0082] Attention Score: This score represents the importance weight of the support set samples s to the classification decision of the current query sample. The higher the score, the greater the contribution of the support set samples to the classification. The calculation formula is as follows:
[0083] α(s)=f attention (s)
[0084] Here, f_attention is an attention network that starts from the output dimension of the feature extractor, undergoes dimensionality reduction processing through intermediate layers, and finally outputs a single-dimensional attention score. The intermediate layers of the network apply non-linear 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 combined fractions is as follows:
[0086] score(q,s) = sim(q,s) × α(s)
[0087] Where score(q,s) is the combined score of query sample q and supporting sample s.
[0088] Attention weights are normalized using 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 frequency bands and electrode features related to emotions.
[0092] The feature-level attention module takes a deep feature representation vector as input and outputs a feature importance weight vector. Employing existing feature attention mechanisms, the module consists of multiple fully connected layers of the same dimension, with a range-limited function at the end to generate importance weights that match the feature dimensions. This module enables the attention prototype network model to adaptively adjust the level of attention given to different EEG feature dimensions, highlighting emotion-related frequency bands and electrode location information, thus improving classification performance and interpretability.
[0093] Step S34, Prototype Calculation and Distance Measurement:
[0094] Input: Support set of sample features and attention weights
[0095] Output: Class prototype vectors and distance metric results
[0096] The class prototype is calculated using a weighted method, and the similarity between the sample and the class prototype is queried using the Euclidean distance metric:
[0097] Weighted prototype calculation:
[0098]
[0099] Where s i For the i-th support set sample of category c, w(q,s) i ) represents the attention weight, p c The weighted prototype vector of category c
[0100] Euclidean distance calculation:
[0101]
[0102] Where q i To query the i-th element of the sample feature vector, Let d(q,p) be the i-th element of the prototype vector of category c. 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. This is the weighted distance metric.
[0106] Step S4: Based on the trained attention prototype network model and unlabeled samples, and combining gradient-weighted class activation mapping with neuroscience knowledge, select unlabeled samples, including:
[0107] Step S41: Calculate a class activation mapping heatmap for each unlabeled sample to screen brain regions and frequency bands that contribute highly to the emotion classification task; the determination of high contribution is achieved through the following steps:
[0108] First, positive contribution features are screened using the ReLU activation function, and negative activation values are removed. Then, the activation values are standardized relative to the maximum activation value in the sample to obtain standardized activation values in the range of 0 to 1. Finally, key brain regions and frequency bands are identified through a region importance scoring mechanism.
[0109] The formula for calculating channel weights is as follows:
[0110]
[0111] Among them, y c It is the predicted score for category c, A k This is the characteristic map of the k-band, where Z is the normalization factor. The weight of category c for the k-th channel.
[0112] Weighted feature map calculation:
[0113]
[0114] Applying ReLU to highlight positive contributions:
[0115]
[0116] in This is the feature map after ReLU activation, where ReLU is the modified linear unit function.
[0117] Guided activation combined:
[0118]
[0119] in It is the positive part of the derivative of the prediction with respect to the input. Activate the mapping for the guided class.
[0120] The guided class activation mapping The feature importance vector will be used as the input for the subsequent electrode importance calculation I(e). map .
[0121] Step S42: Based on neuroscience knowledge, calculate the regional importance score for each brain region;
[0122] The electrode features are reshaped into a 9×9 grid layout, and the position matrix M is defined according to the mapping rules 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 emotional processing are defined:
[0126] Regional weight definition:
[0127] W region ={Prefrontal: 0.35, Frontal: 0.25, Temporal: 0.25, Parietal: 0.10, Occipital: 0.05}
[0128] Electrode importance I(e) represents the importance of electrode e, and is calculated through the following steps:
[0129] First, the feature importance vector is calculated using the guided gradient-weighted activation mapping technique;
[0130] The feature importance vectors are grouped by electrode, with each electrode corresponding to feature values of multiple frequency bands;
[0131] The importance of calculating electrode e:
[0132]
[0133] Where F is the number of frequency bands, feature map The feature importance vector generated for the guided class activation mapping; W r(e) Let W be a binary indicator variable representing the region r to which electrode e belongs. When electrode e is located within brain region r, 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, and S {var} This represents the variance of electrode importance.
[0141] Final regional importance score:
[0142] S region =0.7×S align +0.3×S var
[0143] Where 0.7 and 0.3 are the weighting coefficients for region alignment and variance, S {region} This is the final regional importance score.
[0144] Sample consistency loss calculation: Enhanced samples are generated by adding noise and masks, and the prediction consistency is evaluated.
[0145] Enhanced sample generation:
[0146]
[0147] Where x is the original sample, n1, n2: Gaussian noise, m: Bernoulli random mask, and ⊙: element-wise multiplication. For two augmented 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 squared error.
[0151] Step S43: Calculate the comprehensive sampling score for each unlabeled sample based on the regional importance score and the sample consistency loss; filter unlabeled samples based on the comprehensive sampling score.
[0152] Comprehensive sampling score calculation: Combining regional importance and consistency loss, using adaptive weights:
[0153] Adaptive weighting coefficients:
[0154]
[0155] Where α o Let i be the initial weight (set to 0.7), i be the number of currently selected samples, and n be the target number of samples.
[0156] Normalized importance score:
[0157]
[0158] Where I is the original importance score, I min I max For the minimum and maximum importance scores -ε: a small constant to prevent division by zero, I norm This represents the normalized importance score.
[0159] Normalized consistency score (lower is better):
[0160]
[0161] Where C is the original consistency loss, C min C max C represents the minimum and maximum values of the consistency score, respectively. norm For normalized consistency scores
[0162] Overall 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 labeled, specifically including:
[0165] First round selection: Select importance score I norm The highest-scoring 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 overall sampling score:
[0168] idx i =argmax(S combined for remaining samples
[0169] Iterative selection: Repeat subsequent selections until the target number of samples n has been selected.
[0170] Selected indices ={idx1,idx2,…,idx n}
[0171] In each round of selection, the adaptive weight α(i) is updated 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 results output in step S4 will be used for the active learning iteration in step S6.
[0173] Step S5: Based on the electrode importance score I(e) calculated in Step 4, output an electrode importance visualization chart, including:
[0174] S51. The 62-channel electrodes are placed on a 9×9 grid, and the position mapping is based on the topology of the international 10-20 system to form a more intuitive representation of brain regions.
[0175] S52. Based on the electrode importance score, the electrode importance is presented in a heatmap manner, with the color intensity representing the degree of contribution to the sentiment classification.
[0176] S53. Simultaneously, the activation modes of each frequency band of the top important electrodes are displayed, revealing the contribution of different frequency activities to emotion recognition.
[0177] Step S6: Implementation of the semi-supervised training framework.
[0178] Based on 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] This invention employs an alternating iterative semi-supervised training method, with the following specific implementation steps:
[0180] S61. Initialize network parameters θ and optimizer, setting the base learning rate η = 0.0005 and the 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 ;θ) represents the model's response to the query sample x q Predict the correct category y q The probability, y q To query the true label of the sample, x q To query the feature vector of a sample, L {proto}(θ) This represents the loss of the prototype network.
[0184] S63, Consistent Regularization:
[0185] Calculate the consistency regularization loss:
[0186]
[0187] Where U represents unlabeled samples, and f(x; θ) is the model's prediction of the input x. These are the enhanced sample pairs generated in 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 It is the gradient of the total loss function with respect to the parameter θ, where η is the learning rate, and the learning schedule is: every t = 100 iterations.
[0194] η←η×γ
[0195] Where γ = 0.9 is the attenuation coefficient.
[0196] S65. Active Learning Iteration: After each round of active learning, b new samples are selected using an enhanced class activation map sampling strategy. A greedy algorithm is then used to sequentially select the sample with the highest comprehensive sampling score from the unlabeled samples 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 based on the comprehensive sampling score S combined The indexes of the first b samples selected after sorting in descending order.
[0199] The experimental results are shown in Table 1. Compared with the traditional random sampling method, the method proposed in this invention can significantly improve the accuracy of emotion 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 that of the random sampling strategy.
[0200] Table 1: Accuracy of Sentiment Classification by 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 by fusing data and emotion mechanisms, characterized in that, Includes the following steps: Step S1: Collect and preprocess raw EEG data to generate EEG samples; Step S2: Extract 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 samples, thereby generating 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 representations extracted by the feature extractor, which are used to adjust the attention to different EEG feature dimensions. Step S4: Calculate the class activation map heatmap of the unlabeled samples in each of the unlabeled samples to generate a guided class activation map; Based on the importance of key brain regions to emotional processing and the aforementioned guided class activation mapping, a regional importance score is calculated for each brain region; Enhanced samples are generated by adding noise and masks to the unlabeled samples, and then the sample consistency loss is calculated. Based on the regional importance score and the sample consistency loss, a comprehensive sampling score is calculated for each of the unlabeled samples. The unlabeled samples are filtered based on the comprehensive sampling score.
2. The method for selecting and identifying emotion samples based on the fusion measurement of data and emotion mechanisms according to claim 1, characterized in that, In step S3, the similarity calculation formula is as follows: ; in The features of the query sample, For the features of the support set samples, The dot product similarity between two samples; Calculate attention score The attention score represents the importance weight of the support set sample features for the classification decision of the current query sample, and the calculation formula is as follows: ; in, This refers to the attention prototype network model; Calculate the combination fraction The calculation formula is as follows: ; The attention weight The calculation formula is: ; in This is the normalization function.
3. The method for selecting and identifying emotion samples based on the fusion measurement of data and emotion mechanisms according to claim 1, characterized in that, Step S3 further includes generating class prototype vectors and distance metric results based on the support set samples and the attention weights.
4. The method for selecting and identifying emotion samples based on the fusion measurement of data and emotion mechanisms according to claim 2, characterized in that, In step S4, calculating the comprehensive sampling score includes: Calculate adaptive weight coefficients : ; in The initial weight is 0.
7. The number of unlabeled samples currently selected. The target number of samples; Normalized importance score : ; in, The original importance score, These are the minimum and maximum values of the importance score, respectively, and ε is a small constant to prevent division by zero; Normalized Consistency Score : ; in For the original consistency loss, These are the minimum and maximum values of the consistency score, respectively; The comprehensive sampling score The calculation formula is as follows: 。 5. The method for selecting and identifying emotion samples based on the fusion measurement of data and emotion mechanisms according to claim 4, characterized in that, In step S4, filtering the unlabeled samples based on the comprehensive sampling score includes: Select the importance score. The highest-ranking unlabeled sample is taken as the first labeled sample; For the remaining unlabeled samples, select them in descending order of their comprehensive sampling scores until the target number of samples has been selected; The adaptive weights are updated after each round of selection. .
6. The method for selecting and identifying emotion samples based on the fusion measurement of data and emotion mechanisms according to claim 5, characterized in that, It also includes step S5, visualizing the importance of the electrodes, including: Project the importance of electrodes onto a 9×9 grid to highlight the locations of critical electrodes; The activation modes of important electrodes are visualized by frequency band, presenting the interaction between frequency bands and electrodes.
Citation Information
Patent Citations
Cross-period brain grain recognition method and system based on multi-branch attention feature fusion
CN117521007A
Emotion recognition method based on multi-domain attention fusion network
CN119557728A