Method, device and equipment for extracting and reducing dimensionality of electroencephalogram signal features of smart glasses
Through the multi-stage integrated feature extraction and dimensionality reduction method, combined with core principal component analysis and dictionary learning, the problems of high computational complexity and poor feature interpretation in smart glasses are solved, and efficient and robust EEG signal feature extraction and dimensionality reduction are achieved, improving signal quality and analysis accuracy.
Patent Information
- Application Number
- CN202510578239.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-05-07
AI Technical Summary
Traditional EEG signal feature extraction methods have problems in smart glasses with high computational complexity, poor feature interpretation, and neglecting local features and detailed information, especially in portable devices, which are low in signal quality and difficult to effectively extract and analyze.
A multi-stage integration method is adopted, combined with core principal component analysis, dictionary learning and feature atomic recombination technology, and the EEG signal is decomposed and recombined through time-domain, frequency-domain and time-frequency-domain feature extraction, low-dimensional nonlinear feature representation is generated, and dimensionality reduction is used using kernel matrix mapping and principal component analysis.
It improves the characterization ability of EEG signals, enhances the robustness and interpretability of features, reduces the use of computing resources, is suitable for real-time processing of embedded devices, and improves the accuracy and efficiency of feature extraction.
Smart Images

Figure CN120105071B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of brain-computer interfaces, and particularly to a method, device, and equipment for extracting and reducing the dimensionality of electroencephalogram (EEG) signals of smart glasses. Background Art
[0002] With the development of wearable device technology, as a new type of human-computer interaction device, smart glasses can collect users' EEG signals in real time and portably by integrating micro-EEG sensors, showing broad application prospects in the fields of brain-computer interfaces, neurological disease diagnosis, emotion recognition, etc. However, EEG signals have characteristics such as non-stationarity, non-linearity, and high dimensionality. Especially for the EEG signals collected by portable devices such as smart glasses, due to factors such as device volume limitations, limited number of electrodes, large environmental interference, and variable user activity states, the signal quality is low, which poses greater challenges to feature extraction and analysis.
[0003] To overcome the above difficulties, researchers have proposed various improved methods for extracting and reducing the dimensionality of EEG signals. Among them, kernel method-based feature extraction techniques, such as Kernel Principal Component Analysis (KPCA), map the original data to a high-dimensional feature space through non-linear mapping and perform principal component analysis in the high-dimensional space, which can effectively capture the non-linear structure and features of the data. However, traditional KPCA methods still have some limitations, such as high computational complexity and poor feature interpretability. In addition, KPCA mainly focuses on the global structure of the data and may ignore local features and detailed information.
[0004] Therefore, there is an urgent need for a method to solve at least one of the above problems. Summary of the Invention
[0005] The embodiments of this application provide a method, device, and equipment for extracting and reducing the dimensionality of EEG signals of smart glasses. The method aims to solve the problems of existing kernel method-based feature extraction techniques, such as Kernel Principal Component Analysis (KPCA), which map the original data to a high-dimensional feature space through non-linear mapping and perform principal component analysis in the high-dimensional space, and can effectively capture the non-linear structure and features of the data. However, traditional KPCA methods still have some limitations, such as high computational complexity and poor feature interpretability. In addition, KPCA mainly focuses on the global structure of the data and may ignore local features and detailed information.
[0006] In a first aspect, the embodiments of this application provide a method for extracting and reducing the dimensionality of EEG signals of smart glasses, including:
[0007] Collect the electroencephalogram (EEG) signals of the wearer according to the micro dry electrodes in the smart glasses frame and temple, form an EEG signal data set, extract time-domain, frequency-domain, and time-frequency-domain features according to the EEG signal data set, and generate an original feature set;
[0008] Decompose each feature vector in the original feature set to obtain a feature atom set. In the feature atom set, obtain the response corresponding to each feature atom, merge the feature atoms corresponding to each response into a feature group, and regenerate the feature atom set according to multiple feature groups;
[0009] Based on the feature atom set, perform atomic-level recombination on each feature vector in the original feature set to generate a recombined feature set; calculate the kernel matrix corresponding to the recombined feature set, map the kernel matrix to a high-dimensional kernel space, perform principal component analysis according to the original feature set, and obtain a kernel principal component projection matrix;
[0010] Use the kernel principal component projection matrix to project the feature set into a low-dimensional space, and combine it with the EEG signal data set to generate a low-dimensional non-linear feature representation, completing the extraction and dimensionality reduction of the EEG signal features of the smart glasses.
[0011] In a second aspect, the present application also provides a device for extracting and reducing the dimensionality of EEG signal features of smart glasses, including:
[0012] A set acquisition unit, configured to collect the EEG signals of the wearer according to the micro dry electrodes in the smart glasses frame and temple, form an EEG signal data set, extract time-domain, frequency-domain, and time-frequency-domain features according to the EEG signal data set, and generate an original feature set;
[0013] A vector decomposition unit, configured to decompose each feature vector in the original feature set to obtain a feature atom set. In the feature atom set, obtain the response corresponding to each feature atom, merge the feature atoms corresponding to each response into a feature group, and regenerate the feature atom set according to multiple feature groups;
[0014] An atomic recombination unit, configured to perform atomic-level recombination on each feature vector in the original feature set based on the feature atom set to generate a recombined feature set; calculate the kernel matrix corresponding to the recombined feature set, map the kernel matrix to a high-dimensional kernel space, perform principal component analysis according to the original feature set, and obtain a kernel principal component projection matrix;
[0015] A dimensionality reduction completion unit is used to project the feature set into a low-dimensional space by using the kernel principal component projection matrix, and generate a low-dimensional non-linear feature representation in combination with the EEG signal data set, so as to complete the feature extraction and dimensionality reduction of the EEG signals of the smart glasses.
[0016] In a third aspect, the present application further provides a computer device, including a processor and a memory. The memory is used to store a computer program, and when the computer program is executed by the processor, it implements the method for extracting and reducing the dimensionality of the EEG signals of the smart glasses as described in the first aspect.
[0017] This method collects EEG signals through the micro dry electrodes on the frame / leg of the smart glasses, extracts time-domain, frequency-domain, and time-frequency-domain features, and generates an original feature set; decomposes the original feature vectors to obtain a feature atom set, generates a new feature group through response merging, and reconstructs the feature atom set; calculates the kernel matrix for the recombined feature set and maps it to a high-dimensional kernel space, and generates a kernel principal component projection matrix in combination with principal component analysis (PCA); uses the projection matrix to reduce the dimensionality of the features to a low-dimensional space, and generates a standardized low-dimensional non-linear feature representation in combination with the original data.
[0018] By simultaneously extracting time-domain, frequency-domain, and time-frequency-domain features, the problem of incomplete information in a single feature dimension is overcome, and the representation ability of EEG signals is improved; through feature atom decomposition and recombination, noise interference and effective signal components are separated, and the feature robustness is improved; kernel principal component analysis (KPCA) effectively processes high-dimensional non-linear data, avoids the linear hypothesis limitation of traditional PCA, and retains discriminant information; combines the physical characteristics of the micro dry electrodes of the smart glasses to design a dimensionality reduction process, reduces the occupation of computing resources, and is suitable for real-time processing by embedded devices; labels the physical meaning and reliability index of the low-dimensional features, and enhances the interpretability of the features in brain-computer interface (BCI) tasks.
[0019] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. Description of the Drawings
[0020] Figure 1 It is a schematic flow chart of the method for extracting and reducing the dimensionality of the EEG signals of the smart glasses shown in the embodiments of the present application;
[0021] Figure 2 It is a schematic structural diagram of the device for extracting and reducing the dimensionality of the EEG signals of the smart glasses shown in the embodiments of the present application;
[0022] Figure 3 It is a schematic structural diagram of the computer device shown in the embodiments of the present application. Detailed Embodiments
[0023] In the following description, specific details such as specific system architectures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.
[0024] It should be understood that when used in the specification and claims of the present application, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0025] It should also be understood that the term "and / or" used in the specification and claims of the present application refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0026] As used in the specification and claims of the present application, the term "if" can be interpreted as "when" or "once" or "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrases "if determined" or "if [the described condition or event] is detected" can be interpreted as meaning "once determined" or "in response to determining" or "once [the described condition or event] is detected" or "in response to detecting [the described condition or event]" depending on the context.
[0027] In addition, in the description of the specification and claims of the present application, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.
[0028] The reference to "one embodiment" or "some embodiments" etc. described in the specification of the present application means that a specific feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "comprising", "including", "having", and their variants all mean "including but not limited to", unless otherwise specifically emphasized in another way.
[0029] The technical solutions of the embodiments of the present application are introduced below.
[0030] With the development of wearable device technology, as a new type of human-computer interaction device, smart glasses can collect users' electroencephalogram (EEG) signals in real-time and portably by integrating micro-EEG sensors, showing broad application prospects in the fields of brain-computer interfaces, neurological disease diagnosis, emotion recognition, etc. However, EEG signals have characteristics such as non-stationarity, non-linearity, and high dimensionality. Especially for the EEG signals collected by portable devices like smart glasses, due to factors such as device volume limitations, limited number of electrodes, large environmental interference, and variable user activity states, the signal quality is low, which poses greater challenges to feature extraction and analysis.
[0031] To overcome the above difficulties, researchers have proposed various improved EEG signal feature extraction and dimensionality reduction methods. Among them, kernel-based feature extraction techniques, such as Kernel Principal Component Analysis (KPCA), map the original data to a high-dimensional feature space through non-linear mapping and perform principal component analysis in the high-dimensional space, which can effectively capture the non-linear structure and features of the data. However, traditional KPCA methods still have some limitations, such as high computational complexity and poor feature interpretability. In addition, KPCA mainly focuses on the global structure of the data and may ignore local features and detailed information.
[0032] Another important feature extraction technique is Dictionary Learning. Dictionary Learning represents the signal as a sparse linear combination of dictionary atoms by adaptively learning an over-complete dictionary and sparse coding, which can automatically discover the potential patterns and structures in the data and has good data adaptability and feature representation ability. However, traditional dictionary learning methods mainly target single features, lack consideration of the correlation between different features, and the learned dictionary lacks hierarchical structure and semantic information.
[0033] In addition, most existing EEG signal feature extraction methods independently process the data at each stage, such as preprocessing, feature extraction, feature selection, etc., ignoring the information fusion and complementarity between different stages, resulting in the extracted features may not be robust and comprehensive enough.
[0034] Therefore, for portable EEG acquisition devices like smart glasses, there is an urgent need for a feature extraction and dimensionality reduction method that can overcome problems such as poor signal quality, low spatial resolution, and large noise interference, and at the same time has high computational efficiency and low resource occupancy. A multi-stage integrated EEG signal feature extraction and dimensionality reduction method is proposed. By integrating techniques such as kernel principal component analysis, dictionary learning, and feature atom recombination, it adaptively extracts the non-linear features of EEG signals and combines preprocessing information for optimization and dimensionality reduction, improving the accuracy, efficiency, and interpretability of feature extraction.
[0035] Please refer to Figure 1 , Figure 1 The flowchart of a method for extracting and reducing the EEG signal features of smart glasses provided in an embodiment of the present application is shown in FIG. The method for extracting and reducing the EEG signal features of smart glasses provided in an embodiment of the present application can be applied to computer devices, including but not limited to smart phones, laptops, tablet computers, desktop computers, physical servers, cloud servers and other devices. Figure 1 As shown, the method for extracting and reducing the EEG signal features of smart glasses in this embodiment includes steps S101 to S104, which are described in detail as follows:
[0036] Step S101, collecting the wearer's EEG signals according to the micro dry electrodes in the frame and temples of the smart glasses to form an EEG signal data set, extracting time domain, frequency domain and time-frequency domain features according to the EEG signal data set to generate an original feature set.
[0037] Specifically, the smart glasses EEG acquisition system adopts an innovative dry electrode design scheme, integrating microelectrodes into the frames and temples of smart glasses. Considering the wearing characteristics and space limitations of smart glasses, the electrodes are mainly distributed in the frontal and temporal regions, and 4-8 dry electrodes are usually used. The system designs the electrode layout based on the international 10-20 system, arranging FP1 and FP2 electrodes in the frontal region, mainly for collecting EEG activities related to cognitive functions and emotional states; arranging T3 and T4 electrodes in the temporal region for collecting EEG signals related to auditory processing and language comprehension. This electrode layout scheme makes full use of the structural characteristics of smart glasses, while ensuring wearing comfort, obtaining electrophysiological information of key brain areas. Due to the particularity of smart glasses, an innovative elastic support structure is used between the electrode and the skin, and a carefully designed mechanical structure is used to ensure that the electrode maintains stable contact with the scalp, while avoiding the discomfort caused by excessive pressure. This elastic support structure can adapt to the differences in head shapes of different users and improve the versatility and applicability of the device.
[0038] The electrodes are made of Ag / AgCl composite materials, which have excellent electrical conductivity and biocompatibility. The electrode surface is treated with a special micro-nano structure to increase the effective contact area with the scalp and reduce the contact impedance. Each electrode is equipped with an independent signal conditioning circuit, including a low-noise preamplifier and a filter. The preamplifier uses a high-performance instrumentation amplifier with an input impedance exceeding 100 MΩ and an input noise lower than 1 μV, which can accurately amplify weak EEG signals (typical amplitude in the μV level) to an appropriate level. In the design of the amplification circuit, special consideration is given to the optimization of the common-mode rejection ratio. The differential amplification structure is adopted, and the common-mode rejection ratio exceeds 100 dB, effectively suppressing the influence of external electromagnetic interference. The filter bank includes a high-pass filter, a low-pass filter, and a notch filter, which are used to preliminarily filter out interference signals. Among them, the cut-off frequency of the high-pass filter is set to 0.1 Hz to remove slow baseline drift; the cut-off frequency of the low-pass filter is 100 Hz to suppress high-frequency interference; the 50 / 60 Hz notch filter is used to eliminate the influence of power frequency interference. A multi-stage cascaded structure is adopted in the filter design to ensure the selectivity and phase characteristics of filtering and avoid signal distortion. The system uses a 24-bit high-precision analog-to-digital converter for signal digitization. The sampling rate can be adjusted in the range of 250 Hz to 1000 Hz, and the dynamic range reaches 100 dB. Considering the spectral characteristics of EEG signals and the actual application requirements, the sampling rate is set to 500 Hz in the standard working mode, which can not only meet the bandwidth requirements of signal analysis but also avoid excessive data storage pressure. The digitized signals are transmitted to the supporting data processing terminal in real time through a low-power Bluetooth module, and a special data compression algorithm is used to reduce the transmission bandwidth requirements while ensuring signal integrity.
[0039] To ensure data quality, the system has implemented a perfect quality control mechanism. During the acquisition process, the electrode impedance is continuously monitored, and an automatic alarm is triggered when the impedance value exceeds the preset threshold. The impedance monitoring adopts a small-signal AC excitation method with a measurement frequency of 10 Hz and an excitation current less than 10 μA to ensure measurement safety without affecting the acquisition of EEG signals. The system also integrates advanced artifact detection algorithms that can real-time identify common artifacts such as blinks, EMG, and movements. These algorithms are based on a multi-feature fusion method, comprehensively considering the time-domain, frequency-domain, and statistical features of the signals, improving the accuracy and reliability of artifact detection. At the same time, signal saturation and dropout are detected, and abnormal data segments are marked. The system also records the environmental noise level, providing a basis for subsequent data screening and processing. Through the built-in three-axis acceleration sensor and gyroscope, the system can accurately identify the head movement state of the user and automatically mark the data segments that may contain movement artifacts. This multi-modal quality control strategy not only ensures the reliability of the acquired data but also provides rich auxiliary information for subsequent signal processing.
[0040] Through the above acquisition system and quality control mechanism, the original EEG signal data set X={X1,X2,...,XM} is finally formed, where M represents the number of subjects, Xi represents the EEG signal data of the i-th subject, and is a C×N matrix, C represents the number of electrode channels, and N represents the number of sampling points. This data set contains complete time series information, channel identification, data quality indicators, etc., and will serve as the basic data for subsequent preprocessing and feature extraction.
[0041] Based on the original EEG signal data set X={X1,X2,...,XM} obtained in the above steps, the quality control indicators recorded during the acquisition process are first used to screen the data. The system marks the data segments with electrode impedance exceeding 50kΩ, which require special processing due to poor signal quality. At the same time, the motion information recorded by the accelerometer and gyroscope is also used to mark the data segments during intense exercise. After completing the preliminary data quality screening, the system performs refined secondary filtering. Although basic analog filtering has been performed in the signal acquisition stage, considering the particularity of the application scenario of smart glasses, more targeted digital filtering is still required. Wavelet transform is used for denoising, and the db4 wavelet basis function is selected for 5-layer decomposition. The wavelet coefficients are processed by the soft threshold method to adaptively retain the important features of the signal while removing the noise components. This wavelet-based denoising method has better time-frequency localization characteristics than traditional filters and can better maintain the transient characteristics of EEG signals. At the same time, by analyzing the environmental noise characteristics recorded during the acquisition process, the wavelet threshold is dynamically adjusted to improve the pertinence and effectiveness of denoising.
[0042] The system uses the empirical mode decomposition (EMD) method to adaptively decompose the non-stationary EEG signal into multiple intrinsic mode functions (IMFs). By analyzing the spectral characteristics and energy distribution of each IMF, the components representing noise and artifacts are identified and removed. In particular, for blink artifacts, since they are significant on the frontal electrodes (FP1 and FP2), the system combines the EMD decomposition results and spatial distribution characteristics for accurate identification and removal. In the process of removing artifacts, the interpolation reconstruction method is used to fill the removed data segments to ensure the continuity of the signal. Considering the non-stationary characteristics of EEG signals, an adaptive segmentation strategy is adopted. The basic window length is set to 2 seconds, and the overlap rate of adjacent data segments is 50%. In each data segment, the rationality of the segmentation is evaluated by calculating the steady-state indicators of the signal (such as variance, average frequency, etc.). If the indicators show that the signal characteristics in the current segment change greatly, the segment length is automatically adjusted.
[0043] A complete preprocessing evaluation index system is designed. In terms of signal-to-noise ratio evaluation, for key EEG rhythm frequency bands such as α (8 - 13 Hz) and β (13 - 30 Hz), the energy ratio before and after preprocessing is calculated respectively, and the denoising effect is evaluated through the comparative analysis of band energies. In terms of time-domain waveform fidelity, two indexes, namely the normalized mean square error and the cross-correlation coefficient, are adopted. Among them, the cross-correlation coefficient focuses on examining the similarity degree of the signals before and after preprocessing, while the mean square error reflects the overall level of signal fidelity. In terms of frequency-domain feature preservation, the Euclidean distance and the Kullback-Leibler divergence of the signal power spectral density before and after preprocessing are calculated to evaluate the degree of frequency-domain feature preservation. At the same time, the removal effects of different types of artifacts are evaluated respectively, including blink artifacts, electromyogram artifacts, and motion artifacts. The performance of artifact removal is evaluated by calculating the detection rate and false detection rate of these characteristic artifacts. Through this system's evaluation system, it is ensured that the preprocessing can, while reducing noise and removing artifacts, maximize the preservation of the characteristic information of the original EEG signal. After the above preprocessing process, the preprocessed EEG signal data set X' = {X'1, X'2,..., X'M} is finally obtained, where X'i represents the preprocessed EEG signal data of the i-th subject and is a matrix of C × N', C represents the number of electrode channels, and N' represents the number of sampling points after preprocessing.
[0044] Perform time-domain analysis on each channel signal sequence, mainly including two types of features: statistical features and morphological features. Statistical features describe the probability distribution characteristics of the signal by calculating the basic statistics of the signal. For the signal sequence x(t) of each channel, calculate the mean μ = E[x(t)] to reflect the central tendency level of the signal; the variance σ² = E[(x(t) - μ)²] to describe the fluctuation amplitude of the signal; the skewness γ = E[(x(t) - μ)³] / σ³ to characterize the asymmetry of the distribution; the kurtosis characterizes the sharpness of the distribution, where E[·] represents the expectation operation. Morphological features focus on describing the waveform structure characteristics of the signal, including the peak-to-peak value Vpp = max(x(t)) - min(x(t)) to reflect the amplitude range of the signal, the zero-crossing rate ZCR = ∑I{x(t)x(t - 1) < 0} / N to characterize the oscillation characteristics of the signal, and the root mean square value of the first-order difference sequence RMSFD = √(∑(x(t) - x(t - 1))² / N) to describe the severity of signal change, where I{·} is the indicator function and N is the number of sampling points. These time-domain features construct a systematic description of the signal's time-domain behavior from multiple perspectives.
[0045] In frequency domain analysis, the fast Fourier transform is used to calculate the power spectral density P(f) of the signal, and rich frequency domain features are extracted in the traditional electroencephalogram rhythm frequency bands. By integrating the power spectral density over the frequency bands of δ (0.5 - 4 Hz), θ (4 - 8 Hz), α (8 - 13 Hz), β (13 - 30 Hz), and γ (30 - 50 Hz), the absolute energy features of each frequency band are obtained. At the same time, the relative energy features are obtained by calculating the proportion of the energy of each frequency band in the total energy, and the energy relationship features between frequency bands are constructed by calculating the ratios of the energies of different frequency bands (such as α / β, θ / α, etc.). On this basis, the center frequency of each frequency band CF = ∑fP(f) / ∑P(f) is calculated to describe the concentration trend of the frequency spectrum, the spectral entropy SE = -∑P(f)logP(f) is used to characterize the complexity of the frequency spectrum distribution, and the spectral edge frequency depicts the energy accumulation characteristics. By calculating the power spectral features between different electrodes, the frequency domain connection features between brain regions are established. For each pair of electrodes (i, j), its cross-power spectrum Pij(f) and coherence Cij(f) = |Pij(f)|² / (Pii(f)Pjj(f)) are calculated to characterize the functional connection strength and pattern between different brain regions from the frequency domain perspective.
[0046] Time-frequency analysis adopts the method combining continuous wavelet transform and Hilbert-Huang transform to achieve a fine characterization of the non-stationary characteristics of the signal. In wavelet analysis, the complex Morlet wavelet is selected as the mother wavelet function, and its scale parameter settings cover the main electroencephalogram rhythm frequency bands. The time-frequency energy distribution map is obtained by calculating the squared modulus of the wavelet coefficients, and energy features are extracted in different time-frequency regions. For each frequency band, the instantaneous energy sequence and its change characteristics are calculated to depict the dynamic change law of the signal energy over time. In Hilbert-Huang transform analysis, first, the empirical mode decomposition is performed on the signal to obtain a set of intrinsic mode functions, and each intrinsic mode function represents the oscillation mode of the signal at different scales. The Hilbert transform is calculated for each intrinsic mode function to obtain the analytic signal z(t) = a(t)exp(jφ(t)), where a(t) is the instantaneous amplitude and φ(t) is the instantaneous phase. Based on this, the instantaneous frequency f(t) = (1 / 2π)dφ(t) / dt is calculated, and the amplitude modulation and frequency modulation features of each intrinsic mode function are extracted to describe the modulation characteristics of the signal at different time scales. At the same time, by analyzing the phase synchrony between the intrinsic mode functions of different electrodes, the time-varying features characterizing the dynamic coupling between brain regions are constructed. This analysis method combining the time domain and the frequency domain can not only describe the local time-frequency characteristics of the signal but also reflect the dynamic change process of the interaction between brain regions.
[0047] After extracting various types of features, these features are systematically organized to form feature vectors. For each data segment, the extracted time-domain features, frequency-domain features, and time-frequency domain features are combined in a fixed order to ensure the consistency and comparability of the features. Finally, an original feature set F = {f1, f2,..., fK} is formed, where K represents the total number of data segments, and each feature vector fi contains time-domain features, frequency-domain features, and time-frequency domain features. This feature set systematically characterizes the properties of EEG signals from multiple aspects such as time, frequency, and time-frequency joint distribution.
[0048] Step S102: Decompose each feature vector in the original feature set to obtain a feature atom set. In the feature atom set, obtain the response corresponding to each feature atom, merge the feature atoms corresponding to each response into a feature group, and regenerate the feature atom set according to multiple feature groups.
[0049] Specifically, using the original feature set obtained in the above steps, perturb each element of each feature vector one by one, input it into the classifier to obtain the corresponding response vector, and classify the response vector.
[0050] In some embodiments, the decomposing each feature vector in the original feature set to obtain a feature atom set includes: perturbing each element of each feature vector in the original feature set one by one, inputting it into the classifier to obtain the response vector and classifying it; according to the classification result of the response vector, decomposing each feature vector in the original feature set to obtain the feature atom set.
[0051] First, construct a stable classifier as the benchmark for feature evaluation. Use a support vector machine (SVM) as the basic classifier and use the RBF kernel function to enhance the non-linear feature mapping ability of the classifier. The training of the classifier adopts the method of hierarchical cross-validation, and the original feature set F = {f1, f2,..., fK} obtained in the above steps is divided into a training set and a validation set according to a ratio of 7:3. The training labels are marked according to the task states recorded in the acquisition experiment, covering multiple states such as resting state, cognitive tasks, and emotional stimuli. To improve the generalization ability of the classifier, the grid search method is used to optimize the parameters γ and penalty factor C of the RBF kernel function during the training process. The search range of the parameter γ is set to [2^-5, 2^5], and the step size is an exponential growth of 2; the search range of the penalty factor C is [2^0, 2^10], and the step size also adopts exponential growth. For each parameter combination, calculate the classification accuracy and F1 score on the validation set, and select the parameter combination with the best comprehensive performance as the final classifier parameters.
[0052] After obtaining the trained classifier, perturbation analysis is performed on each feature vector fi in the original feature set F obtained in the above steps. The perturbation process uses a feature injection method based on Gaussian noise to perform controlled perturbation on each component of the feature vector (including time-domain features, frequency-domain features, and time-frequency domain features). For the j-th component fij in the feature vector fi, Gaussian noise with a mean of 0 and a variance of σ² is injected, i.e., f'ij = fij + ε, where ε ~ N(0, σ²). The variance σ² of the Gaussian noise is adaptively determined and adjusted according to the scale of the feature component. Specifically, for the feature component fij, its standard deviation σij on the training set is calculated, and the variance of the perturbation noise is set to σ² = (0.1σij)². This adaptive setting of the perturbation intensity takes into account the dimensional differences of different feature components, ensuring both the perceptibility of the perturbation and avoiding excessive distortion. At the same time, to maintain the physical meaning of the features, a validity check is performed on the perturbed feature values. For example, for features representing energy, ensure that the perturbed values remain non-negative; for features representing proportions, ensure that the perturbed values are still within the interval [0, 1]. If the perturbation causes the feature value to exceed the valid range, it is adjusted by truncation or resampling. Each feature component is perturbed 100 times independently to obtain statistically reliable response samples.
[0053] The perturbed feature vectors are input into the trained SVM classifier to obtain responses. The classifier outputs a response vector ri = [p0, P1] for each perturbed sample, where p0 and P1 respectively represent the posterior probabilities of the sample belonging to the two classes. These probability values are calculated through the decision function of the SVM, reflecting the position relationship of the sample with the decision hyperplane in the feature space. A response evaluation mechanism based on KL divergence is designed to evaluate the importance of features by comparing the changes in the response vectors before and after perturbation. For the original response vector r and the perturbed response vector r', calculate their KL divergence: KL(r||r') = ∑r(i)log(r(i) / r'(i)). If the KL divergence is less than the preset threshold of 0.1, it is considered that the feature perturbation has little impact on the classification result, and its response is classified as "remaining in the original class"; otherwise, it is classified as "changing to other classes". After obtaining the responses of all perturbed samples, a response pattern matrix M is constructed. The rows of the matrix correspond to different perturbation experiments, and the columns correspond to different response classes. Each element mij in the matrix is assigned a continuous weight value w = 1 / (1 + exp(-α(d - β)) according to the amplitude of the change in the response vector, where α and β are parameters used to adjust the shape of the weight curve.
[0054] Finally, by calculating the importance score \(s = \sum\sum m_{ij}w_{ij}\) of each feature component, the classification result \(R = \{R_1, R_2, \cdots, R_K\}\) of the feature response is obtained, where \(R_i\) represents the response class label of each component of the \(i\)-th feature vector. Each response class label is a binary variable, with 1 indicating that the perturbation of this feature component causes a class change, and 0 indicating that the original class is maintained. This classification result reflects the influence degree of different feature components on the classification performance.
[0055] Based on the response classification result \(R = \{R_1, R_2, \cdots, R_K\}\) obtained according to the above steps, the feature vectors in the original feature set \(F=\{f_1, f_2, \cdots, f_K\}\) are grouped. For each feature vector \(f_i\), the feature components with the same response pattern are grouped into the same feature subset according to its response class label \(R_i\). This grouping method ensures that the feature components with similar response characteristics are processed uniformly. For example, for a feature vector containing time-domain features (such as mean, variance, etc.), frequency-domain features (such as band energy, coherence, etc.) and time-frequency domain features (such as wavelet energy, IMF features, etc.), according to the response labels of each component, the band energy feature and the IMF feature may be grouped into the same subset because they have a similar impact on the classification result. The formation process of the feature subset adopts an iterative method. First, two empty feature subsets \(F_1\) and \(F_2\) are initialized, corresponding to the feature components that maintain the original class and change the class, respectively. During the process of traversing the response labels of the feature vectors, not only the class attribution of the feature components is recorded, but also the position information in the original feature vector is retained, which is crucial for maintaining the physical meaning of the features when reconstructing the features later.
[0056] For each feature subset, an improved dictionary learning method is used for feature decomposition. The core idea of dictionary learning is to find a set of basic feature atoms so that the original features can be represented by the linear combination of these atoms. These feature atoms can be regarded as the basic patterns in the feature space. For example, in electroencephalogram signal analysis, a feature atom may represent a feature combination corresponding to a certain specific cognitive state or emotional pattern. For the feature subset \(F_i\), an overcomplete dictionary \(D_i\) and the corresponding sparse coding coefficient matrix \(A_i\) are constructed. The column vectors of the dictionary \(D_i\) represent the feature atoms, and the number of them is set to twice the dimension of the feature vector. This overcompleteness makes the dictionary have a stronger expression ability. If the dimension of the original feature vector is 100, the corresponding dictionary will contain 200 feature atoms, and these atoms can depict the structure of the feature space more carefully. The optimization objective of dictionary learning is to minimize the reconstruction error and maintain the sparsity of the coding, expressed as \(\minimize_{(D_i,A_i)}\sum||f_{ij}-D_ia_{ij}||^2+\) \(||a_{ij}||_1\), subject to \(||d_i||_2\leq1\), i. The solution to this optimization problem adopts an alternating iteration strategy, where the dictionary and sparse coding coefficients are optimized separately in each iteration. is a mathematical symbol meaning "for all" or "for every". "i" is the index of the dictionary atom, representing the i-th atom in the dictionary D. When combined with "i", it means that the constraint applies to every atom di in the dictionary D, rather than just a specific atom.
[0057] During the dictionary learning process, multiple techniques are adopted to improve the performance and reliability of the algorithm. In the sparse coding stage, an improved LARS-Lasso algorithm is used to solve the sparse coding coefficients aij. This algorithm gradually increases the number of active coefficients through path tracking until the preset sparsity requirement is reached. To accelerate the solution process, Cholesky decomposition is introduced to efficiently calculate the inverse matrix, and the active set strategy is used to reduce the number of variables to be processed in each iteration. In the dictionary update stage, the Block-Coordinate Descent method is adopted to update one dictionary atom at a time. During the update process, a projection algorithm is used to ensure that the dictionary atoms satisfy the unit norm constraint, and at the same time, the orthogonality between the dictionary atoms is maintained through QR decomposition. This optimization strategy not only improves the convergence speed of the algorithm but also ensures the good properties of the dictionary atoms. For example, when processing EEG features, if a certain feature atom mainly reflects the energy distribution in the alpha band, then other atoms will be optimized to capture feature patterns in different frequency bands or different spatial positions.
[0058] To ensure the stability and interpretability of the dictionary learning results, multiple regularization constraints are introduced during the optimization process. First is the non-negativity constraint, which requires all elements of the dictionary atoms to be non-negative values, which is consistent with the physical meaning of EEG features because many features themselves have non-negativity (such as energy, entropy, etc.). Second is the group sparsity constraint, which promotes the dictionary atoms to capture the group structure of the features through L2 / L1 norm regularization. For example, if some time-domain features often appear simultaneously, the group sparsity constraint will tend to use one dictionary atom to represent this group of features. In addition, regularization based on local structure is also adopted to maintain the smoothness of the feature atoms within the local neighborhood. The introduction of these constraint conditions significantly improves the interpretability and generalization ability of the dictionary atoms.
[0059] The finally obtained set of characteristic atoms is represented as A = {A1, A2,..., AN}, where N represents the total number of characteristic atoms, and each characteristic atom Ai is a vector containing the basic patterns extracted from the original features. At the same time, the corresponding dictionary matrix D = {D1, D2,..., DM} is obtained, where M represents the number of feature subsets. These characteristic atoms can not only effectively reconstruct the original features but also have good semantic interpretability. For example, by analyzing the structure of the characteristic atoms, it can be found that a certain atom may mainly correspond to the θ-band activity in the prefrontal region, while another atom may reflect the β-band characteristics in the temporal lobe region.
[0060] In some embodiments, the generating the set of characteristic atoms by recombining according to a plurality of the feature groups includes: extracting the central feature vectors of each of the feature groups and performing pairwise inter-group combination until a preset number of groups is reached, and regenerating the combined set of characteristic atoms.
[0061] Hierarchical combination is performed using the set of characteristic atoms A = {A1, A2,..., AN} obtained by the above steps. Each characteristic atom Ai represents a basic pattern in the original feature space, and these patterns reflect the feature combinations of EEG signals in different physiological or cognitive states. Taking the analysis of cognitive task data as an example, one characteristic atom may capture the characteristic pattern of the increase in the θ-band energy and the decrease in the α-band energy in the prefrontal lobe when the working memory load increases, while another characteristic atom may characterize the characteristic combination of the increase in the β-band energy in the temporal lobe when attention is concentrated. The characteristic atoms with the same response category are grouped into one group to construct an initial structure of characteristic atom groups. In the attention analysis task, an initial group may contain all the characteristic atoms related to the change in attention level, such as the β-band energy in the prefrontal lobe and the P300 event-related potential characteristics; another group may gather the characteristic atoms reflecting the relaxation state, such as the α-band energy characteristics in the occipital lobe. This initial grouping based on the response category ensures that the characteristic atoms with similar functions are processed together.
[0062] For each group of feature atoms \(G_i\), the central feature vector is calculated by the weighted average of all the feature atoms within the group: \(c_i=\sum(w_jA_j) / \sum w_j\), where \(w_j\) represents the weight of the feature atom \(A_j\). The weight design comprehensively considers two aspects: the usage frequency and the reconstruction error of the feature atoms. The usage frequency reflects the importance of the feature atoms in data reconstruction and is measured by counting the number of occurrences of non-zero coefficients in sparse coding; the reconstruction error characterizes the expression accuracy of the feature atoms and is evaluated by calculating the average error when the atom participates in reconstruction. In the emotion recognition task, if a certain feature atom frequently appears and has a small reconstruction error when expressing positive emotion samples, then this atom will obtain a higher weight when calculating the central feature vector. This weighting strategy not only considers the usage frequency of the feature atoms but also pays attention to their reconstruction performance, enabling the central feature vector to more accurately reflect the core characteristics of the feature atoms within the group. At the same time, a regularization term is introduced in the calculation process to prevent individual abnormal feature atoms from having too much influence on the central vector.
[0063] After obtaining the central feature vectors of each group, the similarity between the groups of feature atoms is calculated using the improved cosine similarity: \(sim(G_i,G_j)=(c_i\cdot c_j) / (\|c_i\|_2\|c_j\|_2)\). The physical meaning weights of the feature components are introduced in the similarity calculation process, and different weight coefficients are assigned to different types of features in electroencephalogram signal analysis. For example, when evaluating the group of atoms related to working memory, the matching degree of the features in the prefrontal theta band and alpha band obtains a higher weight because these features are closely related to the working memory load. The system also considers the continuity of the spatial position and assigns a higher combined weight to the features from adjacent brain regions. When calculating the similarity of the feature group of the attention state, not only the matching degree of the spectral features is considered, but also the consistency of the time-domain features, such as the morphological features of event-related potentials. This multi-dimensional similarity measure ensures that the merging process of the feature atoms conforms to the laws of neurophysiological cognition.
[0064] Based on the calculated similarity matrix, the system adopts a bottom-up hierarchical clustering strategy for merging. During the iteration process, the two groups with the highest similarity are selected for merging to construct a new group of feature atoms. The central feature vector of the new group is calculated through the weighted combination of the previous two groups: cnew = (|Gi|ci + |Gj|cj) / (|Gi| + |Gj|). This weighting method based on group size ensures the balance of the merging process. In practical applications, for example, when merging a large group containing multiple attention-related feature atoms with a small group containing only a few fatigue state feature atoms, the new central feature vector will retain more features of the large group, maintaining the stability of the main feature pattern. After each merge, the system dynamically updates the similarity matrix and recalculates the similarity between the new group and other groups. The merging process also introduces local structure preservation constraints to ensure that the feature atoms still maintain their original spatial relationships and spectral characteristics after merging.
[0065] To ensure that the merging process does not overly simplify the feature representation, an adaptive termination criterion based on information gain is designed. For each potential merging operation, the system calculates the information gain before and after merging: IG = H(G) - ∑(|Gk| / |G|)H(Gk). In the emotion recognition task, if merging two groups of feature atoms representing "pleasure" and "excitement" states respectively leads to a significant decrease in the ability to distinguish these two emotions, that is, the information gain is lower than the set threshold, the system will automatically reject this merge. This adaptive termination mechanism can find an appropriate merging granularity in different application scenarios. At the same time, the system continuously monitors the performance of each newly formed group of feature atoms in the original task, and evaluates the merging effect by calculating metrics such as classification accuracy and F1 score. When it is found that a certain merge leads to a performance decline, the system will adjust the merging strategy and restore to a combination scheme with better performance through a backtracking mechanism.
[0066] Finally, the merged set of feature atoms A' = {A'1, A'2,..., A'M} is obtained, where M represents the number of merged groups of feature atoms, and each A'i represents a high-level feature pattern. These feature patterns not only integrate the information of the original feature atoms but also maintain the physical interpretability of the features through a hierarchical organizational structure. In cognitive state analysis, a merged feature atom may simultaneously contain a comprehensive feature representation of attention level, working memory load, and fatigue degree, and can more comprehensively depict the changes in the cognitive state of the subject. For example, in the application of driving fatigue detection, the merged feature atom may fuse multiple basic features such as an increase in prefrontal theta wave energy, a decrease in alpha wave energy, and a change in blink frequency to form a comprehensive feature pattern that can effectively identify the fatigue state.
[0067] Step S103: Based on the set of characteristic atoms, perform atomic-level recombination on each feature vector in the original feature set to generate a recombined feature set; calculate the kernel matrix corresponding to the recombined feature set, map the kernel matrix to a high-dimensional kernel space, and perform principal component analysis based on the original feature set to obtain the kernel principal component projection matrix.
[0068] Specifically, perform atomic-level recombination on the original feature set: Based on the merged set of characteristic atoms obtained in the above steps, perform atomic-level recombination on each feature vector in the original feature set obtained in the above steps to generate new feature vectors, thereby obtaining a recombined feature set.
[0069] In some embodiments, the performing atomic-level recombination on each feature vector in the original feature set includes: calculating the weighted cosine similarity between each feature vector and the merged set of characteristic atoms, selecting multiple characteristic atoms with the highest similarity based on a soft threshold strategy; constructing an encoding matrix corresponding to the characteristic atoms, and solving the encoding coefficients through an optimization problem including a sparse regularization term; normalizing the encoding coefficients, and introducing local structure preservation constraints to generate a recombined feature vector.
[0070] Based on the merged set of characteristic atoms A' = {A'1, A'2,..., A'M} obtained in the above steps, perform atomic-level recombination on each feature vector in the original feature set F obtained in the above steps. The recombination process first calculates the similarity relationship between the original feature vector and the merged characteristic atoms. For the feature vector fj, calculate the cosine similarity between it and each characteristic atom A'i respectively: sim(fj, A'i) = (fj · A'i) / (||fj||2||A'i||2). In the similarity calculation, considering the physical meaning of the feature components, a weighted calculation method is adopted for different types of features. For example, when processing the cognitive state features of electroencephalogram signals, if a certain feature vector contains a feature combination related to the prefrontal θ band and working memory, then when calculating its similarity with the characteristic atom representing cognitive load, these feature components will obtain higher weights. Based on the calculated similarity, select the m characteristic atoms most similar to the original feature vector as the recombination basis. The selection process adopts a soft threshold strategy, that is, not only considering the absolute value of the similarity, but also paying attention to the relative distribution of the similarity. This selection strategy can better maintain the structure of the features. In the application of driving fatigue detection, assume that a certain original feature vector contains features such as an increase in blink frequency and a decrease in occipital α wave energy. The system will preferentially select those characteristic atoms that can comprehensively express the fatigue state for recombination.
[0071] For the selected \(m\) characteristic atoms, an encoding matrix \(E_j\) is constructed. Each row of the encoding matrix corresponds to a selected characteristic atom, and the matrix elements reflect the contribution degree of the characteristic atoms to the reconstructed characteristics. The construction of the encoding matrix takes into account the mutual relationship between the characteristic atoms, and the optimization problem is solved: minimize \(\|f_j - E_jA'\|^2+\alpha\|E_j\|_1\). The first term represents the reconstruction error, the second term is the sparse regularization term, and \(\alpha\) is the balance parameter. The solution of this optimization problem uses the iterative shrinkage algorithm, and the elements of the encoding matrix are updated through soft threshold operation in each iteration. Taking the emotion recognition task as an example, if a feature vector reflects the "pleasant" emotion state, then in the reconstruction process, the characteristic atoms related to positive emotions will obtain larger encoding coefficients, while the characteristic atoms related to negative emotions may obtain coefficients close to zero. The core of the reconstruction process is to map the original features to a new feature space through the encoding matrix. For the feature vector \(f_j\), its reconstructed feature vector is calculated as: \(f_j' = E_jA'\). This mapping process realizes the conversion from the original features to the representation based on characteristic atoms. A normalization operation is introduced in the calculation process to ensure the scale consistency of the reconstructed features.
[0072] To improve the robustness of the reconstruction, a local structure preservation constraint is introduced during the reconstruction process. For similar feature vectors in the original feature space, it is required that they still maintain a similar relationship after reconstruction. This constraint is achieved by adding a structure preservation term to the optimization objective: \(L(f_i,f_j)=\frac{\|f_i'-f_j'\|^2}{\|f_i - f_j\|^2}\). By minimizing this local structure loss, it is ensured that the reconstruction process will not destroy the intrinsic structure of the features. In electroencephalogram signal analysis, this constraint is particularly important because it ensures that features in similar cognitive states or emotion states can still be correctly recognized after reconstruction. Through the above atom-level reconstruction process, the final reconstructed feature set \(F'=\{f_1',f_2',\cdots,f_N'\}\) is obtained, where \(N\) represents the number of feature vectors. Each reconstructed feature vector \(f_i'\) is a compact representation based on the merged characteristic atoms, which not only retains the discriminant information of the original features but also obtains higher expression efficiency. For example, in a fatigue driving detection system, the reconstructed features integrate multiple originally scattered fatigue indicators (such as alpha wave changes, blink features, reaction time, etc.) into a small number of comprehensive features, and each comprehensive feature can describe the fatigue state of the driver from different angles.
[0073] Construct a kernel matrix based on the recombined feature set F' = {f'1, f'2,..., f'N} obtained from the above steps. The construction of the kernel matrix aims to capture the non-linear relationships between feature vectors and enhance their expressive power by mapping the features into a high-dimensional space. First, calculate the Euclidean distance matrix D between all samples in the recombined feature set. The calculation process utilizes the inner product relationship of feature vectors. For any two feature vectors f'i and f'j, the Euclidean distance between them can be expanded as: D²ij = ||f'i - f'j||² = ||f'i||² + ||f'j||² - 2f'i·f'j. This calculation method avoids directly calculating the square of the vector difference and improves the calculation efficiency. For example, when dealing with feature vectors containing time-domain features and frequency-domain features, by pre-computing the L2 norm square and inner product of all feature vectors, the computational amount for constructing the distance matrix can be significantly reduced. After obtaining the distance matrix D, use the Gaussian kernel function to convert the Euclidean distance into a similarity measure. The elements of the kernel matrix K are calculated by the following formula: Kij = exp(-D²ij / 2σ²), where σ is the bandwidth parameter of the Gaussian kernel. The choice of the bandwidth parameter σ has an important impact on the performance of the kernel matrix. An overly large σ value will cause the similarities of all samples to tend to be equal, while an overly small σ value will make the relationships between samples too sparse. An adaptive method based on the median distance is used to determine the value of σ: σ = median({Dij})*β, where median({Dij}) represents the median of the distances between all sample pairs, and β is a tuning factor, usually set between 0.1 and 1. In practical applications, such as emotion recognition tasks, a larger β value is beneficial for capturing the gradual change characteristics of emotional states; while in attention detection tasks, a smaller β value can better distinguish different attention levels.
[0074] The construction of the kernel matrix takes into account the multi-scale characteristics of features, introduces a scale mixing strategy, and combines the kernel matrices under different bandwidth parameters through weighting: K = ∑wkK(σk), where K(σk) represents the kernel matrix constructed using the bandwidth parameter σk, and wk is the corresponding weight coefficient. The weight coefficients are determined by minimizing the classification error on the validation set. This multi-scale kernel matrix can capture both the local and global structures of features simultaneously. In electroencephalogram (EEG) signal analysis, different cognitive states may be manifested on different time scales. For example, the evolution of the fatigue state is a slow process, while the fluctuations of attention may occur on a shorter time scale. At the same time, a local structure preservation constraint is also introduced, requiring the kernel matrix to maintain the local adjacency relationship in the original feature space. This is achieved by adding a regularization term based on the k-nearest neighbor graph in the construction of the kernel matrix. To improve the stability of the kernel matrix, perform spectral decomposition on the kernel matrix: K = U U^T, where is the diagonal matrix of eigenvalues, and U is the corresponding eigenvector matrix. By adjusting the eigenvalues 'ii = ii+ε, where ε is a small regularization parameter, and the regularized kernel matrix K'=U 'U^T.
[0075] The resulting kernel matrix K∈R^(N×N) describes the nonlinear similarity relationship between samples, where Kij represents the inner product of the reorganized eigenvectors f'i and f'j in the high-dimensional feature space. The value of each element is in the interval [0,1]. The larger the value, the higher the similarity of the corresponding sample pair. For example, in the working memory load analysis, the element values of the kernel matrix reflect the relationship between different load levels. The kernel matrix element values corresponding to samples with similar load levels are larger, while the element values corresponding to load levels with significant differences are smaller. The kernel matrix constructed in this way not only captures the nonlinear relationship between eigenvectors, but also maintains the essential structural characteristics of the data.
[0076] In some embodiments, the principal component analysis is performed according to the original feature set to obtain a kernel principal component projection matrix, including: mapping the kernel matrix to a high-dimensional kernel space to construct an auxiliary kernel matrix based on the original feature set; performing eigenvalue decomposition on the auxiliary kernel matrix to obtain principal component directions, and calculating the projection coefficients of the original feature set in the principal component directions; generating the kernel principal component projection matrix according to the projection coefficients and introducing an optimization process that preserves local structure constraints.
[0077] The kernel matrix K obtained in the above steps is mapped to the high-dimensional kernel space, and the original feature set F obtained in the above steps is used as additional information to perform principal component analysis in the kernel space. The high-dimensional feature space represented by the kernel matrix K can capture the nonlinear structure of the data, while the original feature set provides reference information with clear physical meaning. First, the kernel function is used to implicitly define the mapping φ(·) from the original feature space to the kernel space. For the reorganized feature vectors f'i and f'j, their inner product in the kernel space can be directly obtained by the kernel matrix elements: K(f'i,f'j)=φ(f'i)·φ(f'j)=Kij. The advantage of this implicit mapping is that there is no need to explicitly calculate the coordinates in the high-dimensional space, but the kernel matrix is directly used for calculation. For example, in the emotion recognition task, even if the emotional state in the original feature space presents a complex nonlinear distribution, such as the feature distribution of the happy and excited states may present a spiral shape, it can be converted into a linear structure that is easier to analyze through kernel space mapping. This nonlinear to linear transformation greatly simplifies the subsequent analysis process.
[0078] Meanwhile, the mapping function ψ(·) is introduced to map the original feature set F into the same kernel space. The mapping of the original features is achieved by constructing an auxiliary kernel matrix Kaux, whose elements are calculated as: Kaux(fi,fj)=ψ(fi)·ψ(fj). The auxiliary kernel matrix adopts the same kernel function form as the main kernel matrix K, but the parameters may be different. The difference in parameters is mainly reflected in the bandwidth selection of the kernel function, and usually a larger bandwidth is chosen to obtain a smoother mapping. In the attention level analysis task, if the original features include features that directly reflect attention such as prefrontal β-band energy and P300 amplitude, these features will be reasonably represented in the kernel space. For example, the non-linear relationship between β-band energy and P300 amplitude will be transformed into a linear relationship in the kernel space, thus more accurately reflecting the changes in the attention level. For each original feature vector fi, its coordinates ψ(fi) in the kernel space are calculated through the kernel trick, and this coordinate information serves as supplementary information for subsequent principal component analysis.
[0079] When performing principal component analysis in the kernel space, the following optimization problem needs to be solved: maximize_{wk} (1 / N)∑(φ(f'i)^T·wk)² subject to wk^T·wk=1, wk^T·wj=0 (j=1,2,...,k-1).
[0080] where wk represents the k-th principal component direction. This optimization problem is transformed into an eigenvalue decomposition problem of the kernel matrix K through the dual form: KA=λA. By solving the characteristic equation, the eigenvalues λ1≥λ2≥...≥λd arranged in descending order and the corresponding eigenvectors α1,α2,...,αd are obtained. Each principal component direction wk can be expressed as a linear combination of samples in the kernel space: wk=∑αkiφ(f'i). This representation form avoids direct calculation in the high-dimensional kernel space, greatly reducing the computational complexity. In practical applications, such as in the analysis of working memory tasks, each principal component has a clear physical meaning. The first principal component usually corresponds to the main change direction of working memory load, and can reflect the trend that the prefrontal θ-wave energy increases with the increase of load; the second principal component may capture the change in task difficulty, manifested as the modulation of β-band energy; while the third principal component may reflect the degree of fatigue, manifested as the slow change of α-band energy.
[0081] To enhance the interpretability of the principal components, the original feature information is incorporated into the principal component construction process. For the k-th principal component direction \(w_k\), the projection coefficient of the original features in this direction is calculated as: \(\beta_k=(1 / N)\sum_{i}\alpha_{ki}\psi(f_i)\). The calculation process of the projection coefficient takes into account the weights of the samples, and the sample weights are determined according to their projection values in the principal component direction. Samples with larger projection values obtain higher weights. This weighted strategy ensures that the principal components can better reflect the main change trends of the data. The projection coefficient represents the contribution degree of the original features to the principal components and can be used for feature importance analysis. For example, in fatigue driving detection, if the projection coefficient of the blink frequency feature is large, it indicates that this feature has a significant impact on the judgment of the fatigue state; if the projection coefficient of the α-wave energy feature in a certain brain region is large, it means that this brain region plays a key role in fatigue state detection.
[0082] In the principal component construction process, a local structure preservation constraint is also introduced: \(\sum_{i}\sum_{j}W_{ij}\left\lVert w_k^T(\varphi(f_i') - \varphi(f_j'))\right\rVert^2\). Here, \(W_{ij}\) is the adjacency weight matrix constructed based on the original feature space, and the heat kernel weight calculation method is adopted: \(W_{ij}=\exp\left(-\frac{\left\lVert f_i - f_j\right\rVert^2}{t}\right)\), where the parameter \(t\) controls the weight decay rate. This local preservation constraint ensures that the local adjacency relationship in the kernel space is maintained. In practical applications, such as emotional state analysis, this constraint is particularly important. For example, when analyzing the emotional change process from calm to excited, the local structure preservation constraint can ensure that the gradual change characteristics of the emotional state are maintained in the principal component space, and the emotional states at adjacent moments still maintain a similar relationship after projection.
[0083] Through the above process, the kernel principal component projection matrix \(W = [\beta_1, \beta_2, \cdots, \beta_d]^T\) is finally obtained, where each row corresponds to a principal component direction. This projection matrix not only contains the non-linear feature information in the kernel space but also incorporates the physical interpretability of the original features. For example, in cognitive state analysis, the projection matrix can transform complex EEG features into a small number of principal components, and each principal component has a clear physiological interpretation. The first principal component may represent the overall cognitive load level, manifested in the coordinated changes of the theta waves in the prefrontal lobe and the alpha waves in the occipital lobe; the second principal component may reflect the attention allocation state, mainly manifested as the spatial distribution characteristics of the beta-band energy; the third principal component may describe the fatigue degree, integrating the information of the alpha-wave energy change and the blink feature. This principal component analysis method combining the kernel method and the original features maintains the physical meaning and interpretability of the features while reducing the dimensionality.
[0084] Step S104, project the feature set into the low-dimensional space using the kernel principal component projection matrix, and combine it with the EEG signal data set to generate a low-dimensional non-linear feature representation, completing the extraction and dimensionality reduction of the EEG signal features of the smart glasses.
[0085] Specifically, using the kernel principal component projection matrix obtained in the above steps, project the recombined feature set obtained in the above steps from the high-dimensional kernel space to the low-dimensional space, and at the same time, fine-tune it in combination with the preprocessed EEG signal data set obtained in the above steps to obtain the final low-dimensional non-linear feature representation.
[0086] In some embodiments, the projecting the feature set to the low-dimensional space using the kernel principal component projection matrix includes: mapping the recombined feature vectors to the high-dimensional kernel space and performing linear combination through the kernel principal component projection matrix; constructing a multi-layer mapping function according to the EEG signal data, and setting a projection layer, an alignment layer and a fusion layer in the multi-layer mapping function; adjusting the multi-layer mapping function through an optimization objective function including a regularization term to generate low-dimensional space projection coordinates, and projecting the feature set to the low-dimensional space.
[0087] Using the kernel principal component projection matrix W obtained in the above steps, project the recombined feature set F' obtained in the above steps from the high-dimensional kernel space to the low-dimensional space. For the recombined feature vector f'i, first map it to the kernel space, and then project it to the low-dimensional space through the kernel principal component projection matrix W to obtain the initial projection coordinate zi = W^Tf'i. This process can be regarded as the coordinate representation of the feature vector in the principal component direction, and each coordinate component reflects the projection intensity of the feature in the corresponding principal component direction. In the analysis of the attention state, if the principal component direction reflects the change trend of the attention level, then the magnitude of the projection coordinate directly corresponds to different attention states. A larger coordinate value indicates a higher attention level, and a smaller coordinate value corresponds to a state of scattered attention. For example, when the subject is focused on a complex cognitive task, the projection coordinate shows a higher value in the principal component direction reflecting attention, and at the same time, significant activity is also shown in the principal component direction representing cognitive load.
[0088] Exemplarily, generating the low-dimensional non-linear feature representation in combination with the EEG signal data set includes: inputting the low-dimensional space projection coordinates and the preprocessed EEG signal data set into a multi-layer fusion network for dynamically adjusting the feature weights through an attention mechanism and outputting the low-dimensional non-linear feature representation.
[0089] To make full use of the information in the original EEG signals, the present invention designs a mapping function g(·) to fuse the preprocessed EEG signal data X' obtained in the above steps with the projection results. The mapping function adopts a multi-layer structure, including a projection layer, an alignment layer, and a fusion layer. The projection layer is responsible for mapping the preprocessed EEG data to the same dimension as the principal component space; the alignment layer aligns the distributions of the two features through non-linear transformation; and the fusion layer synthesizes the information of the two parts to generate the final feature representation. The optimization objective of the mapping function is: minimize ∑∑||zi - g(X'j)||² + λΩ(g), where the first term is the projection alignment loss and the second term Ω(g) is the regularization term used to control the complexity of the mapping function. The regularization parameter λ is determined by cross-validation. In the working memory task, the preprocessed EEG data contains rich time-domain features, such as the dynamic changes in the energy of the prefrontal θ band and the waveform features of the P300 component, while the kernel principal component projection results better express the spatial features, such as the cooperative patterns of activities in different brain regions. Through the carefully designed mapping function, these two types of complementary features are effectively fused.
[0090] Exemplarily, before outputting the low-dimensional non-linear feature representation, it further includes: imposing a continuity constraint and a consistency constraint in the fusion network to maintain the similarity of the feature distribution and the spatio-temporal consistency.
[0091] In the optimization process of the mapping function, the present invention adopts a segmented training strategy and introduces multiple constraints. First is the continuity constraint, which requires that similar inputs produce similar output features, achieved by adding a similarity preservation term to the loss function: Lsim = ∑∑(||g(X'i) - g(X'j)||^2 / ||X'i - X'j||^2). Second is the consistency constraint. For the data in the same time window, the low-dimensional representations obtained from the two features should be consistent, which is achieved by minimizing the feature differences of paired samples: Lcons = ∑||g(X'i) - g(W^Tf'i)||^2. Taking the emotion recognition task as an example, when the subject watches a video stimulus that triggers a pleasant emotion, the mapping function needs to simultaneously maintain the projection features reflecting the emotion changes in the kernel principal component space and the time-domain features reflecting the emotion response in the original EEG data. The constraint conditions ensure the coordinated expression of these two types of features in the low-dimensional space. At the same time, the design of the mapping function specifically considers the physical meaning of the features, adopts a local connection structure in the projection layer to maintain spatial correlation, uses a monotonic activation function in the alignment layer to maintain the order relationship, and dynamically adjusts the feature weights through an attention mechanism in the fusion layer.
[0092] For the recombined feature vector f'i, the final low-dimensional feature representation is obtained through the processing of the mapping function Similarly, for the preprocessed EEG signal data X'j, the corresponding low-dimensional feature representation ẑj = g(X'j) is obtained through the same mapping function. This unified mapping method ensures that all data are projected into the same feature space. In the practical application of driving fatigue detection, the low-dimensional features effectively integrate information from multiple levels: the kernel principal component projection captures the long-term change trends of the driver's fatigue level, such as the gradual increase in α-wave energy and the continuous prolongation of reaction time; while the original EEG data provides an accurate description of the instantaneous state, such as sudden microsleep events and short-term fluctuations in attention. The mapping function fuses these features into a compact low-dimensional representation, and each dimension has a clear physical meaning. For example, in a certain experiment, when it is detected that the driver's α-wave energy increases significantly and the blink frequency increases abnormally at the same time, these changes will be reflected in the corresponding components of the low-dimensional features, forming a comprehensive representation of the fatigue state.
[0093] The finally obtained set of low-dimensional non-linear feature representations contains the low-dimensional representations of all samples, where N is the number of recombined feature vectors and M is the number of preprocessed EEG signal data samples. Each low-dimensional feature vector is a compact representation of the original features in the optimized space, which not only retains the key patterns extracted by kernel principal component analysis but also preserves the important features of the original EEG signals. This feature representation method that combines multi-source information significantly improves the expressive power and robustness of the features and demonstrates excellent performance in complex cognitive state analysis tasks.
[0094] The provided method has the following beneficial effects:
[0095] 1. Construct a hierarchical and interpretable feature representation. The present invention constructs a hierarchical feature representation system through feature atom decomposition and hierarchical grouping and merging. Feature atoms, as basic feature elements, are adaptively extracted from the data through dictionary learning, and then relevant feature atoms are combined through hierarchical grouping to form high-level feature patterns. This hierarchical feature representation method can better describe the multi-scale characteristics and internal correlations of EEG signals, making the learned features have clear physical meanings and interpretability.
[0096] 2. Improve the adaptability and robustness of feature representation. The present invention adopts the methods of atomic-level recombination and kernel matrix construction to achieve the adaptive optimization of features. Atomic-level recombination performs adaptive reconstruction based on feature importance, and kernel matrix construction captures the non-linear relationships between features. This technical solution that combines feature recombination and kernel methods significantly improves the adaptability of feature representation, enabling the features to better adapt to different task scenarios, and at the same time enhancing the anti-noise ability of the features.
[0097] 3 Achieve efficient non-linear dimensionality reduction and feature fusion. Through kernel principal component analysis and mapping function optimization, the present invention realizes non-linear dimensionality reduction of features and multi-source information fusion. Kernel principal component analysis extracts the main change directions of data, and the mapping function optimally integrates the recombined features and the original signal features. This dimensionality reduction and fusion strategy based on the kernel method significantly reduces the feature dimension while maintaining the discriminant information of features, improving the compactness of feature representation and computational efficiency.
[0098] To implement the electroencephalogram (EEG) signal feature extraction and dimensionality reduction method corresponding to the above method embodiments to achieve the corresponding functions and technical effects. Refer to Figure 2 , Figure 2 The structural block diagram of an EEG signal feature extraction and dimensionality reduction device 200 provided by an embodiment of the present application is shown. For the sake of convenience of description, only the parts related to this embodiment are shown. The EEG signal feature extraction and dimensionality reduction device 200 provided by the embodiment of the present application includes:
[0099] A set acquisition unit 201, configured to collect the EEG signals of the wearer according to the micro dry electrodes in the smart glasses frame and temple, form an EEG signal data set, extract time domain, frequency domain, and time-frequency domain features according to the EEG signal data set, and generate an original feature set;
[0100] A vector decomposition unit 202, configured to decompose each feature vector in the original feature set to obtain a feature atom set, obtain the response corresponding to each feature atom in the feature atom set, merge the feature atoms corresponding to each response into a feature group, and regenerate the feature atom set according to a plurality of the feature groups;
[0101] An atom recombination unit 203, configured to perform atom-level recombination on each feature vector in the original feature set based on the feature atom set to generate a recombined feature set; calculate the kernel matrix corresponding to the recombined feature set, map the kernel matrix to a high-dimensional kernel space, perform principal component analysis according to the original feature set, and obtain a kernel principal component projection matrix;
[0102] A dimensionality reduction completion unit 204, configured to project the feature set into a low-dimensional space by using the kernel principal component projection matrix, and generate a low-dimensional non-linear feature representation in combination with the EEG signal data set to complete the EEG signal feature extraction and dimensionality reduction of the smart glasses.
[0103] The above-mentioned intelligent glasses EEG signal feature extraction and dimension reduction device 200 can implement the intelligent glasses EEG signal feature extraction and dimension reduction method of the above method embodiment. The optional items in the above method embodiment are also applicable to this embodiment, which will not be elaborated here. The remaining content of the embodiment of the present application can refer to the content of the above method embodiment and will not be repeated in this embodiment.
[0104] Figure 3 It is a schematic structural diagram of a computer device provided by an embodiment of the present application. As Figure 3 shown, the computer device 3 of this embodiment includes: at least one processor 30 ( Figure 3 only one is shown here), a memory 31, and a computer program 32 stored in the memory 31 and executable on the at least one processor 30. When the processor 30 executes the computer program 32, the steps in any of the above method embodiments are implemented.
[0105] The computer device 3 can be a computing device such as a smart phone, a tablet computer, a desktop computer, and a cloud server. The computer device may include but is not limited to the processor 30 and the memory 31. Those skilled in the art can understand that Figure 3 this is only an example of the computer device 3 and does not constitute a limitation on the computer device 3. It may include more or fewer components than those shown in the figure, or combine some components, or different components. For example, it may also include input / output devices, network access devices, etc.
[0106] The so-called processor 30 may be a central processing unit (CPU). The processor 30 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0107] The memory 31 may be an internal storage unit of the computer device 3 in some embodiments, such as a hard disk or memory of the computer device 3. The memory 31 may also be an external storage device of the computer device 3 in some other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped on the computer device 3. Further, the memory 31 may also include both the internal storage unit and the external storage device of the computer device 3. The memory 31 is used to store an operating system, application programs, a BootLoader, data, and other programs, such as the program code of the computer program. The memory 31 may also be used to temporarily store data that has been output or is to be output.
[0108] In addition, an embodiment of the present application also provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0109] An embodiment of the present application provides a computer program product, and when the computer program product runs on a computer device, the computer device is caused to implement the steps in each of the above method embodiments when executed.
[0110] In several embodiments provided in the present application, it can be understood that each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, the program segment, or the part of code includes one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the block may occur in a different order from that marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved.
[0111] When the above-mentioned functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art or a part of this technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.
[0112] The specific embodiments described above further elaborate on the purpose, technical solution, and beneficial effects of this application. It should be understood that the above are only specific embodiments of this application and are not used to limit the protection scope of this application. It is particularly pointed out that for those skilled in the art, any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of this application should be included in the protection scope of this application.
Claims
1. An electroencephalogram signal feature extraction and dimensionality reduction method for smart glasses, characterized in that, Including: Collecting the electroencephalogram (EEG) signals of the wearer according to the micro dry electrodes in the smart glasses frame and temple, forming an EEG signal data set, extracting time-domain, frequency-domain and time-frequency domain features according to the EEG signal data set, and generating an original feature set; Decomposing each feature vector in the original feature set to obtain a feature atom set, obtaining the response corresponding to each feature atom in the feature atom set, merging the feature atoms corresponding to each response into a feature group, and regenerating the feature atom set according to multiple feature groups; Based on the regenerated feature atom set, performing atomic-level recombination on each feature vector in the original feature set to generate a recombined feature set; calculating the kernel matrix corresponding to the recombined feature set, mapping the kernel matrix to a high-dimensional kernel space, and performing principal component analysis according to the original feature set to obtain a kernel principal component projection matrix; the performing atomic-level recombination on each feature vector in the original feature set includes: calculating the weighted cosine similarity between each feature vector and the merged feature atom set, selecting multiple feature atoms with the highest similarity based on a soft threshold strategy; constructing an encoding matrix corresponding to the feature atoms, and solving the encoding coefficients through an optimization problem including a sparse regularization term; normalizing the encoding coefficients, and introducing a local structure preservation constraint to generate a recombined feature vector; Projecting the recombined feature set into a low-dimensional space by using the kernel principal component projection matrix, and combining with the EEG signal data set to generate a low-dimensional non-linear feature representation, completing the extraction and dimensionality reduction of the EEG signal features of the smart glasses.
2. The method according to claim 1, characterized in that The decomposing each feature vector in the original feature set to obtain a feature atom set includes: Perturbing each element of each feature vector in the original feature set one by one, inputting the classifier to obtain a response vector and performing classification; Decomposing each feature vector in the original feature set according to the classification result of the response vector to obtain a feature atom set.
3. The method according to claim 1, characterized in that The regenerating the feature atom set according to multiple feature groups includes: Extracting the central feature vectors of each feature group and performing pairwise inter-group merging until a preset grouping number is reached, and regenerating the merged feature atom set.
4. The method according to claim 1, characterized in that The performing principal component analysis according to the original feature set to obtain a kernel principal component projection matrix includes: Mapping the kernel matrix to a high-dimensional kernel space, and constructing an auxiliary kernel matrix based on the original feature set; Performing eigenvalue decomposition on the auxiliary kernel matrix to obtain the principal component direction, and calculating the projection coefficients of the original feature set in the principal component direction; Generating the kernel principal component projection matrix according to the projection coefficients and an optimization process introducing a local structure preservation constraint.
5. The method according to claim 1, wherein The projecting the recombined feature set into a low-dimensional space by using the kernel principal component projection matrix includes: Mapping the recombined feature vector to the high-dimensional kernel space, and performing a linear combination through the kernel principal component projection matrix; Construct a multi-layer mapping function based on the EEG signal data, and set a projection layer, an alignment layer, and a fusion layer in the multi-layer mapping function; Adjust the multi-layer mapping function through an optimization objective function including a regularization term to generate low-dimensional space projection coordinates, and project the reorganized feature set into the low-dimensional space.
6. The method according to claim 5, wherein The generating of the low-dimensional non-linear feature representation in combination with the EEG signal data set includes: Input the low-dimensional space projection coordinates and the preprocessed EEG signal data set into a multi-layer fusion network, which is used to dynamically adjust the feature weights through an attention mechanism and output the low-dimensional non-linear feature representation.
7. The method according to claim 6, wherein Before outputting the low-dimensional non-linear feature representation, it further includes: Apply a continuity constraint and a consistency constraint in the fusion network to maintain the similarity of the feature distribution and the spatio-temporal consistency.
8. An electroencephalogram signal feature extraction and dimensionality reduction device for intelligent glasses, characterized in that It includes: A set acquisition unit, which is used to collect the EEG signals of the wearer according to the micro dry electrodes in the smart glasses frame and temples, form an EEG signal data set, extract time-domain, frequency-domain, and time-frequency-domain features according to the EEG signal data set, and generate an original feature set; A vector decomposition unit, which is used to decompose each feature vector in the original feature set to obtain a feature atom set. In the feature atom set, obtain the response corresponding to each feature atom, merge the feature atoms corresponding to each response into a feature group, and regenerate the feature atom set according to multiple feature groups; An atom recombination unit, which is used to perform atom-level recombination on each feature vector in the original feature set based on the regenerated feature atom set to generate a reorganized feature set; and calculate the kernel matrix corresponding to the reorganized feature set, map the kernel matrix to a high-dimensional kernel space, perform principal component analysis according to the original feature set, and obtain a kernel principal component projection matrix; the performing of atom-level recombination on each feature vector in the original feature set includes: calculating the weighted cosine similarity between each feature vector and the merged feature atom set, selecting multiple feature atoms with the highest similarity based on a soft threshold strategy; constructing an encoding matrix corresponding to the feature atoms, and solving the encoding coefficients through an optimization problem including a sparse regularization term; normalizing the encoding coefficients, and introducing a local structure preservation constraint to generate a reorganized feature vector; A dimensionality reduction completion unit, which is used to project the reorganized feature set into the low-dimensional space by using the kernel principal component projection matrix, and generate a low-dimensional non-linear feature representation in combination with the EEG signal data set, completing the extraction and dimensionality reduction of the EEG signal features of the smart glasses.
9. A computer device, characterized in that, It includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the method according to any one of claims 1 to 7 when executing the computer program.
Citation Information
Patent Citations
Multichannel electroencephalogram data fusion and dimension descending method
CN104794505A
Intelligent glasses electroencephalogram signal noise reduction and feature extraction method, device and equipment
CN119740014A