Method for automatically identifying and removing ocular artifacts of multi-lead electroencephalogram signals based on CycleGAN model

Through adversarial training of CycleGAN model, combined with cyclic consistency loss and adversarial loss, the problems of insufficient generalization ability and noise interference in electroophthalmic artifact removal in EEG signals are solved, and efficient identification and removal of electroophthalmic artifacts are achieved.

CN119564227AActive Publication Date: 2025-03-07NAOXI TECHNOLOGY (CHONGQING) CO LTD

Patent Information

Application Number
CN202411633749.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-03-07
Estimated Expiration
2044-11-15

AI Technical Summary

Technical Problem

The prior art has problems such as insufficient generalization ability, strong dependence on specific conditions, or susceptibility to noise interference when removing electroophageal artifacts in EEG signals.

Method used

Using a multi-lead EEG signal processing method based on the CycleGAN model, through adversarial training of the generator and discriminator, combined with cyclic consistency loss and adversarial loss, the denoising of EEG signals and automatic identification and removal of EEG artifacts are achieved.

Benefits of technology

It realizes efficient identification and removal of electroophageal artifacts in multi-lead EEG signals, has strong generalization ability, strong anti-noise interference, and does not depend on specific conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119564227A_ABST
    Figure CN119564227A_ABST
Patent Text Reader

Abstract

The invention relates to a method for automatically identifying and removing ocular artifacts of multi-lead electroencephalogram signals based on a CycleGAN model, and belongs to the technical field of bio-electricity signal processing. The method comprises the steps that electroencephalogram signal data of a tested person is collected and preprocessed; extracting ocular artifacts, adding the ocular artifacts into an ocular artifact signal library, and adding the electroencephalogram signals without the ocular artifacts into a clean electroencephalogram signal library; a clean electroencephalogram signal and an ocular artifact are randomly selected, the ocular artifact is added into the clean electroencephalogram signal to obtain a noisy electroencephalogram signal, the clean electroencephalogram signal and the noisy electroencephalogram signal are input into a CycleGAN model, and the model is trained; the collected multi-lead electroencephalogram signal data are preprocessed and then input into the trained model, and eye artifacts of the multi-lead electroencephalogram signals are removed. Effective information in the electroencephalogram signals can be reserved for other electroencephalogram signal analysis or application, and eye artifacts in the multi-lead electroencephalogram signals can be recognized and removed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of bioelectric signal processing based on generative adversarial networks, and relates to a method for automatically identifying and removing electrooculographic artifacts of multi-lead electroencephalogram signals based on a CycleGAN model. Background Art

[0002] As an important means of monitoring brain electrical activity, electroencephalogram (EEG) has inestimable value for neuroscience research, clinical diagnosis and cognitive function assessment. However, the acquisition of EEG signals is easily interfered by a variety of endogenous and exogenous factors, which are collectively referred to as artifacts. They significantly increase the difficulty and accuracy of data analysis. EEG artifacts include two categories: exogenous artifacts and endogenous artifacts.

[0003] Among them, exogenous artifacts mainly include environmental noise (such as power line interference, electromagnetic radiation), equipment factors (such as poor electrode contact, amplifier drift) and physical movement artifacts (such as head movement, electrode line shaking). Among them, power line interference usually exists in the form of 50 / 60Hz and its harmonics, which can be effectively filtered out by a notch filter of a specific frequency; while artifacts caused by physical movement can be reduced by improving the fixing device and signal processing technology.

[0004] Endogenous artifacts are generated by the subject's own physiological activities, including eye movements (such as blinking and saccades), muscle activities (such as facial muscle tension and chewing), heart activities (ECG interference), and breathing. Among endogenous artifacts, EOG artifacts are particularly prominent because eye movements can produce significant potential changes, which are particularly evident in EEG recordings of the frontal lobe and prefrontal region, seriously interfering with the interpretation of the brain's true electrical activity.

[0005] In order to effectively remove electrooculogram artifacts from EEG signals, researchers have developed a variety of methods. For example, regression-based methods attempt to regress artifact components from EEG and remove them by establishing a mathematical model between electrooculogram artifacts and EEG signals. Such methods rely on accurate artifact templates and high-quality reference signals, but in practical applications, it is often challenging to obtain these conditions. Methods based on adaptive filters, such as the minimum mean square error (LMS) adaptive filter, can dynamically adjust the filter parameters according to the input signal to minimize the artifact components in the output signal. However, the performance of the adaptive filter is highly dependent on the initial conditions and parameter settings, and the effect of removing nonlinear and non-stationary EOG artifacts is limited. Methods based on blind source separation (BSS): such as independent component analysis (ICA), can decompose EEG signals into multiple independent components, some of which may correspond to artifacts. By identifying and removing these artifact components, a relatively pure EEG signal can be reconstructed. However, ICA is not effective in processing single-channel data or when artifacts and EEG signals are highly overlapped, and additional auxiliary channel information is required. Based on deep learning methods, in recent years, deep learning has shown great potential in EEG artifact removal due to its powerful feature extraction and pattern recognition capabilities. By training deep neural networks (such as convolutional neural networks (CNN) and recurrent neural networks (RNN), it can automatically learn to separate clean signals from artifact components from raw EEG signals. However, deep learning models are susceptible to adversarial samples and are sensitive to noise and small perturbations, which may lead to unstable denoising performance, especially when facing complex and changeable EEG data in the real world.

[0006] Therefore, although existing methods can effectively process electrooculogram artifacts under certain conditions, they generally have problems such as insufficient generalization ability, strong dependence on specific conditions, or susceptibility to noise interference. Therefore, developing a method that can automatically identify and efficiently remove electrooculogram artifacts is of great significance to improving the accuracy and reliability of EEG data. Summary of the invention

[0007] In view of this, the purpose of the present invention is to provide a method for automatic identification and removal of electrooculogram artifacts of multi-lead EEG signals based on the CycleGAN (cyclic generative adversarial network) model, which fully learns the data distribution of the processed EEG signals, identifies the corresponding electrooculogram artifact data part, retains the useful EEG signal information in the EEG data, and effectively removes or suppresses the electrooculogram artifacts.

[0008] In order to achieve the above object, the present invention provides the following technical solutions:

[0009] A method for automatically identifying and removing electrooculographic artifacts of multi-lead EEG signals based on a CycleGAN model, comprising the following steps:

[0010] S1, collect the EEG signal data of the subjects and perform preprocessing;

[0011] S2. According to the distribution characteristics of electrooculogram artifacts in the electroencephalogram signal, determine whether there is an electrooculogram signal containing electrooculogram artifacts in the preprocessed electroencephalogram signal data; extract the electrooculogram artifacts from the electrooculogram artifacts and add them to the electrooculogram artifact signal library, and add the electrooculogram artifacts-free electrooculogram signal to the clean electroencephalogram signal library;

[0012] S3, randomly selecting an EEG signal from the clean EEG signal library, randomly selecting an EEG artifact from the EEG artifact signal library, adding the EEG artifact to the selected EEG signal to obtain a noisy EEG signal, inputting the selected EEG signal and the noisy EEG signal into a CycleGAN model, and training the model;

[0013] The model includes a generator G and a generator F, as well as a discriminator D_X and a discriminator D_Y; wherein the generator G is used to convert the EEG signal from domain X to domain Y, and the generator F is used to convert the EEG signal from domain Y to domain X; the discriminator D_X is used to discriminate whether the input EEG signal is a real EEG signal from domain X or an EEG signal generated by the generator F, and the discriminator D_Y is used to discriminate whether the input EEG signal is a real EEG signal from domain Y or an EEG signal generated by the generator G; the CycleGAN model adopts a cycle consistency loss function to ensure that the EEG signal converted between domains is consistent with the original EEG signal, and adopts an adversarial loss to ensure that the generated EEG signal is as close to the real EEG signal as possible;

[0014] S4. Preprocess the collected multi-lead EEG signal data and then input it into the trained CycleGAN model to remove eye artifacts from multi-lead EEG signals.

[0015] Furthermore, step S1 specifically includes collecting EEG signals of the subject induced by emotions and EEG signals of the subject's left and right hand movement imagination.

[0016] Furthermore, in step S1, the collected EEG signals of the subjects are preprocessed, including: performing baseline correction on each collected data segment to eliminate baseline drift; performing average re-reference processing on each data segment to reduce common noise; performing detrending processing on each data segment to remove linear trends; performing band-pass filtering on each data segment to remove noise outside a specific frequency range; performing band-stop filtering on each data segment to remove power frequency noise; and extracting cleaned signal features from the EEG signal data.

[0017] Furthermore, in step S2, based on the distribution characteristics of electrooculogram artifacts in the EEG signal, that is, the electrooculogram artifacts have obvious large-amplitude potential changes and short duration in the time domain, whether the EEG signal contains electrooculogram artifacts is detected, and the process includes: setting a threshold x thre , set the window size to N, and find the maximum value x of the EEG signal x(t) in the window [t-N+1,t] max and the minimum value x min :

[0018] x max =max{x(t-N+1),x(t-N+1),…,x(t)}

[0019] x min =min{x(t-N+1),x(t-N+1),…,x(t)}

[0020] If x max -x min >x thre , then the EEG signal x(t) contains eye artifacts.

[0021] Further, in step S2, extracting the electrooculogram artifact from the EEG signal containing the electrooculogram artifact includes: finding the signal peak in the EEG signal as the electrooculogram artifact peak t peak , S(t) represents the EEG signal; find the point from the peak to the minimum signal value within the duration of the EEG signal, which is the starting position of the EEG artifact. start , Find the point from the peak to the minimum signal value within the duration of the electrooculogram, and take it as the end position of the electrooculogram artifact. end , Extract start to end All sampling points between and their corresponding signal values ​​S(t i ) to obtain electrooculographic artifacts.

[0022] Furthermore, in step S3, adding the electrooculographic artifact to the selected EEG signal to obtain the noisy EEG signal includes: calculating the average value μ of the clean EEG signal:

[0023]

[0024] In the formula, T represents the signal length, S clean (t) represents clean EEG signal;

[0025] Calculate the minimum value E of the electrooculogram artifact E(t) min :

[0026]

[0027] Calculate the difference Δ=μ-E min , and add the difference to the electrooculogram artifact signal to adjust the amplitude of the electrooculogram artifact signal so as to match the clean EEG signal S clean (t) matches; randomly select the insertion position t in the clean EEG signal insert , and ensure that the inserted electrooculogram artifact does not exceed the signal boundary, that is, t insert ∈[0,TL], L is the length of the electrooculogram artifact signal; after selecting the insertion position, the electrooculogram artifact is inserted into the clean EEG signal to obtain the noisy EEG signal S new (t) = S clean (t)+E adjusted (tt insert ).

[0028] Furthermore, a spatial attention mechanism module and a residual network are added to the CycleGAN model, the feature extraction capability of the generator is enhanced by the spatial attention mechanism module, and the deep neural network is trained more effectively by the residual network.

[0029] The beneficial effects of the present invention are as follows: in the present invention, by inputting clean EEG signals and noisy EEG signals corresponding to the clean EEG signals into the CycleGAN model for training, the model is able to retain effective information in the EEG signals for other EEG signal analysis or applications, and can effectively identify and remove eye artifacts in multi-lead EEG signals, and has strong generalization ability, is independent of specific conditions, and has strong resistance to noise interference.

[0030] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:

[0032] Figure 1 A schematic diagram of the CycleGAN model training and working principle provided by one embodiment of the present invention.

[0033] Figure 2 A schematic flow chart of a method for automatically identifying and removing electrooculographic artifacts from multi-lead EEG signals of a CycleGAN model provided in one embodiment of the present invention.

[0034] Figure 3A schematic diagram of a process for identifying and removing electrooculogram artifacts provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0035] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0036] like Figure 1 As shown, a CycleGAN model for electrooculogram artifact recognition and removal proposed in one embodiment of the present invention is a generative adversarial network for image conversion, and its core idea is to use adversarial training of generative adversarial networks to achieve unsupervised image-to-image conversion. CycleGAN is particularly good at image conversion tasks without paired data, such as converting an image from one domain to another.

[0037] CycleGAN consists of two generators (G and F) and two discriminators (D_X and D_Y). Among them, the generator G is used to convert the EEG signal from domain X to domain Y, and the generator F is used to convert the EEG signal from domain Y to domain X. The discriminator D_X is used to discriminate whether the input EEG signal is a real EEG signal from domain X or an EEG signal generated by the generator F, and the discriminator D_Y is used to discriminate whether the input EEG signal is a real EEG signal from domain Y or an EEG signal generated by the generator G.

[0038] The key to CycleGAN is the cycle consistency loss. This loss ensures that the signal converted from the EEG signal in domain X to domain Y and then back to domain X is the same as the original EEG signal. For an EEG signal x in domain X, the generator G generates an EEG signal G(x) in domain Y, and then the generator F converts G(x) back to domain X, that is, F(G(x)). The cycle consistency loss ensures that x and F(G(x)) are as similar as possible. Similarly, for an EEG signal y in domain Y, the generator F generates an EEG signal F(y) in domain X, and then the generator G converts F(y) back to domain Y, that is, G(F(y)). The cycle consistency loss ensures that y and G(F(y)) are as similar as possible. Among them, domain X can be regarded as a noisy EEG signal domain, and domain Y can be regarded as a noise-free EEG signal domain. The task of generator G is to convert noisy EEG signals into noise-free EEG signals, while the task of generator F is to convert noise-free EEG signals into noisy EEG signals. Through adversarial training, generator G learns to remove noise, while generator F learns to add noise similar to that in domain X.

[0039] CycleGAN also contains adversarial loss, which ensures that the generated EEG signals are as realistic as possible. The discriminator D_Y is used to distinguish between real noise-free EEG signals and EEG signals generated by generator G. The discriminator D_X is used to distinguish between real noisy EEG signals and EEG signals generated by generator F. Generators G and F improve the quality of their generated EEG signals by adversarial discriminators D_Y and D_X, respectively.

[0040] By combining adversarial loss and cycle consistency loss, CycleGAN can effectively convert noisy EEG signals into noise-free EEG signals, that is, achieve the effect of EEG signal denoising. It can be trained without paired data and ensures that the generated EEG signals and the original EEG signals remain consistent after domain conversion through cycle consistency loss, thereby effectively removing noise.

[0041] like Figure 2 and Figure 3 As shown, a method for recognizing and removing electrooculogram artifacts of EEG signals based on a CycleGAN model is provided in one embodiment of the present invention. The method can be applied to automatically recognize and remove electrooculogram artifacts of multi-lead EEG signals. The method comprises the following steps:

[0042] Step 110, collect EEG signal data of the subjects, such as emotion-induced EEG signals and EEG signal data of left and right hand movement imagination; perform unified preprocessing on the EEG signals, including: baseline correction, average re-reference, detrending, bandpass filtering, and 50HZ notch processing. Among them, the collected data includes EEG signals recorded by multiple subjects when watching emotion-induced videos. These videos are designed to induce different emotional states, including positive emotions (positive), neutral emotions (neutral) and negative emotions (negative). The collected EEG signals are preprocessed in the same way to unify the EEG signals so that they can be processed in the next step.

[0043] The preprocessing is performed in the following order: baseline correction is performed on each data segment to eliminate baseline drift. Average re-reference is performed on each data segment to reduce common noise. Detrending is performed on each data segment to remove linear trends. Bandpass filtering is performed on each data segment to remove noise outside a specific frequency range. Band-stop filtering is performed on each data segment to remove power frequency noise. Cleaned signal features are extracted from the EEG data according to the preset preprocessing algorithm. Where C is the number of channels and N is the number of data points in each channel.

[0044] 1) Baseline correction includes: calculating the average value of each channel according to the baseline correction algorithm,

[0045]

[0046] Subtract the mean value from the data of each channel to remove baseline drift:

[0047]

[0048] 2) Average re-reference includes: calculating the average value at each time point, for each time point j, calculating the average value of all channels

[0049]

[0050] The data at each time point are averaged and re-referenced. For each time point j, each channel i, subtract the mean value of that time point

[0051]

[0052] 3) Detrending includes: applying linear detrending methods to remove linear trends in the data to avoid long-term drift affecting the analysis. The steps of linear detrending are:

[0053] Linear fitting: For each row x i, fit a linear model:

[0054]

[0055] Among them, t is the time index, a i and b i are the coefficients of the linear model.

[0056] Remove the fitted linear trend and get the detrended data:

[0057]

[0058] 4) Bandpass filtering includes: setting the filter order, low-frequency and high-frequency cutoff frequencies and sampling frequency, designing a Butterworth bandpass filter and applying it to the data to remove noise outside a specific frequency range.

[0059] 5) Band-stop filtering includes: setting the filter center frequency, quality factor and sampling frequency, designing an IIR band-stop filter and applying it to the data to remove power frequency noise (usually 50 Hz).

[0060] Step 120: The processed EEG data is used to determine whether there are electrooculogram artifacts based on the distribution characteristics of electrooculogram artifacts in the EEG signal (usually manifested as some obvious features that can be distinguished from the EEG signal). Among them, common electrooculogram artifact features are as follows:

[0061] ① Large amplitude changes: Electrooculogram artifacts often appear as large amplitude changes. Compared with normal EEG activity, these changes are often more dramatic. This is because eye movements and blinking produce stronger electrical signals. Large amplitude changes can be expressed as |E(t)|>>|X(t)|, where E(t) is the electrooculogram artifact and X(t) is the EEG signal.

[0062] ② Transient events: Blink artifacts usually appear as transient spikes that last about 200-400 milliseconds. These spikes have large amplitudes and are easily identified in EEG recordings. Transient events can be represented as:

[0063]

[0064] Among them, Δt is the duration of the blink (usually 200-400ms), and A is the amplitude of the blink artifact.

[0065] ③ Symmetry: Electrooculogram artifacts usually appear simultaneously in two electrooculogram channels (such as the electrodes around the left and right eyes) and exhibit symmetrical characteristics. This is because eye movements and blinking activities affect both eyes at the same time.

[0066] E left (t)≈Eright (t)

[0067] ④ Related to eye movements: The appearance of electrooculographic artifacts is usually highly correlated with the subject's eye movements and blinking behavior. If the eye movement data can be recorded synchronously, these artifacts can be easily distinguished from the actual EEG signals.

[0068] Specifically, the step is to set the extreme point in the EEG signal x(t) as t i , then the extreme point is expressed as:

[0069] x(t i )=max{x(t-1),x(t),x(t+1)}or x(t i )=min{x(t-1),x(t),x(t+1)}

[0070] Determine whether the amplitude of the extreme point is greater than the threshold x thre , if it is greater than , then there are electrooculographic artifacts in the EEG signal.

[0071] For an EEG signal x(t) in a time window [t-N+1,t], find its maximum and minimum values ​​in the window:

[0072] x max =max{x(t-N+1),x(t-N+1),…,x(t)}

[0073] x min =min{x(t-N+1),x(t-N+1),…,x(t)}

[0074] If x max -x min >x thre , then the EEG signal x(t) contains eye artifacts.

[0075] Step 121: extract the signal containing electrooculogram artifacts as an electrooculogram artifact signal library. The electrooculogram artifacts mainly appear in the frontal lobe leads of the signal acquisition device. Take the electrooculogram artifact signals of the leads where the frontal lobe is located, and remove the electroencephalogram artifacts as the clean electroencephalogram signal library.

[0076] The starting and ending positions of the electrooculogram artifact can be determined by determining the maximum value in the EEG signal as the peak of the electrooculogram artifact, and then finding the minimum value of the signal before and after the peak to determine the starting and ending positions of the electrooculogram artifact. In the signal set of the electrooculogram artifact, find the sampling point range of the electrooculogram artifact in the time domain, and intercept these points to extract the electrooculogram artifact signal. In which, let the peak position be t peak , then the peak position is through Find the point from the peak to the minimum signal value within the duration of electrooculogram, which is the starting position of the electrooculogram artifact.start , then the starting position is through Find the point from the peak to the minimum signal value within the duration of the electrooculogram, and take it as the end position of the electrooculogram artifact. end , then the end position is through get.

[0077] After obtaining the starting and ending points of the electrooculogram artifact, extract start to end All sampling points between and their corresponding signal values ​​S(t i ):

[0078] {t i}={t|t start ≤t≤t end}

[0079] {S(t i )}={S(t)|t start ≤t≤t end}

[0080] The corresponding electrooculogram artifact fragment is cut out from the electrooculogram artifact EEG data, and then the electrooculogram artifact is added to the signal in the lead where the frontal lobe is located in the obtained clean EEG signal according to the blinking frequency, so that the noisy EEG signal corresponding to the clean signal is obtained. Specifically, the amplitude of the electrooculogram artifact is adjusted to match the average value of the clean EEG signal, and then random insertion is performed. Let the clean EEG signal be S clean (t), the average value μ is calculated as follows:

[0081]

[0082] Adjust the electrooculogram artifact segment, set the electrooculogram artifact segment to E(t), length to L, and calculate the minimum value of the electrooculogram artifact E min :

[0083]

[0084] Calculate the difference Δ, Δ = μ-E min , adjust the electrooculogram artifact segment to add the difference Δ:

[0085] E adjusted (t)=E(t)+Δ

[0086] Select a random insertion position, set the length of the clean EEG signal to T, and randomly select an insertion position t insert , so that the inserted fragment does not exceed the signal boundary:

[0087] t insert ∈[0,TL]

[0088] After selecting the insertion position, insert the electrooculogram artifact segment. insert ,t insert +L], there are:

[0089] S new (t) = S clean (t)+E adjusted (tt insert )

[0090] Step 130: Two one-to-one corresponding EEG signals are input into the CycleGAN model for training. The generator G of the CycleGAN model generates a de-artifacted EEG signal (domain Y) from the EEG signal containing electrooculogram artifacts (domain X), and the generator F generates an EEG signal containing electrooculogram artifacts (domain X) from the de-artifacted EEG signal (domain Y). The discriminator D_X distinguishes between the real EEG signal containing electrooculogram artifacts and the signal generated by the generator F, and the discriminator D_Y distinguishes between the real de-artifacted EEG signal and the signal generated by the generator G.

[0091] Step 131: The encoder part of the CycleGAN model is used for feature extraction, which uses multiple convolutional layers to gradually extract the features of the EEG signal. The generator network first extracts the features of the input EEG signal, then downsamples the features and extracts high-level features through the encoder part, learns complex feature mapping relationships through the residual block part, and finally maps the features back to the EEG signal space through the decoder part to generate the EEG signal of the target domain. The generator network not only needs to convert the style of the EEG signal, but also needs to maintain the content consistency of the EEG signal. When converting the noisy signal to the clean signal, the converted noisy signal needs to maintain the identity characteristics of the other parts of the signal. The generator network uses adversarial training to make the generated EEG signal look as real as possible in the target domain. The output of the generator is evaluated by the discriminator network to ensure the quality of the generated EEG signal. The generator network works with its corresponding generator (such as G and F) to ensure that the source domain EEG signal can be reconstructed back to the original EEG signal after two conversions (source domain to target domain and then to source domain) through cycle consistency loss. This feature helps to maintain the structure and content of the source EEG signal. The generator network competes with the discriminator network through adversarial loss. The generator tries to generate realistic EEG signals in the target domain, making it impossible for the discriminator to distinguish between true and false, thereby improving the quality of the generated EEG signals. The generator network is optimized by minimizing the adversarial loss and the cycle consistency loss. During the training process, the generator continuously adjusts parameters to generate higher quality EEG signals and maintain the structure and content of the source EEG signals.

[0092] Step 132: The discriminator network of the CycleGAN model is mainly used to evaluate the authenticity of the EEG signals generated by the generator network, and to help the generator improve the quality of the generated EEG signals through adversarial training. CycleGAN contains two discriminator networks, which are used to evaluate the authenticity of the source domain EEG signals and the target domain EEG signals respectively. The main task of the discriminator network is to distinguish between real EEG signals and generated EEG signals (fake EEG signals). The discriminator receives an EEG signal as input and outputs a probability value, indicating the probability that the input EEG signal is real. Through adversarial training, the discriminator network continuously improves its discrimination ability, which forces the generator network to continuously improve to generate more realistic EEG signals. The game between the discriminator and the generator drives the generator to generate high-quality EEG signals.

[0093] The discriminator network usually consists of a series of convolutional layers, which are used to extract features of the input EEG signal. These convolutional layers help the discriminator identify the authenticity of the EEG signal by extracting spatial features and texture information layer by layer. The last few layers of the discriminator usually include fully connected layers or convolutional layers, which are used to integrate the features extracted by the previous layers and output a binary classification result, indicating whether the EEG signal is real (marked as 1) or generated (marked as 0). The discriminator network is trained by adversarial loss (such as binary cross entropy loss or least squares loss). The adversarial loss is used to measure the classification accuracy of the discriminator for real EEG signals and generated EEG signals, and is used to update the weights of the discriminator.

[0094] Step 133: The loss functions of CycleGAN include: Adversarial Loss, Cycle Consistency Loss, and Identity Loss.

[0095] ① The adversarial loss includes the generator loss (Generator Loss) and the discriminator loss (Discriminator Loss). The generator loss uses the cross entropy loss of logistic regression to measure the difference between the fake samples generated by the generator and the real labels:

[0096]

[0097] Among them, z i is the input of the generator, and N is the number of samples.

[0098] The discriminator loss consists of two parts: the loss for real samples and the loss for fake samples, which is measured using the cross entropy loss of logistic regression:

[0099]

[0100] Among them, xi For real samples.

[0101] ② Cycle consistency loss is used to ensure that the image remains unchanged when mapping from one domain to another and back. This loss consists of two parts: the loss from domain A to domain B and back, and the loss from domain B to domain A and back:

[0102]

[0103] Among them, generator G is used to map from domain A to domain B, generator F is used to map from domain B to domain A, and x i is a sample of domain A, y i is a sample of domain B.

[0104] ③ Identity loss is used to ensure that the input image maintains its own characteristics when passing through the generator. This loss also consists of two parts: the identity loss of domain A and domain B:

[0105]

[0106] Step 134: Adding attention mechanism and residual network to the generator of CycleGAN can further improve the performance of the model, especially when processing complex EEG signals. The residual network can train deep neural networks more effectively by introducing residual blocks. The role of the spatial attention mechanism module in the CycleGAN model is mainly to enhance the feature extraction ability of the generator, thereby more effectively removing electrooculographic artifacts in EEG signals.

[0107] A typical residual block consists of the following parts:

[0108] Skip Connection: Add the input directly to the output, forming a short-circuit path.

[0109] Convolutional layer: Usually contains two convolutional layers, each convolutional layer is followed by batch normalization and activation function (such as ReLU).

[0110] In the CycleGAN model, the complexity and depth of the model can be adjusted by stacking multiple residual blocks, so as to flexibly meet the needs of different tasks and data sets. The output of the residual block can be expressed as:

[0111]

[0112] Where x is the input, is the feature extracted by the convolution layer and activation function, {W i} are the weight parameters of the convolutional layer. The skip connection adds the input directly to the output, ensuring that the gradient can be back-propagated without hindrance.

[0113] The role of the spatial attention module in the CycleGAN model is mainly to enhance the generator's feature extraction capabilities, thereby more effectively removing electrooculographic artifacts in EEG signals. Among them, spatial attention mainly focuses on the spatial position of the feature map, that is, an attention weight is generated for each spatial position (H, W) of the feature map, and these weights are used to adjust the feature strength of each position. This mechanism can enhance the model's attention to important positions in the image and ignore irrelevant background information.

[0114] Through the attention mechanism, the generator can better focus on the important features in the input EEG signal and reduce the interference of irrelevant or noisy features, which helps the generator to more accurately convert EEG signals containing electrooculographic artifacts into clean EEG signals and enhance the artifact removal effect. In addition, the combination of the attention mechanism and the residual network can improve the performance of the generator and enable it to better learn complex signal conversion tasks.

[0115] Step 140, the model obtained through training in steps 130 to 134 is used to directly remove electrooculogram artifacts from the collected multi-lead data. Specifically, the collected EEG data is subjected to the same preprocessing and then input into the trained model to directly obtain a clean EEG signal with the electrooculogram artifacts removed. Moreover, the model can retain the effective information in the EEG signal for other EEG signal analysis or applications, thereby realizing end-to-end multi-lead automatic recognition and removal of electrooculogram artifacts.

[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.

Claims

1. A method for automatically identifying and removing electrooculographic artifacts from multi-lead EEG signals based on a CycleGAN model, characterized in that: The method comprises: collecting and preprocessing the EEG signal data of the test person; According to the distribution characteristics of electrooculogram artifacts in EEG signals, it is determined whether there are EEG signals containing electrooculogram artifacts in the preprocessed EEG signal data; the electrooculogram artifacts are extracted from the EEG signals containing electrooculogram artifacts and added to the electrooculogram artifact signal library, and the EEG signals without electrooculogram artifacts are added to the clean EEG signal library; Randomly select an EEG signal from the clean EEG signal library, randomly select an EEG artifact from the EEG artifact signal library, add the EEG artifact to the selected EEG signal to obtain a noisy EEG signal, input the selected EEG signal and the noisy EEG signal into a CycleGAN model, and train the model; The model includes a generator G and a generator F, as well as a discriminator D_X and a discriminator D_Y; wherein the generator G is used to convert the EEG signal from domain X to domain Y, and the generator F is used to convert the EEG signal from domain Y to domain X; the discriminator D_X is used to discriminate whether the input EEG signal is a real EEG signal from domain X or an EEG signal generated by the generator F, and the discriminator D_Y is used to discriminate whether the input EEG signal is a real EEG signal from domain Y or an EEG signal generated by the generator G; the CycleGAN model adopts a cycle consistency loss function to ensure that the EEG signal converted between domains is consistent with the original EEG signal, and adopts an adversarial loss to ensure that the generated EEG signal is as close to the real EEG signal as possible; The collected multi-lead EEG signal data is preprocessed and then input into the trained CycleGAN model to remove eye artifacts from multi-lead EEG signals.

2. The method according to claim 1, characterized in that The collecting of the EEG signal data of the subject includes collecting the EEG signals of the subject under emotion induction and the EEG signals of the subject's left and right hand movement imagination.

3. The method according to claim 1 or 2, characterized in that: The collected EEG signals of the subjects were preprocessed, including: baseline correction for each piece of collected data to eliminate baseline drift; average re-reference processing for each piece of data to reduce common noise; detrending processing for each piece of data to remove linear trends; band-pass filtering for each piece of data to remove noise outside a specific frequency range; band-stop filtering for each piece of data to remove power frequency noise; and extracting cleaned signal features from the EEG signal data.

4. The method according to claim 1, characterized in that: According to the distribution characteristics of electrooculogram artifacts in EEG signals, i.e., the electrooculogram artifacts have obvious large-amplitude potential changes and short duration in the time domain, the process of detecting whether the EEG signal contains electrooculogram artifacts includes: setting a threshold x thre , set the window size to N, and find the maximum value x of the EEG signal x(t) in the window [t-N+1,t] max and the minimum value x min : x max =max{x(t-N+1),x(t-N+1),…,x(t)} x min =min{x(t-N+1),x(t-N+1),…,x(t)} If x max -x min >x thre , then the EEG signal x(t) contains eye artifacts.

5. The method according to claim 1, characterized in that Extracting electrooculogram artifacts from an EEG signal containing electrooculogram artifacts includes: finding the signal peak in the EEG signal as the electrooculogram artifact peak t peak , S(t) represents the EEG signal; find the point from the peak to the minimum signal value within the duration of the EEG signal, which is the starting position of the EEG artifact. start , Find the point from the peak to the minimum signal value within the duration of the electrooculogram, and take it as the end position of the electrooculogram artifact. end , Extract start to end All sampling points between and their corresponding signal values ​​S(t i ) to obtain electrooculographic artifacts.

6. The method according to claim 1, characterized in that Adding the electrooculogram artifacts to the selected EEG signal to obtain a noisy EEG signal includes: calculating the average value μ of the clean EEG signal: Where T represents the signal length, S clean (t) represents clean EEG signal; Calculate the minimum value E of the electrooculogram artifact E(t) min : Calculate the difference Δ=μ-E min , and add the difference to the electrooculogram artifact signal to adjust the amplitude of the electrooculogram artifact signal so as to match the clean EEG signal S clean (t) matches; randomly select the insertion position t in the clean EEG signal insert , and ensure that the inserted electrooculogram artifact does not exceed the signal boundary, that is, t insert ∈[0,TL], L is the length of the electrooculogram artifact signal; after selecting the insertion position, the electrooculogram artifact is inserted into the clean EEG signal to obtain the noisy EEG signal S new (t) = S clean (t)+E adjusted (tt insert ).

7. The method according to claim 1, characterized in that A spatial attention mechanism module and a residual network are added to the CycleGAN model. The feature extraction capability of the generator is enhanced by the spatial attention mechanism module, and the deep neural network is trained more effectively by the residual network.

Citation Information

Patent Citations

  • Method for analyzing electroencephalogram signals of patient with motor imagery cerebral apoplexy by utilizing CycleGAN

    CN111523520A

  • SSDA-based electroencephalogram signal ocular artifact removal method

    CN111543984A

  • Multi-step time sequence prediction method based on CycleGAN neural network

    CN112733444A

  • Electroencephalogram data amplification method and system based on generative adversarial network model

    CN116010848A

  • Feedback adversarial learning

    US11429841B1

Cited By

  • Electroencephalogram signal processing system for sleep analysis

    CN119848472A

  • An EEG signal processing system for sleep analysis

    CN119848472B

  • Electroencephalogram monitoring system for neurology patients

    CN120052916A

  • Electroencephalogram signal processing method and system based on motion artifact prediction

    CN120549516A