Brain Electrical Distortion Detection and Recovery Method and Device Based on Wavelet Domain Energy Modulation

Through the method based on wavelet domain energy modulation, the time-frequency characteristics of the EEG signal are extracted and modulated and processed, the problem of poor noise removal effect in the prior art is solved, intelligent detection and recovery of various distortion conditions is achieved, and the accuracy and robustness of detection and recovery are improved.

CN119719723BActive Publication Date: 2025-06-17XIAOZHOU TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510242390.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-03
Publication Date
2025-06-17
Estimated Expiration
2045-03-03

AI Technical Summary

Technical Problem

The existing EEG signal denoising methods lack biological interpretation capabilities and the adequacy of using prior domain knowledge, resulting in limited denoising effect.

Method used

The EEG distortion detection and recovery method based on wavelet domain energy modulation is adopted, and the energy spectrum is obtained through time-frequency transformation, and the modulation process is performed based on the preset intensity threshold, the wavelet coefficient characteristics are extracted, and the comprehensive distortion feature description is generated based on the similarity calculation and weight assignment, and the signal recovery is finally achieved through wavelet coefficient adjustment.

Benefits of technology

It realizes intelligent adaptive detection and recovery of various EEG distortion conditions, makes full use of the time-frequency characteristics of EEG signals, improves the accuracy and robustness of distortion detection and recovery, and enhances the system's adaptability and self-regulation capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119719723B_ABST
    Figure CN119719723B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for electroencephalogram (EEG) distortion detection and recovery based on wavelet domain energy modulation. The method includes: obtaining modulated wavelet coefficients; extracting wavelet coefficient data corresponding to each EEG type from the wavelet coefficients; extracting wavelet feature data of each EEG type; obtaining a preset normal feature corresponding to the EEG data, calculating the similarity between each wavelet feature data and the preset normal feature to determine a target similarity calculation result and a distortion mode feature corresponding to the target similarity calculation result; obtaining the current operation stage corresponding to the EEG data, determining a weight value corresponding to each distortion mode feature according to the current operation stage, obtaining a feature vector of the distortion mode feature, and generating a comprehensive distortion feature description according to multiple feature vectors and corresponding weight values; obtaining a wavelet coefficient adjustment control instruction corresponding to the comprehensive distortion feature, reconstructing the original EEG signal, and obtaining the recovered EEG signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of brain-computer interfaces, and particularly to a method and device for detecting and recovering EEG distortion based on wavelet domain energy modulation. Background Technique

[0002] As an important means of directly measuring brain nerve activities, electroencephalogram (EEG) technology has broad application prospects in fields such as medical diagnosis, brain-computer interface (BCI), and cognitive function analysis. Compared with other imaging technologies (such as functional magnetic resonance imaging fMRI, etc.), EEG has the advantages of high time resolution, no radiation, and simple operation, and can reflect the bioelectrical activities of brain neuron populations in real time. However, due to the extremely weak amplitude of EEG signals themselves (usually in the microvolt to millivolt range), they are extremely vulnerable to various physiological and external noise sources. Therefore, removing the confounding noise components in EEG data has always been a major challenge in this field.

[0003] Traditional EEG denoising methods mainly include data-driven statistical modeling methods based on wavelet transform, independent component analysis (ICA), empirical mode decomposition (EMD), etc., and probability framework methods based on Bayesian estimation, particle filtering, etc. These techniques perform well in simple laboratory environments, but in real scenarios, due to the lack of modeling constraints on complex noise sources and the intrinsic mechanisms of the brain, their denoising performance is often unsatisfactory. In recent years, with the rapid development of deep learning technology, researchers have begun to attempt to automatically extract features from data and predict pure EEG signals based on methods such as convolutional neural networks, recurrent neural networks, and generative adversarial networks, and have achieved certain results. However, these methods either lack sufficient biological interpretability or cannot make full use of prior domain knowledge, and there are certain limitations in the denoising effect.

[0004] Therefore, there is an urgent need for a method to solve at least one of the above problems. Summary of the Invention

[0005] The embodiments of this application provide a method and device for detecting and recovering EEG distortion based on wavelet domain energy modulation, aiming to solve the problem that existing methods either lack sufficient biological interpretability or cannot make full use of prior domain knowledge, and there are certain limitations in the denoising effect.

[0006] In a first aspect, the embodiments of this application provide a method for detecting and recovering EEG distortion based on wavelet domain energy modulation, including:

[0007] Obtain the original EEG data and perform time-frequency transformation to obtain the energy spectrum corresponding to the original EEG data, and perform modulation processing on the components in the energy spectrum that do not meet the preset intensity threshold to obtain the modulated wavelet coefficients;

[0008] Extract the wavelet coefficient data corresponding to each EEG type according to the wavelet coefficient parameter characteristics corresponding to each EEG type among the said wavelet coefficients;

[0009] Perform spectral weighted average calculation on the said wavelet coefficient data by using a preset time window, obtain the spectral centroid value and the corresponding frequency change state, so as to extract the wavelet feature data of each said EEG type;

[0010] Obtain the preset normal features corresponding to the said EEG data, calculate the similarity between each said wavelet feature data and the preset normal features, and determine the target similarity calculation result and the distortion mode feature corresponding to the target similarity calculation result according to the similarity calculation results corresponding to each said wavelet feature data;

[0011] Obtain the current operation stage corresponding to the said EEG data, determine the weight value corresponding to each said distortion mode feature according to the current operation stage, obtain the feature vector of the said distortion mode feature, and generate a comprehensive distortion feature description according to the multiple said feature vectors and the corresponding weight values;

[0012] Obtain the wavelet coefficient adjustment control instruction corresponding to the said comprehensive distortion feature, and reconstruct the original EEG signal according to the wavelet coefficient adjustment control instruction to obtain the restored EEG signal.

[0013] In a second aspect, the present application also provides an EEG distortion detection and restoration device, including:

[0014] A coefficient acquisition module, configured to acquire original EEG data and perform time-frequency transformation, obtain the energy spectrum corresponding to the said original EEG data, and perform modulation processing on the components in the energy spectrum that do not meet the preset intensity threshold to obtain the modulated wavelet coefficients;

[0015] A data extraction module, configured to extract the wavelet coefficient data corresponding to each EEG type according to the wavelet coefficient parameter characteristics corresponding to each EEG type among the said wavelet coefficients;

[0016] A state acquisition module, configured to perform spectral weighted average calculation on the said wavelet coefficient data by using a preset time window, obtain the spectral centroid value and the corresponding frequency change state, so as to extract the wavelet feature data of each said EEG type;

[0017] A feature acquisition module, configured to obtain the preset normal features corresponding to the said EEG data, calculate the similarity between each said wavelet feature data and the preset normal features, and determine the target similarity calculation result and the distortion mode feature corresponding to the target similarity calculation result according to the similarity calculation results corresponding to each said wavelet feature data;

[0018] A phase acquisition module, configured to acquire the current operation phase corresponding to the EEG data, determine the weight value corresponding to each of the distortion mode features according to the current operation phase, acquire the feature vector of the distortion mode features, and generate a comprehensive distortion feature description according to the multiple feature vectors and the corresponding weight values;

[0019] A signal acquisition module, configured to acquire the wavelet coefficient adjustment control instruction corresponding to the comprehensive distortion feature, reconstruct the original EEG signal according to the wavelet coefficient adjustment control instruction, and acquire the restored EEG signal.

[0020] In a third aspect, the present application further provides a computer device, including a processor and a memory, where the memory is used to store a computer program, and when the computer program is executed by the processor, it implements the EEG distortion detection and recovery method based on wavelet domain energy modulation as described in the first aspect.

[0021] In a fourth aspect, the present application further provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, it implements the EEG distortion detection and recovery method based on wavelet domain energy modulation as described in the first aspect.

[0022] Compared with the prior art, the present application at least has the following beneficial effects:

[0023] 1. It realizes intelligent adaptive detection and recovery of various EEG distortion situations

[0024] Traditional EEG distortion detection and recovery methods usually only target specific types of distortions, such as baseline drift, electromyogram interference, etc., and lack the comprehensive processing ability for complex and variable distortion situations. The method of the present invention can adaptively detect various possible distortion modes, including distortions caused by baseline drift, abnormal cognitive processing, emotional state changes, etc., by modulating the time-frequency energy spectrum of the EEG signal.

[0025] Specifically, the method first divides the time-frequency energy spectrum of the EEG signal into multiple frequency domain segments, and each segment corresponds to different modulation features (such as specific frequency ranges and energy intensity ranges). Then, for the frequency domain segments that meet the modulation features, their energy values are retained; for the frequency domain segments that do not meet the modulation features, their energy values are modulated, thereby realizing the adaptive modulation of the energy spectrum. Through this modulation process, the frequency and energy components related to specific distortion modes are selectively retained or removed, thereby realizing the adaptive detection of various distortion situations.

[0026] In addition, the method also fuses the distortion detection results into a comprehensive distortion feature description, matches it with the preset distortion attributes, and determines the specific distortion attributes corresponding to the EEG data, thereby further improving the accuracy and pertinence of distortion detection. According to the matched distortion attributes, the method can also generate control instructions for controlling the change of wavelet coefficients, realizing the adaptive restoration of EEG signals, and effectively overcoming the defect that the existing technology only performs restoration for specific distortion types.

[0027] 2. Make full use of the time-frequency characteristics of EEG signals, and improve the accuracy and robustness of distortion detection and restoration

[0028] Most of the existing EEG distortion detection and restoration technologies mainly work on time-domain signals, and it is difficult to effectively capture and utilize the rich time-frequency characteristic information of EEG signals, resulting in certain limitations in detection accuracy and restoration effect. The method of the present invention is based on the wavelet-domain characteristics of EEG signals and makes full use of its time-frequency information, so it has high distortion detection accuracy and restoration ability.

[0029] Specifically, the method first performs wavelet transform on the original EEG data to obtain the initial state of its corresponding wavelet coefficients, and performs time-frequency transform on the EEG data to calculate the energy spectrum corresponding to the frequency-domain signal. Wavelet transform can perform multi-scale decomposition of the signal in both the time and frequency directions, thereby effectively capturing the time-frequency characteristics of EEG signals; while time-frequency transform can map the EEG signal to the time-frequency two-dimensional plane, making its time-frequency structure more obvious.

[0030] On this basis, the method performs modulation processing on the energy spectrum, and then obtains the modulation result of the EEG wavelet coefficients. Through methods such as inverse time-frequency transform and template matching, the method can accurately extract the wavelet coefficient data of different EEG types from the modulation result, and perform distortion detection and restoration based on these wavelet feature data, thereby making full use of the rich time-frequency information of EEG signals and significantly improving the accuracy and robustness of the entire detection and restoration process.

[0031] 3. Closely combine the distortion detection and restoration processes, and improve the adaptability and self-regulation ability of the system

[0032] The existing technologies usually process EEG distortion detection and distortion restoration separately, lacking an effective feedback regulation mechanism, resulting in often unsatisfactory restoration effects. The method of the present invention closely combines the distortion detection and restoration processes, constructs a highly adaptive and self-regulating intelligent system, and can adjust the restoration strategy in real time according to the detection results, thereby significantly improving the overall adaptability and restoration effect.

[0033] Specifically, the method first matches the specific distortion attributes corresponding to the EEG data according to the comprehensive distortion feature description, such as baseline drift, abnormal cognitive processing, etc. Then, based on these matched distortion attributes, the method generates control instructions for controlling the change of wavelet coefficients to achieve distortion recovery. These control instructions directly act on the wavelet coefficients of the original EEG data, adjust them to new wavelet coefficients that can offset the distortion effect, and finally reconstruct the EEG signal after distortion recovery through inverse wavelet transform.

[0034] It can be seen that the method closely combines the distortion detection process (i.e., distortion attribute matching) and the distortion recovery process (i.e., wavelet coefficient adjustment) to form a closed-loop self-regulating system. If new distortion attributes are found in the distortion detection, the system will generate new wavelet coefficient control instructions accordingly to adjust the recovery strategy in real time; conversely, if the recovery effect is not ideal, the system will also re-optimize the distortion detection model according to the feedback information, thus always maintaining the dynamic balance between detection and recovery and significantly improving the adaptability and self-regulating ability of the entire system.

[0035] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit this application. Brief Description of the Drawings

[0036] Figure 1 It is a schematic flow chart of the EEG distortion detection and recovery method based on wavelet domain energy modulation shown in the embodiments of this application;

[0037] Figure 2 It is a schematic structural diagram of the EEG distortion detection and recovery device shown in the embodiments of this application;

[0038] Figure 3 It is a schematic structural diagram of the computer device shown in the embodiments of this application. Detailed Embodiments

[0039] In the following description, specific details such as specific system structures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of this application. However, those skilled in the art should clearly understand that this application can also be implemented in other embodiments without these specific details. In other cases, the detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of this application.

[0040] It should be understood that when used in the specification of this application and the appended claims, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.

[0041] It should also be understood that the term "and / or" as used in the specification and appended claims of this application refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0042] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when", "once", "in response to determining", or "in response to detecting" depending on the context. Similarly, the phrase "if determined" or "if [the described condition or event] is detected" can be interpreted as meaning "once determined", "in response to determining", "once [the described condition or event] is detected", or "in response to detecting [the described condition or event]" depending on the context.

[0043] In addition, in the description of the specification and appended claims of this application, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.

[0044] Reference to "one embodiment" or "some embodiments" etc. described in the specification of this application means that a specific feature, structure, or characteristic described in connection with that embodiment is included in one or more embodiments of this application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "comprising", "including", "having", and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0045] The technical solutions of the embodiments of this application will be introduced below.

[0046] Electroencephalogram (EEG) signals are key physiological indicators reflecting the collective electrical activities of brain neurons and are widely used in many fields such as clinical diagnosis, cognitive science, and human-computer interaction. However, during actual acquisition and transmission, EEG signals are extremely vulnerable to various interferences and distortions, such as baseline drift, electromyogram interference, environmental noise, etc. These distortions will seriously reduce the quality of EEG signals and affect subsequent signal processing and analysis. Therefore, effective distortion detection and recovery of EEG signals are key links to ensure data quality and improve analysis accuracy.

[0047] Traditional EEG distortion detection and recovery methods mainly rely on manual experience and fixed template matching, and have the following disadvantages: 1) The detection and recovery processes highly depend on the knowledge and experience of domain experts and lack the ability of automated and intelligent processing; 2) Using fixed distortion templates and processing strategies, they cannot effectively handle complex and variable distortion situations; 3) They only target specific types of distortion (such as baseline drift, electromyogram interference, etc.) and lack the comprehensive processing ability for multiple distortions; 4) Most methods work on time-domain signals and it is difficult to capture and utilize the time-frequency characteristics of EEG signals.

[0048] In recent years, with the development of technologies such as wavelet analysis and machine learning, people have begun to try to apply these emerging technologies to the field of EEG distortion detection and recovery. Wavelet transform can perform multi-scale decomposition of signals in both the time and frequency directions, thereby effectively capturing the time-frequency characteristics of EEG signals and laying a foundation for distortion detection and recovery. Machine learning algorithms can automatically mine the characteristic patterns of EEG distortion from a large amount of data and achieve intelligent distortion detection and recovery.

[0049] However, when the existing wavelet-domain and machine learning methods are applied to EEG distortion detection and recovery, there are still some deficiencies: 1) Most methods are limited to detecting and recovering specific types of distortion (such as baseline drift, etc.) and lack the comprehensive processing ability for multiple distortion situations; 2) Some machine learning-based methods require a large amount of manually labeled training data and are usually only effective in specific scenarios; 3) Most methods separately process distortion detection and distortion recovery and lack an effective feedback adjustment mechanism; 4) Most of the existing technologies do not fully utilize the time-frequency characteristics of EEG signals, resulting in insufficient accuracy and robustness of distortion detection and recovery.

[0050] Please refer to Figure 1 , Figure 1 FIG. Figure 1 is a schematic flowchart of an EEG distortion detection and recovery method based on wavelet-domain energy modulation provided by an embodiment of the present application. The EEG distortion detection and recovery method based on wavelet-domain energy modulation in the embodiment of the present application can be applied to computer devices, and the computer devices include but are not limited to devices such as smart phones, laptop computers, tablet computers, desktop computers, physical servers, and cloud servers. As

[0051] Step S101, obtain the original EEG data and perform time-frequency transformation to obtain the energy spectrum corresponding to the original EEG data, and perform modulation processing on the components in the energy spectrum that do not meet the preset intensity threshold to obtain the modulated wavelet coefficients.

[0052] Specifically, EEG data is usually collected by multiple sensor arrays, and the electrical activity signals of different brain regions are collected by each sensor. These raw EEG data are often mixed with various sources of noise and interference and need to be appropriately preprocessed before being used for subsequent distortion detection and recovery analysis. The preprocessing steps mainly include filtering to remove high-frequency noise and baseline correction to eliminate drift, etc.

[0053] Filtering to remove high-frequency noise means using a digital filter to remove the high-frequency noise components in the EEG data. These high-frequency noises may come from muscle activity, equipment interference, etc. Commonly used filters include Butterworth band-pass filters, Chebyshev filters, etc. For example, by using a 4th-order Butterworth band-pass filter with a passband frequency range set to 1 - 40 Hz, most of the high-frequency noise can be filtered out. After filtering, the high-frequency noise in the EEG data is effectively removed.

[0054] Baseline correction to eliminate drift refers to removing the baseline drift phenomenon in the EEG data. Baseline drift means that the average value of the EEG signal has changed slowly over a period of time, which may be caused by factors such as electrode displacement and skin impedance change. Usually, the method of linear regression fitting is used to estimate and eliminate this drift trend, so that the baseline of the EEG data is restored to an appropriate level.

[0055] After preprocessing such as filtering and baseline correction, the quality of the EEG data is improved, and the noise and interference are effectively removed, laying a foundation for subsequent analysis. The preprocessed EEG data can be represented as a matrix X, where each row corresponds to a time point and each column corresponds to a sensor channel, that is, X(t, c) represents the EEG amplitude value at time t and channel c.

[0056] At the same time, this application also needs to obtain the initial state W0 of the wavelet coefficients corresponding to the EEG data as a reference baseline for distortion detection. Wavelet transform is a time-frequency analysis tool that can decompose the EEG signal into wavelet coefficients of different scales, and these wavelet coefficients can well capture the mutation and micro-distortion characteristics of the EEG signal.

[0057] The basic idea of wavelet transform is to project the signal onto a set of wavelet basis functions to obtain the corresponding wavelet coefficients. Commonly used wavelet bases include Haar wavelet, Daubechies wavelet, Coiflet wavelet, etc. For discrete signals, this application uses discrete wavelet transform (DWT). Let the selected wavelet basis be ψ(t), and perform wavelet decomposition of the EEG data X(t) at scale s, and we can get:

[0058] W(s, t) = 1 / √s ∫X(τ)ψ((τ - t) / s)dτ.

[0059] Among them, W(s,t) is the wavelet coefficient at scale s and time t. Through wavelet decomposition at different scales s, this application can obtain multi-scale wavelet coefficients W(s,t,c), where s is the discrete scale sequence, t is the time sequence, and c is the channel sequence. Denote the wavelet coefficients of all scales as W0(s,t,c), which is the initial state of the wavelet coefficients corresponding to the EEG data.

[0060] Wavelet coefficients can well capture the mutation and minute distortion features in EEG signals. This is because the wavelet basis function ψ(t) itself has the property of localization and can effectively represent the local features of the signal. For example, when a mutation occurs in the EEG signal, the wavelet coefficients will generate larger amplitude values at the corresponding time and scale, so that the abnormality of the signal can be detected. However, due to the basis functions of the traditional Fourier transform being sine and cosine over the entire time domain and lacking the property of localization, it cannot effectively capture the local abnormal features of the signal. Therefore, wavelet transform has unique advantages in processing non-stationary signals (such as EEG).

[0061] Next, this application needs to perform time-frequency transformation on the EEG data to obtain the frequency-domain signal and calculate the energy spectrum corresponding to this frequency-domain signal. Time-frequency transformation is a method of converting a time-domain signal to the frequency domain. Commonly used is the short-time Fourier transform (STFT). STFT obtains the spectrogram on the time-frequency two-dimensional plane by applying a sliding window function to the time-domain signal and calculating the Fourier transform of the signal within each time segment.

[0062] Specifically, the STFT transformation includes the following steps:

[0063] 1. Apply an appropriate window function w(t) to the time-domain EEG signal X(t) to obtain the windowed signal x(t)w(t - τ). The role of the window function is to divide the entire signal into overlapping small segments, and each small segment can be approximately regarded as stationary. Commonly used window functions include Gaussian window, Hamming window, etc.

[0064] 2. Calculate the Fourier transform of the windowed signal to obtain the value of STFT at time τ and frequency f: STFT(τ, f)= ∫x(t)w(t - τ)e^(-j2πft)dt.

[0065] 3. Slide the window w(t) and repeat steps 1) and 2) to obtain all the values of STFT at time t and frequency f, STFT(t,f).

[0066] Through the STFT transformation, this application can obtain the energy distribution of EEG data in the time-frequency domain, that is, the energy spectrum. The energy spectrum can be used to reflect the energy intensity of EEG signals in different frequency bands, which is of great significance for detecting and classifying different types of electroencephalogram activities. Let the energy spectrum of EEG data X be E(t, f), then we have:

[0067] E(t, f) = |STFT(X)(t, f)|^2 = |∫X(τ)w(τ - t)e^(-j2πfτ)dτ|^2.

[0068] That is, the energy spectrum E(t, f) is the square modulus of the STFT coefficient, reflecting the energy magnitude of the EEG signal at time t and frequency f. The calculation of the energy spectrum is affected by the window function w(t), and different window functions will lead to differences in time resolution and frequency resolution. For example, a narrower Gaussian window can obtain better time resolution but poorer frequency resolution; a wider window function has poorer time resolution and better frequency resolution. Therefore, the selection of the window function needs to balance the requirements of time resolution and frequency resolution according to the specific application scenario. Generally speaking, for applications that need to capture instantaneous electroencephalogram activities, a narrower window function is more suitable.

[0069] The so-called modulation features refer to some features that can reflect the distortion or abnormality of EEG signals, which are usually closely related to the energy intensity of the energy spectrum.

[0070] In some embodiments, the modulation processing based on the components in the energy spectrum that do not meet the preset intensity threshold to obtain the modulated wavelet coefficients includes: dividing the high-energy intensity frequency domain segment corresponding to the first modulation feature and the medium-energy intensity frequency domain segment corresponding to the second modulation feature based on the energy spectrum; performing modulation processing on the components in the high-energy intensity frequency domain segment and the medium-energy intensity frequency domain segment that do not meet the preset intensity threshold to obtain the modulated wavelet coefficients.

[0071] This application defines two modulation features. The first modulation feature corresponds to the alpha wave (8 - 13 Hz) and the high-energy intensity region, and the second modulation feature corresponds to the beta wave (13 - 30 Hz) and the medium-energy intensity region. The specific frequency range and energy intensity range need to be set according to the actual application scenario and prior knowledge. The purpose of setting the modulation features is to selectively retain or remove the frequency and energy components related to specific EEG abnormalities in the subsequent modulation processing. For each modulation feature, this application needs to divide the corresponding frequency domain segment on the energy spectrum E(t, f).

[0072] Exemplarily, the modulation processing of the components in the high energy intensity frequency domain segment and the medium energy intensity frequency domain segment that do not meet the preset intensity threshold includes: performing a first modulation processing on the components in the high energy intensity frequency domain segment that do not meet the preset intensity threshold; performing a second modulation processing on the components in the medium energy intensity frequency domain segment that do not meet the preset intensity threshold.

[0073] Assume that the frequency range corresponding to the first modulation feature is [f1_min, f1_max], and the energy intensity range is [E1_min, E1_max]. In this application, the entire energy spectrum E(t, f) can be traversed to find all (t, f) points that satisfy f1_min ≤ f ≤ f1_max and E1_min ≤ E(t, f) ≤ E1_max, and classify them into the first high energy intensity frequency domain segment S1 corresponding to the first modulation feature. Similarly, assume that the frequency range corresponding to the second modulation feature is [f2_min, f2_max], and the energy intensity range is [E2_min, E2_max]. This application can find all (t, f) points that satisfy f2_min ≤ f ≤ f2_max and E2_min ≤ E(t, f) ≤ E2_max, and classify them into the second medium energy intensity frequency domain segment S2 corresponding to the second modulation feature. In this way, this application divides the energy spectrum E(t, f) into two non-overlapping frequency domain segments S1 and S2, which respectively correspond to the first modulation feature and the second modulation feature.

[0074] For the point (t, f) in the first high energy intensity frequency domain segment S1, if E(t, f) does not meet the preset energy intensity threshold T1, then set the energy value of this point to 0, that is, perform the first modulation processing. For the point (t, f) in the second medium energy intensity frequency domain segment S2, if E(t, f) does not meet the preset energy intensity threshold T2, then set the energy value of this point to 0, that is, perform the second modulation processing. Assume that the energy intensity threshold of the first modulation feature is T1, and the energy intensity threshold of the second modulation feature is T2, then the modulation processing can be expressed as:

[0075] For (t, f) belonging to S1: if E(t, f) ≥ T1, then E'(t, f) = E(t, f); otherwise E'(t, f) = 0;

[0076] For (t, f) belonging to S2: if E(t, f) ≥ T2, then E'(t, f) = E(t, f);

[0077] otherwise E'(t, f) = 0;

[0078] Among them, E'(t, f) is the energy spectrum after modulation processing. Through the above modulation processing, the present application can selectively retain or remove frequency and energy components related to specific EEG abnormalities, which is conducive to subsequent wavelet coefficient feature extraction and distortion detection.

[0079] It should be noted that the parameters of the modulation processing, including the frequency range of the modulation feature, the energy intensity range, and the corresponding energy intensity thresholds T1 and T2, need to be set and adjusted according to the specific application scenario and prior knowledge. Generally speaking, these parameters can be obtained through statistical analysis and cross-validation of a large amount of training data. In addition, the above modulation processing describes the case of two modulation features. In actual applications, the present application can also introduce more types of modulation features according to needs, so as to perform more refined processing on EEG data.

[0080] After the above modulation processing, the present application obtains the modulated energy spectrum E'(t, f). Next, the present application needs to convert E'(t, f) back to the time domain to obtain the modulation result of the wavelet coefficients corresponding to the EEG data. This step can be achieved by performing an inverse STFT transform on E'(t, f). The specific process is as follows:

[0081] 1. Calculate the analytic signal Z(t, f) of E'(t, f): Z(t, f) = E'(t, f) + jH(E'(t, f)), where H(·) represents the Hilbert transform.

[0082] 2. Perform an inverse STFT transform on Z(t, f) to obtain the time-domain signal z(t): z(t) = ∫Z(t, f)e^(j2πft)df.

[0083] 3. Apply the original window function w(t) to z(t), that is, x'(t) = z(t)w(t).

[0084] 4. Perform a wavelet transform on x'(t) to obtain the modulation result W'(s, t, c) of the wavelet coefficients corresponding to the EEG data.

[0085] Through the above steps, the present application completes the entire energy spectrum modulation processing, maps the modulation result back to the wavelet coefficient domain, and obtains the modulation result W'(s, t, c) of the EEG wavelet coefficients.

[0086] Step S102, extract the wavelet coefficient data corresponding to each EEG type according to the wavelet coefficient parameter characteristics corresponding to each EEG type in the wavelet coefficients.

[0087] Specifically, for each scale s, the present application performs an inverse wavelet transform on W'(s, t, c) in time t and channel c to obtain the reconstruction coefficient C(s, t) at scale s, where C(s, t) = ∑cW'(s, t, c)ψc(t), and ψc(t) is the wavelet basis function corresponding to channel c. Next, an inverse wavelet transform is performed on the reconstruction coefficients C(s, t) of all scales s, and the time-domain signal x'(t) can be obtained, that is, x'(t) = ∑s∑kC(s, k)φ(t - k2^s), where φ(t) is the scaling function. In this way, the present application converts the wavelet coefficient modulation result W'(s, t, c) back to the time-domain signal x'(t).

[0088] In some embodiments, the extracting the wavelet coefficient data corresponding to each EEG type according to the wavelet coefficient parameter characteristics corresponding to each EEG type in the wavelet coefficients includes: performing an inverse time-frequency transform on the wavelet coefficients; obtaining the wavelet coefficient parameter characteristics corresponding to each EEG type; and extracting the corresponding wavelet coefficient data in the wavelet coefficients after the inverse transform according to each wavelet coefficient parameter characteristic.

[0089] After obtaining the time-domain signal x'(t), the present application can extract the wavelet coefficient data of different EEG types from x'(t) based on the wavelet coefficient parameter characteristics corresponding to various EEG types. Different types of EEG often correspond to different parameter characteristics such as frequency ranges, energy distributions, and time patterns, and these characteristics can be obtained by performing time-frequency analysis on x'(t). For example, the present application can perform a short-time Fourier transform (STFT) on x'(t) to obtain the time-frequency spectrum STFT(t, f); or perform a wavelet transform on x'(t) to obtain wavelet coefficients W(s, t) of different scales. According to prior knowledge, different types of EEG will exhibit characteristic patterns on STFT(t, f) or W(s, t), so the present application can classify EEG types based on these patterns.

[0090] Assume that the present application needs to classify EEG into K categories, that is, EEG1, EEG2,..., EEGK. Then the present application can first construct K template features, each template feature corresponding to one EEG type, for subsequent matching and classification. Let the template feature of the k-th type of EEG be Tk(t, f) or Tk(s, t), which can be obtained through statistical learning of a large number of labeled EEG data, or can be manually designed based on prior knowledge. With these template features, the present application can calculate the similarity between x'(t) and each template feature and classify x'(t) into the EEG type that is most similar to it. The calculation of similarity can use various methods such as Euclidean distance, correlation coefficient, and mutual information. For example, if the present application uses STFT as the feature, the similarity calculation can be expressed as:

[0091] sim(k) = ∑t∑f|STFT(x')(t,f) - Tk(t,f)|^2。

[0092] Then x'(t) will be classified into the EEG type with the minimum sim(k) value. Similarly, if this application uses wavelet coefficients as features, the similarity calculation can be changed to:

[0093] sim(k) = ∑s∑t|W(x')(s,t) - Tk(s,t)|^2。

[0094] In the above way, this application can classify the time-domain signal x'(t) into K different EEG types. For each type of EEG, this application can extract the wavelet coefficient data of this type of EEG from x'(t) according to its corresponding template feature Tk(t,f) or Tk(s,t). For example, for the k-th type of EEG, this application can construct a mask Mk(t,f) or Mk(s,t), where Mk(t,f) = 1 when the similarity at the point (t,f) is high enough with Tk(t,f), otherwise 0; the definition of Mk(s,t) is similar. Then, this application can obtain the wavelet coefficient data Wk(s,t,c) of the k-th type of EEG by multiplying the STFT or wavelet coefficients of x'(t) by Mk(t,f) or Mk(s,t):

[0095] Wk(s,t,c) = W(x')(s,t,c) * Mk(s,t) (using wavelet coefficients as features) or Wk(s,t,c) = STFT^-1(STFT(x')(t,f) * Mk(t,f)) (using STFT as features).

[0096] Where STFT^-1 represents performing an inverse transform on the STFT result to obtain data in the wavelet coefficient domain. In this way, this application has successfully extracted the wavelet coefficient data Wk(s,t,c) corresponding to different EEG types from the modulation result x'(t), and obtained the wavelet coefficient data of each classified EEG type.

[0097] Step S103: Perform spectral weighted average calculation on the wavelet coefficient data using a preset time window to obtain the spectral centroid value and the corresponding frequency change state, so as to extract the wavelet feature data of each EEG type.

[0098] Specifically, the method of spectral centroid is adopted to analyze the frequency variation state of the wavelet coefficients of each EEG type, and wavelet feature data is extracted based on this. First, this application needs to set a time window tw for local analysis of the wavelet coefficient data. The length of the time window tw can be set according to the specific application scenario and usually needs to meet two conditions: one is that it is long enough to capture the important time patterns of the EEG signal; the other is that it cannot be too long to avoid losing the stationarity of the signal within the window. A common practice is to use a sliding window method, that is, each time a time segment of length tw is analyzed, and then the window slides to the next time segment, and so on, so as to achieve a full-coverage analysis of the entire time series.

[0099] In some embodiments, the method of performing spectral weighted average calculation on the wavelet coefficient data by using a preset time window to obtain the spectral centroid value and the corresponding frequency variation state, so as to extract the wavelet feature data of each EEG type includes: performing the weighted average calculation on each wavelet coefficient data according to the preset time window to obtain the spectral centroid value; obtaining the frequency variation state corresponding to each spectral centroid value; and extracting the wavelet feature data from the frequency variation state.

[0100] For the wavelet coefficient data Wk(s,t,c) within each time window tw, this application can calculate its spectral centroid at each scale s, that is:

[0101] Ck(s) = ∑t∑c|Wk(s,t,c)|^2 * f(s) / ∑t∑c|Wk(s,t,c)|^2.

[0102] Where f(s) is the frequency corresponding to scale s, and |Wk(s,t,c)|^2 is the energy of the wavelet coefficient. This formula actually performs a weighted average on each frequency component, with the weight being the energy of that frequency component, so as to obtain a "centroid" value Ck(s) representing the overall frequency distribution. It should be noted that the scale-frequency mapping relationship f(s) corresponding to different wavelet basis functions is different, so specific mapping formulas need to be used in actual calculations. For example, for the Morlet wavelet, f(s) = Fc / (s*dt), where Fc is the central frequency of the wavelet and dt is the sampling interval.

[0103] After obtaining the spectral centroid Ck(s) at each scale s, this application can further calculate the comprehensive spectral centroid within the entire time window tw, that is:

[0104] Qk = ∑s∑t∑c|Wk(s,t,c)|^2 * Ck(s) / ∑s∑t∑c|Wk(s,t,c)|^2.

[0105] The comprehensive spectral centroid Qk reflects the overall frequency distribution of the EEG type k within the current time window tw, and its magnitude is closely related to the frequency variation state of the EEG. Generally speaking, if the value of Qk is large, it indicates that the frequency components of this EEG type tend to be high-frequency; otherwise, they tend to be low-frequency. By tracking the change trend of Qk, this application can monitor the rising or falling of the EEG frequency, and then infer potential abnormalities or distortions. For example, this application can set a threshold interval [Q_min, Q_max]. If Qk is outside this interval for a long time, it may mean that an abnormal change has occurred in the EEG frequency.

[0106] According to the above spectral centroid analysis results, this application can extract the wavelet feature data corresponding to each EEG type. One method is that for each time window tw, taking the comprehensive spectral centroid Qk, the spectral centroids Ck(s) at each scale, the wavelet coefficient energy ∑t∑c|Wk(s,t,c)|^2, etc. as features, to construct a feature vector Fk:

[0107] Fk = [Qk, Ck(1), Ck(2), ..., Ck(S), Ek(1), Ek(2), ..., Ek(S)].

[0108] Where Ek(s) = ∑t∑c|Wk(s,t,c)|^2 represents the total wavelet coefficient energy at scale s. In this way, this application can capture various important features such as the frequency distribution feature and energy feature of the EEG type k within the current time window tw, so as to comprehensively describe its frequency variation state. Concatenating the feature vectors Fk within multiple consecutive time windows tw can obtain the wavelet feature data sequence corresponding to the EEG type k, which is used for subsequent distortion detection and recovery.

[0109] Step S104, obtain the preset normal features corresponding to the EEG data, calculate the similarity between each wavelet feature data and the preset normal features, and according to the similarity calculation results corresponding to each wavelet feature data, determine the target similarity calculation result and the distortion mode feature corresponding to the target similarity calculation result.

[0110] Specifically, before performing distortion detection and recovery, this application needs to first clarify the application scenario corresponding to the current EEG data, including the type of application program and the specific mode of data processing. This is because different application scenarios have different requirements for EEG signals, and the same EEG signal may be judged as normal or abnormal in different scenarios. For example, in sleep monitoring applications, the alfa wave (8 - 13Hz) is a normal phenomenon; but in tasks that require concentration, the appearance of the alfa wave may mean distraction. Therefore, this application needs to perform targeted distortion detection and recovery processing on the EEG signal according to the specific application scenario.

[0111] In some embodiments, obtaining the preset normal features corresponding to the EEG data includes: obtaining the application type and data processing method corresponding to the EEG data; and obtaining the preset normal features according to the application type and data processing method.

[0112] Assume that the system of the present application supports N different application programs, such as sleep monitoring, attention detection, emotion analysis, etc., and each application program may have multiple data processing modes, such as real-time mode, offline mode, etc. The present application can configure a unique ID, such as (app_id, mode_id), for each application program and mode, and maintain a lookup table to match the (app_id, mode_id) corresponding to the current EEG data with the pre-set normal EEG mode. A possible matching strategy is that the present application can collect a large number of labeled normal EEG data samples, train a normal EEG mode for each (app_id, mode_id) situation, and store it in the lookup table. In actual application, the present application can find the corresponding (app_id, mode_id) according to the metadata of the current EEG data (such as acquisition time, device information, etc.), and then take out the corresponding normal EEG mode from the lookup table as a reference for distortion detection.

[0113] Suppose the application program and mode corresponding to the current EEG data are (app_id_curr, mode_id_curr), and the normal EEG mode corresponding to it taken out by the present application from the lookup table is N_curr. This normal EEG mode N_curr can be a wavelet feature sequence, which contains the wavelet feature data of normal EEG within different time windows tw, and is used to characterize features such as its frequency distribution and change trend. In the step, the present application has extracted the wavelet feature data F1, F2,..., FK corresponding to K different EEG types within each time window tw of the current EEG data. Next, the present application needs to calculate the similarity between the wavelet feature data of each EEG type and the normal EEG mode N_curr respectively, so as to judge whether the current EEG data is distorted or abnormal.

[0114] In this similarity calculation method, the present application first needs to select a suitable kernel function k(x, y) for Fk(tw) and N_curr(tw) to measure the similarity between two vectors x and y. Commonly used kernel functions include Gaussian kernel, polynomial kernel, Laplace kernel, etc., each of which has different properties, advantages and disadvantages. Considering the non-linear and non-stationary characteristics of EEG data, the present application recommends using the Gaussian kernel function, which is defined as k(x, y) = exp(-||x - y||_2^2 / (2*sigma^2)), where sigma is the kernel bandwidth parameter that controls the smoothness of the kernel function. A smaller sigma value will make the kernel function sharper and more localized, reflecting the subtle differences in the data; while a larger sigma value will make the kernel function smoother, reflecting the general trend of the data. In practical applications, the value of sigma often needs to be optimized through methods such as cross-validation to obtain the best similarity calculation performance. Once the kernel function k(x, y) is determined, the present application can calculate the kernel similarity between Fk(tw_i) at time window tw_i and N_curr(tw_j) at time window tw_j, that is, K_kn(i, j) = k(Fk(tw_i), N_curr(tw_j)). In this way, the present application obtains a kernel matrix K_kn, where each element K_kn(i, j) reflects the similarity degree between Fk and N_curr at different time points.

[0115] Next, the present application needs to normalize K_kn to obtain the comprehensive similarity between Fk and N_curr over the entire time series. Suppose the present application adopts the method of linear kernel normalization. The idea is to first calculate the column vectors and row vectors of K_kn, and then use these vectors to normalize K_kn so that the sum of the elements in each column or each row is 1. Specifically, let the sum of the column vectors of K_kn be n and the sum of the row vectors be m, then the normalized kernel matrix is K_kn' = D_n^(-1 / 2) * K_kn * D_m^(-1 / 2), where D_n and D_m are diagonal matrices with diagonal elements n and m respectively. After this normalization process, each element of K_kn' is in the interval [0, 1], reflecting the relative similarity between Fk and N_curr at different time points. To obtain the comprehensive similarity between Fk and N_curr over the entire time series, the present application can calculate the Frobenius norm of K_kn', that is, sim = ||K_kn'||_F = sqrt(sum(sum(K_kn'.^2))). Obviously, when Fk and N_curr are exactly the same, sim will reach the minimum value of 0; on the contrary, when the difference between the two is large, the value of sim will become larger.

[0116] Based on this similarity value, the present application can determine whether there is distortion or abnormality in the current EEG type k. Generally speaking, if the sim value is small, it indicates that the energy distribution of Fk is very similar to that of the normal mode N_curr, and it is considered that this EEG type is in a normal state; on the contrary, if the sim value is large, it indicates that the energy distribution difference between the two is large, which may mean that this EEG type has undergone distortion or abnormality.

[0117] In the above steps, the present application has separately calculated the similarity sim_k between the wavelet feature data Fk of each EEG type and the preset normal mode N_curr, obtaining a similarity sequence sim_1, sim_2,..., sim_K, where K is the total number of EEG types. Next, the present application needs to determine whether there is distortion or abnormality in the current EEG data based on these similarity results. If so, it is necessary to further match the corresponding specific distortion mode characteristics. For this purpose, the present application first needs to set a similarity threshold thresh_k for each EEG type k. When sim_k > thresh_k, it is considered that this type of EEG has undergone distortion or abnormality. The setting of the threshold thresh_k needs to be based on the specific application scenario and the characteristics of the EEG type, and can be obtained through statistical analysis of a large number of labeled data. Generally speaking, for those EEG types that are more sensitive to distortion, the present application will set a smaller threshold to improve the sensitivity of distortion detection; while for those EEG types that are less sensitive to distortion, the present application can appropriately relax the threshold to reduce the false alarm rate. For example, in the application of sleep monitoring, the present application may set a larger threshold for slow-wave sleep (0.5 - 4Hz) because this type of EEG is not very sensitive to some minor distortions; while for fast-wave sleep (12 - 16Hz), the present application needs to set a smaller threshold because it is often more sensitive to distortion.

[0118] After determining the threshold thresh_k for each EEG type k, the present application can traverse the entire similarity sequence sim_1, sim_2,..., sim_K and select those similarity results that satisfy the condition sim_k > thresh_k. Suppose there are M similarity results of EEG types that satisfy this condition. The present application records their corresponding EEG type indices idx_1, idx_2,..., idx_M, as well as the corresponding similarity values sim_idx_1, sim_idx_2,..., sim_idx_M. Next, the present application needs to match the selected similarity results with their corresponding distortion mode features. The so-called distortion mode features refer to the features such as frequency, energy, and time pattern that can reflect the EEG signal under specific distortion conditions, and they are the key basis for distortion detection and recovery. In practical applications, the present application usually needs to collect and label a large number of distorted EEG data samples in advance for different application scenarios, and then perform feature extraction and modeling on these samples to obtain a series of distortion mode feature templates. These distortion mode feature templates can be based on different feature representation methods, such as wavelet features, spectral features, non-linear features, etc., or they can be a fusion representation of multiple features. Regardless of the feature representation method adopted, the key is to ensure that these distortion mode feature templates can accurately depict the features of the EEG signal under different distortion conditions and have a certain degree of discrimination from each other for subsequent matching and classification.

[0119] Suppose the present application has already constructed a template library containing L distortion mode feature templates for the current application scenario, denoted as {T_1, T_2,..., T_L}. Each template T_i is a vector with the same dimension as the EEG type wavelet feature data Fk, and is used to describe the feature pattern of the EEG signal under the i-th distortion mode. Next, the present application needs to match the selected M similarity results sim_idx_1, sim_idx_2,..., sim_idx_M with these distortion mode feature templates to determine which distortion mode feature each of them corresponds to. The matching method can be nearest neighbor matching based on distance metric, or classifier matching based on kernel function or probability model, or other more complex matching algorithms. Here, the present application takes the support vector machine (SVM) classifier based on kernel function as an example to introduce a possible matching scheme.

[0120] First, the present application needs to extract the corresponding EEG type wavelet feature data from M similarity results, namely F_idx_1, F_idx_2,..., F_idx_M. Then, the present application constructs a new feature matrix X that includes these M feature data and L distortion mode feature templates, where each row of X represents a feature vector. Next, the present application needs to construct a binary classification SVM model, namely SVM_i, for each distortion mode feature template T_i against the remaining templates, take X as the input, and train each SVM_i. During the training process, the present application needs to select a suitable kernel function, such as a Gaussian kernel, a polynomial kernel, etc., and adjust the corresponding kernel parameters to obtain the best classification performance. After training, the present application can use these SVM_i models to classify F_idx_1, F_idx_2,..., F_idx_M to determine which distortion mode feature each of them belongs to. Specifically, for each F_idx_j (j = 1, 2,..., M), the present application inputs it into L SVM_i models to obtain L classification results y_ij, where y_ij represents the probability value that F_idx_j is classified as the i-th type of distortion mode feature by SVM_i. The present application selects the distortion mode feature category corresponding to the maximum value of y_ij as the matching result of F_idx_j. In other words, if there exists a k such that y_kj = max{y_ij}, then it is considered that the distortion mode feature corresponding to F_idx_j is T_k.

[0121] Step S105: Obtain the current operation stage corresponding to the EEG data, determine the weight value corresponding to each distortion mode feature according to the current operation stage, obtain the feature vector of the distortion mode feature, and generate a comprehensive distortion feature description according to the multiple feature vectors and the corresponding weight values.

[0122] Specifically, based on the matching result between the EEG type wavelet feature data and the distortion mode feature template, the present application has determined the distortion mode feature category existing in the current EEG data. However, in different application scenarios and data processing modes, the influence degree of the same distortion mode feature on the EEG signal may be different. Therefore, the present application needs to assign a suitable weight value to each distortion mode feature according to the specific application scenario and processing mode to reflect its importance in the current operation stage. Assuming that the application corresponding to the current EEG data is app_curr and the data processing mode is mode_curr, the present application can query a pre-established weight lookup table to determine the operation stage stage_curr of the current EEG data processing according to (app_curr, mode_curr). This operation stage stage_curr reflects the specific links of EEG data processing, such as data acquisition, preprocessing, feature extraction, classification and recognition, etc. Different operation stages have different requirements for the EEG signal. Therefore, the influence degree of the same distortion mode feature in different operation stages is also different.

[0123] Exemplarily, the obtaining of the current operation stage corresponding to the EEG data includes: obtaining the current operation stage according to the application type and the data processing method.

[0124] To quantify the importance of each distortion mode feature in the current operation stage, the present application can preset a weight value w_ij for each distortion mode feature category i and each operation stage j, which is used to represent the importance degree of the i-th type of distortion mode feature in the j-th operation stage. These weight values w_ij can be obtained through statistical analysis of a large amount of training data or set according to the expert's experience knowledge. Generally speaking, if a certain distortion mode feature has a greater influence on the EEG signal in a certain operation stage, the present application will assign a larger weight value to it; on the contrary, if the distortion mode feature has a smaller influence on the current operation stage, the present application will assign a smaller weight value. For example, in the EEG data acquisition stage, the present application may assign larger weight values to those distortion mode features related to baseline drift, electromyogram interference, etc., because these distortion mode features will seriously affect the data quality; while for those distortion mode features related to cognitive processing or emotional state, the present application can assign smaller weight values because their influence in the data acquisition stage is not significant. On the contrary, in the EEG classification and recognition stage, the present application may need to assign larger weight values to the distortion mode features related to cognitive processing or emotional state because these distortion mode features will directly affect the accuracy of the classification result.

[0125] Suppose that a series of weight values \(w_{ij}\) have been pre - set for the current \((app_{curr}, mode_{curr})\) scenario in this application, where \(i\) is the index of the distortion mode feature category and \(j\) is the index of the operation stage. In the step, this application matches \(M\) distortion mode feature categories \(idx_1, idx_2,\cdots, idx_M\), corresponding to \(M\) EEG - type wavelet feature data \(F_{idx_1}, F_{idx_2},\cdots, F_{idx_M}\). Next, this application needs to determine the corresponding distortion detection weight values for these \(M\) distortion mode feature categories according to the current operation stage \(stage_{curr}\). Specifically, for the \(m\) - th distortion mode feature category \(idx_m(m = 1,2,\cdots,M)\), this application can query the weight table and take out \(w_{idx_m, stage_{curr}}\) as its corresponding distortion detection weight value, denoted as \(weight_m\). In this way, this application obtains \(M\) distortion detection weight values \(weight_1, weight_2,\cdots, weight_M\), corresponding to \(F_{idx_1}, F_{idx_2},\cdots, F_{idx_M}\) respectively. Obviously, these weight values reflect the importance of different distortion mode features in the current operation stage. The larger the value of \(weight_m\), the greater the impact of the \(m\) - th distortion mode feature on the current EEG data processing, and the more attention this application needs to pay to it.

[0126] First, for the m-th distortion mode feature F_idx_m, the present application can normalize it to obtain the normalized feature vector F'_idx_m = F_idx_m / ||F_idx_m||, where ||·|| represents the Euclidean norm. Then, the present application uses the weight value weight_m determined in the step to calculate the new feature vector P_idx_m of the m-th distortion mode feature at the current operation stage stage_curr, i.e., P_idx_m = weight_m * F'_idx_m. Through this weighting process, the present application realizes the distinction of the importance degrees of different distortion mode features at the current operation stage. The larger the weight value, the greater the influence of the distortion mode feature on the current operation stage, and the larger the component value in its corresponding new feature vector P_idx_m. Repeating the above process, the present application can obtain M new feature vectors P_idx_1, P_idx_2, ..., P_idx_M, which respectively correspond to the weighted feature representations of M distortion mode features at the current operation stage stage_curr. Next, the present application needs to fuse these M new feature vectors to obtain the comprehensive distortion feature description F_final. The fusion method can be simple vector concatenation or more complex non-linear fusion methods, such as kernel methods, deep neural networks, etc. Here, the present application adopts a non-linear fusion method based on a kernel function, and the specific steps are as follows: First, the present application selects a suitable kernel function k(x,y), such as the Gaussian kernel k(x,y) = exp(-||x - y||^2 / (2sigma^2)), where sigma is the kernel bandwidth parameter that controls the smoothness of the kernel function. Generally, sigma needs to be optimized through methods such as cross-validation to obtain the best fusion performance. Next, the present application constructs an M×M kernel matrix K, where K(i,j) = k(P_idx_i, P_idx_j). Obviously, K is a symmetric positive semi-definite matrix that can well characterize the similarity between P_idx_i and P_idx_j. To obtain the fused comprehensive distortion feature description F_final, the present application can perform eigenvalue decomposition on K, extract the eigenvectors corresponding to its largest d eigenvalues, and splice them into a new feature vector, i.e., F_final = [v_1, v_2, ..., v_d]^T, where v_i is the eigenvector corresponding to the i-th largest eigenvalue of K, and d is the feature dimension selected by the present application, which needs to be set according to the specific application scenario. Through this kernel feature extraction method, the present application realizes the non-linear fusion of M new feature vectors P_idx_1, P_idx_2, ..., P_idx_M and obtains the comprehensive distortion feature description F_final reflecting the EEG distortion state at the current operation stage stage_curr.It should be noted that when constructing the kernel matrix K, other prior knowledge can also be introduced in this application, such as the correlation between distortion mode features, hierarchical structure, etc., so as to obtain a more reasonable kernel function and improve the fusion effect. For example, this application can construct a weighted kernel matrix K_w, where K_w(i,j) = w_ij * k(P_idx_i, P_idx_j). Here, w_ij is the correlation weight between the i-th and j-th distortion mode features, reflecting the degree of correlation between them. Obviously, when w_ij is larger, the value of K_w(i,j) is also larger, indicating that a larger weight should be given to P_idx_i and P_idx_j during fusion; conversely, when w_ij is smaller, the value of K_w(i,j) is also smaller, indicating that the weight of P_idx_i and P_idx_j during fusion is lower. In this way, this application introduces the correlation between distortion mode features into the construction of the kernel matrix, thereby obtaining a more reasonable comprehensive distortion feature description F_final.

[0127] Step S106, obtain a wavelet coefficient adjustment control instruction corresponding to the comprehensive distortion feature, and reconstruct the original EEG signal according to the wavelet coefficient adjustment control instruction to obtain the restored EEG signal.

[0128] Specifically, this application needs to construct a distortion attribute model for mapping the comprehensive distortion feature description F_final to a set of predefined distortion attribute labels. Assume that this application predefines L possible distortion attributes, denoted as {A_1, A_2, ..., A_L}, where each A_i is a vector representing the feature pattern corresponding to the i-th distortion attribute. These distortion attributes can cover various factors that may cause EEG signal distortion, such as baseline drift, EMG interference, abnormal cognitive processing, emotional state changes, etc.

[0129] In some embodiments, the obtaining of the wavelet coefficient adjustment control instruction corresponding to the comprehensive distortion feature includes: obtaining the distortion attribute corresponding to the comprehensive distortion feature; generating the wavelet coefficient adjustment control instruction according to the distortion attribute.

[0130] For each distortion attribute \(A_i\), this application can obtain its corresponding feature pattern vector representation by training on a large amount of labeled distorted EEG data. Next, this application needs to match the comprehensive distortion feature description \(F_{final}\) with these distortion attribute feature patterns \(\{A_1, A_2, \ldots, A_L\}\) to determine which distortion attributes \(F_{final}\) corresponds to. The matching method can be nearest neighbor matching based on distance metric, or classifier matching based on kernel function or probability model, or other more complex pattern recognition algorithms. Here, this application takes the support vector machine (SVM) classifier based on kernel function as an example to introduce a possible matching scheme. First, this application constructs a new feature matrix \(X\) that contains \(F_{final}\) and all distortion attribute feature patterns \(\{A_1, A_2, \ldots, A_L\}\), where each row of \(X\) represents a feature vector. Next, this application constructs a binary classification SVM model for each distortion attribute feature pattern \(A_i\) against the rest of the patterns, namely \(SVM_i\), takes \(X\) as the input, and trains each \(SVM_i\). During the training process, this application needs to select a suitable kernel function, such as Gaussian kernel, polynomial kernel, etc., and adjust the corresponding kernel parameters to obtain the best classification performance. After training, this application can use these \(SVM_i\) models to classify \(F_{final}\) and determine which distortion attributes it belongs to. Specifically, this application inputs \(F_{final}\) into \(L\) \(SVM_i\) models to obtain \(L\) classification results \(y_i\), where \(y_i\) represents the probability value that \(F_{final}\) is classified as the \(i\)-th type of distortion attribute by \(SVM_i\). This application selects the indices \(i\) for which all \(y_i\) values are greater than a certain threshold \(\theta\), and the corresponding distortion attributes \(A_i\) are the distortion attributes corresponding to \(F_{final}\) obtained by this application's matching. In other words, if there exists a set of indices \(i_1, i_2, \ldots, i_k\) such that \(y_{i_1}>\theta\), \(y_{i_2}>\theta\), \(\ldots\), \(y_{i_k}>\theta\), then this application considers the distortion attributes corresponding to \(F_{final}\) to be \(\{A_{i_1}, A_{i_2}, \ldots, A_{i_k}\}\). The setting of the threshold \(\theta\) needs to be based on the specific application scenario, and it reflects this application's confidence requirement for distortion attribute matching. Generally speaking, the larger the \(\theta\) value, the higher this application's confidence requirement for the distortion attribute matching result, but it may also lead to missed reports; on the contrary, the smaller the \(\theta\) value, the lower this application's confidence requirement for the distortion attribute matching, but it may increase the risk of false alarms. In practical applications, this application can determine a reasonable \(\theta\) value through cross-validation on a large amount of validation data to balance the relationship between missed reports and false alarms.Through the above steps, this application completes the process of matching the distortion attributes corresponding to the EEG data according to the comprehensive distortion feature description F_final. Next, this application needs to generate control instructions for controlling the change of wavelet coefficients to achieve distortion recovery based on these matched distortion attributes. Suppose the distortion attributes matched by this application are {A_i_1, A_i_2, ..., A_i_k}. This application can pre-design a corresponding wavelet coefficient control strategy C_i_j for each distortion attribute A_i_j to guide how to adjust the wavelet coefficients to achieve distortion recovery. These wavelet coefficient control strategies can be designed manually by experts or automatically learned from data through methods such as machine learning. Each control strategy C_i_j is essentially a function whose input is the current wavelet coefficient W(s,t,c) and whose output is the adjusted wavelet coefficient W'(s,t,c). For example, for the distortion attribute A_i_j related to baseline drift, its corresponding wavelet coefficient control strategy C_i_j can be: W'(s,t,c) = W(s,t,c) - mean(W(s,t,c)), that is, by subtracting the mean of the wavelet coefficients to eliminate the influence of baseline drift. For the distortion attribute A_i_j related to abnormal cognitive processing, its corresponding wavelet coefficient control strategy C_i_j can be: W'(s,t,c) = W(s,t,c) * g(s,t,c), where g(s,t,c) is a modulation function designed based on prior knowledge to enhance or suppress specific time-scale components related to cognitive processing.

[0131] Once the present application determines the corresponding wavelet coefficient control strategies {C_i_1, C_i_2, ..., C_i_k} for each set of distortion attributes {A_i_1, A_i_2, ..., A_i_k} obtained for each match, the present application can fuse these control strategies to obtain the final comprehensive wavelet coefficient control strategy C_final for guiding the adjustment of wavelet coefficients. The fusion method can be simple linear weighting or more complex non-linear fusion, depending specifically on the correlation and constraint conditions between different control strategies. For example, the present application can adopt a linear weighting fusion method, i.e., C_final = sum(w_i * C_i_j), where w_i is the weight coefficient corresponding to the i-th distortion attribute A_i_j, reflecting the importance of this distortion attribute at the current operation stage stage_curr. Obviously, the larger the value of w_i, the greater the impact of the i-th distortion attribute on the EEG signal, and the corresponding wavelet coefficient control strategy C_i_j should be given a larger weight during fusion. These weight coefficients w_i can be set according to the distortion detection weight values weight_i determined in the steps, for example, by setting w_i = weight_i / sum(weight_i). In this way, the present application incorporates the differences in the impact degrees of different distortion attributes on the EEG signal into the final comprehensive wavelet coefficient control strategy C_final. In some embodiments, obtaining the wavelet coefficient adjustment control instruction corresponding to the comprehensive distortion feature includes: obtaining the distortion attribute corresponding to the comprehensive distortion feature; generating the wavelet coefficient adjustment control instruction according to the distortion attribute.

[0132] In some embodiments, reconstructing the original EEG signal according to the wavelet coefficient adjustment control instruction to obtain the restored EEG signal includes: obtaining the original wavelet coefficients corresponding to the original EEG signal; adjusting the parameters corresponding to the original wavelet coefficients according to the wavelet coefficient adjustment control instruction; reconstructing the original EEG signal according to the adjusted original wavelet coefficients to obtain the restored EEG signal.

[0133] First, the present application substitutes the original wavelet coefficients \(W_0(s,t,c)\) into the control strategy \(C_{final}\), obtaining \(W'(s,t,c)=C_{final}(W_0(s,t,c))\). Here, \(C_{final}(\cdot)\) represents the process of adjusting wavelet coefficients by applying the comprehensive control strategy \(C_{final}\). It should be noted that in practical applications, the present application does not need to explicitly construct a closed-form expression for \(C_{final}\), but only needs to make corresponding adjustments to the original wavelet coefficients \(W_0(s,t,c)\) according to the different control strategies \(\{C_{i_1}, C_{i_2}, \cdots, C_{i_k}\}\) included in \(C_{final}\). For example, if \(C_{final}\) includes a control strategy \(C_{i_j}\) related to baseline drift, whose expression is \(W'(s,t,c)=W(s,t,c)-\text{mean}(W(s,t,c))\), then the present application only needs to subtract the mean of \(W_0(s,t,c)\) at each scale \(s\), time \(t\), and channel \(c\) on that scale and channel to achieve the wavelet coefficient adjustment required by this control strategy. Similarly, if \(C_{final}\) also includes a control strategy \(C_{i_j}\) related to abnormal cognitive processing, whose expression is \(W'(s,t,c)=W(s,t,c)\times g(s,t,c)\), then the present application only needs to multiply \(W_0(s,t,c)\) by the corresponding modulation function \(g(s,t,c)\). By this decomposed method, the present application can effectively avoid explicitly constructing the complex comprehensive control strategy \(C_{final}\), thereby reducing the computational complexity. Once the adjusted wavelet coefficients \(W'(s,t,c)\) are obtained, the present application can use the method of inverse wavelet transform to reconstruct them into the time-domain signal \(x'(t)\). Specifically, the process of inverse wavelet transform includes the following steps:

[0134] 1. Calculate the reconstruction coefficients \(C'(s,t)\) at each scale \(s\), where \(C'(s,t)=\sum_c W'(s,t,c)\times\psi_c(t)\). \(\psi_c(t)\) is the wavelet basis function corresponding to channel \(c\), and \(\sum_c\) represents summation over all channels \(c\).

[0135] 2. Perform the inverse wavelet transform on the reconstruction coefficients \(C'(s,t)\) of all scales \(s\) to obtain the time-domain signal \(x'(t)\), that is, \(x'(t)=\sum_s\sum_k C'(s,k)\times\phi(t - k\times2^s)\). Here, \(\phi(t)\) is the scaling function, corresponding to the reconstruction of the lowest-frequency component.

[0136] 3. Perform post-processing such as denoising filtering on \(x'(t)\) to obtain the final EEG signal \(x_{final}(t)\) after distortion recovery.

[0137] All kinds of wavelet functions ψ_c(t) and phi(t) involved in the above formula need to be determined according to the actually adopted wavelet basis. For example, if the Haar wavelet is adopted as the wavelet basis in this application, then ψ_c(t) = ψ(t) = 1 (0 ≤ t < 1 / 2) - 1 (1 / 2 ≤ t < 1), and phi(t) = 1 (0 ≤ t < 1). If the Daubechies wavelet basis is adopted, then ψ_c(t) and phi(t) need to use the corresponding Daubechies wavelet function expressions. In this way, the adjusted wavelet coefficient W'(s, t, c) in this application is reconstructed into the time-domain signal x'(t). It should be noted that due to rounding errors and truncation errors in the process of wavelet inverse transform, x'(t) may contain some high-frequency noise components. Therefore, after obtaining x'(t), this application also needs to perform appropriate post-processing on it, such as band-pass filtering, smoothing filtering, etc., to obtain the final EEG signal x_final(t) after distortion recovery.

[0138] In order to execute the EEG distortion detection and recovery method based on wavelet domain energy modulation corresponding to the above method embodiment to achieve the corresponding functions and technical effects. Refer to Figure 2 , Figure 2 The block diagram of a brain electrical activity (EEG) distortion detection and recovery device 200 provided by an embodiment of the present application is shown. For the sake of convenience of description, only the parts related to this embodiment are shown. The EEG distortion detection and recovery device 200 provided by the embodiment of the present application includes:

[0139] A coefficient acquisition module 201, configured to acquire original EEG data, perform time-frequency transformation, acquire the energy spectrum corresponding to the original EEG data, perform modulation processing based on the components in the energy spectrum that do not meet the preset intensity threshold, and acquire the modulated wavelet coefficients;

[0140] A data extraction module 202, configured to extract the wavelet coefficient data corresponding to each EEG type according to the wavelet coefficient parameter characteristics corresponding to each EEG type in the wavelet coefficients;

[0141] A state acquisition module 203, configured to perform spectral weighted average calculation on the wavelet coefficient data by using a preset time window, acquire the spectral centroid value and the corresponding frequency change state, so as to extract the wavelet feature data of each EEG type;

[0142] A feature acquisition module 204, configured to acquire the preset normal features corresponding to the EEG data, calculate the similarity between each wavelet feature data and the preset normal features, and determine the target similarity calculation result and the distortion mode feature corresponding to the target similarity calculation result according to the similarity calculation results corresponding to each wavelet feature data;

[0143] A stage acquisition module 205, configured to acquire the current operation stage corresponding to the EEG data, determine the weight value corresponding to each of the distortion mode features according to the current operation stage, acquire the feature vector of the distortion mode features, and generate a comprehensive distortion feature description according to the multiple feature vectors and the corresponding weight values;

[0144] A signal acquisition module 206, configured to acquire a wavelet coefficient adjustment control instruction corresponding to the comprehensive distortion feature, and reconstruct the original EEG signal according to the wavelet coefficient adjustment control instruction to acquire a restored EEG signal.

[0145] The above EEG distortion detection and restoration device 200 can implement the EEG distortion detection and restoration method based on wavelet domain energy modulation in the above method embodiments. The optional items in the above method embodiments are also applicable to this embodiment, which will not be elaborated here. The remaining content of the embodiments of the present application can refer to the content of the above method embodiments, and will not be repeated in this embodiment.

[0146] Figure 3 It is a schematic structural diagram of a computer device provided in an embodiment of the present application. As Figure 3 shown, the computer device 3 in 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. When the processor 30 executes the computer program 32, the steps in any of the above method embodiments are implemented.

[0147] The computer device 3 may be a computing device such as a smart phone, a tablet computer, a desktop computer, and a cloud server. The computer device may include but is not limited to the processor 30 and the memory 31. Those skilled in the art can understand that Figure 3 merely examples of the computer device 3 are given, and do not constitute a limitation to the computer device 3. It may include more or fewer components than shown in the figure, or combine some components, or different components. For example, it may also include input and output devices, network access devices, etc.

[0148] The so-called processor 30 may be a Central Processing Unit (CPU), and the processor 30 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0149] In some embodiments, the memory 31 may be an internal storage unit of the computer device 3, such as the hard disk or memory of the computer device 3. In some 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 the internal storage unit and the external storage device of the computer device 3. The memory 31 is used to store an operating system, application programs, a BootLoader, data, and other programs, such as the program code of the computer program, etc. The memory 31 may also be used to temporarily store data that has been output or is to be output.

[0150] In addition, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0151] An embodiment of the present application provides a computer program product, and when the computer program product runs on a computer device, the computer device is caused to implement the steps in each of the above method embodiments when executed.

[0152] In several embodiments provided by this application, it can be understood that each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, the program segment, or the part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved.

[0153] If the above functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs, and other various media that can store program codes.

[0154] The specific embodiments described above further elaborate on the purpose, technical solution, and beneficial effects of this application. It should be understood that the above descriptions are only specific embodiments of this application and are not used to limit the protection scope of this application. It is particularly pointed out that for those skilled in the art, any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of this application shall be included in the protection scope of this application.

Claims

1. A method for detecting and restoring EEG distortion based on wavelet domain energy modulation, characterized in that: include: Acquire original EEG data and perform time-frequency transformation to obtain an energy spectrum corresponding to the original EEG data, perform modulation processing based on components in the energy spectrum that do not meet a preset intensity threshold, and obtain modulated wavelet coefficients; Extracting wavelet coefficient data corresponding to each EEG type from the wavelet coefficients according to the wavelet coefficient parameter characteristics corresponding to each EEG type; Using a preset time window to perform spectrum weighted average calculation on the wavelet coefficient data, obtaining the spectrum centroid value and the corresponding frequency change state, so as to extract the wavelet feature data of each EEG type; Acquire a preset normal feature corresponding to the EEG data, perform similarity calculation between each of the wavelet feature data and the preset normal feature, and determine a target similarity calculation result and a distortion mode feature corresponding to the target similarity calculation result according to the similarity calculation result corresponding to each of the wavelet feature data; Acquire the current operation stage corresponding to the EEG data, determine the weight value corresponding to each of the distortion pattern features according to the current operation stage, acquire the feature vector of the distortion pattern feature, and generate a comprehensive distortion feature description according to a plurality of the feature vectors and the corresponding weight values; A wavelet coefficient adjustment control instruction corresponding to the comprehensive distortion feature is obtained, and the original EEG signal is reconstructed according to the wavelet coefficient adjustment control instruction to obtain a restored EEG signal.

2. The method according to claim 1, characterized in that The step of performing modulation processing on the components in the energy spectrum that do not meet the preset intensity threshold to obtain modulated wavelet coefficients includes: Divide the high energy intensity frequency domain segment corresponding to the first modulation feature into the medium energy intensity frequency domain segment corresponding to the second modulation feature based on the energy spectrum; Modulation processing is performed on the components in the high-energy intensity frequency domain segment and the medium-energy intensity frequency domain segment that do not meet the preset intensity threshold, and the modulated wavelet coefficients are obtained.

3. The method according to claim 2, characterized in that The modulating process of the components in the high energy intensity frequency domain segment and the medium energy intensity frequency domain segment that do not meet the preset intensity threshold comprises: Performing a first modulation process on the component in the high energy intensity frequency domain segment that does not meet a preset intensity threshold; A second modulation process is performed on the component in the medium energy intensity frequency domain segment that does not meet the preset intensity threshold.

4. The method according to claim 1, characterized in that: The step of extracting wavelet coefficient data corresponding to each EEG type from the wavelet coefficients according to the wavelet coefficient parameter characteristics corresponding to each EEG type comprises: Performing an inverse time-frequency transform on the wavelet coefficients; Obtain the wavelet coefficient parameter characteristics corresponding to each EEG type; Corresponding wavelet coefficient data is extracted from the inversely transformed wavelet coefficients according to each of the wavelet coefficient parameter features.

5. The method according to claim 1, characterized in that: The method of using a preset time window to perform spectrum weighted average calculation on the wavelet coefficient data to obtain a spectrum centroid value and a corresponding frequency change state to extract wavelet feature data of each EEG type includes: Performing the weighted average calculation on each of the wavelet coefficient data according to the preset time window to obtain the spectrum centroid value; Obtaining the frequency change state corresponding to each of the frequency spectrum centroid values; The wavelet characteristic data is extracted in the frequency change state.

6. The method according to claim 1, characterized in that The step of obtaining the wavelet coefficient adjustment control instruction corresponding to the comprehensive distortion feature includes: Obtaining a distortion attribute corresponding to the comprehensive distortion feature; The wavelet coefficient adjustment control instruction is generated according to the distortion attribute.

7. The method according to claim 1, characterized in that The reconstructing the original EEG signal according to the wavelet coefficient adjustment control instruction to obtain the restored EEG signal includes: Obtaining original wavelet coefficients corresponding to the original EEG signal; Adjust the parameters corresponding to the original wavelet coefficients according to the wavelet coefficient adjustment control instruction; The original EEG signal is reconstructed according to the adjusted original wavelet coefficients to obtain the restored EEG signal.

8. The method according to claim 1, characterized in that The obtaining of the preset normal features corresponding to the EEG data includes: Obtaining the application type and data processing method corresponding to the EEG data; The preset normal features are obtained according to the application type and the data processing method.

9. The method according to claim 8, characterized in that The obtaining of the EEG data corresponding to the current operation stage includes: The current operation stage is obtained according to the application type and the data processing method.

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 9 when executing the computer program.

Citation Information

Patent Citations

  • Electroencephalogram abnormal signal detection device and method

    CN111528838A

  • Method for removing ocular artifacts in single-channel electroencephalogram signals

    CN114403896A