Intelligent glasses electroencephalogram signal feature extraction and dimension reduction method, device and equipment
Through smart glasses, EEG signals are collected and feature extraction and dimensionality reduction are solved, and the problem of low signal quality is achieved, efficient feature extraction and analysis is achieved, suitable for real-time processing of portable devices, and feature interpretability is improved.
Patent Information
- Application Number
- CN202510578239.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2045-05-07
AI Technical Summary
When collecting EEG signals, smart glasses have low signal quality due to equipment size limitations, limited number of electrodes, large environmental interference, and variable user activity status, which brings greater challenges to feature extraction and analysis.
A method of extracting and dimensionality reduction of EEG signal features of smart glasses is adopted. EEG signals are collected through micro dry electrodes, time domain, frequency domain and time frequency domain features are extracted, feature atoms are decomposed and reorganized, kernel matrix is calculated and principal component analysis is performed, kernel principal component projection matrix is obtained, feature sets are projected into low-dimensional space, and low-dimensional nonlinear feature representation is generated.
It improves the characterization ability of EEG signals, separates noise interference and effective signal components, reduces computing resource occupation, is suitable for real-time processing of embedded devices, and enhances the interpretability of features.
Smart Images

Figure CN120105071A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of brain-computer interface technology, and in particular to a method, device and equipment for extracting and reducing the features of electroencephalogram (EEG) signals of smart glasses. Background Art
[0002] With the development of wearable device technology, smart glasses, as a new type of human-computer interaction device, can collect users' EEG signals in real time and in a portable manner by integrating micro EEG sensors, showing broad application prospects in the fields of brain-computer interface, neurological disease diagnosis, emotion recognition, etc. However, EEG signals have the characteristics of non-stationarity, nonlinearity, and high dimensionality. In particular, EEG signals collected in portable devices such as smart glasses have low signal quality due to factors such as device size limitations, limited number of electrodes, large environmental interference, and variable user activity states, which brings greater challenges to feature extraction and analysis.
[0003] In order to overcome the above difficulties, researchers have proposed various improved EEG signal feature extraction and dimensionality reduction methods. Among them, feature extraction techniques based on kernel methods, such as kernel principal component analysis (KPCA), map the original data to a high-dimensional feature space through nonlinear mapping, and perform principal component analysis in the high-dimensional space, which can effectively capture the nonlinear structure and characteristics of the data. However, the traditional KPCA method still has 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 detail information.
[0004] Therefore, a method is urgently needed to solve at least one of the above problems. Summary of the invention
[0005] The embodiments of the present application provide a method, device and equipment for extracting and reducing the feature of EEG signals of smart glasses. The method aims to solve the existing feature extraction technology based on kernel methods, such as kernel principal component analysis (KPCA), which maps the original data to a high-dimensional feature space through nonlinear mapping, and performs principal component analysis in the high-dimensional space, which can effectively capture the nonlinear structure and characteristics of the data. However, the traditional KPCA method still has 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 the problem of local features and detailed information.
[0006] In a first aspect, the present application provides a method for extracting and reducing the features of brain wave signals of smart glasses, including:
[0007] 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, and extracting time domain, frequency domain and time-frequency domain features according to the EEG signal data set to generate an original feature set;
[0008] Decomposing each feature vector in the original feature set to obtain a feature atom set, obtaining a response corresponding to each feature atom in the feature atom set, merging the feature atoms corresponding to each response into a feature group, and re-merging a plurality of feature groups to generate the feature atom set;
[0009] Based on the feature atomic set, each feature vector in the original feature set is reorganized at the atomic level to generate a reorganized feature set; and a kernel matrix corresponding to the reorganized feature set is calculated, the kernel matrix is mapped to a high-dimensional kernel space, and a principal component analysis is performed according to the original feature set to obtain a kernel principal component projection matrix;
[0010] The feature set is projected into a low-dimensional space using the kernel principal component projection matrix, and a low-dimensional nonlinear feature representation is generated in combination with the EEG signal data set, thereby completing the smart glasses EEG signal feature extraction and dimensionality reduction.
[0011] In a second aspect, the present application also provides a device for extracting and reducing the features of brain electrical signals of smart glasses, comprising:
[0012] A set acquisition unit, used for 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, and extracting time domain, frequency domain and time-frequency domain features according to the EEG signal data set to generate an original feature set;
[0013] A vector decomposition unit, used for decomposing each feature vector in the original feature set to obtain a feature atom set, obtaining a response corresponding to each feature atom in the feature atom set, merging the feature atoms corresponding to each response into a feature group, and re-merging a plurality of feature groups to generate the feature atom set;
[0014] an atomic recombination unit, for performing atomic-level recombination on each feature vector in the original feature set based on the feature atomic set to generate a reorganized feature set; and calculating a kernel matrix corresponding to the reorganized feature set, mapping the kernel matrix to a high-dimensional kernel space, performing principal component analysis according to the original feature set, and obtaining a kernel principal component projection matrix;
[0015] The dimensionality reduction completion unit is used to project the feature set into a low-dimensional space using the kernel principal component projection matrix, and generate a low-dimensional nonlinear feature representation in combination with the EEG signal data set to complete the smart glasses EEG signal feature extraction and dimensionality reduction.
[0016] In a third aspect, the present application also provides a computer device, including a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method for extracting and reducing the features of the EEG signals of smart glasses as described in the first aspect is implemented.
[0017] This method collects EEG signals through micro-dry electrodes on the frame / arm of smart glasses, extracts time domain, frequency domain, and time-frequency domain features, and generates an original feature set; decomposes the original feature vector to obtain a feature atom set, generates a new feature group by response merging, and reconstructs the feature atom set; calculates the kernel matrix of the reorganized feature set and maps it to a high-dimensional kernel space, and combines principal component analysis (PCA) to generate a kernel principal component projection matrix; uses the projection matrix to reduce the feature dimension to a low-dimensional space, and combines the original data to generate a standardized low-dimensional nonlinear feature representation.
[0018] By simultaneously extracting features in the time domain, frequency domain, and time-frequency domain, the problem of incomplete information in a single feature dimension is overcome, and the characterization ability of EEG signals is improved; by decomposing and reorganizing feature atoms, noise interference and effective signal components are separated to improve feature robustness; kernel principal component analysis (KPCA) effectively processes high-dimensional nonlinear data, avoids the linear assumption limitations of traditional PCA, and retains discriminative information; a dimensionality reduction process is designed based on the physical properties of micro-dry electrodes in smart glasses to reduce computing resource usage and make it suitable for real-time processing of embedded devices; the physical meaning and reliability indicators of low-dimensional features are annotated to enhance the interpretability of features in brain-computer interface (BCI) tasks.
[0019] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A schematic diagram of a process for extracting and reducing the EEG signal features of smart glasses according to an embodiment of the present application;
[0021] Figure 2 This is a schematic diagram of the structure of a device for extracting and reducing the EEG signal features of smart glasses according to an embodiment of the present application;
[0022] Figure 3 A schematic diagram of the structure of a computer device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0023] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may 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 prevent unnecessary details from obstructing the description of the present application.
[0024] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of 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 combinations thereof.
[0025] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0026] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0027] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0028] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0029] The technical solution of the embodiment of the present application is introduced below.
[0030] With the development of wearable device technology, smart glasses, as a new type of human-computer interaction device, can collect users' EEG signals in real time and in a portable manner by integrating micro EEG sensors, showing broad application prospects in the fields of brain-computer interface, neurological disease diagnosis, emotion recognition, etc. However, EEG signals have the characteristics of non-stationarity, nonlinearity, and high dimensionality. In particular, EEG signals collected in portable devices such as smart glasses have low signal quality due to factors such as device size limitations, limited number of electrodes, large environmental interference, and variable user activity states, which brings greater challenges to feature extraction and analysis.
[0031] In order to overcome the above difficulties, researchers have proposed various improved EEG signal feature extraction and dimensionality reduction methods. Among them, feature extraction techniques based on kernel methods, such as kernel principal component analysis (KPCA), map the original data to a high-dimensional feature space through nonlinear mapping, and perform principal component analysis in the high-dimensional space, which can effectively capture the nonlinear structure and characteristics of the data. However, the traditional KPCA method still has 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 detail information.
[0032] Another important feature extraction technology is dictionary learning. Dictionary learning adaptively learns an overcomplete dictionary and sparse coding, represents the signal as a sparse linear combination of dictionary atoms, can automatically discover the potential patterns and structures in the data, and has good data adaptability and feature representation capabilities. However, traditional dictionary learning methods mainly focus on single features, lack consideration of the correlation between different features, and the learned dictionary lacks hierarchical structure and semantic information.
[0033] In addition, most of the existing EEG signal feature extraction methods process the data of each stage independently, 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 smart glasses, a portable EEG acquisition device, there is an urgent need for a feature extraction and dimensionality reduction method that can overcome the problems of poor signal quality, low spatial resolution, and large noise interference, while having high computational efficiency and low resource consumption. A multi-stage integrated EEG signal feature extraction and dimensionality reduction method is proposed. By integrating kernel principal component analysis, dictionary learning, feature atom recombination and other technologies, the nonlinear features of EEG signals are adaptively extracted, and the optimization and dimensionality reduction are combined with preprocessing information, which improves 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 electrode is made of Ag / AgCl composite material, which has excellent conductivity and biocompatibility. The surface of the electrode is processed with 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 of more than 100MΩ and an input noise of less than 1μV, which can accurately amplify weak EEG signals (typical amplitude is μV level) to a suitable level. In the design of the amplification circuit, special consideration is given to the optimization of the common mode rejection ratio. A differential amplification structure is adopted, and the common mode rejection ratio exceeds 100dB, which effectively suppresses the influence of external electromagnetic interference. The filter group 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 cutoff frequency of the high-pass filter is set to 0.1Hz to remove slow baseline drift; the cutoff frequency of the low-pass filter is 100Hz to suppress high-frequency interference; and the 50 / 60Hz notch filter is used to eliminate the influence of power frequency interference. A multi-stage cascade structure is used in the filter design to ensure the selectivity and phase characteristics of the filter and avoid signal distortion. The system uses a 24-bit high-precision analog-to-digital converter to digitize the signal. The sampling rate can be adjusted from 250Hz to 1000Hz, and the dynamic range reaches 100dB. Considering the spectral characteristics and practical application requirements of EEG signals, the sampling rate is set to 500Hz 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 signal is 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 implements a complete quality control mechanism. During the acquisition process, the electrode impedance is continuously monitored, and an alarm is automatically triggered when the impedance value exceeds the preset threshold. Impedance monitoring uses a small signal AC excitation method with a measurement frequency of 10Hz and an excitation current of less than 10μA, which ensures measurement safety while not affecting the acquisition of EEG signals. The system also integrates advanced artifact detection algorithms, which can identify common artifacts such as blinking, electromyography, and movement in real time. These algorithms are based on a multi-feature fusion method, which comprehensively considers the time domain characteristics, frequency domain characteristics, and statistical characteristics of the signal to improve 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 to provide a basis for subsequent data screening and processing. Through the built-in three-axis accelerometer and gyroscope, the system can accurately identify the user's head movement status and automatically mark data segments that may contain motion artifacts. This multimodal quality control strategy not only ensures the reliability of the collected 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 was designed. In terms of signal-to-noise ratio evaluation, the energy ratios before and after preprocessing were calculated for key EEG rhythm frequency bands such as α (8-13Hz) and β (13-30Hz), and the denoising effect was evaluated by comparing the energy of the frequency bands. In terms of time domain waveform fidelity, two indicators, normalized mean square error and cross-correlation coefficient, were used. The cross-correlation coefficient focused on the similarity of the signals before and after preprocessing, while the mean square error reflected the overall level of signal fidelity. In terms of frequency domain feature preservation, the degree of frequency domain feature preservation was evaluated by calculating the Euclidean distance and Kullback-Leibler divergence of the power spectral density of the signal before and after preprocessing. At the same time, the removal effects of different types of artifacts were evaluated separately, including blink artifacts, electromyographic artifacts, and motion artifacts. The performance of artifact removal was evaluated by calculating the detection rate and false detection rate of these characteristic artifacts. Through this systematic evaluation system, it is ensured that the preprocessing can reduce noise and remove artifacts while maintaining the characteristic information of the original EEG signal to the greatest extent. After the above preprocessing process, the final preprocessed EEG signal data set X'={X'1,X'2,...,X'M} is obtained, where X'i represents the preprocessed EEG signal data of the i-th subject, which is a C×N' matrix, C represents the number of electrode channels, and N' represents the number of sampling points after preprocessing.
[0044] The time domain analysis of each channel signal sequence mainly includes 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, the mean μ=E[x(t)] is calculated to reflect the central trend level of the signal; the variance σ²=E[(x(t)-μ)²] describes the fluctuation amplitude of the signal; the skewness γ=E[(x(t)-μ)³] / σ³ characterizes the asymmetry of the distribution; the kurtosis Characterizes the sharpness of the distribution, where E[·] represents the expected operation. The morphological characteristics focus on describing the waveform structure characteristics of the signal, including the peak-to-peak value Vpp=max(x(t))-min(x(t)) reflecting the amplitude range of the signal, the zero-crossing rate ZCR=∑I{x(t)x(t-1)<0} / N characterizing 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) describing the intensity of the signal change, where I{·} is the characteristic function and N is the number of sampling points. These time domain features construct a systematic description of the time domain behavior of the signal from multiple perspectives.
[0045] In the frequency domain analysis, the power spectrum density P(f) of the signal is calculated by fast Fourier transform, and rich frequency domain features are extracted on the traditional EEG rhythm frequency band. By integrating the power spectrum density in the frequency bands of δ(0.5-4Hz), θ(4-8Hz), α(8-13Hz), β(13-30Hz), and γ(30-50Hz), the absolute energy characteristics of each frequency band are obtained. At the same time, the proportion of the energy of each frequency band to the total energy is calculated to obtain the relative energy characteristics, and the energy relationship characteristics between frequency bands are constructed by calculating the ratio of the energy of different frequency bands (such as α / β, θ / α, etc.). On this basis, the center of gravity frequency CF=∑fP(f) / ∑P(f) of each frequency band is calculated to describe the concentration trend of the spectrum, the spectrum entropy SE=-∑P(f)logP(f) characterizes the complexity of the spectrum distribution, and the spectrum edge frequency characterizes the energy accumulation characteristics. By calculating the power spectrum characteristics between different electrodes, the frequency domain connection characteristics between brain regions are established. For each pair of electrodes (i, j), their mutual 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 a frequency domain perspective.
[0046] Time-frequency analysis uses a method that combines continuous wavelet transform and Hilbert-Huang transform to achieve a fine characterization of the non-stationary characteristics of the signal. In wavelet analysis, complex Morlet wavelet is selected as the mother wavelet function, and its scale parameter setting covers the main EEG rhythm frequency bands. The time-frequency energy distribution diagram is obtained by calculating the modulus square of the wavelet coefficients, and the energy characteristics are extracted in different time-frequency regions. For each frequency band, the instantaneous energy sequence and its change characteristics are calculated to characterize the dynamic change law of signal energy over time. In Hilbert-Huang transform analysis, the signal is first subjected to empirical mode decomposition to obtain a set of intrinsic mode functions, each of which represents the oscillation mode of the signal at different scales. The Hilbert transform is calculated for each eigenmode function to obtain the analytical 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 characteristics of each eigenmode function are extracted to describe the modulation characteristics of the signal on different time scales. At the same time, by analyzing the phase synchronization between the eigenmode functions of different electrodes, the time-varying characteristics that characterize the dynamic coupling between brain regions are constructed. This analysis method that combines time domain and frequency domain can not only describe the local time-frequency characteristics of the signal, but also reflect the dynamic changes in the interaction between brain regions.
[0047] After extracting all kinds 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, the 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 characteristics of EEG signals from multiple levels 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, 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 re-merge multiple feature groups to generate a feature atom set.
[0049] Specifically, using the original feature set obtained in the above steps, the elements of each feature vector are perturbed one by one, input into the classifier to obtain the corresponding response vector, and the response vector is classified.
[0050] In some embodiments, decomposing each feature vector in the original feature set to obtain a feature atomic set includes: perturbing the elements of each feature vector in the original feature set one by one, inputting the elements into a classifier to obtain a response vector and classifying the response vector; and decomposing each feature vector in the original feature set according to the classification result of the response vector to obtain a feature atomic set.
[0051] First, a stable classifier is constructed as a benchmark for feature evaluation. Support vector machine (SVM) is used as the basic classifier, and the RBF kernel function is used to enhance the nonlinear feature mapping ability of the classifier. The classifier is trained by stratified cross-validation. The original feature set F={f1,f2,...,fK} obtained in the above steps is divided into a training set and a validation set in a ratio of 7:3. The training labels are annotated according to the task states recorded in the acquisition experiment, covering multiple states such as resting state, cognitive tasks, and emotional stimulation. In order to improve the generalization ability of the classifier, the grid search method is used to optimize the parameter γ and penalty factor C of the RBF kernel function during the training process. The search range of parameter γ is set to [2^-5,2^5], with an exponential growth of 2 steps; the search range of penalty factor C is [2^0,2^10], and the step size also uses exponential growth. For each set of parameter combinations, the classification accuracy and F1 score on the validation set are calculated, and the parameter combination with the best comprehensive performance is selected as the final classifier parameter.
[0052] After obtaining the trained classifier, a 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 perturbations on each component in the feature vector (including time domain features, frequency domain features, and time-frequency domain features). For the jth component fij in the feature vector fi, a Gaussian noise with a mean of 0 and a variance of σ² is injected, that is, 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 perturbation intensity setting takes into account the dimensional differences of different feature components, ensuring the perceptibility of the perturbation while avoiding excessive distortion. At the same time, in order to maintain the physical meaning of the feature, the validity of the perturbed feature value is checked. For example, for features representing energy, ensure that the perturbed value remains non-negative; for features representing ratios, ensure that the perturbed value remains in the interval [0,1]. If the perturbation causes the feature value to exceed the valid range, it is adjusted by truncation or resampling. Perform 100 independent perturbations on each feature component to obtain statistically reliable response samples.
[0053] The perturbed feature vector is input into the trained SVM classifier to obtain the response. The classifier outputs a response vector ri=[p0,P1] for each perturbed sample, where p0 and P1 represent the posterior probability that the sample belongs to two categories, respectively. These probability values are calculated by the decision function of the SVM, reflecting the positional relationship between the sample and the decision hyperplane in the feature space. A response evaluation mechanism based on KL divergence is designed to evaluate the importance of the feature by comparing the changes in the response vector before and after the perturbation. For the original response vector r and the perturbed response vector r', their KL divergence is calculated: 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 effect on the classification result, and its response is classified as "maintaining the original category"; otherwise, it is classified as "changing to other categories". After obtaining the responses of all perturbed samples, the response pattern matrix M is constructed, and the rows of the matrix correspond to different perturbation experiments, and the columns correspond to different response categories. Each element mij in the matrix is assigned a continuous weight value w=1 / (1+exp(-α(d-β))) according to the amplitude of the change of the response vector, where α and β are parameters used to adjust the shape of the weight curve.
[0054] Finally, by calculating the importance score s=∑∑mijwij of each feature component, the classification result of the feature response R={R1,R2,...,RK} is obtained, where Ri represents the response category label of each component of the i-th feature vector. Each response category label is a binary variable, 1 means that the category changes due to the perturbation of the feature component, and 0 means that the original category remains. The classification result reflects the degree of influence of different feature components on the classification performance.
[0055] According to the response classification result R={R1,R2,...,RK} obtained in the above steps, the feature vectors in the original feature set F={f1,f2,...,fK} are grouped. For each feature vector fi, the feature components with the same response pattern are summarized into the same feature subset according to its response category label Ri. This grouping method ensures that 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 label of each component, the band energy feature and the IMF feature may be grouped into the same subset because they have similar effects on the classification results. The feature subset formation process adopts an iterative method. First, two empty feature subsets F1 and F2 are initialized, corresponding to the feature components that maintain the original category and change the category, respectively. In the process of traversing the response labels of the feature vector, not only the category affiliation 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 during subsequent feature reconstruction.
[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 a linear combination of these atoms. These feature atoms can be regarded as basic patterns in the feature space. For example, in EEG signal analysis, a feature atom may represent a feature combination corresponding to a specific cognitive state or emotional pattern. For the feature subset Fi, an overcomplete dictionary Di and the corresponding sparse coding coefficient matrix Ai are constructed. The column vector of the dictionary Di represents the feature atoms, and its number is set to twice the dimension of the feature vector. This overcompleteness makes the dictionary more expressive. If the dimension of the original feature vector is 100, the corresponding dictionary will contain 200 feature atoms, which can more finely characterize the structure of the feature space. The optimization goal of dictionary learning is to minimize the reconstruction error and maintain the sparsity of the coding, expressed as minimize (Di,Ai) ∑||fij- Diaij||^2 + ||aij||1,subject to ||di||2 ≤ 1, i. This optimization problem is solved by using an alternating iterative strategy, where the dictionary and sparse coding coefficients are optimized separately in each iteration. is a mathematical symbol that means "for all" or "for each one". "i" is the index of the dictionary atom, indicating the i-th atom in the dictionary D. i" together, indicating that the constraint applies to every atom di in the dictionary D, not just a specific atom.
[0057] In the process of dictionary learning, multiple techniques are used to improve the performance and reliability of the algorithm. In the sparse coding stage, the improved LARS-Lasso algorithm is used to solve the sparse coding coefficients aij. The algorithm gradually increases the number of active coefficients by path tracing until the preset sparsity requirement is reached. In order to speed up 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 that need to be processed in each iteration. In the dictionary update stage, the Block-Coordinate Descent method is used to update one dictionary atom at a time. During the update process, the projection algorithm is used to ensure that the dictionary atoms meet the unit norm constraint, and 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 feature atom mainly reflects the energy distribution of the α band, then other atoms will be optimized to capture feature patterns in different frequency bands or different spatial positions.
[0058] In order to ensure the stability and interpretability of the dictionary learning results, multiple regularization constraints are introduced in the optimization process. The first is the non-negative constraint, which requires that all elements of the dictionary atoms are non-negative values, which is consistent with the physical meaning of EEG features, because many features themselves are non-negative (such as energy, entropy, etc.). The second is the group sparsity constraint, which uses L2 / L1 norm regularization to force dictionary atoms to capture the group structure of features. For example, if certain time domain features often appear at the same time, the group sparsity constraint will tend to use one dictionary atom to represent this group of features. In addition, local structure-based regularization is used to maintain the smoothness of feature atoms in the local neighborhood. The introduction of these constraints significantly improves the interpretability and generalization ability of dictionary atoms.
[0059] The final feature atom set is represented as A={A1,A2,...,AN}, where N represents the total number of feature atoms, and each feature atom Ai is a vector containing the basic pattern 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 feature atoms can not only effectively reconstruct the original features, but also have good semantic interpretability. For example, by analyzing the structure of feature atoms, it can be found that a certain atom may mainly correspond to the theta band activity in the prefrontal region, while another atom may reflect the beta band characteristics in the temporal region.
[0060] In some embodiments, the re-merging of the feature atom set based on the plurality of feature groups includes: extracting the central feature vector of each feature group and performing pairwise merging between groups until a preset number of groups is reached, and re-generating the merged feature atom set.
[0061] The feature atom set A={A1,A2,...,AN} obtained by the above steps is hierarchically merged. Each feature atom Ai represents a basic pattern in the original feature space, which reflects the feature combination of EEG signals in different physiological or cognitive states. Taking cognitive task data analysis as an example, one feature atom may capture the feature pattern of the increase of the prefrontal θ band energy and the decrease of the α band energy when the working memory load increases, while another feature atom may represent the feature combination of the enhanced temporal β band energy when the attention is focused. Feature atoms with the same response category are grouped together to construct the initial feature atom group structure. In the attention analysis task, an initial group may contain all feature atoms related to changes in attention level, such as the prefrontal β band energy, P300 event-related potential features, etc.; another group may gather feature atoms reflecting the relaxation state, such as the occipital α band energy features. This initial grouping based on response categories ensures that feature atoms with similar functions are processed centrally.
[0062] For each feature atom group Gi, the central feature vector is calculated by the weighted average of all feature atoms in the group: ci=∑(wjAj) / ∑wj, where wj represents the weight of feature atom Aj. The weight design comprehensively considers the usage frequency and reconstruction error of feature atoms. The usage frequency reflects the importance of feature atoms in data reconstruction, which is measured by counting the number of occurrences of non-zero coefficients in sparse coding; the reconstruction error characterizes the expression accuracy of feature atoms, which is evaluated by calculating the average error when the atom participates in reconstruction. In the emotion recognition task, if a feature atom appears frequently in expressing positive emotion samples and has a small reconstruction error, then the atom will obtain a higher weight when calculating the central feature vector. This weighting strategy not only considers the usage frequency of feature atoms, but also pays attention to their reconstruction performance, so that the central feature vector can more accurately reflect the core characteristics of feature atoms in 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 improved cosine similarity is used to calculate the similarity between feature atomic groups: sim(Gi,Gj)=(ci·cj) / (||ci||2||cj||2). The similarity calculation process introduces the physical meaning weights of the feature components, and assigns different weight coefficients to different types of features in EEG signal analysis. For example, when evaluating atomic groups related to working memory, the feature matching degree of the prefrontal theta band and alpha band is given a higher weight because these features are closely related to working memory load. The system also considers the continuity of spatial position and assigns higher combined weights to features from adjacent brain regions. When calculating the similarity of attention state feature groups, not only the matching degree of spectral features is considered, but also the consistency of time domain features, such as the morphological characteristics of event-related potentials. This multi-dimensional similarity measure ensures that the merging process of feature atoms conforms to the cognitive laws of neurophysiology.
[0064] Based on the calculated similarity matrix, the system adopts a bottom-up hierarchical clustering strategy for merging. In the iterative process, the two groups with the highest similarity are selected for merging to construct a new feature atom group. The central feature vector of the new group is calculated by merging the weighted combination of the first 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 small number of fatigue state feature atoms, the new central feature vector will retain more features of the large group and maintain 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] In order to ensure that the merging process does not oversimplify 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 the merging: IG=H(G)-∑(|Gk| / |G|)H(Gk). In the emotion recognition task, if the merging of two feature atomic groups representing the "pleasure" and "excitement" states respectively will lead to a significant decrease in the ability to distinguish between the two emotions, that is, the information gain is lower than the set threshold, and the system will automatically reject this merging. This adaptive termination mechanism can find a suitable merging granularity in different application scenarios. At the same time, the system continuously monitors the performance of each newly formed feature atomic group in the original task, and evaluates the merging effect by calculating indicators such as classification accuracy and F1 score. When it is found that a certain merging leads to a decline in performance, the system will adjust the merging strategy and restore to a combination with better performance through the backtracking mechanism.
[0066] Finally, the merged feature atom set A'={A'1,A'2,...,A'M} is obtained, where M represents the number of merged feature atom groups 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 contain a comprehensive feature representation of attention level, working memory load and fatigue level at the same time, which can more comprehensively characterize the changes in the cognitive state of the subject. For example, in the application of driving fatigue detection, the merged feature atoms may integrate multiple basic features such as the increase in the energy of the prefrontal θ wave, the decrease in the energy of the α wave, and the change in the blinking frequency, forming a comprehensive feature pattern that can effectively identify the fatigue state.
[0067] Step S103, based on the feature atomic set, each feature vector in the original feature set is reorganized at the atomic level to generate a reorganized feature set; and the kernel matrix corresponding to the reorganized feature set is calculated, the kernel matrix is mapped to a high-dimensional kernel space, and principal component analysis is performed according to the original feature set to obtain the kernel principal component projection matrix.
[0068] Specifically, the original feature set is reorganized at the atomic level: based on the merged feature atomic set obtained in the above steps, each feature vector in the original feature set obtained in the above steps is reorganized at the atomic level to generate a new feature vector to obtain a reorganized feature set.
[0069] In some embodiments, the atomic-level reorganization of each feature vector in the original feature set includes: calculating the weighted cosine similarity between each feature vector and the merged feature atom set, and selecting multiple feature atoms with the highest similarity based on a soft threshold strategy; constructing a coding matrix corresponding to the feature atoms, and solving the coding coefficients through an optimization problem containing a sparse regularization term; normalizing the coding coefficients, and introducing a local structure preservation constraint to generate a reorganized feature vector.
[0070] Based on the merged feature atom set A'={A'1,A'2,...,A'M} obtained in the above steps, each feature vector in the original feature set F obtained in the above steps is reorganized at the atomic level. The reorganization process first calculates the similarity relationship between the original feature vector and the merged feature atom. For the feature vector fj, the cosine similarity between it and each feature atom A'i is calculated respectively: sim(fj,A'i)=(fj·A'i) / (||fj||2||A'i||2). In the similarity calculation, the physical meaning of the feature components is considered, and a weighted calculation method is used for different types of features. For example, when processing the cognitive state characteristics of EEG signals, if a feature vector contains a combination of features related to the prefrontal θ band and working memory, then when calculating its similarity with the feature atom representing cognitive load, these feature components will obtain a higher weight. Based on the calculated similarity, the m feature atoms that are most similar to the original feature vector are selected as the basis for reorganization. The selection process adopts a soft threshold strategy, that is, not only the absolute value of the similarity is considered, but also the relative distribution of the similarity is paid attention to. This selection strategy can better maintain the structure of features. In the application of driving fatigue detection, assuming that an original feature vector contains features such as increased blinking frequency and reduced occipital alpha wave energy, the system will prioritize those feature atoms that can comprehensively express the fatigue state for reorganization.
[0071] For the selected m feature atoms, the encoding matrix Ej is constructed. Each row of the encoding matrix corresponds to a selected feature atom, and the matrix elements reflect the contribution of the feature atom to the reorganized feature. The construction of the encoding matrix takes into account the relationship between the feature atoms, and is solved by the optimization problem: minimize ||fj-EjA'||2 + α||Ej||1. The first term represents the reconstruction error, the second term is the sparse regularization term, and α is the balance parameter. The solution of this optimization problem adopts an iterative shrinkage algorithm, and the elements of the encoding matrix are updated through a soft threshold operation in each iteration. Taking the emotion recognition task as an example, if a feature vector reflects the "pleasure" emotional state, then in the reorganization process, the feature atoms related to positive emotions will obtain a larger encoding coefficient, while the feature atoms related to negative emotions may obtain a coefficient close to zero. The core of the reorganization process is to map the original features to the new feature space through the encoding matrix. For the feature vector fj, its reorganized feature vector is calculated as: f'j=EjA'. This mapping process realizes the conversion from the original feature to the feature atom-based representation. Normalization operation is introduced in the calculation process to ensure the scale consistency of the reorganized features.
[0072] In order to improve the robustness of the recombination, a local structure preservation constraint is introduced in the recombination process. For similar feature vectors in the original feature space, it is required that they still maintain a similar relationship after recombination. This constraint is achieved by adding a structure preservation term to the optimization objective: L(fi,fj)=||f'i-f'j||2 / ||fi-fj||2. By minimizing this local structure loss, it is ensured that the recombination process does not destroy the intrinsic structure of the feature. In EEG signal analysis, this constraint is particularly important because it ensures that features of similar cognitive states or emotional states can still be correctly identified after recombination. Through the above atomic-level recombination process, the reorganized feature set F'={f'1,f'2,...,f'N} is finally obtained, where N represents the number of feature vectors. Each reorganized feature vector f'i is a compact representation based on the merged feature atom, which not only maintains the discriminant information of the original feature, but also obtains higher expression efficiency. For example, in a fatigue driving detection system, the reorganized features integrate multiple originally scattered fatigue indicators (such as alpha wave changes, blinking characteristics, reaction time, etc.) into a small number of comprehensive features, each of which can characterize the driver's fatigue state from different angles.
[0073] The kernel matrix is constructed based on the reorganized feature set F'={f'1,f'2,...,f'N} obtained in the above steps. The construction of the kernel matrix aims to capture the nonlinear relationship between feature vectors and enhance its expressiveness by mapping the features to a high-dimensional space. First, the Euclidean distance matrix D between all samples in the reorganized feature set is calculated. The calculation process uses the inner product relationship of the 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 processing feature vectors containing time domain features and frequency domain features, the calculation amount of distance matrix construction can be significantly reduced by pre-calculating the L2 norm square and inner product of all feature vectors. After obtaining the distance matrix D, the Gaussian kernel function is used 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 bandwidth parameter σ has an important impact on the performance of the kernel matrix. Too large a σ value will cause the similarity of all samples to tend to be equal, while too small a σ value will make the relationship between samples too sparse. The adaptive method based on median distance is used to determine the σ value: σ=median({Dij})*β, where median({Dij}) represents the median of all sample distances, and β is an adjustment factor, usually set between 0.1 and 1. In practical applications, such as emotion recognition tasks, larger β values are conducive to capturing the gradual characteristics of emotional states; while in attention detection tasks, smaller β values can better distinguish different attention levels.
[0074] The construction of the kernel matrix takes into account the multi-scale characteristics of the features and introduces a scale mixing strategy to perform a weighted combination of kernel matrices under different bandwidth parameters: 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 coefficient is determined by minimizing the classification error on the validation set. This multi-scale kernel matrix can capture both the local and global structures of the features. In EEG signal analysis, different cognitive states may manifest themselves on different time scales. For example, the evolution of fatigue state is a slow process, while fluctuations in attention may occur on a shorter time scale. At the same time, a local structure preservation constraint is 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. In order to improve the stability of the kernel matrix, the kernel matrix is spectrally decomposed: K=U U^T, where is the eigenvalue diagonal matrix, and U is the corresponding eigenvector matrix. '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] At the same time, the mapping function ψ(·) is introduced to map the original feature set F to 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 selection of the bandwidth of the kernel function. Usually a larger bandwidth is selected to obtain a smoother mapping. In the attention level analysis task, if the original features contain features that directly reflect attention, such as the prefrontal beta band energy and P300 amplitude, these features will be reasonably expressed in the kernel space. For example, the nonlinear relationship between the beta band energy and the P300 amplitude will be transformed into a linear relationship in the kernel space, thereby more accurately reflecting the changes in the attention level. For each original feature vector fi, its coordinate ψ(fi) in the kernel space is calculated by the kernel technique, and these coordinate information serves as supplementary information for the subsequent principal component analysis.
[0079] When performing principal component analysis in kernel space, we need to solve the following optimization problem: 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 kth principal component direction. This optimization problem is transformed into the eigenvalue decomposition problem of the kernel matrix K through dual form: KA=λA. By solving the characteristic equation, the eigenvalues λ1≥λ2≥...≥λd and the corresponding eigenvectors α1,α2,...,αd in descending order 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 avoids direct calculation in the high-dimensional kernel space and greatly reduces the computational complexity. In practical applications, such as working memory task analysis, each principal component has a clear physical meaning. The first principal component usually corresponds to the main change direction of working memory load, which can reflect the trend of the increase of prefrontal θ wave energy with increasing load; the second principal component may capture the change of task difficulty, which is reflected in the modulation of β band energy; and the third principal component may reflect the degree of fatigue, which is manifested as a slow change of α band energy.
[0081] In order to enhance the interpretability of the principal component, the original feature information is integrated into the principal component construction process. For the kth principal component direction wk, the projection coefficient of the original feature in this direction is calculated: βk=(1 / N)∑αkiψ(fi). The calculation process of the projection coefficient takes into account the weight of the sample. The sample weight is determined according to its projection value in the principal component direction. The sample with a larger projection value obtains a higher weight. This weighting strategy ensures that the principal component can better reflect the main change trend of the data. The projection coefficient indicates the contribution of the original feature to the principal component and can be used for feature importance analysis. For example, in fatigue driving detection, if the projection coefficient of the blinking frequency feature is large, it means that this feature has a significant effect on the judgment of fatigue state; if the projection coefficient of the alpha wave energy feature of a certain brain area is large, it indicates that the brain area plays a key role in fatigue state detection.
[0082] In the process of principal component construction, a local structure preservation constraint is also introduced: ∑∑Wij||wk^T(φ(f'i)-φ(f'j))||². Among them, Wij is the adjacency weight matrix constructed based on the original feature space, and the hot kernel weight calculation method is adopted: Wij=exp(-||fi-fj||² / t), and 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 excitement, the local structure preservation constraint can ensure that the gradual 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, we finally get the kernel principal component projection matrix W=[β1,β2,...,βd]^T, where each row corresponds to a principal component direction. This projection matrix contains both the nonlinear feature information in the kernel space and the physical interpretability of the original features. For example, in cognitive state analysis, the projection matrix can convert complex EEG features into a small number of principal components, each of which has a clear physiological interpretation. The first principal component may represent the overall cognitive load level, which is reflected in the coordinated changes in the frontal theta wave and the occipital alpha wave; the second principal component may reflect the state of attention allocation, which is mainly manifested in the spatial distribution characteristics of the beta band energy; the third principal component may describe the degree of fatigue, which integrates the information of the alpha wave energy change and the blinking characteristics. This principal component analysis method that combines the kernel method and the original features maintains the physical meaning and interpretability of the features while reducing the dimension.
[0084] Step S104, using the kernel principal component projection matrix to project the feature set into a low-dimensional space, and combining the EEG signal data set to generate a low-dimensional nonlinear feature representation, to complete the smart glasses EEG signal feature extraction and dimensionality reduction.
[0085] Specifically, the kernel principal component projection matrix obtained in the above steps is used to project the reorganized feature set obtained in the above steps from the high-dimensional kernel space to the low-dimensional space, and at the same time, the preprocessed EEG signal data set obtained in the above steps is fine-tuned to obtain the final low-dimensional nonlinear feature representation.
[0086] In some embodiments, the use of the kernel principal component projection matrix to project the feature set to a low-dimensional space includes: mapping the reorganized 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 based on 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, generating low-dimensional space projection coordinates, and projecting the feature set to a low-dimensional space.
[0087] Using the kernel principal component projection matrix W obtained in the above steps, the reorganized feature set F' in the above steps is projected from the high-dimensional kernel space to the low-dimensional space. For the reorganized feature vector f'i, it is first mapped to the kernel space, and then projected 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 attention state analysis, if the principal component direction reflects the trend of the change of the attention level, then the size of the projection coordinate directly corresponds to different attention states, and a larger coordinate value indicates a higher level of attention, and a smaller coordinate value corresponds to a state of distracted attention. For example, when the subject focuses on a complex cognitive task, the projection coordinate presents a higher value in the principal component direction reflecting attention, and also shows significant activity in the principal component direction representing cognitive load.
[0088] Exemplarily, the method of generating a low-dimensional nonlinear feature representation by combining 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 feature weights through an attention mechanism, and outputting the low-dimensional nonlinear feature representation.
[0089] In order to make full use of the information of the original EEG signal, the present invention designs a mapping function g(·) to fuse the preprocessed EEG signal data X' obtained in the above steps with the projection result. 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 distribution of the two features through nonlinear transformation; and the fusion layer integrates the two parts of information to generate the final feature representation. The optimization goal 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 a 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 characteristics of the P300 component, while the kernel principal component projection results better express the spatial features, such as the coordinated pattern of activities in different brain regions. Through a carefully designed mapping function, these two types of complementary features are effectively integrated.
[0090] Exemplarily, before outputting the low-dimensional nonlinear feature representation, the method further includes: applying continuity constraints and consistency constraints in the fusion network to maintain the similarity and spatiotemporal consistency of feature distribution.
[0091] In the process of optimizing the mapping function, the present invention adopts a segmented training strategy and introduces multiple constraints. The first is the continuity constraint, which requires similar inputs to produce similar output features, which is achieved by adding a similarity preservation term to the loss function: Lsim=∑∑(||g(X'i)-g(X'j)||^2 / ||X'i-X'j||^2). The second is the consistency constraint. For data in the same time window, the low-dimensional representation obtained from the two features should be consistent, which is achieved by minimizing the feature difference 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 induces pleasant emotions, the mapping function needs to simultaneously maintain the projection features reflecting emotional changes in the kernel principal component space and the time domain features reflecting emotional responses in the original EEG data. The constraints ensure that these two types of features are expressed in a coordinated and consistent manner in the low-dimensional space. At the same time, the design of the mapping function takes special consideration of the physical meaning of the features. The local connection structure is used in the projection layer to maintain the spatial correlation, the monotonic activation function is used in the alignment layer to maintain the order relationship, and the feature weights are dynamically adjusted through the attention mechanism in the fusion layer.
[0092] For the reorganized feature vector f'i, the final low-dimensional feature representation is obtained after processing by 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, low-dimensional features effectively integrate information at multiple levels: the kernel principal component projection captures the long-term trend of the driver's fatigue level, such as the gradual increase in α wave energy and the continuous extension of reaction time; while the original EEG data provides an accurate characterization of the instantaneous state, such as sudden sleep 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 was detected that the driver's α wave energy increased significantly and the blinking frequency increased abnormally, these changes would be reflected in the corresponding components of the low-dimensional features, forming a comprehensive representation of the fatigue state.
[0093] The final low-dimensional nonlinear feature representation set It contains low-dimensional representations of all samples, where N is the number of reorganized feature vectors and M is the number of EEG signal data samples after preprocessing. Each low-dimensional feature vector is a compact representation of the original feature in the optimization space, which not only maintains the key patterns extracted by kernel principal component analysis, but also retains the important features of the original EEG signal. This feature representation method combining multi-source information significantly improves the expressiveness and robustness of the features, and shows excellent performance in complex cognitive state analysis tasks.
[0094] The provided method has the following beneficial effects:
[0095] 1. Constructing 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 data through dictionary learning, and then related feature atoms are combined through hierarchical grouping to form high-level feature patterns. This hierarchical feature representation method can better characterize the multi-scale characteristics and intrinsic correlations of EEG signals, so that the learned features have clear physical meanings and interpretability.
[0096] 2 Improve the adaptability and robustness of feature representation. The present invention uses atomic-level recombination and kernel matrix construction methods to achieve adaptive optimization of features. Atomic-level recombination is adaptively reconstructed based on feature importance, and kernel matrix construction captures the nonlinear relationship between features. This technical solution combining feature recombination and kernel methods significantly improves the adaptability of feature representation, enables features to better adapt to different task scenarios, and enhances the anti-noise ability of features.
[0097] 3. Achieve efficient nonlinear dimensionality reduction and feature fusion. The present invention achieves nonlinear dimensionality reduction and multi-source information fusion of features through kernel principal component analysis and mapping function optimization. Kernel principal component analysis extracts the main change direction of the data, and the mapping function optimizes and integrates the reorganized features and the original signal features. This kernel-based dimensionality reduction and fusion strategy significantly reduces the feature dimension while maintaining feature discriminant information, and improves the compactness and computational efficiency of feature representation.
[0098] In order to implement the smart glasses EEG signal feature extraction and dimensionality reduction method corresponding to the above method embodiment, to achieve the corresponding functions and technical effects. Figure 2 , Figure 2 The structural block diagram of a smart glasses EEG signal feature extraction and dimensionality reduction device 200 provided in an embodiment of the present application is shown. For the convenience of description, only the parts related to the present embodiment are shown. The smart glasses EEG signal feature extraction and dimensionality reduction device 200 provided in an embodiment of the present application includes:
[0099] A set acquisition unit 201 is used to collect EEG signals of the wearer according to the micro dry electrodes in the frame and temples of the smart glasses to form an EEG signal data set, and extract time domain, frequency domain and time-frequency domain features according to the EEG signal data set to generate an original feature set;
[0100] A vector decomposition unit 202 is used to decompose each feature vector in the original feature set to obtain a feature atom set, obtain a response corresponding to each feature atom in the feature atom set, merge the feature atoms corresponding to each response into a feature group, and re-merge multiple feature groups to generate the feature atom set;
[0101] The atomic reorganization unit 203 is used to perform atomic-level reorganization on each feature vector in the original feature set based on the feature atomic 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;
[0102] The dimensionality reduction completion unit 204 is used to project the feature set into a low-dimensional space using the kernel principal component projection matrix, and generate a low-dimensional nonlinear feature representation in combination with the EEG signal data set to complete smart glasses EEG signal feature extraction and dimensionality reduction.
[0103] The above-mentioned smart glasses EEG signal feature extraction and dimensionality reduction device 200 can implement the smart glasses EEG signal feature extraction and dimensionality reduction method of the above-mentioned method embodiment. The options in the above-mentioned method embodiment are also applicable to this embodiment and will not be described in detail here. The rest of the contents of the embodiment of this application can refer to the contents of the above-mentioned method embodiment, and will not be repeated in this embodiment.
[0104] Figure 3 This is a schematic diagram of the structure of a computer device provided in one embodiment of the present application. Figure 3 As shown, the computer device 3 of this embodiment includes: at least one processor 30 ( Figure 3 Only one is shown in the figure), a memory 31 and a computer program 32 stored in the memory 31 and executable on the at least one processor 30, wherein the processor 30 implements the steps of any of the above method embodiments when executing the computer program 32.
[0105] The computer device 3 may be a computing device such as a smart phone, a tablet computer, a desktop computer, a cloud server, etc. The computer device may include but is not limited to a processor 30 and a memory 31. Those skilled in the art will understand that Figure 3 It is only an example of computer device 3 and does not constitute a limitation on computer device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.
[0106] The processor 30 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0107] In some embodiments, the memory 31 may be an internal storage unit of the computer device 3, such as a hard disk or memory of the computer device 3. In other embodiments, the memory 31 may also be an external storage device of the computer device 3, 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 an internal storage unit and an external storage device of the computer device 3. The memory 31 is used to store an operating system, an application program, a boot loader (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 further provides a computer-readable storage medium, wherein the computer-readable storage medium stores 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. When the computer program product is run on a computer device, the computer device implements the steps in the above-mentioned method embodiments when executing the computer device.
[0110] In several embodiments provided in the present application, it is understood that each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved.
[0111] If the 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 this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
[0112] The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the scope of protection of the present application. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of protection of the present application.
Claims
1. A method for extracting and reducing the feature of EEG signals of smart glasses, characterized in that: include: 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, and extracting time domain, frequency domain and time-frequency domain features according to the EEG signal data set to generate an original feature set; Decomposing each feature vector in the original feature set to obtain a feature atom set, obtaining a response corresponding to each feature atom in the feature atom set, merging the feature atoms corresponding to each response into a feature group, and re-merging a plurality of feature groups to generate the feature atom set; Based on the feature atomic set, each feature vector in the original feature set is reorganized at the atomic level to generate a reorganized feature set; and a kernel matrix corresponding to the reorganized feature set is calculated, the kernel matrix is mapped to a high-dimensional kernel space, and a principal component analysis is performed according to the original feature set to obtain a kernel principal component projection matrix; The feature set is projected into a low-dimensional space using the kernel principal component projection matrix, and a low-dimensional nonlinear feature representation is generated in combination with the EEG signal data set, thereby completing the smart glasses EEG signal feature extraction and dimensionality reduction.
2. The method according to claim 1, characterized in that Decomposing each feature vector in the original feature set to obtain a feature atom set includes: Performing perturbation processing on the elements of each feature vector in the original feature set one by one, inputting the elements into the classifier to obtain a response vector and performing classification; According to the classification result of the response vector, each feature vector in the original feature set is decomposed to obtain a feature atom set.
3. The method according to claim 1, characterized in that The step of re-merging the plurality of feature groups to generate the feature atom set comprises: The central feature vector of each feature group is extracted and merged in pairs until a preset number of groups is reached, and the merged feature atom set is regenerated.
4. The method according to claim 1, characterized in that: The atomic-level reorganization of each feature vector in the original feature set includes: Calculating the weighted cosine similarity between each feature vector and the merged feature atom set, and selecting multiple feature atoms with the highest similarity based on a soft threshold strategy; Constructing a coding matrix corresponding to the characteristic atoms, and solving the coding coefficients by an optimization problem including a sparse regularization term; The coding coefficients are normalized, and a local structure preservation constraint is introduced to generate a reorganized feature vector.
5. 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 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 projection coefficients of the original feature set on the principal component directions; The kernel principal component projection matrix is generated according to the projection coefficients and in an optimization process that introduces local structure preservation constraints.
6. The method according to claim 1, characterized in that The projecting the feature set to a low-dimensional space using the kernel principal component projection matrix includes: Mapping the reorganized 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; The multi-layer mapping function is adjusted by an optimization objective function including a regularization term to generate low-dimensional space projection coordinates, and the feature set is projected into the low-dimensional space.
7. The method according to claim 6, characterized in that The step of combining the EEG signal data set to generate a low-dimensional nonlinear feature representation comprises: The low-dimensional space projection coordinates and the preprocessed EEG signal data set are input into a multi-layer fusion network to dynamically adjust feature weights through an attention mechanism and output the low-dimensional nonlinear feature representation.
8. The method according to claim 7, characterized in that Before outputting the low-dimensional nonlinear feature representation, the method further includes: Continuity constraints and consistency constraints are imposed in the fusion network to maintain the similarity and spatiotemporal consistency of feature distribution.
9. A device for extracting and reducing the feature of brain wave signals of smart glasses, characterized in that: include: A set acquisition unit, used for 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, and extracting time domain, frequency domain and time-frequency domain features according to the EEG signal data set to generate an original feature set; A vector decomposition unit, used for decomposing each feature vector in the original feature set to obtain a feature atom set, obtaining a response corresponding to each feature atom in the feature atom set, merging the feature atoms corresponding to each response into a feature group, and re-merging a plurality of feature groups to generate the feature atom set; an atomic recombination unit, for performing atomic-level recombination on each feature vector in the original feature set based on the feature atomic set to generate a reorganized feature set; and calculating a kernel matrix corresponding to the reorganized feature set, mapping the kernel matrix to a high-dimensional kernel space, performing principal component analysis according to the original feature set, and obtaining a kernel principal component projection matrix; The dimensionality reduction completion unit is used to project the feature set into a low-dimensional space using the kernel principal component projection matrix, and generate a low-dimensional nonlinear feature representation in combination with the EEG signal data set to complete the smart glasses EEG signal feature extraction and dimensionality reduction.
10. A computer device, characterized in that: The method comprises 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 8 when executing the computer program.
Citation Information
Patent Citations
Multichannel electroencephalogram data fusion and dimension descending method
CN104794505A
Individualized dynamic intention feature extraction method based on electroencephalogram signals and related device
CN117473303A
Intelligent glasses electroencephalogram signal noise reduction and feature extraction method, device and equipment
CN119740014A
Cited By
Medical monitoring sensing data association storage method and system based on machine learning
CN120910518A
Machine learning based medical monitoring sensor data correlation storage method and system
CN120910518B