Noise reduction methods, electronic devices, and software products for electroencephalogram (EEG) signals

By using the inverse denoising operation of the conditional diffusion model, the problems of complex multi-source artifacts and task feature preservation in EEG signal processing in existing technologies are solved. Effective denoising and signal structure preservation are achieved under different task states, improving the accuracy of task state analysis.

CN123058754APending Publication Date: 2026-11-10TIANJIN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611584299.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-14
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

When processing EEG signals, existing technologies based on human experience struggle to effectively handle complex multi-source artifacts, potentially weakening effective EEG features relevant to the task state. Meanwhile, deep learning-based methods lack denoising strategies tailored to task characteristics, making it difficult to balance artifact suppression and neural feature preservation.

Method used

The conditional diffusion model is adopted, and the inverse denoising operation guided by task spectral features is introduced. By utilizing conditional mapping, encoding, attention fusion, conditional modulation and diffusion modules, multi-source artifacts are adaptively suppressed and EEG signals that conform to task statistical characteristics are generated.

Benefits of technology

Adaptive suppression of multi-source artifacts under different task states maintains consistency in EEG signal structural features, providing a reliable signal basis for subsequent task state analysis and improving analysis accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123058754A_ABST
    Figure CN123058754A_ABST
Patent Text Reader

Abstract

This application provides a denoising method, electronic device, and program product for electroencephalogram (EEG) signals, applied in the field of biosignal processing technology. The method includes: repeatedly performing the following operations until the 0th intermediate state signal is obtained, and using it as the target EEG signal: mapping and splicing task spectral features and the t-th diffusion time step to obtain a conditional vector; encoding the t-th intermediate state signal and the EEG signal respectively; performing multi-head attention calculation on the obtained diffusion state features and reference features to obtain a first fusion feature; fusing the first fusion feature, diffusion state features, and reference features to obtain a second fusion feature; linearly modulating the second fusion feature according to the modulation parameters obtained by multi-layer perceptual mapping of the conditional vector to obtain a modulation feature; and obtaining the (t-L)-th intermediate state signal based on the t-th predicted noise obtained by performing a denoising operation on the modulation feature and the t-th intermediate state signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of biosignal processing technology, and more specifically, to a noise reduction method, electronic device, and program product for electroencephalogram (EEG) signals. Background Technology

[0002] Electroencephalogram (EEG) signals can directly reflect the brain's neural activity with a millisecond-level temporal resolution, providing a physiological basis for analyzing task states. However, because EEG signals are easily affected by multi-source noise during acquisition, undenoised EEG signals cannot be directly used for task state analysis.

[0003] While data processing methods based on human experience can be used for EEG denoising, they struggle to effectively handle complex multi-source artifacts and may weaken effective EEG features relevant to task state. Therefore, using EEG signals denoised using human experience-based data processing methods for task state analysis results in inaccurate interpretation. Summary of the Invention

[0004] In view of this, embodiments of this application provide a noise reduction method, electronic device, and program product for electroencephalogram (EEG) signals.

[0005] According to one aspect of the embodiments of this application, a method for denoising electroencephalogram (EEG) signals is provided, comprising: repeatedly performing the following operations until a zero intermediate state signal is obtained, and using the zero intermediate state signal as the target EEG signal: using a conditional mapping module to map the task spectral features corresponding to the target object in a predetermined state and the t-th diffusion time step respectively, and concatenating the mapping results to obtain a conditional vector, wherein the task spectral features are obtained based on the power spectral density of multiple predetermined clean EEG signals corresponding to the predetermined state, t∈{T, TL, ..., L}, T is an integer greater than 1, and L is an integer greater than or equal to 1 and less than T; using an encoding module to map the t-th intermediate state signal and the target object in the predetermined state... The EEG signals of the target object are encoded to obtain diffuse state features and reference features, where the T-th intermediate state signal is a random noise signal. The attention fusion module performs multi-head attention calculation on the diffuse state features and reference features to obtain the first fusion feature. The first fusion feature, diffuse state features and reference features are then fused to obtain the second fusion feature. The conditional modulation module performs multi-layer perceptual mapping on the conditional vector to obtain modulation parameters. The second fusion feature is then linearly modulated using the modulation parameters to obtain the modulation feature. The conditional diffusion module performs denoising on the modulation feature to obtain the t-th predicted noise. Based on the t-th predicted noise and the t-th intermediate state signal, the tL-th intermediate state signal is obtained.

[0006] According to an embodiment of this application, the attention fusion module includes: a preprocessing submodule, an attention fusion submodule, a convolutional feedforward thinning submodule, and a modulation fusion submodule. The above-mentioned use of the attention fusion module to perform multi-head attention calculation on the diffusion state features and reference features to obtain a first fused feature, and fusing the first fused feature, diffusion state features, and reference features to obtain a second fused feature, includes: using the preprocessing submodule to add the diffusion state features and reference features point-by-point to obtain a summed feature, and performing a first convolution and a first normalization on the summed feature to obtain a spatial fusion feature; using the attention fusion submodule to perform the spatial fusion feature... Multi-head attention computation is performed to obtain attention fusion features. Residual connections are then made between the attention fusion features and spatial fusion features to obtain residual fusion features. A second convolution and a second normalization are applied to the residual fusion features using a convolutional feedforward refinement submodule to obtain refined features. A third convolution and a third normalization are applied to the refined features using a modulation fusion submodule to obtain first modulation refined features. A fourth convolution and a fourth normalization are then applied to the refined features to obtain second modulation refined features. Finally, the product of the first modulation refined features and the diffusion state features, and the product of the second modulation refined features and the reference features are fused to obtain the second fused feature.

[0007] According to an embodiment of this application, the conditional diffusion model includes a conditional mapping module, an encoding module, an attention fusion module, a conditional modulation module, and a conditional diffusion module. The conditional diffusion model is obtained through the following training operations: the training EEG signal of the training object in a predetermined state, the task spectral features corresponding to the training object in the predetermined state, the training time step, and the first training intermediate state signal are all input into an initial conditional diffusion model corresponding to the conditional diffusion model. This yields training prediction noise and a second training intermediate state signal based on the training prediction noise and the first training intermediate state signal. The first training intermediate state signal is obtained by iteratively adding second-order Gaussian noise from the training time step to the clean EEG signal corresponding to the training object in the predetermined state using the initial conditional diffusion model. Given any one of several pre-defined clean EEG signals; determine the main diffusion loss based on the training prediction noise and Gaussian noise added to the clean EEG signal at the training time step by the initial conditional diffusion model; determine the content consistency loss based on the reference content features and the denoised content features, where the reference content features are obtained by feature extraction from the training EEG signal using a feature encoder, and the denoised content features are obtained by feature extraction from the second training intermediate state signal using a feature encoder; determine the style matching loss based on the first power spectral density corresponding to the clean EEG signal and the second power spectral density corresponding to the second training intermediate state signal; adjust the model parameters of the initial conditional diffusion model based on the main diffusion loss, the content consistency loss, and the style matching loss to obtain the trained conditional diffusion model.

[0008] According to an embodiment of this application, the first power spectral density is obtained by processing a clean EEG signal using a power spectral density calculation function, and the second power spectral density is obtained by processing a second training intermediate state signal using a power spectral density calculation function. Determining the style matching loss based on the first power spectral density corresponding to the clean EEG signal and the second power spectral density corresponding to the second training intermediate state signal includes: obtaining a first difference feature based on the first power spectral density and the second power spectral density; and obtaining the style matching loss based on the sum of squares of multiple first differences included in the first difference feature.

[0009] According to an embodiment of this application, determining the content consistency loss based on the reference content features and the denoised content features includes: obtaining a second difference feature based on the reference content features and the denoised content features; and obtaining the content consistency loss based on the sum of squares of multiple second differences included in the second difference feature.

[0010] According to an embodiment of this application, the encoding module includes a first convolutional submodule and a second convolutional submodule. The above-mentioned encoding of the t-th intermediate state signal and the EEG signal of the target object in a predetermined state using the encoding module to obtain diffusion state features and reference features includes: performing multiple convolution operations on the t-th intermediate state signal using the first convolutional submodule to obtain the above-mentioned diffusion state features; and performing multiple convolution operations on the EEG signal using the second convolutional submodule to obtain the above-mentioned reference features. The network structures of the first convolutional submodule and the second convolutional submodule are the same, but the network parameters corresponding to the first convolutional submodule and the second convolutional submodule are different.

[0011] According to an embodiment of this application, the condition mapping module includes a first multilayer perceptron submodule, a cosine scheduling submodule, a splicing submodule, and a second multilayer perceptron submodule. The condition mapping module maps the task spectrum features corresponding to the target object in a predetermined state and the t-th diffusion time step, and splices the mapping results to obtain a condition vector. This includes: using the first multilayer perceptron submodule to perform multilayer perceptron mapping on the task spectrum features to obtain task condition features; using the predetermined cosine scheduling formula in the cosine scheduling submodule to map the t-th diffusion time step to obtain time condition features; using the splicing submodule to splice the task condition features and time condition features into vectors to obtain an initial condition vector; and using the second multilayer perceptron submodule to perform multilayer perceptron mapping on the initial condition vector to obtain the aforementioned condition vector.

[0012] According to an embodiment of this application, the conditional modulation module includes a third multilayer perceptron submodule, a fourth multilayer perceptron submodule, and a conditional modulation submodule. The modulation parameters include scaling parameters and translation parameters. The process of using the conditional modulation module to perform multilayer perceptron mapping on the conditional vector to obtain modulation parameters, and then using the modulation parameters to linearly modulate the second fused feature to obtain the modulation feature, includes: using the third multilayer perceptron submodule to perform multilayer perceptron mapping on the conditional vector to obtain the scaling parameters; using the fourth multilayer perceptron submodule to perform multilayer perceptron mapping on the conditional vector to obtain the translation parameters. The network structures of the third and fourth multilayer perceptron submodules are the same, but their network parameters are different from those of the third and fourth multilayer perceptron submodules, respectively. The conditional modulation submodule then performs linear mapping on the second fused feature based on the scaling parameters and the translation parameters to obtain the modulation feature.

[0013] According to another aspect of the embodiments of this application, an electronic device is provided, including: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method described above.

[0014] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, which stores computer-executable instructions that, when executed, are used to implement the above-described method.

[0015] According to another aspect of the embodiments of this application, a computer program product is provided, the computer program product including computer executable instructions, which, when executed, are used to implement the above-described method.

[0016] According to an embodiment of this application, since the task spectral features are obtained based on the power spectral density of multiple predetermined clean EEG signals corresponding to a predetermined state, a conditional mapping module is used to map the task spectral features corresponding to the target object in the predetermined state and the t-th diffusion time step, and the mapping results are concatenated to obtain a conditional vector. This conditional vector reflects the statistical characteristics and noise level of the task corresponding to the predetermined state. An encoding module encodes the t-th intermediate state signal and the EEG signal of the target object in the predetermined state to obtain diffusion state features and reference features. An attention fusion module performs multi-head attention calculation on the diffusion state features and reference features to obtain a first fusion feature. The first fusion feature, diffusion state features, and reference features are then fused to obtain a second fusion feature. This second fusion feature reflects the structural features of the t-th intermediate state signal and the structural features corresponding to the EEG signal of the target object in the predetermined state.

[0017] Subsequently, the conditional modulation module performs multi-layer perceptual mapping on the conditional vector to obtain modulation parameters. These modulation parameters are then used to linearly modulate the second fused feature, yielding a modulated feature. The conditional diffusion module performs denoising on the modulated feature, obtaining the t-th predicted noise. Based on the t-th predicted noise and the t-th intermediate state signal, the tL-th intermediate state signal is obtained. This process is repeated until the 0th intermediate state signal is obtained, which is then used as the target EEG signal. This approach, considering the differences in the time-frequency structure and distribution characteristics of EEG under different task states, introduces task spectral features corresponding to the target object in a predetermined state to guide the reverse denoising operation of the conditional diffusion model. Simultaneously, the noisy target object's EEG signal is used as a reference to constrain the sample-level output of the conditional diffusion model. This allows the conditional diffusion model to not only adaptively suppress multi-source artifacts in the noisy target object's EEG signal under different task states but also simultaneously generate a target EEG signal that conforms to the task's statistical characteristics, maintaining consistency between the structural characteristics of the output target EEG signal and the target object's EEG signal. This provides a reliable signal foundation for subsequent task state analysis, improving the analysis accuracy. Attached Figure Description

[0018] The above and other objects, features and advantages of this application will become clearer from the following description of embodiments of this application with reference to the accompanying drawings.

[0019] Figure 1 A flowchart of a noise reduction method for electroencephalogram (EEG) signals according to an embodiment of this application is shown.

[0020] Figure 2 A schematic diagram of a conditional diffusion model according to an embodiment of this application is shown.

[0021] Figure 3 A schematic diagram of the structure of the attention fusion module according to an embodiment of this application is shown.

[0022] Figure 4 A schematic diagram of another conditional diffusion model according to an embodiment of this application is shown.

[0023] Figure 5A The performance test results corresponding to the sleep EEG dataset according to an embodiment of this application are shown.

[0024] Figure 5B The performance test results corresponding to the motor imagery EEG dataset according to an embodiment of this application are shown.

[0025] Figure 6A The correlation coefficient results corresponding to sleep EEG data according to embodiments of this application are shown.

[0026] Figure 6B The output signal-to-noise ratio results corresponding to sleep EEG data according to an embodiment of this application are shown.

[0027] Figure 6C The correlation coefficient results corresponding to motor imagery EEG data according to embodiments of this application are shown.

[0028] Figure 6D The output signal-to-noise ratio results corresponding to motor imagery EEG data are shown according to an embodiment of this application.

[0029] Figure 7 A block diagram of an electronic device suitable for implementing a noise reduction method for electroencephalogram (EEG) signals, according to an embodiment of this application, is shown. Detailed Implementation

[0030] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.

[0031] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0032] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0033] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).

[0034] In the embodiments of this application, the collection, updating, analysis, processing, use, transmission, provision, disclosure, and storage of data (e.g., including but not limited to user personal information) comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures have been taken to prevent unauthorized access to user personal information data and to safeguard user personal information security and network security.

[0035] In the embodiments of this application, the user's authorization or consent was obtained before obtaining or collecting the user's personal information.

[0036] In this embodiment, the EEG signal can be a human EEG signal. When the EEG signal is a human EEG signal, the electroencephalogram (EEG) signal, as a key intermediate variable, is widely used in motor imagery tasks. In motor imagery tasks, EEG signals can be used to detect hand movements, such as grasping and lifting, and can also control devices such as computer mice and wheelchairs.

[0037] While EEG signals can directly reflect brain neural activity with millisecond-level temporal resolution, providing a physiological basis for task state analysis, they are susceptible to multi-source noise during acquisition, including electromyography (EMG) artifacts, motion artifacts, electrode perturbation noise, and environmental interference. Data processing methods based on human experience, such as filtering, independent component analysis, canonical correlation analysis, and wavelet transform, can be used for EEG denoising, but they suffer from incomplete artifact separation, strong reliance on human experience, and the potential weakening of task-related EEG features. Consequently, when using these denoised EEG signals to analyze task states, the analysis is often inaccurate.

[0038] Furthermore, many deep learning-based EEG denoising methods in related technologies employ task-agnostic unified modeling strategies to denoise human EEG signals. Applying such task-agnostic unified modeling strategies to denoise EEG signals can easily weaken task-state-related neural responses while removing artifacts, making it difficult to achieve high-fidelity signal reconstruction.

[0039] Therefore, the technical problems to be solved by the embodiments of this application include: when data processing methods based on human experience are used to denoise human EEG signals, they lack adaptability in practical application scenarios, are difficult to effectively handle complex multi-source artifacts, and may weaken effective EEG features related to task state. Deep learning-based EEG denoising methods lack denoising strategies tailored to task characteristics, making it difficult to simultaneously suppress artifacts and preserve neural features related to task state.

[0040] In view of this, embodiments of this application propose a noise reduction method, electronic device, and program product for electroencephalogram (EEG) signals, which can be applied to the field of biosignal processing technology.

[0041] The denoising method for EEG signals provided in this application introduces task spectral features corresponding to the target object in a predetermined state to guide the reverse denoising operation of the conditional diffusion model. At the same time, the EEG signal of the noisy target object is used as a reference to constrain the sample-level output of the conditional diffusion model. This allows the conditional diffusion model to not only adaptively suppress multi-source artifacts in the EEG signal of the noisy target object under different task states, but also maintain the structure and statistical characteristics of the EEG signal, providing a reliable signal basis for subsequent task state analysis and improving the analysis accuracy.

[0042] Figure 1 A flowchart of a noise reduction method for electroencephalogram (EEG) signals according to an embodiment of this application is shown. Figure 2 A schematic diagram of a conditional diffusion model according to an embodiment of this application is shown.

[0043] Can be used Figure 2 The conditional diffusion model shown is implemented Figure 1 The method shown is for noise reduction of EEG signals. For example... Figure 2 As shown, the conditional diffusion model may include: a conditional mapping module, an encoding module, an attention fusion module, a conditional modulation module, and a conditional diffusion module.

[0044] like Figure 1 As shown, the noise reduction method for EEG signals in this embodiment includes operations S101 to S108.

[0045] In operation S101, the conditional mapping module is used to map the task spectral features corresponding to the target object in the predetermined state and the t-th diffusion time step, and the mapping results are concatenated to obtain the conditional vector. The task spectral features are obtained based on the power spectral density of multiple predetermined clean EEG signals corresponding to the predetermined state, where t∈{T, TL, ..., L}, T is an integer greater than 1, and L is an integer greater than or equal to 1 and less than T. t gradually decreases from T to L, with an interval of L between two adjacent t values, and T is an integer multiple of L. The target object can be a person.

[0046] T and L can be selected according to the actual situation and are not limited here. For example, T can be 1000, 1200 or 1500, etc. L can be 1, 20 or 50, etc.

[0047] The predetermined state is either an active state or a sleep state.

[0048] For example, multiple predetermined clean EEG signals corresponding to a predetermined state can be clean EEG signals of a person corresponding to the predetermined state.

[0049] In a scenario where the predetermined state is a motor state, and the multiple predetermined clean EEG signals corresponding to the motor state are clean EEG signals of the person corresponding to the motor state, the multiple predetermined clean EEG signals corresponding to the motor state can be clean motor imagery EEG signals from the EEG denoising benchmark dataset (EEGdenoiseNet) that have already been processed for a motor task. Furthermore, this application uniformly resamples the motor imagery EEG segments and EMG artifact segments in the clean motor imagery EEG signals to 256Hz, so that each 2-second segment includes 2×256=512 time sampling points.

[0050] In a scenario where the predetermined state is sleep, and the multiple predetermined clean EEG signals corresponding to the sleep state are clean EEG signals of the person corresponding to the sleep state, the multiple predetermined clean EEG signals corresponding to the sleep state can be sleep EEG signals from healthy subjects in a sleep EEG dataset (ISRUC-Sleep). Embodiments of this application can process the sleep EEG signals according to the EEGdenoiseNet data processing method, making the processed sleep EEG signals consistent with the format of motor imagery EEG signals.

[0051] For example, the power spectral density of multiple predetermined clean EEG signals corresponding to a predetermined state can be averaged to obtain the task spectral characteristics corresponding to the predetermined state.

[0052] For example, when the target object is a person, before performing operation S101, this application can obtain the task spectrum features corresponding to the motion state and the task spectrum features corresponding to the sleep state. By processing the EEG signal of a person in a predetermined state using a power spectral density calculation function, a target power spectral density is obtained. The similarity between the target power spectral density and the task spectrum features corresponding to the motion state and the task spectrum features corresponding to the sleep state is calculated respectively. Based on the task spectrum feature corresponding to the maximum similarity among the two similarities, the task spectrum features corresponding to the person in the predetermined state are obtained.

[0053] For example, the task spectrum features corresponding to the target object in the predetermined state and the t-th diffusion time step can be mapped to obtain the corresponding conditional features. The corresponding conditional features are then sequentially concatenated into vectors and mapped using multilayer sensing to obtain the conditional vector.

[0054] According to an embodiment of this application, the conditional diffusion model can determine the noise level based on the task's spectral characteristics and the conditional vector obtained at the t-th diffusion time step, i.e., determine whether the current stage is a high-noise stage or a low-noise stage, and at the same time determine the statistical characteristics of the task corresponding to the predetermined state.

[0055] In operation S102, the encoding module encodes the t-th intermediate state signal and the EEG signal of the target object in the predetermined state, respectively, to obtain the diffusion state features and reference features. The t-th intermediate state signal is a random noise signal. The t-th intermediate state signal is the initial intermediate state signal. The t-th intermediate state signal conforms to a Gaussian distribution.

[0056] For example, the t-th intermediate state signal can be encoded to obtain the diffusion state feature. The EEG signal of the target object in a predetermined state can be encoded to obtain the reference feature.

[0057] In operation S103, the attention fusion module is used to perform multi-head attention calculation on the diffusion state features and reference features to obtain the first fused feature. The first fused feature, diffusion state features and reference features are then fused to obtain the second fused feature.

[0058] In operation S104, the conditional modulation module is used to perform multi-layer sensing mapping on the conditional vector to obtain modulation parameters. The modulation parameters are then used to linearly modulate the second fused feature to obtain the modulation feature.

[0059] In operation S105, the conditional diffusion module is used to perform a denoising operation on the modulation feature to obtain the t-th predicted noise, and the tL-th intermediate state signal is obtained based on the t-th predicted noise and the t-th intermediate state signal.

[0060] For example, the conditional diffusion module can be used to sequentially downsample, decompose, mix, and predict noise in the modulation features to obtain the t-th predicted noise.

[0061] For example, the conditional diffusion module can be a module in a denoising diffusion model that can perform downsampling, multi-scale decomposition, mixing, and noise prediction during the denoising process, and obtain the intermediate state signal of the previous time step based on the current predicted noise and the current intermediate state signal. The denoising diffusion model can be, for example, a denoising diffusion implicit model (DDIM) or a denoising diffusion probabilistic model (DDPM).

[0062] In operation S106, is tL equal to 0? If yes, operation S107 will be executed; otherwise, operation S108 will be executed.

[0063] In operation S107, the 0th intermediate state signal is taken as the target EEG signal.

[0064] In operation S108, t = tL. Then, return to operation S101.

[0065] like Figure 1As shown, the noise reduction method for EEG signals provided in this application embodiment can obtain the denoised target EEG signal by repeatedly executing operations S101 to S108 until the 0th intermediate state signal is obtained and using the 0th intermediate state signal as the target EEG signal.

[0066] According to embodiments of this application, the noise reduction method for electroencephalogram (EEG) signals can denoise the EEG signals of a target object in a predetermined state. The removed "noise" is the actual acquisition noise mixed in during the actual acquisition of EEG signals, such as electromyography artifacts, motion artifacts, electrode disturbances, and environmental interference.

[0067] According to an embodiment of this application, since the task spectral features are obtained based on the power spectral density of multiple predetermined clean EEG signals corresponding to a predetermined state, a conditional mapping module is used to map the task spectral features corresponding to the target object in the predetermined state and the t-th diffusion time step, and the mapping results are concatenated to obtain a conditional vector. This conditional vector reflects the statistical characteristics and noise level of the task corresponding to the predetermined state. An encoding module encodes the t-th intermediate state signal and the EEG signal of the target object in the predetermined state to obtain diffusion state features and reference features. An attention fusion module performs multi-head attention calculation on the diffusion state features and reference features to obtain a first fusion feature. The first fusion feature, diffusion state features, and reference features are then fused to obtain a second fusion feature. This second fusion feature reflects the structural features of the t-th intermediate state signal and the structural features corresponding to the EEG signal of the target object in the predetermined state.

[0068] Subsequently, the conditional modulation module performs multi-layer perceptual mapping on the conditional vector to obtain modulation parameters. These modulation parameters are then used to linearly modulate the second fused feature, yielding a modulated feature. The conditional diffusion module performs denoising on the modulated feature, obtaining the t-th predicted noise. Based on the t-th predicted noise and the t-th intermediate state signal, the tL-th intermediate state signal is obtained. This process is repeated until the 0th intermediate state signal is obtained, which is then used as the target EEG signal. This approach, considering the differences in the time-frequency structure and distribution characteristics of EEG under different task states, introduces task spectral features corresponding to the target object in a predetermined state to guide the reverse denoising operation of the conditional diffusion model. Simultaneously, the noisy target object's EEG signal is used as a reference to constrain the sample-level output of the conditional diffusion model. This allows the conditional diffusion model to not only adaptively suppress multi-source artifacts in the noisy target object's EEG signal under different task states but also simultaneously generate a target EEG signal that conforms to the task's statistical characteristics, maintaining consistency between the structural characteristics of the output target EEG signal and the target object's EEG signal. This provides a reliable signal foundation for subsequent task state analysis, improving the analysis accuracy.

[0069] Figure 3 A schematic diagram of the structure of the attention fusion module according to an embodiment of this application is shown.

[0070] like Figure 3 As shown, the attention fusion module may include: a preprocessing submodule, an attention fusion submodule, a convolutional feedforward refinement submodule, and a modulation fusion submodule.

[0071] According to embodiments of this application, for example, Figure 1 Operation S103, as shown, utilizes the attention fusion module to perform multi-head attention calculation on the diffusion state features and reference features to obtain a first fused feature. Then, it fuses the first fused feature, the diffusion state features, and the reference features to obtain a second fused feature. This can include the following operations: Using a preprocessing submodule, the diffusion state features and reference features are added point-by-point to obtain a summed feature; the summed feature undergoes a first convolution and a first normalization to obtain a spatial fused feature; using the attention fusion submodule, the spatial fused feature undergoes multi-head attention calculation to obtain an attention fused feature; the attention fused feature and the spatial fused feature are then joined by a residual connection to obtain a residual fused feature; using a convolution feedforward thinning submodule, the residual fused feature undergoes a second convolution and a second normalization to obtain a thinned feature; using a modulation fusion submodule, the thinned feature undergoes a third convolution and a third normalization to obtain a first modulation thinned feature; the thinned feature undergoes a fourth convolution and a fourth normalization to obtain a second modulation thinned feature; and the product between the first modulation thinned feature and the diffusion state features, and the product between the second modulation thinned feature and the reference feature, are fused to obtain the second fused feature.

[0072] The role of the attention fusion module is to model the interaction between diffusion state features and reference features, rather than simply concatenating or adding the two together.

[0073] For example, a preprocessing submodule can be used to perform a 1×1 convolution on the summed features. Then, the normalization layer and activation function in the preprocessing submodule can be used to perform layer normalization and nonlinear mapping on the features obtained from the first convolution operation to obtain spatial fusion features. The activation function can be SiLU (Sigmoid Linear Unit).

[0074] According to embodiments of this application, by using a preprocessing submodule to add the diffusion state features and reference features point by point to obtain a summed feature, and then performing a first convolution and a first normalization on the summed feature to obtain a spatial fusion feature, the diffusion state features and the noisy reference features are in a consistent feature space. This step can unify the channel dimension and feature value distribution range of the dual-source features, reducing fusion instability caused by different input sources.

[0075] By utilizing the attention fusion submodule to perform multi-head attention computation on spatial fusion features, attention fusion features are obtained. Residual fusion features are then obtained by performing a residual connection between the attention fusion features and the spatial fusion features. This allows for modeling the dependencies between features at different time points, different channels, and between the two types of input features. Through this mechanism, the conditional diffusion model can adaptively determine which temporal structures in the original noisy reference features are more useful for noise prediction of the current diffusion state (i.e., the current intermediate state signal).

[0076] The subsequent residual fusion features are input into the convolutional feedforward refinement submodule. The one-dimensional convolutional network in the convolutional feedforward refinement submodule performs a second convolution on the residual fusion features. The kernel length of the one-dimensional convolutional network is 3. Then, the features obtained from the second convolution operation are sequentially normalized and nonlinearly mapped using the normalization layer and activation function in the convolutional feedforward refinement submodule to obtain the refined features. The activation function can be SiLU.

[0077] By utilizing a convolutional feedforward refinement submodule to perform a second convolution and a second normalization on the residual fused features, refined features are obtained, which can further extract local temporal patterns and refine the representation after attention fusion. Compared with ordinary fully connected feedforward networks, the one-dimensional convolutional feedforward refinement module is more suitable for processing such one-dimensional non-stationary time series signals.

[0078] Subsequently, one branch of the modulation fusion submodule can be used to sequentially perform 1×1 convolutions and layer normalization on the refined features to obtain the first modulation refined feature. Another branch of the modulation fusion submodule can then be used to sequentially perform 1×1 convolutions and layer normalization on the refined features to obtain the second modulation refined feature. The modulation fusion submodule is then used to calculate the product between the first modulation refined feature and the diffusion state feature, and the product between the second modulation refined feature and the reference feature. These two products are then added together to obtain the second fused feature.

[0079] By using the modulation fusion submodule to perform a third convolution and a third normalization on the refined features, a first modulation refined feature is obtained. A fourth convolution and a fourth normalization are then performed on the refined features to obtain a second modulation refined feature. The product between the first modulation refined feature and the diffusion state feature is fused with the product between the second modulation refined feature and the reference feature to obtain a second fused feature. This process can preserve the characteristics of the original input features (i.e., the diffusion state feature and the reference feature) and stabilize the distribution of the fused second fused feature.

[0080] Figure 4 A schematic diagram of another conditional diffusion model according to an embodiment of this application is shown.

[0081] like Figure 4As shown, the conditional diffusion model may include: a conditional mapping module, an encoding module, an attention fusion module, a conditional modulation module, and a conditional diffusion module. Figure 4 For the specific structure and function of the attention fusion module, please refer to [link / reference]. Figure 3 This will not be elaborated upon here. The encoding module may include a first convolutional submodule and a second convolutional submodule.

[0082] According to embodiments of this application, for example, Figure 1 The operation S102 shown uses an encoding module to encode the t-th intermediate state signal and the EEG signal of the target object in a predetermined state, respectively, to obtain diffusion state features and reference features. It may include the following operations: using a first convolution submodule to perform multiple convolution operations on the t-th intermediate state signal to obtain diffusion state features; using a second convolution submodule to perform multiple convolution operations on the EEG signal to obtain reference features. The network structures of the first and second convolution submodules are the same, but the network parameters corresponding to the first and second convolution submodules are different.

[0083] For example, the first and second convolutional submodules can both be two-layer one-dimensional convolutional networks, and the kernel size can be 3.

[0084] By performing multiple convolution operations on the t-th intermediate state signal using the first convolution submodule, diffusion state features are obtained. These features reflect the noise state of the intermediate state signal under the current backdiffusion step, as well as the local temporal information required for subsequent noise prediction. By performing multiple convolution operations on the EEG signal using the second convolution submodule, reference features are obtained. These reference features provide a temporal structure reference corresponding to the current input (i.e., the EEG signal) to the backdiffusion denoising process.

[0085] It's important to note that the original EEG signal containing artifacts is not noise. Although it contains EMG artifacts, motion artifacts, electrode contact perturbations, or transient high-frequency abnormalities, it still contains the waveform morphology, phase changes, local rhythms, and task-related temporal structure of the current real EEG activity. Therefore, by performing multiple convolution operations on the EEG signal through the second convolution submodule to obtain reference features, the conditional diffusion model can maintain the structural information corresponding to the current input EEG signal during denoising, rather than relying solely on task conditions to generate an EEG signal that conforms to the overall task distribution but has a structure inconsistent with the current input EEG signal.

[0086] like Figure 4 As shown, the condition mapping module includes a first multilayer perceptron submodule, a cosine scheduling submodule, a splicing submodule, and a second multilayer perceptron submodule.

[0087] According to embodiments of this application, for example, Figure 1The operation S101 shown uses the condition mapping module to map the task spectrum features corresponding to the target object in the predetermined state and the t-th diffusion time step, and concatenates the mapping results to obtain a condition vector. It may include the following operations: using the first multilayer perceptron submodule to perform multilayer perceptron mapping on the task spectrum features to obtain task condition features; using the predetermined cosine scheduling formula in the cosine scheduling submodule to map the t-th diffusion time step to obtain time condition features; using the concatenation submodule to concatenate the task condition features and time condition features into vectors to obtain an initial condition vector; and using the second multilayer perceptron submodule to perform multilayer perceptron mapping on the initial condition vector to obtain a condition vector.

[0088] The task spectral features are used to characterize the prior spectral distribution of a relatively clean, predetermined clean EEG signal under the current predetermined state. The t-th diffusion time step is used to characterize the noise level corresponding to the current back-diffusion stage.

[0089] For example, both the first and second multilayer perceptron submodules include a multilayer perceptron (MLP).

[0090] By mapping the t-th diffusion time step using a predetermined cosine scheduling formula in the root of the cosine scheduling submodule, temporal conditional features are obtained. This allows the conditional diffusion model to determine different diffusion stages based on these features and predict corresponding Gaussian noise intensities for each stage. Furthermore, task-related spectral features are introduced, enabling the conditional diffusion model to perceive not only the current noise level but also the task-related spectral distribution that the current EEG signal should conform to during the backdiffusion step. Therefore, task-related spectral features can serve as task-level spectral priors to guide EEG signal recovery.

[0091] The conditional vector includes both task spectral prior information and diffusion time step information. By concatenating the task conditional features and temporal conditional features into vectors, the independent representations of both types of conditional information can be preserved, and the subsequent mapping network learns the combination relationship between the two.

[0092] like Figure 4 As shown, the conditional modulation module includes a third multilayer sensor submodule, a fourth multilayer sensor submodule, and a conditional modulation submodule. The modulation parameters include scaling parameters and translation parameters.

[0093] According to embodiments of this application, for example, Figure 1The operation S104 shown involves using a conditional modulation module to perform multi-layer sensing mapping on the conditional vector to obtain modulation parameters, and then using the modulation parameters to perform linear modulation on the second fused feature to obtain a modulation feature. This operation may include the following steps: using a third multi-layer sensing submodule to perform multi-layer sensing mapping on the conditional vector to obtain scaling parameters; using a fourth multi-layer sensing submodule to perform multi-layer sensing mapping on the conditional vector to obtain translation parameters, wherein the network structures of the third and fourth multi-layer sensing submodules are the same but their network parameters are different from those of the corresponding network modules; and using the conditional modulation submodule to perform linear mapping on the second fused feature based on the scaling and translation parameters to obtain the modulation feature.

[0094] For example, both the third and fourth multi-layer perceptron submodules include a multi-layer perceptron (MLP).

[0095] For example, the scaling parameter can be multiplied element-wise with the second fusion feature, and then added to the translation parameter to obtain the modulation feature.

[0096] The modulation feature is a feature obtained after joint conditional modulation by the task and time. The modulation feature is then input into the subsequent conditional diffusion module for diffusion noise prediction, resulting in the t-th predicted noise.

[0097] According to embodiments of this application, the conditional modulation submodule linearly maps the second fusion feature based on scaling and translation parameters to obtain modulation features. This enables the conditional diffusion model to know not only the current noise level but also the task state distribution that the current EEG signal should conform to in each back-diffusion step, based on the modulation features. Consequently, the conditional diffusion model can employ different noise prediction strategies at different diffusion stages and under different task conditions.

[0098] The noise reduction method for EEG signals provided in this application enables the conditional diffusion model to utilize two types of conditional information simultaneously at each back-diffusion time step: on the one hand, the t-th diffusion time step provides information on the current noise level, allowing the conditional diffusion model to adjust its noise prediction strategy according to the diffusion stage; on the other hand, the task spectrum prototype (i.e., the task spectrum features corresponding to the target object in a predetermined state) provides a spectral prior of the predetermined clean EEG signal in the current task state, allowing the conditional diffusion model to preserve task-related EEG rhythm structures as much as possible while suppressing artifacts. Thus, it is possible to generate and recover the target EEG signal under task-constrained conditions.

[0099] The conditional diffusion model provided in this application embodiment is obtained through the following training operation: the training EEG signal of the training object in a predetermined state, the task spectral features corresponding to the training object in the predetermined state, the training time step, and the first training intermediate state signal are all input into the initial conditional diffusion model corresponding to the conditional diffusion model to obtain training prediction noise and a second training intermediate state signal based on the training prediction noise and the first training intermediate state signal. The first training intermediate state signal is obtained by iteratively adding training time step-gaussian noise to the clean EEG signal corresponding to the training object in the predetermined state by the initial conditional diffusion model. The clean EEG signal is any one of multiple predetermined clean EEG signals. Based on the training prediction noise and the first training intermediate state signal... The noise and initial conditional diffusion model are used to determine the main diffusion loss by adding Gaussian noise to the clean EEG signal at the training time step. Content consistency loss is determined based on reference content features and denoised content features. The reference content features are obtained by feature extraction from the training EEG signal using a feature encoder, and the denoised content features are obtained by feature extraction from the second training intermediate state signal using a feature encoder. Style matching loss is determined based on the first power spectral density corresponding to the clean EEG signal and the second power spectral density corresponding to the second training intermediate state signal. The model parameters of the initial conditional diffusion model are adjusted based on the main diffusion loss, content consistency loss, and style matching loss to obtain the trained conditional diffusion model.

[0100] Multiple pre-defined clean EEG signals are used to train the conditional diffusion model. The trained conditional diffusion model is then used as the initial conditional diffusion model for the next round of training until a predetermined number of training rounds are reached or the joint loss determined based on the diffusion principal loss, content consistency loss, and style matching loss falls within a predetermined loss threshold.

[0101] After inputting the training EEG signal of the training object in the predetermined state, the task spectral features corresponding to the training object in the predetermined state, the training time step, and the first training intermediate state signal into the initial conditional diffusion model corresponding to the conditional diffusion model, the conditional mapping module to be trained in the initial conditional diffusion model maps the task spectral features and the training time step corresponding to the training object in the predetermined state, and concatenates the training mapping results to obtain the training condition vector; the encoding module to be trained in the initial conditional diffusion model encodes the first training intermediate state signal and the training EEG signal of the training object in the predetermined state to obtain the training diffusion state features and the training reference features. In the initial conditional diffusion model, the attention fusion module to be trained performs multi-head attention calculation on the training diffusion state features and training reference features to obtain the first training fusion feature, and then fuses the first training fusion feature, the training diffusion state features, and the training reference features to obtain the second training fusion feature. In the initial conditional diffusion model, the conditional modulation module to be trained performs multi-layer perceptual mapping on the training condition vector to obtain the training modulation parameters, and uses the training modulation parameters to linearly modulate the second training fusion feature to obtain the training modulation feature. In the initial conditional diffusion model, the conditional diffusion module to be trained performs a denoising operation on the training modulation feature to obtain the training prediction noise, and obtains the second training intermediate state signal based on the training prediction noise and the first training intermediate state signal.

[0102] For example, at the t-th training time step, the initial conditional diffusion model can iteratively add the second-highest Gaussian noise of the t-th training time step to the clean EEG signal corresponding to the training object in the predetermined state, obtaining the first intermediate training state signal, thus realizing the forward diffusion operation on the clean EEG signal corresponding to the training object in the predetermined state. The way the initial conditional diffusion model performs the forward diffusion operation on the clean EEG signal corresponding to the training object in the predetermined state can be the same as the way DDPM performs the forward diffusion operation on the clean EEG signal, and is not limited here.

[0103] The diffusion principal loss is the basic noise prediction loss, used to constrain the conditional diffusion module to be trained to accurately predict the Gaussian noise added during forward diffusion. The diffusion principal loss enables the conditional diffusion model to complete the basic backward diffusion denoising process, but it mainly focuses on the noise prediction error and cannot fully constrain whether the denoising result retains the effective temporal structure and task-related spectral features of the original EEG signal.

[0104] Therefore, in addition to the diffusion principal loss, this application further introduces content consistency loss and style matching loss to form a multi-constraint joint optimization objective. The content consistency loss and style matching loss do not directly use visual semantic features and texture features from image tasks, but are redefined based on the one-dimensional temporal and spectral characteristics of EEG signals.

[0105] For example, a feature encoder can be used to extract features from training EEG signals to obtain reference content features. The feature encoder can then be used to extract features from the second training intermediate state signal to obtain denoised content features. The difference between the two in the feature space can be calculated to obtain the content consistency loss.

[0106] Since the training EEG signal is an EEG signal containing artifacts and the second training intermediate state signal is a denoised output signal, this application can use a feature encoder to extract features from the EEG signal containing artifacts and the denoised output signal respectively, and obtain reference content features and denoised content features.

[0107] Since the noisy training EEG signal includes the waveform morphology, phase changes, and local rhythmic structure of the real EEG, this content consistency loss can prevent the conditional diffusion model from over-smoothing or altering the effective EEG components when removing EMG artifacts. Furthermore, the content consistency loss can constrain the denoised output to retain the sample-level temporal structure of the original noisy training EEG signal.

[0108] The style matching loss is determined based on a first power spectral density and a second power spectral density, where the first power spectral density corresponds to the clean EEG signal and the second power spectral density corresponds to the denoised output signal. Thus, the style matching loss can constrain the denoised output to approximate the clean EEG signal in terms of spectral distribution.

[0109] For example, the joint loss determined based on diffusion principal loss, content consistency loss, and style matching loss. As shown in formula (1).

[0110] (1);

[0111] in, To spread the main loss, For loss of content consistency, For style matching loss, and These are the weighting coefficients for content consistency loss and style matching loss, used to balance the relationship between noise prediction, temporal structure preservation, and spectral distribution alignment.

[0112] and It can be a fixed value, or it can be updated by performing multi-layer perceptual mapping and linear mapping on the training condition vector.

[0113] For example, the diffusion master loss can be calculated according to formula (2). .

[0114] (2);

[0115] in, Indicates a clean EEG signal. Indicates the first The first intermediate state signal of training at each training time step. The training EEG signals of the training subject in a predetermined state. Represents the spectral characteristics of the task. This represents the Gaussian noise added during the forward diffusion process. This represents training prediction noise. The network structure representing the diffusion master loss.

[0116] We further introduce content consistency loss and style matching loss to constrain the denoising output, while preserving the temporal content of the original input and approximating the spectral distribution of clean EEG signals.

[0117] Content consistency loss is used to constrain the denoised output to retain sample-level valid temporal content in the original training EEG signal containing artifacts. Unlike directly comparing the denoised output and the training EEG signal containing artifacts in the original signal space, this application first trains a feature encoder through an EEG denoising task, then uses the trained feature encoder to extract content features, and calculates the content consistency loss in the feature space.

[0118] According to an embodiment of this application, determining the content consistency loss based on the reference content features and the denoised content features may include: obtaining a second difference feature based on the reference content features and the denoised content features; and obtaining the content consistency loss based on the sum of squares of a plurality of second differences included in the second difference feature.

[0119] For example, the second difference feature can be obtained by subtracting the elements with the same index in the reference content feature from the denoised content feature.

[0120] For example, the content consistency loss can be calculated according to formula (3). .

[0121] (3);

[0122] in, Represents the feature encoder. This represents the intermediate state signal during the second training phase.

[0123] According to an embodiment of this application, the feature encoder is obtained through the following training operations: First, the training EEG signal of the training object in a predetermined state is input into a pre-trained network, wherein the pre-trained network includes a feature encoder to be trained and a decoder to be trained. Then, the feature encoder to be trained extracts features from the training EEG signal to obtain training reference content features, and the decoder to be trained recovers the training reference content features to obtain a reconstructed EEG signal. The deviation between the reconstructed EEG signal and the clean EEG signal is calculated, and the network parameters of the pre-trained network are updated according to the deviation to obtain a trained pre-trained network, and thus a trained feature encoder. Training of the feature encoder is stopped when the number of training iterations reaches a predetermined number or the deviation is within a predetermined deviation range. After pre-training is completed, the parameters of the feature encoder are fixed, and the feature encoder is no longer updated during the training of the conditional diffusion model.

[0124] By training the feature encoder using the training EEG signals of the training object in a predetermined state, the feature encoder learns to extract content features related to the reconstruction of the clean EEG signal from the training EEG signal containing artifacts. In order to use the feature encoder as a content feature extractor in the future, the feature encoder can perform feature mapping between the original training EEG signal containing artifacts and the diffusion denoising output (i.e., the second training intermediate state signal), construct a content consistency loss based on the feature differences between the two, and use the content consistency loss to constrain the training of the diffusion model.

[0125] For example, the feature encoder can be a one-dimensional residual convolutional encoder (1D-ResCNN). A one-dimensional residual convolutional encoder can include five residual blocks. These five residual blocks cause the number of channels of the input features to the one-dimensional residual convolutional encoder to change in the following order: 1→32→64→128→64→32. The first three residual blocks gradually increase the number of channels to enhance feature representation; subsequent residual blocks then reduce the number of channels back to a lower dimension to compress redundant information and retain the main structural features. This design allows the feature encoder to extract rich EEG temporal patterns without outputting excessively high-dimensional features.

[0126] The first power spectral density is obtained by processing the clean EEG signal using the power spectral density calculation function, and the second power spectral density is obtained by processing the second training intermediate state signal using the power spectral density calculation function.

[0127] Determining the style matching loss based on the first power spectral density corresponding to the clean EEG signal and the second power spectral density corresponding to the second training intermediate state signal may include: obtaining a first difference feature based on the first power spectral density and the second power spectral density; and obtaining the style matching loss based on the sum of squares of multiple first differences included in the first difference feature.

[0128] For example, the first difference feature can be obtained by subtracting the elements with the same index in the first power spectral density from the elements with the same index in the second power spectral density.

[0129] For example, the style matching loss can be calculated according to formula (4). .

[0130] (4);

[0131] in, This represents the function for calculating power spectral density.

[0132] According to embodiments of this application, by introducing task spectral features to guide backdiffusion, the conditional diffusion model adaptively generates target EEG signals that conform to task statistical characteristics under different task states. Simultaneously, the noisy EEG signal serves as a reference constraint sample-level output, ensuring a one-to-one correspondence between the output and input. This effectively suppresses EMG artifacts, motion artifacts, and electrode perturbation noise, while preserving task-state-related EEG features, thus solving the problem of easily weakening task-related neural oscillations.

[0133] Embodiments of this application also provide a noise reduction device for electroencephalogram (EEG) signals, used to repeatedly perform the following operations until the 0th intermediate state signal is obtained, and the 0th intermediate state signal is used as the target EEG signal: A conditional mapping module maps and concatenates the task spectral features corresponding to the target object in a predetermined state and the t-th diffusion time step to obtain a conditional vector, wherein the task spectral features are obtained based on the power spectral density of multiple predetermined clean EEG signals corresponding to the predetermined state, t∈{T, TL, ..., L}, where T is an integer greater than 1, and L is an integer greater than or equal to 1 and less than T; an encoding module is used to process the t-th intermediate state signal and the EEG signal of the target object in the predetermined state... The electrical signals are encoded to obtain diffusion state features and reference features, where the T-th intermediate state signal is a random noise signal. The attention fusion module performs multi-head attention calculation on the diffusion state features and reference features to obtain the first fused feature. The first fused feature, diffusion state features, and reference features are then fused to obtain the second fused feature. The conditional modulation module performs multi-layer sensing mapping on the conditional vector to obtain modulation parameters. The second fused feature is then linearly modulated using the modulation parameters to obtain the modulation feature. The conditional diffusion module performs denoising on the modulation feature to obtain the t-th predicted noise. Based on the t-th predicted noise and the t-th intermediate state signal, the tL-th intermediate state signal is obtained.

[0134] It should be noted that the noise reduction device part for EEG signals in the embodiments of this application corresponds to the noise reduction method part for EEG signals in the embodiments of this application. For a detailed description of the noise reduction device part for EEG signals, please refer to the noise reduction method part for EEG signals, which will not be repeated here.

[0135] The following will describe the practicality and adaptability of the noise reduction method for EEG signals provided in the embodiments of this application based on experimental results.

[0136] To verify the effectiveness of the noise reduction method for EEG signals provided in the application in removing EMG artifacts under different EEG task conditions, the experiment used motor imagery EEG data and sleep EEG data to construct semi-simulated noisy EEG data for verification.

[0137] The motor imagery EEG data were obtained from the EEGdenoiseNet dataset. After preprocessing, a total of 4514 clean EEG segments and 5598 EMG segments were obtained. Both EEG and EMG segments were uniformly resampled to 256 Hz, and each EEG sample was 2 seconds long.

[0138] Sleep EEG data were obtained from the ISRUC-Sleep dataset, selecting data from 10 healthy subjects. After processing including 1–80 Hz filtering, artifact removal, segmentation, and resampling, clean EEG segments with the same number of EEG data as those for motor imagery were randomly selected to avoid the impact of data imbalance between different tasks on model training.

[0139] Semi-simulated noisy EEG (i.e., training EEG signal of the training object in a predetermined state) is obtained by linearly superimposing a pure EEG signal with a randomly selected electromyographic signal, as shown in formula (5).

[0140] (5);

[0141] in, This is an electromyographic signal. This is a coefficient used to control the intensity of artifacts. The signal-to-noise ratio (SNR) of the input training EEG signals was randomly set within the range of -5 dB to 5 dB to cover different levels of electromyographic contamination.

[0142] Two semi-simulated noisy EEG datasets were divided into training, validation, and test sets at 80%, 10%, and 10% respectively. During training, data of different task types were input simultaneously, enabling the model to learn the signal distributions corresponding to different EEG tasks. Performance was evaluated on motor imagery EEG and sleep EEG during testing.

[0143] The settings for training the conditional diffusion model were as follows: the number of time steps in the diffusion process was set to 1000, and a cosine noise scheduling strategy was adopted. The TimeMixer (i.e., the conditional diffusion module) backbone network consisted of a 3-layer temporal modeling structure and a 4-layer multi-scale downsampling structure, with a downsampling ratio of 2 for each layer and an input feature dimension of 128. The joint loss used consisted of the diffusion principal loss, content consistency loss, and style matching loss. The diffusion principal loss served as the primary optimization objective, while the other two losses were used to constrain the EEG temporal content and spectral structure. The training batch size was set to 256, the Adam (adaptive moment estimation) optimizer was used, and an early stopping strategy was implemented using the validation set. Training was stopped when the model did not achieve further improvement after 80 consecutive training epochs, and the parameters of the model with the best validation performance were retained.

[0144] To verify the denoising performance of the EEG signal denoising method (hereinafter referred to as TaskEEGDiT) provided in this application, TaskEEGDiT is compared with other EEG denoising methods such as SimpleCNN (simple convolutional neural network), 1DResCNN (one-dimensional residual convolutional neural network), EEGDfus (fine-grained EEG denoising conditional diffusion model), EEGIFNet (two-branch interactive fusion neural network), GCTNet (generative adversarial network-guided parallel convolutional neural network), DTPNet (dense connection temporal pyramid network), and DSATCN (dual-stream attention temporal convolutional network). Furthermore, a task-conditional version of DSATCN (hereinafter referred to as DSATCN (task condition)) is constructed based on the DSATCN method to incorporate task condition information, and this is used to verify the performance of the TaskEEGDiT method relative to other task-aware denoising networks.

[0145] All methods were trained and tested using the same data partitioning, input length, preprocessing method, signal-to-noise ratio range, and evaluation metrics. Evaluation metrics included correlation coefficient (CC), output signal-to-noise ratio (SNR), relative root mean square error (RRMSEs) in the spectral domain, and relative root mean square error (RRMSEt) in the temporal domain. The output signal-to-noise ratio (SNR) was obtained by averaging the SNR of the denoised EEG outputs corresponding to multiple data points in the test set. Experimental results are shown in Table 1.

[0146] Table 1 Experimental Results

[0147]

[0148] As shown in Table 1, the noise reduction method for EEG signals provided in this application achieves a signal-to-noise ratio (SNR) of 13.841 dB on motor imagery EEG data, an improvement of approximately 2.18 dB compared to 11.664 dB on task-conditional DSATCN. On sleep EEG data, the SNR of the noise reduction method provided in this application reaches 15.781 dB, an improvement of approximately 2.43 dB compared to 13.348 dB on task-conditional DSATCN. Furthermore, the noise reduction method provided in this application exhibits higher control coefficients (CC) and lower relative ground truth (RRMSEs) and relative ground truth (RRMSEt) on both datasets, indicating that it can better restore the temporal waveform and spectral structure of EEG signals while suppressing EMG artifacts.

[0149] To evaluate the adaptability of the noise reduction method for EEG signals provided in this application to different intensities of electromyographic contamination, tests were conducted under multiple fixed conditions with an input SNR of -5 dB to 5 dB, i.e., the input SNR range of the test data was -5 dB to 5 dB. The test results are as follows: Figure 5A and Figure 5B As shown.

[0150] Figure 5A The performance test results corresponding to the sleep EEG dataset according to an embodiment of this application are shown. Figure 5B The performance test results corresponding to the motor imagery EEG dataset according to an embodiment of this application are shown.

[0151] like Figure 5A and Figure 5B As shown, under most noisy EEG input signal-to-noise ratio (SNR) conditions in the two EEG datasets, the denoising method for EEG signals provided in this application can achieve high CC (correlation coefficient) and high SNR of denoised EEG output, especially when the noisy EEG input SNR is low and EMG artifacts are strong. As the input EEG becomes cleaner, the performance differences between methods decrease, but the denoising method for EEG signals provided in this application still maintains stable denoising performance, indicating that the denoising method for EEG signals provided in this application can adapt to different degrees of EMG contamination. The SNR of denoised EEG output is obtained by averaging the SNR of denoised EEG output corresponding to multiple test data under fixed conditions.

[0152] To verify the role of task spectral features, while keeping the trained model parameters unchanged, only the task conditions used during the inference phase were changed, setting four scenarios: correct task spectral features, noisy task spectral features, swapped incorrect task spectral features, and no task spectral features. Experimental results are as follows: Figures 6A-6D As shown.

[0153] Figure 6A The correlation coefficient results corresponding to sleep EEG data according to embodiments of this application are shown. Figure 6B The output signal-to-noise ratio results corresponding to sleep EEG data according to an embodiment of this application are shown. Figure 6C The correlation coefficient results corresponding to motor imagery EEG data according to embodiments of this application are shown. Figure 6D The output signal-to-noise ratio results corresponding to motor imagery EEG data are shown according to an embodiment of this application.

[0154] like Figure 6A and Figure 6B As shown, on sleep EEG data, when using the correct task spectral features, the CC reaches 0.979 and the SNR reaches 15.78 dB. When using the swapped incorrect task spectral features, the CC drops to 0.955 and the SNR drops to 10.94 dB.

[0155] like Figure 6C and Figure 6D As shown, on motor imagery EEG data, when using the correct task spectral features, the CC is approximately 0.966 and the SNR is approximately 13.84 dB. When using the swapped incorrect task spectral features or not using task spectral features, the SNR decreases to 9.26 dB and 9.60 dB, respectively. The experimental results indicate that task spectral features can provide effective task feature guidance for the noise reduction process, while the noisy input EEG itself can provide sample-level information. Therefore, even if the task conditions are perturbed, the model still has a certain noise reduction capability.

[0156] Figure 7 A block diagram of an electronic device suitable for implementing a noise reduction method for electroencephalogram (EEG) signals, according to an embodiment of this application, is shown. Figure 7 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0157] like Figure 7 As shown, an electronic device 700 according to an embodiment of this application includes a processor 701, which can perform various appropriate actions and processes according to a program stored in ROM 702 or a program loaded from storage portion 708 into RAM 703. The processor 701 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this application.

[0158] RAM 703 stores various programs and data required for the operation of electronic device 700. Processor 701, ROM 702, and RAM 703 are interconnected via bus 704. Processor 701 executes various operations of the method flow according to embodiments of this application by executing programs in ROM 702 and / or RAM 703. It should be noted that the programs may also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 may also execute various operations of the method flow according to embodiments of this application by executing programs stored in said one or more memories.

[0159] According to embodiments of this application, the electronic device 700 may further include an input / output (I / O) interface 705, which is also connected to a bus 704. The electronic device 700 may also include one or more of the following components connected to the input / output (I / O) interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input / output (I / O) interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.

[0160] According to embodiments of this application, the method flow according to embodiments of this application can be implemented as a computer software program. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable storage medium, the computer program containing program code for performing the method shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by processor 701, it performs the functions defined in the system of embodiments of this application. According to embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0161] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.

[0162] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium. Examples include, but are not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0163] For example, according to embodiments of this application, a computer-readable storage medium may include the ROM 702 and / or RAM 703 described above and / or one or more memories other than ROM 702 and RAM 703.

[0164] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods provided in the embodiments of this application. When the computer program product is run on an electronic device, the program code is used to enable the electronic device to implement the methods provided in the embodiments of this application.

[0165] When the computer program is executed by the processor 701, it performs the functions defined in the system / apparatus of this application embodiment. According to the embodiments of this application, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0166] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 709, and / or installed from a removable medium 711. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0167] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0168] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two blocks shown consecutively may actually be processed substantially in parallel, depending on the relevant functions, and sometimes may be executed in reverse order. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions. Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.

[0169] The embodiments of this application have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of this application. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this application is defined by the appended embodiments and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this application, and all such substitutions and modifications should fall within the scope of this application.

Claims

1. A method for noise reduction of electroencephalogram (EEG) signals, characterized in that, include: Repeat the following steps until the 0th intermediate state signal is obtained, and use the 0th intermediate state signal as the target EEG signal: The conditional mapping module is used to map the task spectral features corresponding to the target object in the predetermined state and the t-th diffusion time step, and the mapping results are concatenated to obtain the conditional vector. The task spectral features are obtained based on the power spectral density of multiple predetermined clean EEG signals corresponding to the predetermined state, where t∈{T, TL, ..., L}, T is an integer greater than 1, and L is an integer greater than or equal to 1 and less than T. The encoding module is used to encode the t-th intermediate state signal and the EEG signal of the target object in the predetermined state to obtain the diffusion state features and reference features, wherein the t-th intermediate state signal is a random noise signal; The attention fusion module is used to perform multi-head attention calculation on the diffusion state features and reference features to obtain the first fused feature. The first fused feature, the diffusion state features and the reference features are then fused to obtain the second fused feature. The conditional vector is mapped to the conditional vector using a conditional modulation module to obtain modulation parameters. The second fused feature is then linearly modulated using the modulation parameters to obtain the modulation feature. The conditional diffusion module is used to perform denoising on the modulation features to obtain the t-th predicted noise, and the tL-th intermediate state signal is obtained based on the t-th predicted noise and the t-th intermediate state signal.

2. The method according to claim 1, characterized in that, The attention fusion module includes: a preprocessing submodule, an attention fusion submodule, a convolutional feedforward thinning submodule, and a modulation fusion submodule. The attention fusion module performs multi-head attention calculation on the diffusion state features and reference features to obtain a first fused feature. The first fused feature, the diffusion state features, and the reference features are then fused to obtain a second fused feature, which includes: The preprocessing submodule is used to add the diffusion state features and reference features point by point to obtain the summed features. The summed features are then subjected to the first convolution and the first normalization to obtain the spatial fusion features. The attention fusion submodule is used to perform multi-head attention computation on the spatial fusion features to obtain attention fusion features, and residual connection is performed on the attention fusion features and the spatial fusion features to obtain residual fusion features; The convolutional feedforward thinning submodule is used to perform a second convolution and a second normalization on the residual fusion features to obtain the thinned features. The first modulation refinement feature is obtained by performing a third convolution and a third normalization on the refinement feature using the modulation fusion submodule. The second modulation refinement feature is obtained by performing a fourth convolution and a fourth normalization on the refinement feature. The product between the first modulation refinement feature and the diffusion state feature and the product between the second modulation refinement feature and the reference feature are fused to obtain the second fused feature.

3. The method according to claim 1 or 2, characterized in that, The conditional diffusion model includes a conditional mapping module, an encoding module, an attention fusion module, a conditional modulation module, and a conditional diffusion module; The conditional diffusion model is obtained through the following training operations: The training EEG signal of the training object in the predetermined state, the task spectral features corresponding to the training object in the predetermined state, the training time step, and the first training intermediate state signal are all input into the initial conditional diffusion model corresponding to the conditional diffusion model to obtain training prediction noise and a second training intermediate state signal based on the training prediction noise and the first training intermediate state signal. The first training intermediate state signal is obtained by iteratively adding the training time step second Gaussian noise to the clean EEG signal corresponding to the training object in the predetermined state by the initial conditional diffusion model. The clean EEG signal is any one of a plurality of predetermined clean EEG signals. The diffusion principal loss is determined based on the Gaussian noise added to the clean EEG signal at the training time step according to the training prediction noise and the initial condition diffusion model. Based on the reference content features and the denoised content features, the content consistency loss is determined. The reference content features are obtained by extracting features from the training EEG signals using a feature encoder, and the denoised content features are obtained by extracting features from the second training intermediate state signals using a feature encoder. The style matching loss is determined based on the first power spectral density corresponding to the clean EEG signal and the second power spectral density corresponding to the second training intermediate state signal. Based on the diffusion master loss, content consistency loss, and style matching loss, the model parameters of the initial conditional diffusion model are adjusted to obtain the trained conditional diffusion model.

4. The method according to claim 3, characterized in that, The first power spectral density is obtained by processing a clean EEG signal using a power spectral density calculation function, and the second power spectral density is obtained by processing a second training intermediate state signal using a power spectral density calculation function. The determination of style matching loss based on the first power spectral density corresponding to the clean EEG signal and the second power spectral density corresponding to the second training intermediate state signal includes: The first difference feature is obtained based on the first power spectral density and the second power spectral density; The style matching loss is obtained by summing the squares of multiple first differences included in the first difference feature.

5. The method according to claim 3, characterized in that, The determination of content consistency loss based on reference content features and denoised content features includes: The second difference feature is obtained based on the reference content features and the denoised content features; The content consistency loss is obtained by summing the squares of multiple second differences included in the second difference feature.

6. The method according to claim 1 or 2, characterized in that, The encoding module includes a first convolutional submodule and a second convolutional submodule. The encoding module is used to encode the t-th intermediate state signal and the EEG signal of the target object in a predetermined state, respectively, to obtain diffusion state features and reference features, including: The diffusion state features are obtained by performing multiple convolution operations on the t-th intermediate state signal using the first convolution submodule. The reference features are obtained by performing multiple convolution operations on the EEG signal using the second convolution submodule, wherein the network structures of the first and second convolution submodules are the same but the network parameters corresponding to the first and second convolution submodules are different.

7. The method according to claim 1 or 2, characterized in that, The condition mapping module includes a first multilayer perceptron submodule, a cosine scheduling submodule, a splicing submodule, and a second multilayer perceptron submodule. The condition mapping module maps the task spectral features corresponding to the target object in a predetermined state to the t-th diffusion time step, and splices the mapping results to obtain a condition vector including: The task condition features are obtained by performing multi-layer perceptual mapping on the task spectral features using the first multi-layer perceptual machine submodule. The temporal condition features are obtained by mapping the t-th diffusion time step using the predetermined cosine scheduling formula in the cosine scheduling submodule. The task condition features and time condition features are vector-concatenated using the splicing submodule to obtain the initial condition vector. The initial condition vector is obtained by performing multi-layer sensing mapping on the second multi-layer sensing submodule.

8. The method according to claim 1 or 2, characterized in that, The conditional modulation module includes a third multilayer sensor submodule, a fourth multilayer sensor submodule, and a conditional modulation submodule, and the modulation parameters include scaling parameters and translation parameters; The conditional modulation module performs multi-layer perceptual mapping on the conditional vector to obtain modulation parameters. These modulation parameters are then used to linearly modulate the second fused feature, resulting in the following modulated features: The scaling parameters are obtained by performing multi-layer perceptual mapping on the condition vector using the third multi-layer perceptual machine submodule. The translation parameters are obtained by performing multi-layer sensing mapping on the condition vector using the fourth multi-layer sensing submodule. The network structures of the third and fourth multi-layer sensing submodules are the same, but the network parameters corresponding to the third and fourth multi-layer sensing submodules are different. The modulation feature is obtained by linearly mapping the second fused feature according to the scaling parameter and the translation parameter using the conditional modulation submodule.

9. An electronic device, comprising: One or more processors; Memory, used to store one or more programs. The characteristic is that, when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 8.