A detail enhancement electroencephalogram noise reduction method based on diffusion residual learning
By employing a two-stage EEG denoising method, which utilizes a reconstructed network to restore the main structure and combines it with a conditional diffusion residual network to restore details, the oversmoothing problem in deep learning EEG denoising is solved, achieving efficient fine-grained neural dynamic restoration.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- UNIV OF SCI & TECH OF CHINA
- Filing Date
- 2026-06-02
- Publication Date
- 2026-07-10
AI Technical Summary
Existing deep learning EEG denoising methods are prone to oversmoothing, failing to effectively recover high-frequency, low-amplitude fine-grained neural dynamics, and the computational cost of directly generating complete signals using diffusion models is high.
A two-stage approach is adopted. First, the main structure is restored through a reconstructed EEG noise reduction network. Then, the residual details are restored using a conditional diffusion residual network. By combining one-dimensional convolution, state space model and FiLM modulation, detail enhancement and noise reduction are achieved.
While maintaining overall waveform fidelity, it restores fine-grained neural dynamics at high frequencies and low amplitudes, making it suitable for removing various types of EEG artifacts, reducing computational burden, and improving signal quality.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention relates to the fields of biomedical signal processing and deep learning, and in particular to a method for enhancing the detail of EEG signals by combining two-stage reconstruction-based denoising with conditional diffusion residual learning. Background Technology
[0002] Electroencephalography (EEG) can record brain neural activity in a non-invasive manner. It has advantages such as high temporal resolution and relatively low equipment cost, and has been widely used in brain-computer interfaces, disease-aided diagnosis, sleep monitoring, emotion recognition, and neuroscience research.
[0003] However, EEG signals have low amplitude and high non-stationarity, making them highly susceptible to artifacts such as eye movements, muscle activity, electrocardiographic coupling, head movements, and electrode cable disturbances. Artifacts alter EEG waveforms, spectral energy distribution, and transient details, thus affecting subsequent classification, recognition, diagnosis, and interpretation. Therefore, robust and reliable EEG artifact removal methods are crucial components of intelligent EEG analysis systems.
[0004] Traditional EEG noise reduction methods include filtering, regression, independent component analysis, canonical correlation analysis, and empirical mode decomposition. These methods typically rely on prior assumptions such as artifact frequency bands, amplitude ranges, or multi-channel observation conditions, limiting their applicability in single-channel or low-channel portable EEG scenarios. In recent years, deep learning methods have been able to directly learn the nonlinear mapping from noisy EEG to clean EEG, significantly improving EEG artifact removal performance.
[0005] However, existing end-to-end deep denoising networks typically need to simultaneously achieve both overall structural restoration and local detail restoration. When the model excessively pursues global reconstruction metrics such as mean squared error, it is prone to oversmoothing, which weakens high-frequency components, transient spikes, local oscillations, and low-amplitude details while suppressing artifacts. For EEG signals, these fine-grained changes may have important physiological implications and downstream interpretive value.
[0006] While diffusion models possess the ability to progressively denoise and generate details, directly applying them to generate complete, clean EEG signals incurs significant computational overhead and easily introduces redundant components inconsistent with the original EEG structure. How to restore the fine-grained residual details suppressed by conventional deep networks while maintaining overall waveform fidelity remains a technical challenge for current EEG denoising techniques. Summary of the Invention
[0007] The purpose of this invention is to overcome the problems of oversmoothing, insufficient detail recovery, and high computational cost of directly generating complete signals using diffusion models in existing deep learning EEG denoising methods. This invention proposes a detail-enhanced EEG denoising method based on diffusion residual learning, which aims to transform the problem of full signal generation into a problem of residual detail recovery. This method can alleviate the oversmoothing phenomenon in deep learning EEG denoising and restore the fine-grained neural dynamics of high frequency and low amplitude while maintaining the overall waveform fidelity. It is applicable to various EEG artifact removal scenarios, including electrooculography, electromyography, electrocardiography, and motion artifacts.
[0008] To achieve the above objectives, the present invention adopts the following technical solution: The present invention provides a detail-enhanced EEG noise reduction method based on diffusion residual learning, characterized by the following steps: Step 1, obtain the first Noisy single-channel EEG signal sequence and its corresponding clean single-channel EEG signal sequence ,in, Indicates the first Noisy single-channel EEG signal at sampling time The value of , Indicates the first A clean single-channel EEG signal at the sampling time The value of , and , This represents the total number of sampling points for a segment of signal; Step 2: Constructing the first-stage reconstructed EEG noise reduction network and the noisy single-channel EEG signal sequence Input the reconstructed EEG noise reduction network The signal is processed in the first stage to obtain the initial denoised single-channel EEG signal using equation (2). : (2) In equation (2), This represents the parameters of the reconstructed EEG noise reduction network in the first stage. Step 3: Calculate the clean single-channel EEG signal sequence using equation (3). With the initial denoised single-channel EEG signal Residual details between : (3) Step 4: Construct the second-stage conditional diffusion residual detail recovery network. and represented in terms of the residual details. As the target of diffusion modeling, the noisy single-channel EEG signal sequence and the initial denoised single-channel EEG signal Conditional information As constraint information, the conditional diffusion residual detail recovery network in the second stage... The training process yields the second-stage conditional diffusion residual detail recovery model. Step 5: Use the trained second-stage conditional diffusion residual detail recovery model to perform inverse denoising sampling on the Gaussian noise, and obtain the... Segment prediction residual details ; Step 6: Use equation (13) to obtain the first... Final denoised single-channel EEG signal : (13) Step 7, based on and A loss function is constructed to update the network parameters, thereby obtaining the optimal EEG denoising model after training, which is used to achieve detailed enhancement and denoising of input noisy single-channel EEG signals.
[0009] The detail-enhanced EEG noise reduction method based on diffusion residual learning described in this invention is also characterized in that step 4 includes: Step 4.1: Use equation (5) to represent the residual details. Perform forward diffusion noise addition to obtain the first... Noisy residual variable under each diffusion step : (5) In equation (5), This represents noise that follows a standard Gaussian distribution. Indicates the preceding Cumulative noise scheduling parameters under each diffusion step Indicates the first Noise scheduling parameters under each diffusion step; Step 4.2: Add the noise-added residual variable diffusion steps and condition information Input the conditional diffusion residual detail recovery network of the second stage In the middle, and using equation (6) to obtain the first Predicted noise at each diffusion step : (6) In equation (6), This represents the conditional diffusion residual detail recovery network. The noise prediction function in These represent the parameters of the conditional diffusion residual detail recovery network in the second stage; Step 4.3: Construct the predicted loss for diffused noise using equation (7). : (7) In equation (7), Represents the L2 norm; Indicates the number of diffusion steps Residual details representation and Gaussian noise Calculate the mathematical expectation of the random sampling results; Step 4.4: Use equation (8) to analyze the noisy residual variable. Perform reverse denoising sampling to obtain the first Residual state under each diffusion step : (8) In equation (8), Indicates the first The intensity of random perturbation during the backsampling process in each diffusion step. Indicates Gaussian noise; Step 4.5: Repeat the reverse denoising sampling process in step 4.4 until... Thus, the predicted residual details are obtained. .
[0010] Furthermore, the second-stage conditional diffusion residual detail recovery network It includes: a signal branch, a conditional branch, and a feature-level linear modulation module (FiLM); wherein, the signal branch is used for... Feature extraction is performed to obtain the first... Signal branching characteristics at each diffusion step The conditional branch is used for... Feature extraction is performed to obtain conditional branch features. And using equation (11) to obtain the first Fusion features modulated after each diffusion step : (11) In equation (11), and These represent the scaling parameter and the offset parameter, respectively. This indicates element-wise multiplication.
[0011] Furthermore, at least one of the signal branch and the conditional branch is equipped with a Mamba-based state-space model encoder, and the received input feature sequence is processed using equations (9) and (10). Perform state updates to obtain the output feature sequence. : (9) (10) In equations (9) and (10), Indicates the first Input features at each sampling location, Indicates the first The hidden state at each sampling location Indicates the first The hidden state at each sampling location Indicates the first Output features at each sampling location , and They represent the first State transition parameters, input mapping parameters, and output mapping parameters for each sampling location; The Mamba-based state-space model encoder projects the input feature sequence into an output and combines residual connections and layer normalization: When applied to a signal branch, it yields long-range dependent signal branch characteristics. ; When applied to conditional branches, it yields the long-range dependency conditional branch feature. .
[0012] The present invention provides an electronic device, including a memory and a processor, characterized in that the memory is used to store a program supporting the processor to execute the detail-enhanced EEG noise reduction method based on diffusion residual learning, and the processor is configured to execute the program stored in the memory.
[0013] The present invention discloses a computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, performs the steps of the detail-enhanced EEG noise reduction method based on diffusion residual learning.
[0014] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention breaks down the complete EEG noise reduction task into a first-stage main structure recovery and a second-stage residual detail recovery, avoiding the conflict between a single network simultaneously undertaking the goals of global fidelity and local detail recovery, and thus mitigating the oversmoothing phenomenon in deep learning EEG noise reduction from a mechanistic perspective.
[0015] 2. The diffusion model in this invention does not directly generate complete and clean EEG signals, but recovers detailed components in the residual space, thereby reducing the diffusion generation burden, reducing the risk of introducing physiologically unreasonable components, and improving reasoning efficiency.
[0016] 3. This invention utilizes conditional information such as noisy input, first-stage estimation, and noise intensity to constrain the back diffusion process, ensuring that the generated residual details remain consistent with the original EEG structure. This is beneficial for simultaneously obtaining high waveform correlation and detail fidelity.
[0017] 4. This invention combines one-dimensional convolutional local information extraction, long-range dependency modeling of state space model and FiLM conditional modulation in conditional diffusion residual network, which can simultaneously capture short-time waveform edges, transient peaks, local oscillations and dependencies across time positions, and is applicable to various EEG artifact types. Attached Figure Description
[0018] Figure 1 This is a flowchart of the EEG noise reduction method based on diffusion residual learning of the present invention; Figure 2 This is a schematic diagram of the forward diffusion and backward recovery process in the residual space of the present invention; Figure 3 This is a schematic diagram of the bi-branch structure of the conditional diffusion residual network of the present invention. Detailed Implementation
[0019] In this embodiment, a detail-enhanced EEG denoising method based on diffusion residual learning is used to remove electrooculography (EOG), electromyography (EMG), electrocardiography (ECG), and motion artifacts from single-channel EEG signals. The core idea of this method is: first, a first-stage reconstructive denoising network is used to recover the dominant structures in the noisy EEG signal; then, a second-stage conditional diffusion residual network is used to specifically generate residual details missed in the first stage; finally, the denoising result with enhanced details is obtained by summing the residuals. The overall process is as follows: Figure 1 As shown. The method includes the following: Step 1: Training Data Construction: Obtain a collection of clean EEG fragments and artifact noise fragment set In one specific implementation, the EEG, EOS, and EMG segments are derived from publicly available EEG noise-reduced datasets, the ECG segments are derived from arrhythmia ECG datasets, and motion artifacts are derived from electrode movement or cable disturbance data. All signals are uniformly resampled to the same sampling rate and divided into single-channel segments of the same length.
[0020] For each clean EEG signal Select a noise signal from the set of noise segments. Based on the preset signal-to-noise ratio The mixing intensity coefficient is calculated using equation (1). And generate a noisy single-channel EEG signal sequence. Preferably, Random sampling can be performed in the range of -5 dB to 5 dB to enhance the model's adaptability to different noise intensities.
[0021] (1) Training, validation, and testing data can be divided in an 8:1:1 ratio, or cross-validation or cross-test validation can be used depending on the actual scenario.
[0022] Step 2: First-stage reconstructed EEG noise reduction network: like Figure 2 As shown, the first stage of constructing a reconstructed EEG noise reduction network is performed. And the noisy single-channel EEG signal sequence Input Reconstruction EEG Noise Reduction Network The signal is processed in the first stage to obtain the initial denoised single-channel EEG signal using equation (2). : (2) In equation (2), This represents the parameters of the reconstructed EEG noise reduction network in the first stage. The goal of this stage is to restore the dominant structure of the EEG signal as stably as possible, including the overall waveform trend, main frequency band response, and amplitude range.
[0023] In a preferred embodiment, the first-stage reconstructive EEG denoising network consists of multiple one-dimensional temporal convolutional blocks, each including two consecutive one-dimensional convolutional layers with a kernel size preferably of 3. Batch normalization layers and ReLU activation layers are placed after the convolutional layers to stabilize the training process and enhance nonlinear expressive power. To reduce the risk of overfitting, a dropout layer is placed after the convolutional blocks. A fully connected layer or a one-dimensional convolutional mapping layer is placed at the end of the network to ensure that the output length matches the length of the input EEG segment.
[0024] The first-stage reconstructed EEG noise reduction network can be trained using the mean squared error loss function shown in equation (3): (3) After training is completed, the parameters of the first-stage reconstructive EEG noise reduction network are fixed during the second-stage training process, so that the second-stage conditional diffusion residual detail recovery network focuses only on learning the residual detail distribution.
[0025] Step 3: Residual detail representation construction: Traditional end-to-end noise reduction networks tend to weaken local high-frequency details while suppressing artifacts. Therefore, this embodiment does not require the diffusion model to generate a complete and clean EEG signal, but instead uses Equation (4) to calculate a clean single-channel EEG signal sequence. Compared with the initial denoised single-channel EEG signal The difference between them is recorded as the residual detail representation. : (4) Residual detail representation This typically includes low-amplitude transient changes, waveform spikes and edges, local oscillation details, and high-frequency components that are difficult to recover from the first-stage reconstructed EEG denoising network. Since the dominant structure has already been recovered by the first-stage reconstructed EEG denoising network, the second stage only needs to generate details with a smaller amplitude in the residual space, thus reducing the generation difficulty and computational burden of the diffusion model.
[0026] Step 4: Conditional Diffusion Residual Detail Recovery Network: like Figure 3 As shown, a second-stage conditional diffusion residual detail recovery network is constructed. And expressed in residual details As a diffusion modeling target, noisy single-channel EEG signal sequences and initial denoised single-channel EEG signal Conditional information As constraint information, the conditional diffusion residual detail recovery network in the second stage... Conduct training.
[0027] During the forward diffusion process, residual details are represented using equation (5). Perform forward diffusion noise addition to obtain the first... Noisy residual variable under each diffusion step : (5) In equation (5), This represents noise that follows a standard Gaussian distribution. Indicates the preceding Cumulative noise scheduling parameters under each diffusion step Indicates the first Noise scheduling parameters under diffusion steps.
[0028] In the backdiffusion process, the conditional diffusion residual detail recovery network Based on the current noise-added residual variable diffusion steps and condition information Predict noise. This includes conditional information. Noisy single-channel EEG signal sequence And the initial denoised single-channel EEG signal in the first stage Composition, that is . No. Predicted noise at each diffusion step This can be obtained from equation (6): (6) In equation (6), Represents a conditional diffusion residual detail recovery network The noise prediction function in This represents the parameters of the conditional diffusion residual detail recovery network in the second stage.
[0029] The second-stage conditional diffusion residual detail recovery network can use the diffusion noise prediction loss shown in equation (7). Conduct training: (7) In equation (7), Represents the L2 norm; Indicates the number of diffusion steps Residual details representation and Gaussian noise Calculate the mathematical expectation of the joint random sampling results.
[0030] Using equation (8) to analyze the noisy residual variable Perform reverse denoising sampling to obtain the first... Residual state under diffusion steps : (8) In equation (8), Indicates the first The intensity of random perturbation during the backsampling process in each diffusion step. This represents Gaussian noise. In practice, deterministic or random sampling methods can be used. The preferred number of diffusion steps is 50, but it can also be set to 20 to 100 steps depending on speed and accuracy requirements. Repeat the reverse denoising sampling process shown in equation (7) until... This allows us to obtain the details of the predicted residuals. .
[0031] like Figure 3 As shown, the conditional diffusion residual detail recovery network It adopts a dual-branch structure, including a signal branch, a conditional branch, and a feature-level linear modulation module (FiLM).
[0032] Signal branch is used to process the noisy residual variable. Feature extraction is performed to obtain the first... Signal branching characteristics at each diffusion step Conditional branches are used to process conditional information. Feature extraction is performed to obtain conditional branch features. .
[0033] In a preferred embodiment, the signal branch and conditional branch first extract short-time features through a local information extraction unit. The local information extraction unit may consist of two one-dimensional convolutional layers with a kernel size of 3, used to capture transient peaks, waveform edges, and short-time oscillation patterns. Subsequently, the signal branch features are... and conditional branch features The signals are fed into a Mamba-based state-space model encoder to capture dependencies across a longer time span. When the Mamba-based state-space model encoder operates on the signal branches, long-range dependency signal branch features are obtained. When applied to conditional branches, it yields the long-range dependency conditional branch feature. .
[0034] The Mamba-based state-space model encoder receives input feature sequences. And use equations (9) and (10) to perform state updates and output mapping:
[0035]
[0036] In equations (9) and (10), Indicates the first Input features at each sampling location, Indicates the first The hidden state at each sampling location Indicates the first Output features at each sampling location , and They represent the first The state transition parameters, input mapping parameters, and output mapping parameters for each sampling location.
[0037] The Mamba-based state-space model encoder can further refine the output feature sequence. The output projection is performed, and combined with residual connections and layer normalization, to obtain the long-range dependency features of the corresponding branches.
[0038] To achieve conditional fusion, this embodiment sets up a feature-level linear modulation module FiLM between the signal branch and the conditional branch, and uses equation (11) to obtain the first... Fusion features modulated after each diffusion step : (11) In equation (11), and These respectively represent the branching features due to long-range dependencies. The generated scaling and offset parameters, This represents element-wise multiplication. This represents the fusion feature after conditional information modulation.
[0039] Through FiLM modulation, the model can dynamically adjust the residual recovery process based on noisy EEG structures, initial estimates, and noise intensity. Modulated fusion features It is then fed into the output layer to predict noise injected during the diffusion process or to recover residual details.
[0040] Step 5: Reasoning and Output: For the noisy single-channel EEG signal to be processed First, the first-stage reconstructed EEG noise reduction network, which has been trained, is input to obtain the initial estimate. Then, the conditional diffusion residual detail recovery network... Starting with Gaussian noise, based on conditional information Perform backdiffusion sampling to generate prediction residual details. Finally, by using the residual summation method of equation (12), the detailed-enhanced denoised EEG output is obtained. : (12) Among them, for training samples Finally, the denoised single-channel EEG signal As given by equation (13): (13) Since the second stage only recovers residual details, while the first stage has already provided a stable principal structure estimate, this inference process can compensate for details that are easily suppressed by the oversmoothing of deep networks without destroying the overall waveform.
[0041] In summary, the method of this invention decomposes the EEG noise reduction task into a main structure recovery stage and a residual detail recovery stage. The first-stage reconstructive EEG noise reduction network provides stable global structure estimation, while the second-stage conditional diffusion residual detail recovery network specifically recovers the fine-grained residual details missed in the first stage. This enables the suppression of artifacts in electrooculography, electromyography, electrocardiography, and motion, while reducing the oversmoothing phenomenon in traditional deep learning EEG noise reduction methods. It also improves the overall waveform fidelity and detail recovery capability of EEG signals, providing a more reliable EEG signal basis for subsequent brain-computer interfaces, sleep monitoring, disease-assisted diagnosis, and medical health analysis.
[0042] In this embodiment, an electronic device includes a memory and a processor. The memory stores a program that supports the processor in executing the above-described method, and the processor is configured to execute the program stored in the memory.
[0043] In this embodiment, a computer-readable storage medium stores a computer program, which is executed by a processor to perform the steps of the above method.
[0044] To verify the effectiveness of this invention, experiments can be conducted on electrooculography (EOG), electromyography (EMG), electrocardiography (ECG), and motion artifact removal tasks. Evaluation metrics include relative root mean square error (RRMSE), correlation coefficient (CC), and output signal-to-noise ratio (SNR). A smaller RRMSE indicates lower reconstruction error, a CC closer to 1 indicates higher consistency between the denoised signal and the clean label waveform, and a larger SNR indicates less artifact residue.
[0045] In practice, an existing deep denoising network can be used as the first-stage reconstructive denoising network, followed by the conditional diffusion residual network of this invention. By comparing the first-stage output and the final output, the contribution of the second stage to detail recovery and oversmoothing mitigation can be verified.
[0046] This invention can be deployed as a software toolkit, model training plugin, EEG analysis system module, or embedded processing program. For offline EEG analysis systems, this invention can serve as a preprocessing module to improve the reliability of subsequent feature extraction and classification; for portable EEG devices, this invention can adjust the number of backdiffusion steps according to computing power constraints to achieve a balance between inference speed and detail recovery.
[0047] Table 1
[0048] Table 2
[0049] Table 3
[0050] Table 4
[0051] Note: The methods mentioned in Tables 1-4 include traditional decomposition methods EMD-CCA and EMD-ICA, existing deep learning EEG denoising methods EEGDfus, FCNN, 1D-ResCNN, SimpleCNN, and DuoCL, and enhancement methods FCNN-DRL, 1D-ResCNN-DRL, SimpleCNN-DRL, and DuoCL-DRL that incorporate the diffusion residual learning strategy of this invention into the corresponding baseline networks. Methods with the suffix "DRL" indicate that the conditional diffusion residual detail recovery module proposed in this invention is embedded as a second-stage detail enhancement module after the corresponding first-stage denoising network; "↓" and "↑" indicate a decrease and an increase in performance relative to the corresponding baseline methods, respectively.
[0052] Tables 1-4 list the experimental results of different EEG denoising methods on four typical artifact removal tasks: electromyography (EMG), electrooculography (EOG), electrocardiography (ECG), and motion artifacts. The experiments used relative root mean square error (RRMSE), correlation coefficient (CC), and signal-to-noise ratio (SNR) as evaluation metrics. A lower RRMSE indicates a smaller reconstruction error between the denoised signal and the real clean EEG; a higher CC indicates a stronger waveform correlation; and a higher SNR indicates better signal quality after denoising. The experimental results show that, compared to traditional EMD-CCA, EMD-ICA methods, and existing deep learning denoising models, the DRL enhancement optimization strategy proposed in this invention achieves superior denoising performance on most artifact removal tasks for different baseline networks, manifested in lower RRMSE, higher CC, and improved SNR. Specifically, SimpleCNN-DRL achieved optimal or near-optimal overall performance in EOG and ECG artifact removal tasks, and also achieved the lowest RRMSE and highest CC in the Motion artifact removal task; DuoCL-DRL achieved the lowest RRMSE in the EMG artifact removal task; and FCNN-DRL achieved the highest SNR in both EMG and Motion tasks. These results demonstrate that the DRL enhancement strategy proposed in this invention can effectively improve the adaptive suppression ability of EEG denoising models against different types of artifacts, further improving signal reconstruction quality while maintaining the effective components of EEG signals. This invention can be embedded as a general model enhancement module into different deep learning EEG denoising networks to improve the reliability and stability of EEG signals in subsequent downstream applications such as classification, recognition, diagnosis, and brain-computer interfaces. In implementation, this method can be deployed as a software module, training strategy, or model optimization tool during the EEG denoising model training phase to adaptively optimize EEG data under different artifact types, thereby assisting the model in achieving better denoising results.
Claims
1. A detail-enhanced EEG noise reduction method based on diffusion residual learning, characterized in that, The procedure is as follows: Step 1, obtain the first Noisy single-channel EEG signal sequence and its corresponding clean single-channel EEG signal sequence ,in, Indicates the first Noisy single-channel EEG signal at sampling time The value of , Indicates the first A clean single-channel EEG signal at the sampling time The value of , and , This represents the total number of sampling points for a segment of signal; Step 2: Constructing the first-stage reconstructed EEG noise reduction network and the noisy single-channel EEG signal sequence Input the reconstructed EEG noise reduction network The signal is processed in the first stage to obtain the initial denoised single-channel EEG signal using equation (2). : (2) In equation (2), This represents the parameters of the reconstructed EEG noise reduction network in the first stage. Step 3: Calculate the clean single-channel EEG signal sequence using equation (3). With the initial denoised single-channel EEG signal Residual details between : (3) Step 4: Construct the second-stage conditional diffusion residual detail recovery network. and represented in terms of the residual details. As the target of diffusion modeling, the noisy single-channel EEG signal sequence and the initial denoised single-channel EEG signal Conditional information As constraint information, the conditional diffusion residual detail recovery network in the second stage... The training process yields the second-stage conditional diffusion residual detail recovery model. Step 5: Use the trained second-stage conditional diffusion residual detail recovery model to perform inverse denoising sampling on the Gaussian noise, and obtain the... Segment prediction residual details ; Step 6: Use equation (13) to obtain the first... Final denoised single-channel EEG signal : (13) Step 7, based on and A loss function is constructed to update the network parameters, thereby obtaining the optimal EEG denoising model after training, which is used to enhance the details of the input noisy single-channel EEG signal and reduce noise.
2. The detail-enhanced EEG noise reduction method based on diffusion residual learning according to claim 1, characterized in that, Step 4 includes: Step 4.1: Use equation (5) to represent the residual details. Perform forward diffusion noise addition to obtain the first... Noisy residual variable under each diffusion step : (5) In equation (5), This represents noise that follows a standard Gaussian distribution. Indicates the preceding Cumulative noise scheduling parameters under each diffusion step Indicates the first Noise scheduling parameters under each diffusion step; Step 4.2: Add the noise-added residual variable diffusion steps and condition information Input the conditional diffusion residual detail recovery network of the second stage In the middle, and using equation (6) to obtain the first Predicted noise at each diffusion step : (6) In equation (6), This represents the conditional diffusion residual detail recovery network. The noise prediction function in These represent the parameters of the conditional diffusion residual detail recovery network in the second stage; Step 4.3: Construct the predicted loss for diffused noise using equation (7). : (7) In equation (7), Represents the L2 norm; Indicates the number of diffusion steps Residual details representation and Gaussian noise Calculate the mathematical expectation of the random sampling results; Step 4.4: Use equation (8) to analyze the noisy residual variable. Perform reverse denoising sampling to obtain the first... Residual state under diffusion steps : (8) In equation (8), Indicates the first The intensity of random perturbation during the backsampling process in each diffusion step. Indicates Gaussian noise; Step 4.5: Repeat the reverse denoising sampling process in step 4.4 until... Thus, the predicted residual details are obtained. .
3. The detail-enhanced EEG noise reduction method based on diffusion residual learning according to claim 1, characterized in that, The second-stage conditional diffusion residual detail recovery network It includes: a signal branch, a conditional branch, and a feature-level linear modulation module (FiLM); wherein, the signal branch is used for... Feature extraction is performed to obtain the first... Signal branching characteristics at each diffusion step The conditional branch is used for... Feature extraction is performed to obtain conditional branch features. And using equation (11) to obtain the first Fusion features modulated after each diffusion step : (11) In equation (11), and These represent the scaling parameter and the offset parameter, respectively. This indicates element-wise multiplication.
4. The detail-enhanced EEG noise reduction method based on diffusion residual learning according to claim 3, characterized in that, At least one of the signal branch and the conditional branch is equipped with a Mamba-based state-space model encoder, and uses equations (9) and (10) to process the received input feature sequence. Perform state updates to obtain the output feature sequence. : (9) (10) In equations (9) and (10), Indicates the first Input features at each sampling location, Indicates the first The hidden state at each sampling location Indicates the first The hidden state at each sampling location Indicates the first Output features at each sampling location , and They represent the first State transition parameters, input mapping parameters, and output mapping parameters for each sampling location; When the Mamba-based state-space model encoder is configured with signal branches, the input feature sequence is projected onto the output, and combined with residual connections and layer normalization, long-range dependent signal branch features are obtained. ; When the Mamba-based state-space model encoder is configured with conditional branches, the input feature sequence is projected onto the output, and combined with residual connections and layer normalization, long-range dependent conditional branch features are obtained. .
5. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store a program that supports the processor in executing a detail-enhanced EEG noise reduction method based on diffusion residual learning as described in any one of claims 1-4, wherein the processor is configured to execute the program stored in the memory.
6. A computer-readable storage medium storing a computer program thereon, characterized in that, The computer program, when run by the processor, executes the steps of the detail-enhanced EEG noise reduction method according to any one of claims 1-4.