An EEG Feature Visual Analysis Method and System for Affective Computing
By adopting an incremental optimization algorithm in the extraction of EEG emotional feature, including dynamic standardization, comparative learning pre-training and collaborative cross-attention mechanisms, the problems of individual differences and noise interference are solved, and the feature quality and model generalization ability are significantly improved.
Patent Information
- Application Number
- CN202510388187.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-03-31
AI Technical Summary
EEG emotional feature extraction faces problems of individual differences and noise interference, resulting in low feature quality and affecting the generalization ability of cross-tested modeling.
A progressive optimization algorithm is used, including dynamic standardization within the subjects, comparative learning pre-training and collaborative cross-attention mechanisms, to eliminate individual differences and noise interference, and to extract differential entropy features aligned across subjects.
It effectively improves the quality of EEG emotional characteristics, reduces the impact of individual differences and noise, and improves the interpretability of features and the generalization ability of models.
Smart Images

Figure CN119918014B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electroencephalogram (EEG) signal visualization analysis, and particularly to a visual analysis method and system for EEG features oriented to emotion computing. Background Art
[0002] Electroencephalogram (EEG) signals are physiological signals that record the electrical activities of the brain. Their spatio-temporal and spectral characteristics provide key evidence for revealing the brain function mechanism and are irreplaceable in neuroscience research and clinical diagnosis. Deep learning has created a new paradigm for EEG analysis. For example, emotion computing technology provides an effective way to decode human emotional states and promote the development of brain-computer interfaces.
[0003] In the EEG analysis framework driven by deep learning, the feature extraction stage is responsible for capturing the EEG response patterns related to tasks, and the model construction stage establishes the mapping relationship from feature vectors to target tasks. Among them, feature quality is the core factor determining task performance. Although deep neural networks have powerful feature learning capabilities, their performance highly depends on the quality of input features. In other words, even the optimal classification model is difficult to fully compensate for the information loss caused by low-quality features. However, EEG emotion feature extraction faces a double dilemma: firstly, there are inherent physiological differences in the EEG signals generated by different subjects under the same experimental conditions, which limits the cross-subject generalization ability of models trained based on a single subject; secondly, noises such as electrooculogram (EOG) / electromyogram (EMG) artifacts and power frequency interference result in a relatively large proportion of outliers in the feature space. These problems pose challenges to cross-subject modeling of EEG emotion data. Therefore, proposing a systematic feature quality improvement scheme has become a key requirement in current research.
[0004] In terms of dealing with individual differences, the mainstream methods focus on the architecture optimization of algorithm models. However, the black-box characteristics of the models lead to the lack of interpretability in the feature learning process, and most methods still remain in the algorithm prototype stage and have not yet formed tool-based applications that can be actually deployed. Although existing EEG analysis tools provide preprocessing functions such as denoising, the cumbersome installation and configuration processes and the dependence on programming skills increase their usage thresholds. More importantly, these tools generally lack a feature engineering module and are difficult to establish effective connections with downstream tasks (such as emotion classification). Summary of the Invention
[0005] The present invention provides a visual analysis method and system for EEG features oriented to emotion computing. Particularly aiming at the key technical bottlenecks such as significant individual differences and low signal-to-noise ratio in EEG emotion recognition, a set of systematic solutions is proposed through innovative technology integration.
[0006] The first aspect of the present invention provides a visual analysis method for EEG features oriented to emotion computing, and the method includes the following steps:
[0007] (1) Feature optimization: Design a progressive optimization algorithm to eliminate individual differences in EEG emotional features, adopt an intra-subject dynamic normalization strategy to eliminate inter-individual baseline differences, use a contrastive learning algorithm to extract cross-subject aligned differential entropy representations, and introduce a collaborative cross-attention mechanism to achieve dynamic complementary fusion of differential entropy and power spectral density features.
[0008] (2) Feature evaluation: Construct a multi-dimensional evaluation system to evaluate the feature quality from multiple perspectives such as feature distribution patterns, individual difference coefficients, clustering, and correlation, and verify the effectiveness of the feature optimization method.
[0009] (3) Abnormal feature inspection: Establish an inspection mechanism that combines outlier detection and multi-domain visual analysis to achieve the localization and inspection of abnormal features in low signal-to-noise ratio EEG signals.
[0010] (4) Feature export: Generate and export feature files and visualized graphic reports after optimization and anomaly processing.
[0011] The progressive feature optimization algorithm described in step (1) specifically includes the following steps:
[0012] (11) Intra-subject dynamic normalization: Eliminate inter-individual baseline differences through a per-subject normalization strategy; adopt an adaptive dynamic normalization method to achieve dynamic balance between global and local statistics. Perform the following specific steps:
[0013] (111) For the data of each subject, initialize its global mean and standard deviation ;
[0014] (112) Use a sliding window to traverse the samples of the current subject and calculate the local statistics within the window in real time and ;
[0015] (113) Achieve the fusion of global and local statistics through a dynamic weight to obtain dynamic statistics and :
[0016] (1)
[0017] (114) Based on the dynamic statistics, perform Z-Score normalization on the original data within the window and map it to a unified space with zero mean and unit standard deviation;
[0018] (115) Dynamically decay the value during the traversal process, while retaining the global statistical characteristics, gradually enhancing the adaptability to the dynamic characteristics of EEG time series.
[0019] (12) Contrastive learning pre-training: In the standardized feature space, the intra-class compactness and inter-class separability of the feature space are optimized through positive and negative sample pairs constrained by cross-subject emotional states, so that the feature distances of the same emotional state are reduced, and the feature distances of different emotional states are enlarged, thereby learning emotional representations with cross-subject consistency. The specific algorithm steps are as follows:
[0020] (121) In the sampler, positive and negative sample pairs are drawn across subjects in batches, where the positive sample pairs come from the same emotional state, and the negative sample pairs come from different emotional states;
[0021] (122) In the encoder, a spatio-temporal double convolution architecture is used to extract low-dimensional emotional feature representations from high-dimensional EEG signals;
[0022] (123) In the projector, through a mapping structure combining a spatio-temporal double convolution layer and an average pooling layer, the features output by the encoder are mapped to a contrast space where similarity can be calculated;
[0023] (124) Optimize the parameters of the encoder and projector through the InfoNCE loss function to maximize the cosine similarity of positive sample pairs and minimize the cosine similarity of negative sample pairs, forcing the network to learn cross-subject invariant emotional representations.
[0024] (13) Collaborative cross-attention fusion: Extract differential entropy (DE) features from the encoder of the contrast learning algorithm, introduce a collaborative cross-attention mechanism, and achieve dynamic complementary fusion of differential entropy and power spectral density features. The specific algorithm includes:
[0025] (131) Dimension alignment: Use a multi-layer perceptron network to align the dimensions of the power spectral density (PSD) and differential entropy DE features.
[0026] (132) Attention calculation, specifically including:
[0027] Calculate the attention weight in the DE-PSD direction : Generate a query matrix by linearly transforming the PSD feature matrix At the same time, convert the DE feature matrix into a key matrix , is the feature dimension scaling factor. The specific formula is as follows:
[0028] (2)
[0029] PSD-DE direction attention weight The calculation adopts a mirror structure: convert the DE feature into a query matrix , while mapping the PSD features to a key matrix .
[0030] (133) Feature fusion, specifically including:
[0031] Adopt a weighted strategy to generate a fused feature representation. For DE, the original feature vector and the attention weight are weighted and combined to generate an enhanced DE feature containing PSD information. The formula is as follows:
[0032] (3)
[0033] For PSD, the original feature vector and the weight matrix are fused to obtain the fused PSD feature representation . Through an adaptive gating fusion mechanism, and are dynamically integrated to generate the final emotion representation .
[0034] The multi-dimensional evaluation system described in step (2) specifically includes the following steps:
[0035] (21) Distribution pattern analysis: Use the t-SNE (t-Distributed Stochastic Neighbor Embedding) algorithm to reduce the high-dimensional features to a two-dimensional space, and clustering visualization is used to qualitatively analyze the distribution differences across subjects.
[0036] (22) Individual aggregation analysis: Define an individual aggregation (IA) index to quantify the within-subject aggregation degree of feature points in the two-dimensional space. When calculating, randomly select 20% of the samples to construct multiple rounds of iterations, and perform the following operations in each round of iteration:
[0037] (221) Clustering analysis: Perform k-means clustering on the two-dimensional features, use the subject feature slice corresponding to the current sample index as the initial clustering center, and assign class labels to all samples;
[0038] (222) Individual aggregation rate calculation: For each subject, count the maximum number of samples belonging to the same clustering label, and calculate the ratio of this value to the total number of samples, which is defined as the individual aggregation rate of this subject;
[0039] (223) Step aggregation rate calculation: Calculate the mean value of the individual aggregation rates of all subjects as the step aggregation rate of the current iteration round.
[0040] The average value of the aggregation rate for all iterative steps is output as the individual aggregation IA.
[0041] (23) Individual difference analysis: The Individual Difference Index (IDI) is proposed to measure the inter-class distribution difference of different subjects in a two-dimensional space. The following specific steps are performed:
[0042] (231) For the two-dimensional data of each subject, a probability distribution model is constructed using Gaussian kernel density estimation;
[0043] (232) For any two subjects , the Jensen-Shannon divergence is calculated based on their density distributions ;
[0044] (233) Calculate the JS divergence for all subject pairs and construct a matrix , where is the total number of subjects. The final global individual difference index is defined as the mean of the upper triangular or lower triangular part of matrix D, excluding the diagonal elements.
[0045] (24) Correlation analysis: The Individual Correlation (IC) index is proposed, and a non-parametric method based on k-nearest neighbor distance entropy estimation is used to quantify the non-linear association strength between EEG features and subject identity labels. The following specific steps are performed:
[0046] (241) Align the continuous EEG features with the discrete subject identity labels to form the observation data pairs ;
[0047] (242) For each data point , calculate its local mutual information:
[0048] (4)
[0049] where, is the digamma function used to estimate the local entropy value, is the total number of samples, is the number of samples of the same class as , is defined as the number of samples in the neighborhood, and the neighborhood radius is taken as the k-nearest neighbor distance of ;
[0050] (243) The individual correlation index IC is obtained by averaging the local mutual information of all data points.
[0051] The inspection mechanism combining outlier detection and multi-domain visual analysis described in step (3) includes:
[0052] (31) Outlier detection and analysis: Identify abnormal features with large fluctuations through the interquartile range (IQR) of sample data, and calculate the noise ratio (NSR) to identify features with a high degree of abnormal contamination.
[0053] (32) Multi-domain feature visual analysis: Construct a joint analysis framework for the spatio-temporal domain, time-frequency domain, and space-frequency domain, specifically including:
[0054] Spatio-temporal domain anomaly analysis: Combine the dynamic superposition visualization of EEG waveforms and the spatial mapping of brain topographies to identify abnormal electrode contacts; Through the interactive design of single-channel focused display and multi-channel context hiding, ensure the accuracy of anomaly inspection and avoid visual interference caused by signal overlap.
[0055] Time-frequency domain anomaly analysis: Capture the time-varying characteristics of the energy in each frequency band through time-frequency spectrum coding technology, and focus on identifying 50 / 60Hz power frequency interference noise; Design a multi-level screening strategy to achieve efficient anomaly inspection from overview to detail: Preset typical time windows and electrode combinations related to emotions in the interactive interface, support manual fine-tuning of the time range boundary, and support gradually focusing from multi-electrode combinations to single-electrode signals along the spatial dimension.
[0056] Space-frequency domain anomaly analysis: Realize the correlation analysis of frequency domain-space domain features by comparing and displaying the spatial distribution characteristics of five-band differential entropy (DE) and power spectral density (PSD) through brain topography matrices.
[0057] The second aspect of the present invention provides an EEG feature visual analysis system for emotion computing, which is used to implement the above EEG feature visual analysis method. This system consists of four core functional modules:
[0058] Feature optimization module: Design a progressive optimization algorithm to eliminate individual differences in EEG emotion features, adopt an in-subject dynamic normalization strategy to eliminate baseline differences between individuals, use a contrast learning algorithm to extract cross-subject aligned differential entropy representations, and introduce a collaborative cross-attention mechanism to achieve dynamic complementary fusion of differential entropy and power spectral density features.
[0059] Feature evaluation module: Construct a multi-dimensional evaluation system to evaluate the feature quality from multiple angles such as feature distribution patterns, individual difference coefficients, clustering, and correlation, and verify the effectiveness of the feature optimization method.
[0060] Abnormal feature inspection module: Establish an inspection mechanism combining outlier detection and multi-domain visual analysis to achieve the positioning and inspection of abnormal features in low signal-to-noise ratio EEG signals.
[0061] Feature Export Module: Generate and export the feature files and visual graphic reports after optimization and exception handling.
[0062] The third aspect of the present invention relates to a computing device, including a memory and a processor, wherein an executable code is stored in the memory, and when the processor executes the code, the electroencephalogram feature visual analysis method of the present invention can be implemented.
[0063] The fourth aspect of the present invention relates to a computer-readable storage medium, in which a program is stored, and when the program is executed by a processor, the electroencephalogram feature visual analysis method of the present invention is implemented.
[0064] The advantages of the present invention are as follows: (1) An analysis framework for electroencephalogram emotion data characteristics is proposed. Through the construction of a full process support of feature optimization-evaluation-exception checking, a systematic solution is provided for individual differences and noise problems; (2) A progressive feature optimization algorithm is proposed. Intra-subject dynamic normalization eliminates the baseline differences between individuals, and the contrast learning algorithm extracts differential entropy features aligned across subjects. The collaborative cross-attention mechanism realizes the dynamic complementary fusion of differential entropy and power spectral density features; (3) A visualization system is constructed to realize the engineering application of the theoretical framework and innovative methods. Description of the Drawings
[0065] Figure 1 It is a schematic flowchart of the method of the present invention.
[0066] Figure 2 It is a schematic diagram of the contrast learning algorithm of the present invention.
[0067] Figure 3 It is a schematic diagram of the collaborative cross-attention fusion algorithm of the present invention.
[0068] Figure 4 It is a schematic diagram of the logical structure of the system of the present invention.
[0069] Figure 5 It is an implementation interface diagram of the system of the present invention.
[0070] Figure 6 It is a schematic diagram of the computing device of the present invention. Detailed Embodiments
[0071] The present invention will be further described below in conjunction with the drawings and embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of them, and should not be construed as a limitation to the present invention. Based on the described embodiments, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present invention.
[0072] Embodiment 1
[0073] Refer to Figure 1 , this embodiment relates to an EEG feature visual analysis method for emotion computing, including the following steps:
[0074] (1) Feature optimization: Design a progressive optimization algorithm to eliminate individual differences in EEG emotion features, specifically including:
[0075] (11) Intra-subject dynamic normalization: Adopt a per-subject normalization strategy to replace the traditional global normalization to better eliminate the baseline differences between individuals. Use an adaptive dynamic normalization method to achieve the dynamic balance of global and local statistics. The following specific steps are executed:
[0076] (111) For the data of each subject, initialize its global mean and standard deviation ;
[0077] (112) Use a sliding window to traverse the samples of the current subject, and calculate the local statistics inside the window and in real time;
[0078] (113) Achieve the fusion of global and local statistics through the dynamic weight to obtain the dynamic statistics and :
[0079] (1)
[0080] (114) Based on the dynamic statistics, perform Z-Score normalization on the original data inside the window, and map it to a unified space with zero mean and unit standard deviation;
[0081] (115) Dynamically decay the value during the traversal process, and while retaining the global statistical characteristics, gradually enhance the adaptability to the dynamic characteristics of EEG time series.
[0082] (12) Contrastive learning pre-training: In the standardized feature space, optimize the intra-class compactness and inter-class separability of the feature space through positive and negative sample pairs constrained by cross-subject emotional states, so that the feature distances of the same emotional state are reduced, and the feature distances of different emotional states are enlarged, thereby learning emotional representations with cross-subject consistency. Refer to Figure 2 , the steps of the contrastive learning algorithm are as follows:
[0083] (121) In the sampler, draw positive and negative sample pairs across subjects in batches, where the positive sample pairs come from the same emotional state, and the negative sample pairs come from different emotional states.
[0084] (122) In the encoder, a spatio-temporal double convolutional architecture is adopted to extract low-dimensional emotional feature representations from high-dimensional EEG signals. The spatial convolutional layer maps multi-channel EEG signals to 16 spatial features through a two-dimensional convolutional kernel (30 channels × 1 time point); after dimension rearrangement, the temporal convolutional layer extracts 16 temporal features with a convolutional kernel of 60 strides, and enhances the non-linear expression ability through the ELU activation function.
[0085] (123) In the projector, through a structure combining spatio-temporal double convolutional layers and an average pooling layer, the features output by the encoder are mapped to a contrast space where similarity can be calculated. The average pooling layer compresses the time dimension to 1 / 30 of the original length; the grouped spatial convolution expands the spatial dimension to 32 dimensions with a group number of 16 (equal to the number of input channels); the grouped temporal convolution further expands the feature dimension from 32 to 64 dimensions with a group number of 32. Finally, its output is reshaped into 2304 dimensions.
[0086] d. Contrastive loss: The parameters of the encoder and projector are optimized through the InfoNCE loss function to maximize the cosine similarity of positive sample pairs and minimize the cosine similarity of negative sample pairs, forcing the network to learn emotion representations invariant across subjects.
[0087] (13) Collaborative cross-attention fusion: Introduce a collaborative cross-attention mechanism to achieve dynamic complementary fusion of differential entropy and power spectral density features. Refer to Figure 3 , this algorithm includes the following steps:
[0088] (131) Feature extraction and dimension alignment: Obtain the pre-aligned differential entropy (DE) features from the encoder of the contrastive learning algorithm. Perform non-linear mapping of the power spectral density (PSD) features using a multi-layer perceptron (MLP), while using a single-layer linear projection for the DE features to achieve dimension unification of the two types of heterogeneous feature vectors.
[0089] (132) Attention calculation and feature fusion, specifically including:
[0090] Calculate the attention weights in the DE-PSD direction : Generate a query matrix by linearly transforming the PSD feature matrix At the same time, convert the DE feature matrix into a key matrix is the feature dimension scaling factor. The specific formula is as follows:
[0091] (2)
[0092] Attention weights in the PSD-DE direction The calculation adopts a mirror structure: Convert the DE features into a query matrix At the same time, map the PSD features to a key matrix .
[0093] A weighted strategy is adopted to generate the fused feature representation. For DE, the original feature vector and the attention weight are weighted and combined to generate the enhanced DE feature containing PSD information , and the formula is as follows:
[0094] (3)
[0095] For PSD, the original feature vector and the weight matrix are fused to obtain the fused PSD feature representation . Through the adaptive gating fusion mechanism, and are dynamically integrated to generate the final emotion representation . This representation can be input into a classifier such as a multi-layer perceptron to perform cross-subject emotion classification tasks.
[0096] (2) Feature evaluation: A multi-dimensional evaluation system is constructed to evaluate the quality of the optimized features. Refer to Part B of Figure 1 , specifically including:
[0097] (21) Distribution pattern analysis: The non-linear dimensionality reduction algorithm t-SNE maps the high-dimensional original features to a two-dimensional space to generate a multi-colored encoded clustering scatter plot. Among them, different colors correspond to samples of different subjects. When the projection space shows multiple clusters separated and single-color samples dominate the distribution of a single cluster, it indicates that there are significant intra-subject aggregation and inter-subject difference problems in the features.
[0098] (22) Individual aggregation analysis: An individual aggregation index is used to characterize the degree of intra-class aggregation of samples of the same subject. When calculating, to improve efficiency and ensure the stability of the results, 20% of the samples are randomly selected to construct multiple rounds of iterations, and the following operations are performed in each round of iteration:
[0099] (221) Clustering analysis: Perform k-means clustering on the two-dimensional features, use the subject feature slice corresponding to the current sample index as the initial clustering center, and assign class labels to all samples;
[0100] (222) Calculation of individual aggregation rate: For each subject, count the maximum number of samples belonging to the same clustering label in its samples, calculate the ratio of this value to the total number of samples, and define it as the individual aggregation rate of this subject;
[0101] (223) Calculation of step aggregation rate: Calculate the mean value of the individual aggregation rates of all subjects as the step aggregation rate of the current iteration round;
[0102] The average value of the aggregation rate of all iterative steps is output as the individual aggregation IA. When it approaches 1, it indicates that the samples of the same subject in the feature space show a high degree of within-class aggregation.
[0103] (23) Analysis of individual differences: The individual difference index IDI is used to measure the between-class distribution differences of different subjects in the two-dimensional space. The specific calculation steps are as follows:
[0104] (231) For each subject 's two-dimensional data, a probability distribution model is constructed using Gaussian kernel density estimation;
[0105] (232) For any two subjects , the Jensen-Shannon divergence is calculated based on their density distributions ;
[0106] (233) Calculate the JS divergence of all pairs of subjects and construct a matrix , where n is the total number of subjects;
[0107] (234) The global individual difference index is defined as the mean of the upper triangular or lower triangular part of the matrix D, excluding the diagonal elements.
[0108] This index comprehensively reflects the heterogeneity of the individual characteristic distribution at the group level: when the IDI value approaches 0, it indicates that the EEG feature patterns between different subjects are highly similar; an IDI value approaching 1 indicates significant individual differences in the group.
[0109] (24) Individual correlation analysis: The individual correlation IC index is used to quantify the non-linear association strength between EEG features and subject identity labels. A non-parametric method based on k-nearest neighbor distance entropy estimation is specifically used for mutual information calculation. The specific steps are as follows:
[0110] (241) Align the continuous EEG features with the discrete subject identity labels to form observation data pairs ;
[0111] (242) For each data point , calculate its local mutual information:
[0112] (4)
[0113] Where is the digamma function, used to estimate the local entropy value, is the total number of samples, is the number of samples of the same type as , is defined as The number of samples in the neighborhood, and the neighborhood radius is taken as the distance to the k-th nearest neighbor.
[0114] (243) The individual correlation index IC is obtained by averaging the local mutual information of all data points.
[0115] When IC approaches 0, it indicates that the subject identity label and the EEG features are statistically independent, and the feature space does not contain identifiable subject identity information. On the contrary, the larger the IC value, the more it indicates that and have a strong correlation, and the feature representation has the ability to distinguish subject identities, and this characteristic may affect the performance of the emotion classification model.
[0116] By comparing the evaluation results before and after feature optimization, the performance improvement effect of the optimization method can be effectively verified. For features with unsatisfactory evaluation results, it is necessary to further check the reasons for their abnormalities.
[0117] (3) Abnormal feature inspection: Establish an inspection mechanism that combines outlier detection and multi-domain visual analysis, specifically including:
[0118] (31) Outlier detection and analysis: Adopt an EEG abnormal feature localization method based on the interquartile range method, and the specific steps are as follows:
[0119] (311) Calculate the interquartile range of the sample data , that is, the difference between the third quartile and the first quartile. IQR quantifies the dispersion degree of the core data distribution and identifies abnormal features with large fluctuations;
[0120] (312) Set the outlier detection threshold based on IQR: the lower threshold , the upper threshold , where c is a preset expansion coefficient, generally set to 1.5; identify data points outside the range as outliers;
[0121] (313) Calculate the noise proportion NSR, which is defined as the ratio of the number of outliers to the total number of data points, and is used to identify features with a high degree of abnormal contamination.
[0122] (32) Multi-domain feature visual analysis: Establish a joint analysis framework for spatio-temporal domain, time-frequency domain, and spatio-frequency domain features, and reveal the characteristics of EEG signals in different domains through visual design to identify potential abnormal patterns;
[0123] During the spatio-temporal domain analysis, an approach combining the dynamic superposition visualization of EEG waveforms and the spatial mapping of brain topographies is adopted to analyze electrode contact abnormalities; an interactive method of "focus-context" is used to solve the visual confusion caused by signal overlap: single-channel highlighting is triggered by mouse hovering, and the remaining channels are hidden in a low-saturation form.
[0124] During the time-frequency domain analysis, the short-time Fourier transform (STFT) is used for signal transformation. The time-varying characteristics of the energy in each frequency band are encoded by a three-dimensional time-frequency-energy spectrogram. This design can identify 50 / 60 Hz power frequency noise.
[0125] During the time-frequency domain analysis, the fast Fourier transform (FFT) is used to convert the time-domain signal to the frequency domain. Then the frequency-domain signal is decomposed into five sub-band signals related to emotional activities. Subsequently, the power spectral density (PSD) of each sub-band signal is calculated, and the differential entropy (DE) is calculated by taking the logarithm of the EEG energy spectrum in a specific frequency band. Subsequently, PSD and DE are combined with spatial domain characteristics to construct a multi-band brain topogram to achieve the collaborative analysis of frequency-domain and spatial-domain characteristics.
[0126] (4)Feature derivation
[0127] After verifying the effectiveness of the feature optimization scheme, the optimized feature file can be selected for export.
[0128] Subsequently, the analysis conclusions in the abnormal feature inspection and analysis stage are summarized, the visualization charts to be exported are selected, the report content is previewed, and finally a PDF-formatted graphic report is exported.
[0129] Embodiment 2
[0130] As Figure 4 shown, the EEG feature visual analysis system for emotion computing according to the present invention integrates six interactive views, and these views work together to achieve four functional modules: (1) a feature optimization module, which integrates a feature optimization algorithm to eliminate individual differences in EEG features; (2) a feature evaluation module, which integrates a feature evaluation method to analyze the quality of the optimized features and verify the effectiveness of the optimization algorithm; (3) an abnormal feature inspection module, which integrates an abnormal feature inspection method to achieve the positioning and verification of abnormal features in EEG signals with low signal-to-noise ratio; (4) a feature derivation module, which realizes the export of the optimized feature set and the generation of a visualization report.
[0131] Among them, Figure 4 the dotted area represents the chart design within each view, and the elliptical area represents the feature visual analysis method for realizing the function of this view. The specific description is as follows:
[0132] (1)Feature optimization module
[0133] This module is implemented by a user panel and a log view. AsFigure 5 For part A, the user panel integration feature optimization method includes within-subject dynamic normalization, contrast learning, and collaborative cross-attention. These three methods can be implemented individually or in combination. As Figure 5 For part B, the log view saves a traceable optimization history in the form of a timeline.
[0134] (2)Feature evaluation module
[0135] Refer to Figure 5 For part C of , this module is implemented by the feature view. This view integrates methods for feature distribution pattern analysis, clustering analysis, individual difference analysis, and correlation analysis to comprehensively evaluate the feature optimization effect.
[0136] Among them, the clustering scatter plot ( Figure 5 part c1 of ) analyzes the feature distribution pattern after t-SNE dimensionality reduction. The global box plot ( Figure 5 part c4 of ) compares the distribution differences across subjects by analyzing the median, spread range, and outliers of each subject's features.
[0137] The five-sided radar chart ( Figure 5 part c2 of ) shows feature quality indicators such as clustering and correlation, and the double-ring dashboard ( Figure 5 part c3 of ) compares the classification accuracy across subjects. The above visualization analysis results and quantitative metrics provide a qualitative and quantitative combined reference basis for the selection of optimization strategies.
[0138] (3)Abnormal feature inspection module
[0139] This module is implemented by the localization view and the EEG visualization view. In the localization view, Figure 5 parts d1 and d3 of respectively show the quantitative and qualitative analysis results of two outlier detection metrics, IQR (interquartile range) and NSR (noise ratio). When a trial shows a high IQR or NSR value, the system will identify it as an abnormal trial and highlight it in d1, indicating that further inspection is required.
[0140] The EEG visualization view provides a multi-domain feature visualization function to support the verification analysis of abnormal features. Figure 5 Part e1 of is a spatio-temporal feature map, including time-domain waveforms and brain topographies. Figure 5 Part e2 of is a time-frequency feature map. The time-frequency spectrum shows the time-varying characteristics of the energy in each frequency band: the horizontal axis represents the time series, the vertical axis represents the frequency range, and the color shade encodes the energy intensity. This view synchronously displays (1 - 4Hz), (4 - 8Hz), (8 - 13Hz), (13 - 30Hz), The spectral distribution diagrams of five frequency bands (30 - 65 Hz) are provided to offer a multi-scale analysis perspective from the time-frequency domain to the frequency domain. When continuous energy accumulation appears near 50 Hz in the time-frequency spectrum, or the spectral distribution diagram shows narrow-band spike characteristics in this frequency band, it can be determined that the current data contains power frequency interference components. Figure 5 The e3 part is the spatio-frequency feature map, which shows the spatial distribution characteristics of five-band differential entropy (DE) and power spectral density (PSD) through comparison with the electroencephalogram topographic matrix.
[0141] This view designs a multi-level screening strategy to achieve efficient anomaly inspection from overview to details: typical time windows and electrode combinations related to emotions are preset in the interactive interface, manual fine-tuning of the time range boundary is supported, and focusing from multi-electrode combinations to single-electrode signals along the spatial dimension is supported.
[0142] (4) Feature Export Module
[0143] This module is implemented through the export panel ( Figure 5 the F part of), and users can summarize the analysis conclusions, select visualization charts, and generate, preview, and export PDF reports in the panel. In addition, users can also export specific feature data files as needed.
[0144] Embodiment 3
[0145] Referring to Figure 6 , this embodiment relates to a computing device including a memory and a processor, wherein executable code is stored in the memory, and when the processor executes this code, the electroencephalogram feature visual analysis method described in Embodiment 1 is implemented.
[0146] Embodiment 4
[0147] This embodiment relates to a computer-readable storage medium with a program stored thereon, and when this program is executed by a processor, the electroencephalogram feature visual analysis method described in Embodiment 1 is implemented.
[0148] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the embodiments of the present invention are not limited to any specific combination of hardware and software.
[0149] The specific embodiments of the present invention disclosed above are only for illustration, but the present invention is not limited thereto. Those skilled in the art can make various modifications to the present invention without departing from the spirit and scope of the present invention. Obviously, these modifications should all fall within the protection scope required by the present invention.
Claims
1. A visual analysis method of EEG features for affective computing, characterized in that: The following steps are involved: (1) Feature optimization: A progressive optimization algorithm is designed to eliminate individual differences in EEG emotional features. Intra-subject dynamic normalization is used to eliminate baseline differences between individuals. A contrastive learning algorithm is used to extract differential entropy features DE that are aligned across subjects. A collaborative cross-attention mechanism is introduced to achieve dynamic complementary fusion of differential entropy features DE and power spectral density features PSD. (11) Within-subject dynamic normalization includes: eliminating baseline differences between individuals through a subject-by-subject normalization strategy; using an adaptive dynamic normalization method to achieve a dynamic balance between global and local statistics; and performing the following specific steps: (111) For each subject’s data, initialize its global mean and standard deviation ; (112) Use a sliding window to traverse the samples of the current subject and calculate the window in real time Local statistics within and ; (113) Through dynamic weight Realize the fusion of global and local statistics to obtain dynamic statistics and : (114) Based on dynamic statistics, the original data in the window is Z-Score standardized and mapped to a unified space with zero mean and unit standard deviation; (115) Dynamic decay during traversal value, while retaining the global statistical characteristics, gradually enhancing the adaptability to the dynamic characteristics of EEG time series; (12) Contrastive learning pre-training includes: in the standardized feature space, optimizing the intra-class compactness and inter-class separation of the feature space through positive and negative sample pairs constrained by the emotional states of the subjects, so that the feature distance of the same emotional state is reduced and the feature distance of different emotional states is expanded, thereby learning emotional representations with consistency across subjects; (13) Collaborative cross-attention fusion includes: extracting the differential entropy feature DE from the encoder of the contrastive learning algorithm, introducing the collaborative cross-attention mechanism, and realizing the dynamic complementary fusion of the differential entropy feature DE and the power spectral density feature PSD; (2) Feature evaluation: Construct a multidimensional evaluation system to evaluate feature quality from multiple perspectives, including feature distribution pattern, individual difference coefficient, aggregation and correlation, and verify the effectiveness of the feature optimization method; the multidimensional evaluation system specifically includes: (21) Distribution pattern analysis: The t-SNE algorithm is used to reduce high-dimensional features to two-dimensional space, and cluster visualization is used to achieve qualitative analysis of distribution differences across subjects; (22) Cluster analysis: Define the individual clustering IA index to quantify the degree of intra-subject clustering of feature points in two-dimensional space; during the calculation, randomly select 20% of the samples to construct multiple rounds of iterations; (23) Individual difference analysis: The individual difference index (IDI) is proposed to measure the inter-class distribution differences of different subjects in two-dimensional space; (24) Correlation analysis: The subject correlation IC index is proposed, and a non-parametric method based on k-nearest neighbor distance entropy estimation is used to quantify the nonlinear correlation strength between EEG features and subject identity labels; (3) Abnormal feature inspection: Establish an inspection mechanism that combines outlier detection with multi-domain visual analysis to locate and inspect abnormal features in low signal-to-noise ratio EEG signals; (4) Feature export: Generate and export optimized and exception-processed feature files and visual graphic reports.
2. The method for visual analysis of EEG features for emotional computing according to claim 1, characterized in that: The step (12) of contrastive learning pre-training specifically includes: (121) In the sampler, positive and negative sample pairs are extracted across subjects in batches, where the positive sample pairs are from the same emotional state and the negative sample pairs are from different emotional states; (122) In the encoder, a spatiotemporal dual convolutional architecture is used to extract low-dimensional emotion feature representation from high-dimensional EEG signals; (123) In the projector, the features output by the encoder are mapped to a comparison space where similarity can be calculated through a mapping structure that combines a spatiotemporal dual convolutional layer with an average pooling layer; (124) The encoder and projector parameters are optimized through the InfoNCE loss function to maximize the cosine similarity of positive sample pairs and minimize the cosine similarity of negative sample pairs, forcing the network to learn emotional representations that are invariant across subjects.
3. The method for visual analysis of EEG features for emotional computing according to claim 1, characterized in that: The step (13) of collaborative cross attention fusion specifically includes: (131) Dimension alignment: Use a multi-layer perceptron network to align the dimensions of the power spectral density feature PSD and the differential entropy feature DE; (132) Attention calculation, including: Calculate the attention weights in the DE-PSD direction : Generate the query matrix by linear transformation of the PSD feature matrix , and convert the DE feature matrix into a key matrix , is the feature dimension scaling factor; the specific formula is as follows: PSD-DE directional attention weight The calculation adopts a mirror structure: converting DE features into query matrices , and map the PSD features to a key matrix ; (133) Feature fusion, including: A weighted strategy is used to generate the fused feature representation; for DE, the original feature vector With attention weight Perform weighted combination to generate enhanced DE features containing PSD information ; The formula is as follows: For PSD, the original feature vector With the weight matrix Perform fusion operation to obtain the fused PSD feature representation ; Dynamic integration through adaptive gated fusion mechanism and , generating the final emotion representation .
4. The method for visual analysis of EEG features for affective computing according to claim 1, characterized in that: In each iteration of step (22), the following operations are performed: (221) Cluster analysis: Perform k-means clustering on the two-dimensional features, use the subject feature slice corresponding to the current sample index as the initial cluster center, and assign class labels to all samples; (222) Calculation of individual aggregation rate: For each subject, count the maximum number of samples with the same cluster label, and calculate the ratio of the maximum number to the total number of samples, which is defined as the individual aggregation rate of the subject. (223) Step aggregation rate calculation: Calculate the mean of the individual aggregation rates of all subjects as the step aggregation rate of the current iteration round; The average of the aggregation rates of all iteration steps is output as the individual aggregation IA.
5. The method for visual analysis of EEG features for emotional computing according to claim 1, characterized in that: Step (23) specifically includes: (231) For each subject’s two-dimensional data, Gaussian kernel density estimation is used to construct its probability distribution model; (232) For any two subjects , based on its density distribution, calculate the Jensen-Shannon divergence ; (233) Calculate the JS divergence of all pairs of subjects and construct the matrix , n is the total number of subjects; the final global individual difference index is defined as the mean of the upper or lower triangular part of the matrix D, excluding the diagonal elements.
6. The method for visual analysis of EEG features for emotional computing according to claim 1, characterized in that: Step (24) specifically includes: (241) Align the continuous EEG feature Y with the discrete subject identity label X to form an observation data pair ; (242) For each data point , calculate its local mutual information: in, is the digamma function, which is used to estimate the local entropy value, N is the total number of samples, is with The number of samples of the same type, Defined as The number of samples in the neighborhood, the neighborhood radius is The kth nearest neighbor distance of (243) The individual correlation index IC is obtained by averaging the local mutual information of all data points.
7. The method for visual analysis of EEG features for emotional computing according to claim 1, characterized in that: The multi-domain visual analysis described in step (3) includes: constructing a joint analysis framework of the time-space domain, the time-frequency domain, and the space-frequency domain, specifically including: Temporal and spatial domain anomaly analysis: Combine dynamic EEG waveform superposition visualization with brain topography spatial mapping to identify electrode contact anomalies; through the interactive design of single-channel focus display and multi-channel context hiding, ensure the accuracy of anomaly inspection and avoid visual interference caused by signal overlap; Time-frequency domain anomaly analysis: Capture the time-varying characteristics of energy in each frequency band through time-frequency spectrum coding technology, and focus on identifying 50 / 60Hz power frequency interference noise; design a multi-level screening strategy to achieve efficient anomaly inspection from overview to details: preset typical emotion-related time windows and electrode combinations in the interactive interface, support manual fine-tuning of time range boundaries, and support gradual focusing from multi-electrode combinations to single-electrode signals along the spatial dimension; Abnormal analysis in the spatial-frequency domain: The spatial distribution characteristics of the five-band differential entropy features DE and power spectral density features PSD are displayed by comparing the brain topography matrix, realizing the correlation analysis of frequency-space domain features.
8. A visual analysis system of EEG features for affective computing, characterized in that: Feature optimization module: Design a progressive optimization algorithm to eliminate individual differences in EEG emotional features, adopt a dynamic standardization strategy within the subject to eliminate baseline differences between individuals, use a contrastive learning algorithm to extract differential entropy features DE aligned across subjects, and introduce a collaborative cross-attention mechanism to achieve dynamic complementary fusion of differential entropy features DE and power spectral density features PSD; (11) Within-subject dynamic normalization includes: eliminating baseline differences between individuals through a subject-by-subject normalization strategy; using an adaptive dynamic normalization method to achieve a dynamic balance between global and local statistics; and performing the following specific steps: (111) For each subject’s data, initialize its global mean and standard deviation ; (112) Use a sliding window to traverse the samples of the current subject and calculate the window in real time Local statistics within and ; (113) Through dynamic weight Realize the fusion of global and local statistics to obtain dynamic statistics and : (114) Based on dynamic statistics, the original data in the window is Z-Score standardized and mapped to a unified space with zero mean and unit standard deviation; (115) Dynamic decay during traversal value, while retaining the global statistical characteristics, gradually enhancing the adaptability to the dynamic characteristics of EEG time series; (12) Contrastive learning pre-training includes: in the standardized feature space, optimizing the intra-class compactness and inter-class separation of the feature space through positive and negative sample pairs constrained by the emotional states of the subjects, so that the feature distance of the same emotional state is reduced and the feature distance of different emotional states is expanded, thereby learning emotional representations with consistency across subjects; (13) Collaborative cross-attention fusion includes: extracting the differential entropy feature DE from the encoder of the contrastive learning algorithm, introducing the collaborative cross-attention mechanism, and realizing the dynamic complementary fusion of the differential entropy feature DE and the power spectral density feature PSD; Feature evaluation module: Construct a multidimensional evaluation system to evaluate feature quality from multiple perspectives, including feature distribution pattern, individual difference coefficient, aggregation and correlation, and verify the effectiveness of feature optimization methods; the multidimensional evaluation system specifically includes: (21) Distribution pattern analysis: The t-SNE algorithm is used to reduce high-dimensional features to two-dimensional space, and cluster visualization is used to achieve qualitative analysis of distribution differences across subjects; (22) Cluster analysis: Define the individual clustering IA index to quantify the degree of intra-subject clustering of feature points in two-dimensional space; during the calculation, randomly select 20% of the samples to construct multiple rounds of iterations; (23) Individual difference analysis: The individual difference index (IDI) is proposed to measure the inter-class distribution differences of different subjects in two-dimensional space; (24) Correlation analysis: The subject correlation IC index is proposed, and a non-parametric method based on k-nearest neighbor distance entropy estimation is used to quantify the nonlinear correlation strength between EEG features and subject identity labels; Abnormal feature inspection module: establishes an inspection mechanism combining outlier detection with multi-domain visual analysis to locate and inspect abnormal features in EEG signals with low signal-to-noise ratio; Feature export module: Generates and exports optimized and exception-processed feature files and visual graphic reports.
Citation Information
Patent Citations
Brain function connectivity visualization method and system based on EEG
CN118468131A
Method and apparatus for processing electroencephalogram signal, computer-readable medium, and computer device
WO2024174575A1