Emotion calculation-oriented electroencephalogram feature visual analysis method and system
By adopting progressive optimization algorithms and contrast learning algorithms in EEG emotional data analysis, combined with the collaborative cross-attention mechanism, the problems of individual differences and low signal-to-noise ratio of EEG emotional data are solved, higher quality feature extraction and generalization capabilities across subjects are achieved, and visual analysis tools for multi-dimensional evaluation and abnormal detection are provided.
Patent Information
- Application Number
- CN202510388187.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-03-31
AI Technical Summary
During the feature extraction process, EEG emotional data faces the problems of significant individual differences and low signal-to-noise ratio, which leads to limited generalization ability of cross-subject models, and the existing tools lack effective feature engineering modules and visual analysis functions.
A visual analysis method for EEG features for emotion calculation is proposed. Individual differences are eliminated through a progressive optimization algorithm, dynamic standardization and contrast learning algorithms are used intra-participants to extract differential entropy features aligned across subjects, and a collaborative cross-attention mechanism is introduced to achieve dynamic complementary fusion of differential entropy and power spectral density features. At the same time, a multi-dimensional evaluation system and an inspection mechanism combining outlier value detection and multi-domain visual analysis will be built to improve feature quality and the ability of abnormal feature detection.
It effectively eliminates individual differences in EEG emotional characteristics, improves feature quality and signal-to-noise ratio, realizes better generalization ability across subject models, and provides systematic feature optimization and abnormal handling solutions, lowering the threshold for tool use.
Smart Images

Figure CN119918014A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a visual analysis technology of electroencephalogram (EEG) signals, and in particular to a visual analysis method and system of EEG features for affective computing. Background Art
[0002] Electroencephalogram (EEG) is a physiological signal that records the electrical activity of the brain. Its spatiotemporal-spectral characteristics provide a key basis for revealing the mechanism of brain function and are irreplaceable in neuroscience research and clinical diagnosis. Deep learning has created a new paradigm for EEG analysis. For example, affective computing technology provides an effective way to decode human emotional states and promote the development of brain-computer interfaces.
[0003] In the deep learning-driven EEG analysis framework, the feature extraction stage is responsible for capturing the task-related EEG response patterns, and the model building stage establishes the mapping relationship from feature vectors to target tasks. Among them, feature quality is the core factor that determines task performance. Although deep neural networks have powerful feature learning capabilities, their performance is highly dependent on the quality of input features. In other words, even the optimal classification model can hardly fully compensate for the information loss caused by low-quality features. However, EEG emotion feature extraction faces a double dilemma: first, there are inherent physiological differences in 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; second, noise such as electrooculographic / electromyographic artifacts and power frequency interference leads to a large proportion of outliers in the feature space. These problems make cross-subject modeling of EEG emotion data challenging. Therefore, proposing a systematic feature quality improvement solution has become a key need for current research.
[0004] In terms of processing individual differences, mainstream methods focus on optimizing the architecture of algorithm models, but the black-box nature of the model leads to a lack of interpretability in the feature learning process, and most methods are still at the algorithm prototype stage and have not yet formed a tool application that can be actually deployed. Although existing EEG analysis tools provide preprocessing functions such as denoising, the cumbersome installation and configuration process and reliance on programming skills raise the threshold for their use. More importantly, these tools generally lack feature engineering modules, making it difficult to establish effective connections with downstream tasks (such as sentiment classification). Summary of the invention
[0005] The present invention provides a visual analysis method and system for EEG features for affective computing, and proposes a systematic solution through innovative technology integration, especially for key technical bottlenecks such as significant individual differences and low signal-to-noise ratio in EEG emotion recognition.
[0006] A first aspect of the present invention provides a method for visual analysis of EEG features for affective computing, the method comprising the following steps:
[0007] (1) Feature optimization: A progressive optimization algorithm is designed to eliminate individual differences in EEG emotional features. A dynamic normalization strategy within the subject is used to eliminate baseline differences between individuals. A contrastive learning algorithm is used to extract differential entropy representations that are aligned across subjects. A collaborative cross-attention mechanism is introduced to achieve dynamic complementary fusion of differential entropy and power spectral density features.
[0008] (2) Feature evaluation: Construct a multidimensional evaluation system to evaluate feature quality from multiple perspectives, including feature distribution pattern, individual difference coefficient, clustering and correlation, and verify the effectiveness of feature optimization methods.
[0009] (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.
[0010] (4) Feature export: Generate and export optimized and exception-processed feature files and visual graphic reports.
[0011] The progressive feature optimization algorithm in step (1) specifically includes the following steps:
[0012] (11) Dynamic standardization within subjects: Eliminate baseline differences between individuals through subject-by-subject standardization strategy; use adaptive dynamic standardization method to achieve dynamic balance between global and local statistics. Perform the following specific steps:
[0013] (111) For each subject’s data, initialize its global mean and standard deviation ;
[0014] (112) Use a sliding window to traverse the samples of the current subject and calculate the window in real time Local statistics within and ;
[0015] (113) Through dynamic weight Realize the fusion of global and local statistics to obtain dynamic statistics and :
[0016] (1)
[0017] (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;
[0018] (115) Dynamic decay during traversal The value retains the global statistical characteristics while 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 separation of the feature space are optimized by using 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. The specific steps of this algorithm include:
[0020] (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;
[0021] (122) In the encoder, a spatiotemporal dual convolutional architecture is used to extract low-dimensional emotion feature representation from high-dimensional EEG signals;
[0022] (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;
[0023] (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.
[0024] (13) Collaborative cross-attention fusion: Extract differential entropy (DE) features from the encoder of the contrastive learning algorithm, introduce the collaborative cross-attention mechanism, and realize the dynamic complementary fusion of differential entropy and power spectral density features. The algorithm specifically includes:
[0025] (131) Dimension Alignment: Use a multi-layer perceptron network to align the dimensions of power spectral density (PSD) and differential entropy DE features.
[0026] (132) Attention calculation, including:
[0027] 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:
[0028] (2)
[0029] 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 .
[0030] (133) Feature fusion, including:
[0031] 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:
[0032] (3)
[0033] For PSD, the original feature vector With the weight matrix Perform fusion operation to obtain the fused PSD feature representation Dynamic integration through adaptive gating fusion mechanism and , generating the final emotion representation .
[0034] The multi-dimensional evaluation system described in step (2) specifically includes the following steps:
[0035] (21) Distribution pattern analysis: The t-SNE (t-Distributed Stochastic Neighbor Embedding) 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.
[0036] (22) Individual Aggregation Analysis: Define the Individual Aggregation (IA) indicator to quantify the degree of intra-subject aggregation of feature points in two-dimensional space. During the calculation, 20% of the samples are randomly selected to construct multiple rounds of iterations. In each round of iteration, the following operations are performed:
[0037] (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;
[0038] (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 this value to the total number of samples, which is defined as the individual aggregation rate of the subject.
[0039] (223) Calculation of step aggregation rate: Calculate the mean of the individual aggregation rates of all subjects as the step aggregation rate of the current iteration round.
[0040] The average of the aggregation rates of all iteration 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 differences of different subjects in two-dimensional space. The specific steps are as follows:
[0042] (231) For each subject’s two-dimensional data, Gaussian kernel density estimation is used to construct its probability distribution model;
[0043] (232) For any two subjects , based on its density distribution, calculate the Jensen-Shannon divergence ;
[0044] (233) Calculate the JS divergence of all pairs of subjects and construct the matrix , 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.
[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 nonlinear correlation strength between EEG features and subject identity labels. The following specific steps are performed:
[0046] (241) Continuous EEG features Discrete subject identity labels Align to form observation data pairs ;
[0047] (242) For each data point , calculate its local mutual information:
[0048] (4)
[0049] in, is the digamma function, which is used to estimate the local entropy value. 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
[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 analysis: The interquartile range (IQR) of the sample data is used to identify abnormal features with large fluctuations, and the noise ratio (NSR) is calculated to identify features with high abnormal contamination levels.
[0053] (32) Multi-domain feature visual analysis: Construct a joint analysis framework of the spatiotemporal domain, the time-frequency domain, and the space-frequency domain, including:
[0054] Temporal and spatial domain anomaly analysis: Combine the dynamic overlay visualization of EEG waveforms with the spatial mapping of brain topography to identify electrode contact anomalies; through the interactive design of single-channel focused display and multi-channel context hiding, ensure the accuracy of abnormality inspection and avoid visual interference caused by signal overlap.
[0055] Anomaly analysis in the time-frequency domain: The time-varying characteristics of the energy in each frequency band are captured through time-frequency spectrum coding technology, with a focus on identifying 50 / 60Hz power frequency interference noise; a multi-level screening strategy is designed to achieve efficient anomaly inspection from overview to details: typical emotion-related time windows and electrode combinations are preset in the interactive interface, manual fine-tuning of the time range boundaries is supported, and gradual focusing from multi-electrode combinations to single-electrode signals is supported along the spatial dimension.
[0056] Spatial-frequency domain abnormality analysis: The spatial distribution characteristics of the five-band differential entropy (DE) and power spectral density (PSD) are displayed by comparing the brain topography matrix, realizing the correlation analysis of frequency-spatial domain features.
[0057] The second aspect of the present invention provides an EEG feature visual analysis system for emotional computing, which is used to implement the above-mentioned EEG feature visual analysis method. The system consists of four core functional modules:
[0058] Feature optimization module: Design a progressive optimization algorithm to eliminate individual differences in EEG emotional features, adopt a dynamic normalization strategy within the subject to eliminate baseline differences between individuals, use a contrastive learning algorithm to extract differential entropy representations that are aligned across subjects, and introduce a collaborative cross-attention mechanism to achieve dynamic complementary fusion of differential entropy and power spectral density features.
[0059] Feature evaluation module: Build a multidimensional evaluation system to evaluate feature quality from multiple perspectives such as feature distribution pattern, individual difference coefficient, aggregation and correlation, and verify the effectiveness of feature optimization methods.
[0060] Abnormal feature inspection module: 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.
[0061] Feature export module: Generates and exports optimized and exception-processed feature files and visual graphic reports.
[0062] A third aspect of the present invention relates to a computing device, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the code, the method for visual analysis of EEG features of the present invention can be implemented.
[0063] A 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 method for visual analysis of EEG features of the present invention is implemented.
[0064] The advantages of the present invention are: (1) an analysis framework for the characteristics of EEG emotion data is proposed, and a systematic solution is provided for individual differences and noise problems by building a full-process support for feature optimization-evaluation-abnormality inspection; (2) a progressive feature optimization algorithm is proposed, dynamic standardization within the subject eliminates baseline differences between individuals, a contrastive learning algorithm extracts differential entropy features that are aligned across subjects, and a 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 theoretical frameworks and innovative methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 It is a schematic diagram of the process of the present invention.
[0066] Figure 2 It is a schematic diagram of the contrastive 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 is a schematic diagram of a computing device of the present invention. DETAILED DESCRIPTION
[0071] The present invention will be further described below in conjunction with the accompanying drawings and embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments, and should not be understood as limiting the present invention. Based on the described embodiments, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0072] Example 1
[0073] See also Figure 1 This embodiment relates to a visual analysis method of EEG features for emotional computing, comprising the following steps:
[0074] (1) Feature optimization: Design a progressive optimization algorithm to eliminate individual differences in EEG emotion features, including:
[0075] (11) Dynamic standardization within subjects: The traditional global standardization is replaced by a subject-by-subject standardization strategy to better eliminate baseline differences between individuals. The adaptive dynamic standardization method is used to achieve a dynamic balance between global and local statistics. The specific steps are as follows:
[0076] (111) For each subject’s data, initialize its global mean and standard deviation ;
[0077] (112) Use a sliding window to traverse the samples of the current subject and calculate the window in real time Local statistics within and ;
[0078] (113) Through dynamic weight Realize the fusion of global and local statistics to obtain dynamic statistics and :
[0079] (1)
[0080] (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;
[0081] (115) Dynamic decay during traversal The value retains the global statistical characteristics while gradually enhancing the adaptability to the dynamic characteristics of EEG time series.
[0082] (12) Contrastive learning pre-training: In the standardized feature space, the intra-class compactness and inter-class separation of the feature space are optimized by using 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 that are consistent across subjects. Figure 2 , the steps of contrastive learning algorithm are as follows:
[0083] (121) In the sampler, positive and negative sample pairs are extracted across subjects in batches, where the positive sample pairs are from the same affective state and the negative sample pairs are from different affective states.
[0084] (122) In the encoder, a spatiotemporal dual convolution architecture is used to extract low-dimensional emotional feature representation from high-dimensional EEG signals. The spatial convolution layer maps multi-channel EEG signals to 16 spatial features through a two-dimensional convolution kernel (30 channels × 1 time point); after dimensional rearrangement, the temporal convolution layer extracts 16 temporal features using a convolution kernel with a span of 60, and enhances the nonlinear expression capability through the ELU activation function.
[0085] (123) In the projector, the features output by the encoder are mapped to a comparison space where similarity can be calculated through a structure combining a spatiotemporal dual convolutional layer and an average pooling layer. The average pooling layer compresses the time dimension to 1 / 30 of its original length; the grouped spatial convolution expands the spatial dimension to 32 dimensions with a grouping 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 grouping number of 32, and finally, its output is reshaped to 2304 dimensions.
[0086] d. Contrastive loss: 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.
[0087] (13) Collaborative cross-attention fusion: Introduce the collaborative cross-attention mechanism to achieve dynamic complementary fusion of differential entropy and power spectral density features. Figure 3 , the algorithm includes the following steps:
[0088] (131) Feature extraction and dimension alignment: The pre-aligned differential entropy (DE) features are obtained from the encoder of the contrastive learning algorithm. The power spectral density (PSD) features are subjected to nonlinear mapping using a multi-layer perceptron (MLP), while the DE features are subjected to single-layer linear projection to achieve dimensional unification of the two types of heterogeneous feature vectors.
[0089] (132) Attention calculation and feature fusion, including:
[0090] 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:
[0091] (2)
[0092] 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 .
[0093] 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:
[0094] (3)
[0095] For PSD, the original feature vector With the weight matrix Perform fusion operation to obtain the fused PSD feature representation Dynamic integration through adaptive gating fusion mechanism and , generating the final emotion representation This representation can be input into classifiers such as multi-layer perceptrons to implement cross-subject emotion classification tasks.
[0096] (2) Feature evaluation: Construct a multi-dimensional evaluation system to evaluate the quality of optimized features. Figure 1 Part B includes:
[0097] (21) Distribution pattern analysis: The nonlinear dimensionality reduction algorithm t-SNE maps high-dimensional original features to two-dimensional space and generates a multi-color coded cluster scatter plot. Different colors correspond to samples from different subjects. When the projection space shows multi-cluster separation and the single-color sample dominates the single cluster distribution, it indicates that the features have significant intra-subject aggregation and inter-subject differences.
[0098] (22) Individual clustering analysis: Individual clustering indicators are used to characterize the degree of intra-class clustering of samples from the same subject. During the calculation, in order to improve efficiency and ensure the stability of the results, 20% of the samples are randomly selected to construct multiple rounds of iterations. In each round of iteration, the following operations are performed:
[0099] (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;
[0100] (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 this value to the total number of samples, which is defined as the individual aggregation rate of the subject;
[0101] (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;
[0102] The average of the aggregation rates of all iteration 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 are highly clustered within the class.
[0103] (23) Individual difference analysis: The individual difference index IDI is used to measure the inter-class distribution differences of different subjects in two-dimensional space. The specific calculation steps are as follows:
[0104] (231) For each subject The two-dimensional data is constructed using Gaussian kernel density estimation to construct its probability distribution model;
[0105] (232) For any two subjects , based on its density distribution, calculate the Jensen-Shannon divergence ;
[0106] (233) Calculate the JS divergence of all pairs of subjects and construct the matrix , n is the total number of subjects;
[0107] (234) The global individual difference index is defined as the mean of the upper or lower triangular part of the matrix D, excluding the diagonal elements.
[0108] This index comprehensively reflects the heterogeneity of individual characteristic distribution at the group level: when the IDI value approaches 0, it indicates that the EEG characteristic patterns between different subjects are highly similar; when the IDI value approaches 1, it indicates that there are significant individual differences in the group.
[0109] (24) Individual correlation analysis: The individual correlation IC index is used to quantify the nonlinear correlation strength between EEG features and subject identity labels. Specifically, a non-parametric method based on k-nearest neighbor distance entropy estimation is used to calculate mutual information. The specific steps are as follows:
[0110] (241) Continuous EEG features Discrete subject identity labels Align to form observation data pairs ;
[0111] (242) For each data point , calculate its local mutual information:
[0112] (4)
[0113] in, is the digamma function, which is used to estimate the local entropy value. 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.
[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 the subject’s identity label EEG characteristics Statistically independent, the feature space does not contain identifiable subject identity information. On the contrary, the larger the IC value, the and There is a strong correlation, and the feature representation has the ability to distinguish the identities of the subjects. 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, further investigation is required to find the cause of the abnormality.
[0117] (3) Abnormal feature inspection: Establish an inspection mechanism that combines outlier detection with multi-domain visual analysis, including:
[0118] (31) Outlier detection and analysis: The EEG abnormality feature localization method based on the interquartile range method is used. The specific steps are as follows:
[0119] (311) Calculate the interquartile range of sample data , which is the difference between the third quartile and the first quartile. IQR quantifies the dispersion of the core data distribution and identifies abnormal features with large volatility;
[0120] (312) Setting anomaly detection threshold based on IQR: lower threshold , upper threshold , where c is the preset expansion factor, which is generally set to 1.5; The data points in the range are outliers;
[0121] (313) The noise ratio NSR, defined as the ratio of the number of outliers to the total number of data points, is calculated to identify features with high levels of outlier contamination.
[0122] (32) Multi-domain feature visual analysis: Establish a joint analysis framework of spatiotemporal, time-frequency, and space-frequency domain features to reveal the characteristics of EEG signals in different domains through visualization design and identify potential abnormal patterns;
[0123] During the spatiotemporal analysis, the dynamic overlay visualization of EEG waveforms and the spatial mapping of brain topography are combined to analyze electrode contact abnormalities. The "focus-context" interactive method is used to resolve the visual confusion caused by signal overlap: single channel highlighting is triggered by hovering the mouse, and the remaining channels are hidden in low-saturation form.
[0124] In the process of time-frequency domain analysis, short-time Fourier transform (STFT) is used for signal transformation. The time-frequency-energy three-dimensional time-frequency spectrum is used to encode the time-varying characteristics of the energy in each frequency band. This design can identify 50 / 60Hz 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. The frequency domain signal is then decomposed into five sub-band signals related to emotional activity. The power spectral density PSD of each sub-band signal is then calculated, and the differential entropy DE is calculated by taking the logarithm of the EEG energy spectrum of a specific frequency band. Subsequently, PSD and DE are combined with spatial domain characteristics to construct a multi-band brain topography map to achieve a collaborative analysis of frequency-space dual-domain characteristics.
[0126] (4) Feature export
[0127] After verifying the effectiveness of the feature optimization solution, you can choose to export the optimized feature file.
[0128] Subsequently, summarize the analysis conclusions of the abnormal feature inspection and analysis phase, select the visualization charts to be exported, preview the report content, and finally export the graphic report in PDF format.
[0129] Example 2
[0130] like Figure 4 As shown, the visual analysis system of EEG features for emotional computing described in the present invention integrates six interactive views, which work together to implement 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 optimized features and verify the effectiveness of the optimization algorithm; (3) an abnormal feature inspection module, which integrates an abnormal feature inspection method to locate and verify abnormal features in low signal-to-noise ratio EEG signals; and (4) a feature export module, which realizes the export of optimized feature sets and the generation of visual reports.
[0131] in, Figure 4 The dotted area represents the chart design in each view, and the elliptical area represents the characteristic visual analysis method to realize the function of the view. The details are as follows:
[0132] (1) Feature Optimization Module
[0133] This module is implemented by the user panel and log view. Figure 5 In Part A, the user panel integrates feature optimization methods, including intra-subject dynamic normalization, contrastive learning, and collaborative cross-attention. The three methods can be implemented individually or in combination. Figure 5 In Part B, the log view saves the traceable optimization history in the form of a timeline.
[0134] (2) Feature evaluation module
[0135] See also Figure 5 The C part of the module is implemented by the feature view. This view integrates feature distribution pattern analysis, clustering analysis, individual difference analysis and correlation analysis methods to achieve a comprehensive evaluation of feature optimization effects.
[0136] Among them, the cluster scatter plot ( Figure 5 The c1 part of the t-SNE dimension reduction is used to analyze the feature distribution pattern. Figure 5 (C4) By analyzing the median, spread, and outliers of each subject’s characteristics, the distribution differences across subjects can be compared.
[0137] Five-sided radar chart ( Figure 5 The c2 part of the display shows the characteristic quality indicators such as aggregation and correlation, and the double-ring dashboard ( Figure 5 The c3 part of the above analysis compares the classification accuracy across subjects. The above visualization analysis results and quantitative indicators provide a qualitative and quantitative reference for the selection of optimization strategies.
[0138] (3) Abnormal feature inspection module
[0139] This module is implemented by the positioning view and the EEG visualization view. In the positioning view, Figure 5 The d1 and d3 parts of the figure show the quantitative and qualitative analysis results of the two outlier detection indicators, 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 multi-domain feature visualization capabilities to support verification analysis of abnormal features. Figure 5 The e1 part is the spatiotemporal feature map, which contains the time domain waveform and brain topography map. Figure 5 The e2 part is the time-frequency characteristic diagram. 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 depth encodes the energy intensity. This view displays (1-4Hz), (4-8Hz), (8-13Hz), (13-30Hz), The spectrum distribution diagram of five frequency bands (30-65Hz) provides a multi-scale analysis perspective from the time-frequency domain to the frequency domain. When the spectrum shows continuous energy accumulation near 50Hz, or the spectrum distribution diagram shows a narrowband peak feature in this frequency band, it can be determined that the current data contains power frequency interference components. Figure 5 Part e3 is the space-frequency feature map, which shows the spatial distribution characteristics of the five-band differential entropy (DE) and power spectral density (PSD) through brain topography matrix comparison.
[0141] This view designs a multi-level screening strategy to achieve efficient anomaly detection from overview to details: typical emotion-related time windows and electrode combinations are preset in the interactive interface, manual fine-tuning of the time range boundaries is supported, and gradual 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 In the F section of the dashboard, users can summarize analysis conclusions, select visualization charts, and generate, preview, and export PDF reports. In addition, users can also export specific feature data files as needed.
[0144] Example 3
[0145] Reference Figure 6 This embodiment relates to a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the code, it implements the visual analysis method of EEG features described in Example 1.
[0146] Example 4
[0147] This embodiment relates to a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the method for visual analysis of EEG features 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 methods, systems or computer program products. Therefore, the embodiments of the present invention are not limited to any specific combination of hardware and software.
[0149] The above disclosure is only a specific embodiment of the present invention, but the present invention is not limited thereto, and those skilled in the art may 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 scope of protection 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 inter-individual baseline differences. A contrastive learning algorithm is used to extract differential entropy representations that are aligned across subjects. A collaborative cross-attention mechanism is introduced to achieve dynamic complementary fusion of differential entropy and power spectral density features. (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 feature optimization methods. (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 progressive feature optimization algorithm in step (1) specifically includes the following steps: (11) Dynamic standardization within subjects: Eliminate baseline differences between individuals through a subject-by-subject standardization strategy; use an adaptive dynamic standardization method to achieve a dynamic balance between global and local statistics; perform 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 : (1) (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: In the standardized feature space, the intra-class compactness and inter-class separation of the feature space are optimized by using 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 that are consistent across subjects; (13) Collaborative cross-attention fusion: The differential entropy features are extracted from the encoder of the contrastive learning algorithm, and the collaborative cross-attention mechanism is introduced to achieve dynamic complementary fusion of differential entropy and power spectral density features.
3. The method for visual analysis of EEG features for emotional computing as claimed in claim 2, 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.
4. The method for visual analysis of EEG features for emotional computing according to claim 2, 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 power spectral density (PSD) and differential entropy (DE) features; (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: (2) 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: (3) 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 .
5. The method for visual analysis of EEG features for emotional computing according to claim 1, characterized in that: The multi-dimensional evaluation system described in step (2) 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: A 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.
6. The method for visual analysis of EEG features for affective computing according to claim 5, 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 this value 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.
7. The method for visual analysis of EEG features for emotional computing according to claim 5, 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 test pairs 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.
8. The method for visual analysis of EEG features for emotional computing according to claim 5, characterized in that: Step (24) specifically includes: (241) Continuous EEG features Discrete subject identity labels Align to form observation data pairs ; (242) For each data point , calculate its local mutual information: (4) in, is the digamma function, which is used to estimate the local entropy value. 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.
9. 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; Spatial-frequency domain abnormality analysis: The spatial distribution characteristics of the five-band differential entropy (DE) and power spectral density (PSD) are displayed by comparing the brain topography matrix, realizing the correlation analysis of frequency-spatial domain features.
10. 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 representations aligned across subjects, and introduce a collaborative cross-attention mechanism to achieve dynamic complementary fusion of differential entropy and power spectral density features; Feature evaluation module: build a multi-dimensional 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; Abnormal feature inspection module: establish 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
Emotion recognition method based on brain asymmetry and multi-angle fusion network
CN119007073A
Method and apparatus for processing electroencephalogram signal, computer-readable medium, and computer device
WO2024174575A1