An electroencephalogram emotion classification method and system based on multiple fractal features
By extracting Hurst and singular indices using multifractal feature analysis and combining them with a support vector machine classifier, the accuracy of EEG emotion recognition in existing technologies is insufficient, achieving more efficient emotion classification results.
Patent Information
- Application Number
- CN202411569240.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-11-05
AI Technical Summary
Existing EEG emotion recognition technologies rely on traditional linear features and signal processing methods, which make it difficult to effectively capture complex patterns and dynamic changes in EEG signals, resulting in insufficient accuracy and reliability in emotion classification.
The Hurst index and singularity index of EEG data were extracted using multifractal feature analysis and combined with classifiers such as support vector machines to construct an EEG emotion classification system. Non-stationary signals were processed by multifractal detrending fluctuation analysis to enhance the ability to remove signal trends.
It improves the accuracy and robustness of emotion classification, enhances the ability to capture instantaneous emotional changes, and improves the performance of emotion classification.
Smart Images

Figure CN119494036B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of electroencephalogram (EEG) processing and emotion recognition, and particularly relates to an EEG emotion classification method and system based on multi-fractal features. BACKGROUND
[0002] Electroencephalogram (EEG) is a technique for recording brain electrical activity, which can capture the brain's response to different stimuli, including emotional changes. Emotional state is closely related to the electrical activity of the brain, so EEG data analysis has important application in emotion recognition. However, current emotion recognition techniques still have certain limitations. These techniques mostly rely on traditional signal processing methods, such as power spectral density analysis and linear feature extraction, which may not effectively capture the complex patterns and dynamic changes in EEG signals.
[0003] In addition, EEG signals themselves have high nonlinearity and dynamics, which makes it difficult for traditional linear analysis methods to fully utilize the rich information they contain. In addition, the high dimensionality of EEG data and background noise also pose challenges to the accuracy and reliability of emotion classification. Therefore, developing a new method that can more comprehensively analyze the complex patterns in EEG signals is crucial to improving the performance of emotion recognition.
[0004] The application of fractal theory in EEG signal analysis is based on its unique ability to describe the complexity and self-similarity of signals. Fractal features, such as fractal dimension, provide a method for quantifying the complexity of EEG signals. This complexity reflects the dynamic changes and nonlinear characteristics of brain activity, which are closely related to changes in emotional state. Traditional linear features may not fully capture this complexity, while fractal features can reveal hidden patterns and structures in EEG signals.
[0005] In the context of emotion classification, the use of fractal features can improve the accuracy of recognition. Emotional states (such as happiness, sadness, neutrality, and anger) are associated with specific patterns of electrical activity in the brain, and these patterns may exhibit unique features in fractal analysis. Therefore, by analyzing the fractal features of EEG signals, different emotional states can be more effectively distinguished, thereby improving the performance of emotion classification systems. However, existing EEG emotion classification methods rely on traditional fractal feature extraction (such as fractal dimension and box counting method), although they have achieved certain results, but there are limitations in feature selection, classification accuracy and sensitivity to dynamic changes. SUMMARY
[0006] Therefore, the present application provides an EEG emotion classification method based on multi-fractal features, which can accurately and effectively perform emotion recognition.
[0007] The electroencephalogram emotion classification method based on the multi-fractal feature of the application comprises the following steps:
[0008] The Hurst index and the quality index of the electroencephalogram data are extracted by using the multi-fractal analysis method; the derivative of the quality index is obtained to obtain the singular index;
[0009] The Hurst index and the singular index of the electroencephalogram data are taken as the fractal features to perform electroencephalogram emotion classification.
[0010] Further, the Hurst index and the singular index of the electroencephalogram data are extracted by using the multi-fractal analysis method, and specifically:
[0011] S1, for the collected electroencephalogram data sequence {x k}, the mean value of the sequence {x k} is calculated
[0012]
[0013] Wherein, N is the length of the electroencephalogram data sequence;
[0014] S2, the cumulative deviation of the i-th electroencephalogram data is calculated:
[0015]
[0016] S3, the cumulative deviation sequence {Y(i)} is divided into several equal-length subintervals;
[0017] S4, for each subinterval, the points in the subinterval are fitted by the k-order polynomial of the least square method:
[0018] y v (m)=a1m k +a2m k-1 ++a k m+a k+1
[0019] Wherein, m=1,2,…,s, s is the total number of data in the subinterval;
[0020] S5, for each sample interval, the mean square error F 2 (s,v) of the sample data is calculated;
[0021] S6, the average value of F 2 (s,v) is taken to obtain the q fluctuation function F q (s):
[0022]
[0023] Wherein, q is any non-zero real number;
[0024] S7, draw a function relationship graph of "ln[F q (s)]-lns", and the slope in the function relationship graph is the Hurst index H(q);
[0025] S8, calculate the quality index τ(q):
[0026] τ(q)=qH(q)-1
[0027] S9, calculate the singularity index α:
[0028]
[0029] Further, in the S3, the cumulative deviation sequence Y(i) is divided into N S sub-intervals, wherein If s cannot be divided by N, the sequence is shifted back by one item until the remaining part of the sequence is included, and then the shifted sequence is divided into N S sub-intervals; finally, 2N S equal-length sub-intervals are obtained.
[0030] Further, in the S5,
[0031] For intervals v=1,2,,N S , the mean square error F 2 (s,v) is calculated:
[0032]
[0033] For intervals v=N s +1,N s +2,,2N s , the mean square error F 2 (s,v) is calculated:
[0034]
[0035] Further, the multi-fractal detrended fluctuation analysis method is a multi-fractal detrended fluctuation analysis method.
[0036] Further, the classifier used for electroencephalogram emotion classification is a decision tree, a support vector machine, a logistic regression, or a random forest.
[0037] Further, a sample set is constructed, the classifier is trained based on the sample set, and the trained classifier is used to complete electroencephalogram emotion classification;
[0038] The construction of the sample set includes:
[0039] S01, collecting electroencephalogram data under different emotions;
[0040] S02, down-sampling the electroencephalogram data of S01;
[0041] S03, removing the electrooculogram signal in the electroencephalogram data using an independent component analysis algorithm;
[0042] S04, segmenting the electroencephalogram signal to correspond to different emotional segments of the subject and removing the electroencephalogram data corresponding to the preparation time of the subject;
[0043] S05, extracting the electroencephalogram sample from the segmented electroencephalogram signal of S04 to form a sample set.
[0044] Further, in S01, the electroencephalogram data of DEAP dataset, SEED dataset, SEED-IV dataset or SEED-V dataset is directly used.
[0045] The application also provides an electroencephalogram emotion classification system based on multiple fractal features, comprising a signal acquisition module, a feature extraction module and a classifier.
[0046] The signal acquisition module is used to acquire electroencephalogram data.
[0047] The feature extraction module extracts the Hurst index and the singularity index of the electroencephalogram data using the above method.
[0048] The classifier takes the Hurst index and the singularity index of the electroencephalogram data as input and outputs the electroencephalogram emotion classification result using the above method.
[0049] Advantages:
[0050] (1) The application uses a multiple fractal feature extraction method to extract the Hurst index and the singularity index of the electroencephalogram data. This feature can more comprehensively reflect the local dynamic change of the signal, improve the robustness of the classification model, and enhance the ability to capture instantaneous emotional changes, thereby effectively improving the performance of emotion classification.
[0051] (2) The multiple fractal detrended fluctuation analysis method is used to extract the Hurst index and the singularity index of the electroencephalogram signal. This method increases the ability to remove the trend of the signal and is more effective in processing non-stationary signals than the multiple fractal analysis method.
[0052] (3) Support vector machine is used as the classifier for emotion classification. Support vector machine has good robustness for high-dimensional data and noise. BRIEF DESCRIPTION OF DRAWINGS
[0053] Figure 1 The flowchart of the method of the application.
[0054] Figure 2 The confusion matrix of the experimental results. DETAILED DESCRIPTION
[0055] The application will be described in detail below with reference to the accompanying drawings and examples.
[0056] The application provides an electroencephalogram emotion classification method and system based on multiple fractal features.
[0057] Electroencephalogram data is a complex data with nonlinear characteristics and fractal characteristics, and the fractal dimension can characterize the morphological features of the electroencephalogram signal, reflect the complexity of the shape in a non-integer dimension, and can well quantify the irregularity and complexity of the electroencephalogram data.
[0058] The application extracts the Hurst index and the singularity index of the electroencephalogram data by using the multiple fractal analysis method, takes the Hurst index and the singularity index of the electroencephalogram data as the fractal features, and realizes electroencephalogram emotion classification in combination with a classifier. The Hurst index is used to measure the long-term memory characteristics of a time series, and its value is usually between 0 and 1; the Hurst index can be used to study the stability and complexity of brain activity, and help to distinguish different brain states (such as relaxation, attention, anxiety, etc.). The singularity index can reflect the local complexity and self-similarity of a signal. The high and low of the singularity index can represent the complexity of the signal, and help to analyze the noise, sudden events or other important features in the signal. The application takes the Hurst index and the singularity index as the fractal features, and can quickly and accurately realize electroencephalogram emotion classification.
[0059] The method for obtaining the Hurst index and the singularity index of the electroencephalogram data is specifically as follows:
[0060] For an electroencephalogram signal sequence {x k} with a length of N, where k=1,2,…,N, the calculation steps of the multiple fractal analysis are as follows:
[0061] S1, calculate the mean value of the sequence sample {x k}
[0062]
[0063] S2, calculate the cumulative deviation of the sample signal:
[0064] Where i=1,2,…,N.
[0065] S3, divide the cumulative deviation sequence {Y(i)} calculated in S2 into N S small intervals, where
[0066]
[0067] If s cannot be divided by N, Y(i) will have some data not used. In order to make full use of the data samples without causing data loss, the divided data samples need to be reused, the sequence is moved backward until the unused data of the sequence is included, and then divided into N S sub-intervals again, finally obtaining 2N S equal-length sub-intervals. In this way, all data of the data samples can be fully utilized to achieve the best effect.
[0068] The following are examples of data lengths that can be divided by 2:
[0069] Example 1: N = 120, s = 40
[0070] 1) Calculate N S :
[0071]
[0072] This means that we can divide the sequence into 3 intervals of length 40.
[0073] 2) Initial division:
[0074] First interval: Y(1) to Y(40)
[0075] Second interval: Y(41) to Y(80)
[0076] Third interval: Y(81) to Y(120)
[0077] In this way, we use all 120 data points, with no remaining data.
[0078] 3) Repeated division:
[0079] Since there is no remaining data, we do not need to repeat the division.
[0080] 4) Final number of intervals:
[0081] We obtain 3 intervals, each of length 40.
[0082] Example 2: N = 127, s = 40
[0083] 1) Calculate N S :
[0084]
[0085] This means that we can divide the sequence into 3 intervals of length 40, but there will be remaining data.
[0086] 2) Initial division:
[0087] First interval: Y(1) to Y(40)
[0088] Second interval: Y(41) to Y(80)
[0089] Third interval: Y(81) to Y(120)
[0090] In this way, we use 120 data points, leaving 7 data points unused.
[0091] 3) Process the remaining data:
[0092] Since the remaining 7 data points are not enough to form a complete interval of length 40, we need to reuse the existing data.
[0093] 4) Repeat the division:
[0094] Move the sequence back 7 data points and divide again:
[0095] First interval: Y(7) to Y(47)
[0096] Second interval: Y(48) to Y(88)
[0097] Third interval: Y(89) to Y(127)
[0098] In this way, we again use 120 data points, covering the previously unused 7 data points.
[0099] 5) Final number of intervals:
[0100] We get 6 intervals, each of length 40.
[0101] S4, perform k-order polynomial fitting on s points in each equal-length subinterval obtained in S3 using the least squares method:
[0102] y v (m)=a1m k +a2m k-1 ++a k m+a k+1
[0103] where m = 1, 2,..., s; k is obtained according to the current data fitting.
[0104] S5, calculate the mean square error:
[0105] If interval v = 1, 2,..., N S , calculate the mean square error F 2 (s, v):
[0106]
[0107] If interval v = N s +1,N s +2,,2N s , calculate mean square error F 2 (s,v):
[0108]
[0109] S6, take average of F 2 (s,v) to get q fluctuation function F q (s):
[0110]
[0111] Where q is any real number not equal to zero; in multifractal analysis, q is an adjustment parameter, used to adjust the sensitivity to different fluctuation intensity of the signal. When q is positive, high amplitude fluctuations will dominate, so that the signal can be more emphasis on the region of violent fluctuations, when q is negative, low amplitude fluctuations will be emphasized, so more attention to the signal in the flat area. F q (s) increases with s in a power law relationship, that is, F q (s)∝s h(q) For each s there is a corresponding function value F q (s), for the slope of the function relationship graph ln[F q (s)]-lns is the generalized Hurst exponent H(q).
[0112] S7, calculate quality index τ(q) through Hurst exponent:
[0113] τ(q)=qH(q)-1
[0114] S8, calculate the singular index α through the quality index τ(q):
[0115]
[0116] The singular index α reflects the interval singularity degree, and is inversely proportional to the singularity.
[0117] The Hurst exponent and the singular index of the electroencephalogram signal can also be extracted by using the multifractal detrended fluctuation analysis method (MF-DFA). MF-DFA is a new multifractal analysis method, which increases the ability to remove the trend of the signal, and is more effective in processing non-stationary signals than the multifractal analysis method.
[0118] S9, normalize the extracted fractal features to ensure they are on the same scale to improve the stability of the model.
[0119] The electroencephalogram emotion classifier of the present application can employ a decision tree, a support vector machine, a logistic regression, a random forest, etc. In this embodiment, a support vector machine (SVM) is employed, which has good robustness to high-dimensional data and noise.
[0120] The electroencephalogram signal sample set under different emotions can be constructed, and divided into a training set, a validation set and a test set according to the proportions of 60%, 20% and 20%, wherein the training set and the validation set, the test set have no intersection. The classifier is trained based on the training set, the trained classifier is verified based on the validation set, and the classification effect is tested based on the test set.
[0121] The sample set can be constructed by collecting electroencephalogram data under different emotions, or based on existing electroencephalogram data sets, such as DEAP data set, SEED data set, SEED-IV data set, or SEED-V data set. In this embodiment, the SEED data set is employed, which is a multi-modal emotion database based on physiological signals generated under movie clip material evoked stimulation. The SEED electroencephalogram data set contains electroencephalogram data of 15 people, which is collected when they watch movie clips. The movie clips are carefully selected to evoke different types of emotions, which are: positive, negative and neutral.
[0122] The specific construction method of the sample set is as follows:
[0123] S01, download the SEED data set from https: / / bcmi.sjtu.edu.cn / ~seed / index.html;
[0124] S02, downsample the electroencephalogram data of the downloaded SEED data set at a sampling rate of 200Hz;
[0125] S03, use independent component analysis algorithm to remove electrooculogram signals in the electroencephalogram data;
[0126] S04, read the signals of 64 brain electrical channels according to the international 10-20 system standard, and the electrode channel order of the SEDD dataset is as follows: FP1, FPZ, FP2, AF3, AF4, F7, F5, F3, F1, FZ, F2, F4, F6, F8, FT7, FC5, FC3, FC1, FCZ, FC2, FC4, FC6, FT8, T7, C5, C3, C1, CZ, C2, C4, C6, T8, TP7, CP5, CP3, CP1, CPZ, CP2, CP4, CP6, TP8, P7, P5, P3, P1, PZ, P2, P4, P6, P8, PO7, PO5, PO3, POZ, PO4, PO6, PO8, CB1, O1, OZ, O2, CB2;
[0127] The 3-second (200*3=600 data points) preparation time of the electroencephalogram data before the test is removed, and then segmented according to the window length of 30 seconds.
[0128] S05, select electroencephalogram data samples to construct a sample set
[0129] Select the electroencephalogram samples S of m subjects from the dataset SEED C×N i, wherein the value range of i is [1, m], the electroencephalogram sample S C×N i has a data dimension of CxN, C is the number of channels, and N is the number of sampling points to be processed. The processed data sample set is {S1, S2,..., S m xCxt}, wherein t is the number of movie clips played in the test.
[0130] The Hurst index and the singularity index of the sample set electroencephalogram signal are taken as the input of the classifier, and the emotional label is taken as the output of the classifier. The classifier is trained, verified and tested, and the classifier parameters are adjusted to improve the performance. The final classifier is used to realize the electroencephalogram emotion classification.
[0131] The test set is used to evaluate the classifier, and the performance indicators such as accuracy, precision, recall rate and F1 score are calculated. The calculation method is as follows:
[0132] Explanation:
[0133] TP (True Positives): True positive, predicted as positive and actually positive;
[0134] FP (False Positives): False positive, predicted as positive but actually negative;
[0135] FN (false Negatives): False negative, predicted as negative but actually positive;
[0136] TN (True Negatives): True negatives, predicted as negative and actually negative.
[0137] (1) Accuracy: The proportion of the number of correct predictions in the total number of positive and negative examples, expressed by the formula:
[0138]
[0139] (2) Precision: Based on the prediction result, the proportion of correct predictions in the samples predicted as positive, expressed by the formula:
[0140]
[0141] (3) Recall: Based on the actual sample, the proportion of correctly predicted positive examples in the total actual positive samples, expressed by the formula:
[0142]
[0143] (4) F1-score: F1-score is the harmonic mean of precision and recall, which can be considered as a comprehensive consideration of the accuracy and sensitivity of the classifier to positive classes, expressed by the formula:
[0144]
[0145] The following will be described in conjunction with specific embodiments:
[0146] The embodiment uses the SEED electroencephalogram data set (https: / / bcmi.sjtu.edu.cn / ~seed / index.html), and the emotion is divided into 3 categories: positive 1, neutral 0 and negative -1; The results are shown in Table 1 and Figure 2
[0147] Table 1
[0148] Precision Recall F1 score Negative (-1) 0.90 0.90 0.90 Neutral (0) 0.96 0.96 0.96 Positive (1) 0.91 0.91 0.91
[0149] Among them, the precision rate reflects the proportion of the model predicting positive samples in this category, specifically, the precision rate of class -1 is 0.90, which means that 90% of the samples predicted as -1 are correct; The precision rate of class 0 is 0.96, which is the best; The precision rate of class 1 is 0.91, which is also good.
[0150] The recall rate represents the ability of the model to correctly identify positive samples. Specifically, the recall rate for class-1 is 0.90, indicating that 90% of all true class-1 samples are correctly identified. The recall rate for class 0 is 0.96, which is the best performance. The recall rate for class 1 is 0.91, which is also good.
[0151] The F1 value is the harmonic mean of precision and recall, which considers both indicators. Specifically, the F1 values for the three classes are between 0.90 and 0.96, indicating that the model performs well and balancedly in each class.
[0152] The overall accuracy of the model is 0.92, indicating that 92% of the samples are correctly classified, which shows that the performance of the model is relatively good.
[0153] In summary, the above is only a preferred embodiment of the present application, and is not intended to limit the scope of protection of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included within the scope of protection of the present application.
Claims
1. A brainwave emotion classification method based on multifractal features, characterized in that, include: The Hurst index and quality index of EEG data were extracted using multifractal analysis; the singularity index was obtained by differentiating the quality index. Specifically: S1, for the collected EEG data sequence Calculate the sequence mean : ,k = 1, 2,…, N Where N is the length of the EEG data sequence; S2, calculate the cumulative deviation of the i-th EEG data: , i=1, 2,…, N S3, the cumulative deviation sequence { Divide it into several equal-length subintervals; S4, for each sub-interval, perform least squares polynomial fitting on the points within the sub-interval: in, = 1, 2, ..., s, where s is the total number of data points in the sub-interval; S5, for each sample interval, calculate the mean square error of its sample data. ; S6, for Take the average value to get Wave function : in, Let be any non-zero real number; S7, draw " — "A function graph, the slope of which is the Hurst exponent." ; S8, Calculate the quality index : S9, Calculate the singularity index : ; A sample set is constructed, using the Hurst index and singularity index of EEG data as fractal features. A classifier is trained based on this sample set, and the trained classifier is used to classify EEG emotions. The sample set is constructed in the following ways: S01, collects EEG data under different emotions; S02, downsampling the EEG data from S01; S03, using independent component analysis algorithm to remove electrooculography signal from EEG data; S04, segment the EEG signals to correspond to different emotional segments during the test, and remove the EEG data corresponding to the test preparation time; S05, extract EEG samples from the segmented EEG signals of S04 to form a sample set.
2. The method as described in claim 1, characterized in that, In S3, the cumulative deviation sequence Divided into There are 10 sub-intervals, among which If s is not divisible by N, shift the sequence forward by terms until the remaining part of the sequence is included, then divide the shifted sequence into... 2 sub-intervals; ultimately resulting in 2 A series of equal-length intervals.
3. The method as described in claim 2, characterized in that, In S5, For interval Calculate the mean square error : For interval Calculate the mean square error : 。 4. The method as described in claim 1, characterized in that, The multifractal detrending fluctuation analysis method is a multifractal detrending fluctuation analysis method.
5. The method according to any one of claims 1 to 4, characterized in that, The classifiers used for EEG emotion classification include decision trees, support vector machines, logistic regression, or random forests.
6. The method as described in claim 1, characterized in that, In S01, EEG data from the DEAP dataset, SEED dataset, SEED-IV dataset, or SEED-V dataset are directly used.
7. A brainwave emotion classification system based on multifractal features, characterized in that, include: Signal acquisition module, feature extraction module, and classifier; The signal acquisition module is used to acquire electroencephalogram (EEG) data. The feature extraction module is used to extract the Hurst index and singularity index from the electroencephalogram (EEG) data. The classifier takes the Hurst index and singularity index of EEG data as input and outputs the EEG emotion classification result. The feature extraction module and the classifier perform feature extraction and EEG emotion classification using the classification method described in any one of claims 1 to 6.
Citation Information
Patent Citations
Emotion recognition system based on depth learning and brain-computer interface as well as application
CN111616721A
Music automatic switching method based on electroencephalogram signals
CN112754502A