A deep learning-based electroencephalography signal artifact separation method and system

By using a cross-transformer and attention mechanism built through deep learning, the problems of manual dependence and computational complexity in the removal of artifacts in brain electromagnetic signals are solved, and automated and fast artifact separation is achieved, which is applicable to scenarios such as auditory decoding and brain-computer interfaces.

CN121743841BActive Publication Date: 2026-05-15SHANGHAI ARTIFICIAL INTELLIGENCE INNOVATION CENT
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI ARTIFICIAL INTELLIGENCE INNOVATION CENT
Filing Date
2026-02-26
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing methods for removing brain electromagnetic signal artifacts rely on human experience, have high computational complexity, are difficult to meet online processing requirements, and lack a unified computational framework, resulting in unstable processing results and slow speed.

Method used

Employing a deep learning-based approach, a multi-channel time-series signal modeling framework is constructed using a cross-transformer and attention mechanism to achieve automated artifact separation. This framework includes an encoder, a backbone model, and a decoder, supports sliding window and streaming processing modes, and is suitable for parallel computing on graphics processors.

Benefits of technology

It achieves automatic artifact separation without human intervention, reduces processing costs and result inconsistencies, and improves processing speed and efficiency, making it suitable for applications with high real-time requirements and automation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121743841B_ABST
    Figure CN121743841B_ABST
Patent Text Reader

Abstract

The application provides a deep learning-based electroencephalography signal artifact separation method and system. The method comprises: acquiring an original multi-channel electroencephalography signal; performing feature extraction on the original multi-channel electroencephalography signal through an encoder to obtain encoded features; inputting the encoded features into a backbone model, the backbone model being based on a cross transformer, and performing joint modeling on the dependence relationship of the encoded features in the time dimension and the channel dimension through an attention mechanism; generating synthetic artifact channel features based on the features output by the backbone model; and reconstructing signals through a decoder based on the features output by the backbone model and the synthetic artifact channel features, and synchronously outputting an electroencephalography net signal after removing artifacts and a corresponding artifact estimation signal. The method provided by the application can automatically complete artifact separation from the original electroencephalography signal without human participation in the identification and screening process of independent components.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of biomedical signal processing technology, specifically to a method and system for separating brain electromagnetic signal artifacts based on deep learning, which is particularly suitable for scenarios requiring automated and high-precision online processing, such as auditory decoding and brain-computer interfaces. Background Technology

[0002] Electroencephalogram (EEG) signals are an important tool for studying brain activity, but they are highly susceptible to contamination from physiological artifacts such as electrooculography (EOG) and electromyography (EMG) during acquisition, severely affecting subsequent analysis and applications. Among these, EOG artifacts, due to their large amplitude and wide range, have a particularly significant impact on signal quality.

[0003] Among existing techniques for removing artifacts from EEG signals, Independent Component Analysis (ICA) is widely used and serves as a typical baseline approach. This method typically assumes that the observed multichannel EEG signal is a linear mixture of several statistically independent source signals. By decomposing the mixture, a set of independent components and their corresponding spatial weights are obtained.

[0004] Although the ICA method is a widely used technique for removing artifacts in current EEG signals and has some practicality in certain offline analysis scenarios, it can separate EEG artifacts to a certain extent. However, its performance is highly dependent on whether the independence assumption holds and the accuracy of manual parameter setting and component screening. Under low signal-to-noise ratio conditions, the statistical independence between neural signals and artifact signals is often difficult to satisfy, leading to unstable separation results. Moreover, the ICA method still has the following significant shortcomings in engineering applications:

[0005] First, artifact removal based on the ICA method typically requires manual identification and screening of multiple independent components obtained from the decomposition, relying on human experience to determine whether a component belongs to electrooculography (EOG) artifacts. This manual intervention not only increases the cost of use but also leads to subjectivity and inconsistency in the processing results, making it difficult to apply stably in large-scale data processing or automated systems.

[0006] Secondly, the ICA method itself has high computational complexity, typically requiring matrix factorization of the entire multi-channel data stream. Furthermore, the processing flow involves multiple iterative calculations and conditional judgments, resulting in a slow overall processing speed, which is not conducive to efficient parallel computing on graphics processing units (GPUs). This processing approach is difficult to meet the requirements of online or near-real-time applications demanding low latency and high throughput, limiting its practical deployment in auditory decoding and brain-computer interface systems.

[0007] Furthermore, existing artifact removal methods based on ICA are typically presented as independent preprocessing steps, lacking a unified computational framework with subsequent signal decoding or control models, making it difficult to form an end-to-end processing flow. This not only increases the complexity of system integration but also hinders the use of parallel computing platforms such as graphics processing units (GPUs) to accelerate the overall algorithm.

[0008] In recent years, several deep learning-based solutions have been proposed to replace ICA methods. Attention-based temporal signal modeling methods have also shown great potential. However, directly applying such models to artifact separation of multi-channel EEG signals still requires addressing key challenges such as how to efficiently jointly model spatiotemporal features, how to achieve artifact estimation without external references, and how to adapt to online processing requirements. Therefore, constructing an artifact separation scheme that can automatically, efficiently, and uniformly process multi-channel EEG signals and is suitable for online applications remains a pressing technical problem. Summary of the Invention

[0009] The objective of this invention is to provide a method and system for separating brain electromagnetic signal artifacts based on deep learning. This method and / or system addresses the problems of existing technologies, such as the need for manual intervention in artifact recognition, high computational complexity, slow processing speed, and difficulty in online processing. By constructing a unified multi-channel time-series signal modeling framework, it achieves automatic separation of electrooculography artifacts. Furthermore, while ensuring the stability of the processing flow, it improves the overall operating efficiency and engineering usability of the system, making it more suitable for applications in scenarios with high real-time and automation requirements, such as auditory decoding and brain-computer interfaces.

[0010] In a first aspect of the invention, the aforementioned task is solved by a deep learning-based method for separating brain electromagnetic signal artifacts, the method comprising the following steps:

[0011] Acquire raw multichannel brain electromagnetic signals;

[0012] The original multi-channel brain electromagnetic signals are subjected to feature extraction by an encoder to obtain encoded features;

[0013] The encoded features are input into a backbone model, which is based on a cross-transformer and performs joint modeling of the dependencies of the encoded features in the time and channel dimensions through an attention mechanism.

[0014] Based on the features output by the backbone model, synthetic artifact channel features are generated; and

[0015] Based on the features output by the backbone model and the features of the synthetic artifact channel, the signal is reconstructed by the decoder, and the cleaned brain electromagnetic signal after removing artifacts and the corresponding artifact estimation signal are output synchronously.

[0016] In one embodiment of the present invention, the backbone model includes multiple transformer layers, and the joint modeling includes: performing attention computation in the time dimension and attention computation in the channel dimension alternately or in parallel in the transformer layers.

[0017] In one embodiment of the present invention, the attention mechanism is a multi-head attention mechanism, where half of the attention heads are used to calculate self-attention in the channel dimension and the other half of the attention heads are used to calculate self-attention in the time dimension.

[0018] The bulls' focus is on:

[0019]

[0020] Where h represents the index number of the attention head. Indicates the first The output of each attention head; Q represents the normalization function used to map attention weights to a probability distribution; Q represents the query matrix. Indicates the first The query projection weight matrix corresponding to each attention head, where K represents the key matrix. Indicates the first The key projection weight matrix corresponding to each attention head This represents the matrix transpose operation; Indicates the first The feature dimension of each attention head is used to scale the dot product result; V represents the value matrix. Indicates the first The values ​​corresponding to each attention head are projected onto the weight matrix;

[0021]

[0022] in, Indicates input features The output feature representation obtained after performing the cross-head attention mechanism. This indicates an operation that concatenates the outputs of multiple attention heads along the feature dimension. Indicates the 1st, 2nd, ..., 1st The output of each attention head;

[0023] in, for,

[0024]

[0025] Here, S-Attention means that the attention head performs computation in the channel direction, and T-Attention means that the attention head performs computation in the time direction.

[0026] In one embodiment of the present invention, the generated synthetic artifact channel features include:

[0027] The features output by the backbone model are aggregated along the channel dimension to obtain channel aggregated features; wherein, the aggregation operation includes average pooling or weighted averaging.

[0028] The channel aggregation features are linearly transformed to generate the synthetic artifact channel features.

[0029] In one embodiment of the present invention, the method supports online processing, including a sliding window processing mode or a streaming processing mode;

[0030] The sliding window processing mode processes the input signal using a sliding window of fixed length.

[0031] The streaming processing mode processes the input signal step by step using a causal attention mechanism.

[0032] In one embodiment of the present invention, the method is trained through supervised learning, and the training objectives include: making the net brain electromagnetic signal approximate a reference signal averaged from multiple experiments, and making the artifact estimation signal approximate the real artifact signal acquired synchronously.

[0033] In one embodiment of the invention, the encoder includes a convolutional neural network; and / or

[0034] The decoder includes a transposed convolutional neural network.

[0035] In a second aspect of the invention, the aforementioned task is further addressed by a deep learning-based brain electromagnetic signal artifact separation system, which includes the following modules:

[0036] The signal acquisition module is configured to collect raw multichannel brain electromagnetic signals;

[0037] The encoding module is configured to perform feature extraction on the original multichannel brain electromagnetic signal through an encoder to obtain encoded features;

[0038] The spatiotemporal modeling module is configured to input the encoded features into a backbone model, which is based on a cross-transformer and performs joint modeling of the dependencies of the encoded features in the time and channel dimensions through an attention mechanism.

[0039] The artifact feature generation module is configured to generate synthetic artifact channel features based on the features output by the backbone model; and

[0040] The decoding output module is configured to, based on the features output by the backbone model and the features of the synthetic artifact channel, reconstruct the signal through the decoder and simultaneously output the cleaned brain electromagnetic signal after removing artifacts and the corresponding artifact estimation signal.

[0041] In a third aspect, the present invention also provides an electronic device comprising:

[0042] A processor, configured to execute machine-readable instructions;

[0043] A graphics card configured to train the deep learning-based brain electromagnetic signal artifact separation method described above; and

[0044] A memory configured to store machine-readable instructions that, when executed by a processor and / or a graphics card, perform the steps of the deep learning-based brain electromagnetic signal artifact separation method.

[0045] In a fourth aspect, the present invention also provides a computer-readable storage medium having stored thereon computer-readable instructions which, when executed by a processor, perform the steps of the deep learning-based brain electromagnetic signal artifact separation method.

[0046] The technical solution provided by this invention has the following advantages:

[0047] 1. The deep learning-based brain electromagnetic signal artifact separation method proposed in this invention eliminates the need for manual identification and screening of independent components, automatically separating artifacts directly from the raw brain electromagnetic signals. Compared to independent component analysis methods that rely on human experience and rule-based settings, the deep learning-based brain electromagnetic signal artifact separation method proposed in this invention significantly reduces the barrier to entry and labor costs, improves the consistency and repeatability of processing results, and is more suitable for application in automated systems and large-scale data processing.

[0048] 2. The brain electromagnetic signal artifact separation method proposed in this invention adopts an end-to-end unified computing framework, which integrates the artifact separation process into a single model structure, thus avoiding the additional computational overhead caused by the multi-stage, serial processing flow in traditional methods.

[0049] 3. The brain electromagnetic signal artifact separation method based on deep learning proposed in this invention is suitable for efficient acceleration on parallel computing platforms such as graphics processors. Under the same hardware conditions, it can achieve higher processing throughput and lower latency, thereby effectively overcoming the problems of slow processing speed and difficulty in meeting online requirements of independent component analysis methods.

[0050] 4. The deep learning-based brain electromagnetic signal artifact separation method proposed in this invention supports both sliding window processing and streaming processing modes, enabling flexible trade-offs between signal quality and response speed depending on the application scenario. Compared to independent component analysis, which typically requires offline processing of the entire data segment, this invention is more suitable for applications such as auditory decoding and brain-computer interfaces that demand real-time performance and continuous output. Attached Figure Description

[0051] To further illustrate the above and other advantages and features of the various embodiments of the present invention, a more specific description of the various embodiments of the present invention will be presented with reference to the accompanying drawings. It is to be understood that these drawings depict only typical embodiments of the invention and are therefore not intended to limit its scope. In the drawings, identical or corresponding parts will be indicated by identical or similar reference numerals for clarity.

[0052] Figure 1 A flowchart illustrating a deep learning-based brain electromagnetic signal artifact separation method according to an embodiment of the present invention is shown; and

[0053] Figure 2 A schematic diagram of a brain electromagnetic signal artifact separation system based on deep learning according to an embodiment of the present invention is shown. Detailed Implementation

[0054] In the following description, the invention is described with reference to various embodiments. However, those skilled in the art will recognize that the embodiments may be practiced without one or more specific details or with other alternatives and / or additional methods or components. In other instances, well-known structures or operations are not shown or described in detail so as not to obscure the inventive points of the invention. Similarly, for illustrative purposes, specific numbers and configurations are set forth to provide a comprehensive understanding of the embodiments of the invention. However, the invention is not limited to these specific details.

[0055] In this specification, references to "an embodiment" or "this embodiment" mean that a particular feature, structure, or characteristic described in connection with that embodiment is included in at least one embodiment of the invention. The phrase "in one embodiment" appearing throughout this specification does not necessarily refer to the same embodiment in all instances.

[0056] It should be noted that the embodiments of the present invention describe the method steps in a specific order; however, this is only for illustrating the specific embodiment and not for limiting the order of the steps. On the contrary, in different embodiments of the present invention, the order of the steps can be adjusted according to actual needs.

[0057] In this invention, the modules of the system according to the invention can be implemented using software, hardware, firmware, or a combination thereof. When a module is implemented using software, its function can be implemented through computer program flow. For example, the module can be implemented using code segments (such as code segments in languages ​​like C and C++) stored in a storage device (such as a hard disk, memory, etc.), wherein the corresponding function of the module can be implemented when the code segment is executed by a processor. When a module is implemented using hardware, its function can be implemented by setting a corresponding hardware structure. For example, the module's function can be implemented by hardware programming a programmable device such as a field-programmable gate array (FPGA), or by designing an application-specific integrated circuit (ASIC) that includes multiple transistors, resistors, capacitors, and other electronic devices. When a module is implemented using firmware, the module's function can be written into a read-only memory such as an EPROM or EEPROM in the form of program code, and the corresponding function of the module can be implemented when the program code is executed by a processor. In addition, some functions of the module may need to be implemented by separate hardware or by working in cooperation with the hardware. For example, the detection function is implemented by a corresponding sensor (such as a proximity sensor, accelerometer, gyroscope, etc.), the signal transmission function is implemented by a corresponding communication device (such as a Bluetooth device, infrared communication device, baseband communication device, Wi-Fi communication device, etc.), the output function is implemented by a corresponding output device (such as a display, speaker, etc.), and so on.

[0058] For processing multi-channel EEG signals, the signals are typically represented as multi-dimensional time-series data in the form of "channel × time". To model the correlations between different channels while preserving the temporal structure, attention-based multi-channel time-series signal modeling methods have emerged in recent years. To reduce the computational and modeling complexity of multi-channel high-dimensional time-series signals, an improved structure employs a method of cross-calculating attention across different temporal and channel dimensions, known as a cross-attention structure. This allows the model to capture dependencies in both the temporal and spatial (channel) dimensions while maintaining manageable computational complexity. This type of structure is suitable for parallel modeling of multi-channel time-series signals, effectively matching the parallel computing characteristics of graphics processing units (GPUs), thus providing a foundation for online processing.

[0059] To address the problems of existing artifact recognition technologies, such as the need for manual intervention, high computational complexity, slow processing speed, and difficulty in online processing, this invention proposes a deep learning-based method for separating artifacts in brain electromagnetic signals. This method is suitable for automated and online processing of raw multi-channel brain electromagnetic signals. The method uses the raw multi-channel brain electromagnetic signals as input and, through an end-to-end mapping approach, simultaneously outputs the clean signal after artifact removal and the corresponding artifact estimation signal, thereby achieving automatic separation of artifact signals.

[0060] The deep learning-based brain electromagnetic signal artifact separation method provided in this invention uses a cross-transformer as the backbone model for unified modeling of multi-channel time-series signals. By cross-modeling the correlation between signals in both the time and channel dimensions, the model can fully utilize the temporal and spatial correlation features of multi-channel brain electromagnetic signals while maintaining controllable computational complexity.

[0061] Unlike traditional methods that first estimate artifacts or generate regression masks before signal reconstruction, this invention employs an end-to-end mapping approach to directly generate both the net signal and artifact estimation signal simultaneously from the original multi-channel EEG signals, avoiding the complexity and instability of multi-stage processing. This technical solution eliminates the need for manual parameter setting or screening, features a unified processing flow, and is suitable for acceleration on parallel computing platforms such as graphics processing units (GPUs), thus meeting the computational efficiency and automation requirements of online or near-real-time applications.

[0062] Figure 1 A flowchart illustrating a deep learning-based brain electromagnetic signal artifact separation method according to an embodiment of the present invention is shown. Figure 1 As shown, the deep learning-based brain electromagnetic signal artifact separation method includes the following steps:

[0063] Step 101: Acquire raw multi-channel EEG signals. In one embodiment of the present invention, the raw multi-channel EEG signals include electroencephalogram (EEG) signals or magnetoencephalogram (MEG) signals, and the data is represented in the form of a three-dimensional tensor [batch size, number of signal channels, number of time sampling points].

[0064] Step 102: Feature extraction is performed on the original multi-channel EEG signal using an encoder to obtain encoded features. In one embodiment of the present invention, the encoder employs a convolutional neural network (CNN) structure to extract features from the input multi-channel EEG signal. The encoder maps the original signal into a high-dimensional feature representation through convolution operations in the time dimension. The encoded features, i.e., the encoded feature representation, are in the form of [batch size, number of signal channels, number of time steps, feature embedding dimension]. This encoding process preserves the original channel structure while achieving an abstract expression of local temporal features, providing a unified input form for subsequent multi-channel modeling. In one embodiment of the present invention, the encoder includes a convolutional neural network.

[0065] Step 103: Input the encoded features into the backbone model, which is based on a cross-transformer and performs joint modeling of the dependencies of the encoded features in the time and channel dimensions through an attention mechanism.

[0066] In one embodiment of the present invention, the backbone model includes multiple converter layers, and the joint modeling includes: in each converter layer, attention calculation in the time dimension and attention calculation in the channel dimension are performed alternately or in parallel through a multi-head self-attention mechanism, that is, each converter layer models the dependencies in the time and channel dimensions respectively through the multi-head self-attention mechanism, thereby realizing the overall modeling of multi-channel time-series signals.

[0067] In one embodiment of the present invention, the attention mechanism is a multi-head attention mechanism, where half of the attention heads are used to calculate self-attention in the channel dimension and the other half of the attention heads are used to calculate self-attention in the time dimension.

[0068] The formula for calculating multi-head attention per head is:

[0069]

[0070] Where h represents the index number of the attention head. Indicates the first The output of each attention head; represents the normalization function used to map attention weights to a probability distribution; Q represents the query matrix. Indicates the first The query projection weight matrix corresponding to each attention head, where K represents the key matrix. Indicates the first The key projection weight matrix corresponding to each attention head This represents the matrix transpose operation; Indicates the first The feature dimension of each attention head is used to scale the dot product result; V represents the value matrix. This represents the projection weight matrix corresponding to the value of the ℎth attention head;

[0071]

[0072] in, Indicates input features The output feature representation obtained after performing the cross-head attention mechanism. This indicates an operation that concatenates the outputs of multiple attention heads along the feature dimension. Indicates the 1st, 2nd, ..., 1st The output of each attention head;

[0073] in, for,

[0074]

[0075] Here, S-Attention means that the attention head performs calculations in the channel direction, capturing the spatial correlation between channels; T-Attention means that the attention head performs calculations in the time direction, capturing the temporal dynamic pattern of the signal. In this way, each layer of the model can simultaneously aggregate information across time and across channels, which is beneficial for the efficient exchange of information between channels (compared to the temporal Transformer) and between time steps (compared to the spatial Transformer), while significantly reducing the computational complexity compared to two-dimensional attention.

[0076] Step 104: Based on the features output by the backbone model, generate synthetic artifact channel features. In one embodiment of the present invention, the artifacts include electrooculography artifacts.

[0077] Following the final transformer layer of the backbone model, a feature construction module is set up to generate the synthetic artifact channels. Specifically, one feature path directly maintains the original channel dimensions for subsequent net signal generation; the other feature path performs an averaging operation on the channel dimensions to obtain a feature representation reflecting the common variation trend of all channels. These two feature paths are respectively mapped to a new feature space through two different linear mapping layers. The output generated based on the channel-averaged features is used as the feature representation of the synthetic artifact channels.

[0078] In one embodiment of the present invention, generating synthetic artifact channel features includes: performing an aggregation operation on the features output by the backbone model in the channel dimension to obtain channel aggregate features; wherein, the aggregation operation includes average pooling or weighted average; and performing a linear transformation on the channel aggregate features to generate synthetic artifact channel features.

[0079] Based on current experimental results, channel averaging, or simple averaging, can characterize the features of electrooculography (EOG) artifacts. When detecting EOG artifact events, the consistency between the EOG channels generated by the model and the EOG events detected by actual EOG recordings reaches 90% or higher.

[0080] Step 105: Based on the features output by the backbone model and the features of the synthetic artifact channel, the signal is reconstructed through the decoder, and the cleaned brain electromagnetic signal after removing artifacts and the corresponding artifact estimation signal are output synchronously.

[0081] The decoder remaps the high-dimensional features back to the time-domain signal space. The decoder processes the features of each channel separately, ultimately outputting two types of signals: a clean EEG signal after artifact removal; and the corresponding estimated EEG artifact signal. In one embodiment of the invention, the decoder includes a transposed convolutional neural network. Both types of signals are aligned with the input signal in the time dimension, facilitating subsequent analysis or direct use as input to downstream auditory decoding and brain-computer interface systems.

[0082] In one embodiment of the present invention, the deep learning-based brain electromagnetic signal artifact separation method provided by the present invention is trained through supervised learning. The training objectives include: making the net brain electromagnetic signal approximate a reference signal averaged from multiple experiments, and making the artifact estimation signal approximate the synchronously acquired real artifact signal. During the training phase, the actually acquired electrooculogram (EOG) signals are used as artifact supervision information; the average result of brain electromagnetic signals under the same stimulus conditions in multiple repeated experiments is used as an approximate reference signal after artifact suppression. Through the above supervision information, the model is guided to learn the mapping relationship of separating EOG artifacts from the original brain electromagnetic signal and reconstructing the net signal. After training, the model can independently complete the artifact separation task in actual use without inputting the EOG reference signal.

[0083] The deep learning-based brain electromagnetic signal artifact separation method provided by this invention employs a multi-objective optimization strategy during the training phase, simultaneously constraining the output of both the net signal and the artifact signal. In one embodiment of this invention, the method includes at least two output branches: a first branch outputting the artifact-removed EEG / MEG signal; and a second branch outputting a reference signal related to the artifact (such as a synthetic electrooculogram signal). In another embodiment, the method also jointly optimizes the loss function, introducing: a reconstruction or similarity loss between the net signal and the reference signal; and a correlation or regression loss between the artifact output and an auxiliary channel (such as the real EOG). The sum of these two losses yields the model's training loss.

[0084] In one embodiment of the present invention, the deep learning-based brain electromagnetic signal artifact separation method provided by the present invention offers multiple online processing modes to adapt to the needs of different application scenarios. In one embodiment of the present invention, online processing may include a sliding window processing mode or a streaming processing mode.

[0085] In the sliding window processing mode, the input signal is segmented into fixed-length time windows for processing. The model employs a variable encoder structure in the time dimension to fully model the temporal context information within the window, making it suitable for applications with high signal quality requirements. In this mode, the model uses a fixed-length time window as input and processes continuous signals through a sliding window approach. The signals from each window are concatenated using a cosine transition to obtain the processed long signal, with the total time window length on the order of seconds. The model can obtain all information within n seconds (n can be chosen according to needs, such as 3 seconds or 6 seconds). When inferring the separation results of intermediate parts, information from the near future can be used to obtain better signal quality, making it suitable for large-scale preprocessing of static datasets.

[0086] In streaming mode, the model employs a transform decoder structure in the time dimension, using a causal attention mechanism to progressively process the input signal. This allows the system to update the output results gradually as new data is received, thereby reducing processing latency and improving response speed, making it suitable for applications with high real-time requirements. In the streaming mode, after acquiring features from the encoder, inference for that time step (16 sampling points / 16 milliseconds) is immediately performed relying solely on past information. Denoising features and artifact features are then generated for decoding. While future features can no longer be used for inference, latency is significantly reduced, making it suitable for real-time inference scenarios such as brain-computer interfaces.

[0087] Both modes share the same core model structure, differing only in their time-dimension modeling approach, facilitating switching between different application requirements. The two modes can share parameters, thus supporting automatic switching under appropriate calling procedures.

[0088] The feasibility of the brain electromagnetic signal artifact separation method based on deep learning provided by this invention has been verified through experiments.

[0089] The method was validated using real-world EEG data recorded with the Kymata SOTO series. This data, derived from synchronously acquired signals in a real experimental environment, better reflects the practical engineering requirements for artifact separation under low signal-to-noise ratio conditions. Validation on real data further demonstrates the effectiveness and practicality of this technical solution for automated artifact separation without human intervention.

[0090] During the experiment, real-world EEG and MEG signals that were not involved in model training were used as input signals. Simultaneously recorded EEG signals and the average of signals from multiple repeated experiments were used as references to verify the processing effectiveness of the method of this invention. Furthermore, a comparative experiment was conducted between the method of this invention and traditional artifact removal methods based on independent component analysis.

[0091] By calculating the signal-to-noise ratio (SNR) between a single recorded / processed signal and the average signal from multiple experiments, and comparing the signal segments affected by electrooculography (EOG) artifacts with those unaffected, the method provided by this invention can uniformly reduce the additional loss of SNR caused by EOG artifacts in each channel of the magnetoencephalogram (MEG) channel to below 0.5 dB, with most reductions below 0.3 dB. The SNR loss caused by EOG artifacts in the unprocessed signal varies from 0.5 dB to 4 dB depending on the location. For the EEG channel, since all channels are significantly affected by EOG artifacts, the model can uniformly reduce the additional loss of SNR caused by EOG artifacts in each channel by approximately 80%.

[0092] Experimental results show that the brain electromagnetic signals processed using the technical solution of this invention achieve signal quality indicators superior to those of the independent component analysis method, indicating that this invention can effectively suppress electrooculography artifacts without human intervention.

[0093] The experimental results above show that the method proposed in this invention can achieve its intended technical objectives, has good feasibility and engineering application feasibility, and is suitable for related application scenarios such as auditory decoding and brain-computer interfaces.

[0094] In a preferred embodiment of the present invention, the method proposed in this invention simultaneously outputs the net signal and the artifact estimation signal. In other embodiments, only the net signal may be output, or only the artifact estimation signal may be output, or multiple estimation signals corresponding to various types of artifacts may be output, without affecting the core technical concept of the present invention.

[0095] The core idea of ​​this method can be extended to the removal of other physiological artifacts (such as electromyography and electrocardiogram artifacts), requiring only a change in the corresponding training data and supervision signals. Similarly, this framework can also be applied to the enhancement and separation of other biological signals such as electrocardiogram (ECG) and electromyography (EMG).

[0096] This invention proposes a deep learning-based method for separating artifacts in EEG signals. This method eliminates the need for manual identification and screening of independent components, automatically separating artifacts directly from raw EEG signals. Compared to independent component analysis (ICA), which relies on human experience and rule-based settings, this deep learning-based method significantly lowers the barrier to entry and reduces manual costs, while improving the consistency and repeatability of processing results. It is more suitable for automated systems and large-scale data processing. Employing an end-to-end unified computing framework, it integrates the artifact separation process into a single model structure, avoiding the additional computational overhead of multi-stage, serial processing in traditional methods. It is suitable for efficient acceleration on parallel computing platforms such as GPUs, achieving higher throughput and lower latency under the same hardware conditions, effectively overcoming the slow processing speed and difficulty in meeting online requirements of ICA. It supports sliding window and streaming processing modes, allowing for flexible trade-offs between signal quality and response speed depending on the application scenario. Compared to ICA, which typically requires offline processing of the entire data segment, this invention is more suitable for applications requiring real-time performance and continuous output, such as auditory decoding and brain-computer interfaces.

[0097] In one embodiment of the present invention, the present invention also provides a brain electromagnetic signal artifact separation system based on deep learning. Figure 2 A schematic diagram of a deep learning-based brain electromagnetic signal artifact separation system according to an embodiment of the present invention is shown. Figure 2 As shown, the system includes the following modules:

[0098] Signal acquisition module 201 is configured to collect raw multi-channel brain electromagnetic signals;

[0099] Encoding module 202 is configured to perform feature extraction on the original multi-channel brain electromagnetic signal through an encoder to obtain encoded features;

[0100] The spatiotemporal modeling module 203 is configured to input the encoded features into a backbone model, which is based on a cross-transformer and performs joint modeling of the dependencies of the encoded features in the time dimension and the channel dimension through an attention mechanism.

[0101] The artifact feature generation module 204 is configured to generate synthetic artifact channel features based on the features output by the backbone model; and

[0102] The decoding output module 205 is configured to, based on the features output by the backbone model and the features of the synthetic artifact channel, reconstruct the signal through the decoder and simultaneously output the cleaned brain electromagnetic signal after removing artifacts and the corresponding artifact estimation signal.

[0103] In one embodiment of the present invention, an electronic device is also provided, comprising a processor, a graphics card, and a memory. The memory is configured to store machine-readable instructions, the graphics card is configured to train the deep learning-based brain electromagnetic signal artifact separation method, and the processor is configured to execute the machine-readable instructions. When the processor and / or graphics card executes the machine-readable instructions, the following processing steps are implemented: acquiring raw multi-channel brain electromagnetic signals; performing feature extraction on the raw multi-channel brain electromagnetic signals using an encoder to obtain encoded features; inputting the encoded features into a backbone model, the backbone model being based on a cross-transformer and performing joint modeling of the dependencies of the encoded features in the time and channel dimensions through an attention mechanism; generating synthetic artifact channel features based on the features output by the backbone model; and reconstructing the signal using a decoder based on the features output by the backbone model and the synthetic artifact channel features, simultaneously outputting the artifact-free brain electromagnetic signal and the corresponding artifact estimation signal.

[0104] The graphics card used can preferably be a model with a GPU computing power higher than 5.0. Since the amount of data to be trained is large, providing a graphics card configuration can significantly improve the training speed.

[0105] The memory includes various media capable of storing machine-readable instructions, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0106] It is understood that, in addition to the memory and processor mentioned above, the computer system described above also includes other hardware and software components not listed in this specification. The specific components can be determined according to the model of the specific data processing equipment in different application scenarios, and will not be listed and described in detail in this specification.

[0107] In one embodiment of the present invention, a computer-readable storage medium is also provided, on which machine-readable instructions are stored. When executed by a processor, the machine-readable instructions perform the following processing steps: acquiring raw multi-channel EEG signals; performing feature extraction on the raw multi-channel EEG signals using an encoder to obtain encoded features; inputting the encoded features into a backbone model, the backbone model being based on a cross-transformer and performing joint modeling of the dependencies of the encoded features in the time and channel dimensions through an attention mechanism; generating synthetic artifact channel features based on the features output by the backbone model; and reconstructing the signal using a decoder based on the features output by the backbone model and the synthetic artifact channel features, simultaneously outputting the artifact-free EEG signal and the corresponding artifact estimation signal.

[0108] Although various embodiments of the present invention have been described above, it should be understood that they are presented by way of example only and not as limitations. It will be apparent to those skilled in the art that various combinations, modifications, and alterations can be made without departing from the spirit and scope of the invention. Therefore, the breadth and scope of the invention disclosed herein should not be limited by the exemplary embodiments disclosed above, but should be defined according to the technical solutions of the invention and their equivalents.

Claims

1. A method for separating brain electromagnetic signal artifacts based on deep learning, characterized in that, Includes the following steps: Collect raw multichannel brain electromagnetic signals; The original multi-channel brain electromagnetic signals are subjected to feature extraction by an encoder to obtain encoded features; The encoded features are input into a backbone model, which is based on a cross-transformer and performs joint modeling of the dependencies of the encoded features in the time and channel dimensions through an attention mechanism. Based on the features output by the backbone model, synthetic artifact channel features are generated. as well as Based on the features output by the backbone model and the features of the synthetic artifact channel, the signal is reconstructed by the decoder, and the brain electromagnetic signal after artifact removal and the corresponding artifact estimation signal are output synchronously. The attention mechanism is a multi-head attention mechanism, where half of the attention heads are used to calculate self-attention in the channel dimension and the other half are used to calculate self-attention in the time dimension. The bulls' focus is on: Where h represents the index number of the attention head. Indicates the first The output of each attention head; Q represents the normalization function used to map attention weights to a probability distribution; Q represents the query matrix. Indicates the first The query projection weight matrix corresponding to each attention head, where K represents the key matrix. Indicates the first The key projection weight matrix corresponding to each attention head This represents the matrix transpose operation; Indicates the first The feature dimension of each attention head is used to scale the dot product result; V represents the value matrix. Indicates the first The values ​​corresponding to each attention head are projected onto the weight matrix; in, Indicates input features The output feature representation obtained after performing the cross-head attention mechanism. This indicates an operation that concatenates the outputs of multiple attention heads along the feature dimension. Indicates the 1st, 2nd, ..., ... The output of each attention head; in, for, Here, S-Attention means that the attention head performs computation in the channel direction, and T-Attention means that the attention head performs computation in the time direction.

2. The method according to claim 1, characterized in that, The backbone model includes multiple transformer layers, and the joint modeling includes: performing attention computation in the time dimension and attention computation in the channel dimension alternately or in parallel in the transformer layers.

3. The method according to claim 1, characterized in that, The generated synthetic artifact channel features include: The features output by the backbone model are aggregated along the channel dimension to obtain channel aggregated features; wherein, the aggregation operation includes average pooling or weighted averaging. The channel aggregation features are linearly transformed to generate the synthetic artifact channel features.

4. The method according to claim 1, characterized in that, The method supports online processing, including sliding window processing mode or streaming processing mode; The sliding window processing mode processes the input signal using a sliding window of fixed length. The streaming processing mode processes the input signal step by step using a causal attention mechanism.

5. The method according to claim 1, characterized in that, The method employs supervised learning training, with training objectives including: making the net brain electromagnetic signal approximate a reference signal averaged from multiple experiments, and making the artifact estimation signal approximate the real artifact signal acquired synchronously.

6. The method according to claim 1, characterized in that, The encoder includes a convolutional neural network; and / or The decoder includes a transposed convolutional neural network.

7. A deep learning-based brain electromagnetic signal artifact separation system, applied to the deep learning-based brain electromagnetic signal artifact separation method of claim 1, characterized in that, Includes the following modules: The signal acquisition module is configured to collect raw multichannel brain electromagnetic signals; The encoding module is configured to perform feature extraction on the original multichannel brain electromagnetic signal through an encoder to obtain encoded features; The spatiotemporal modeling module is configured to input the encoded features into a backbone model, which is based on a cross-transformer and performs joint modeling of the dependencies of the encoded features in the time and channel dimensions through an attention mechanism. The artifact feature generation module is configured to generate synthetic artifact channel features based on the features output by the backbone model; as well as The decoding output module is configured to, based on the features output by the backbone model and the features of the synthetic artifact channel, reconstruct the signal through the decoder and simultaneously output the cleaned brain electromagnetic signal after removing artifacts and the corresponding artifact estimation signal.

8. An electronic device, characterized in that, include: A processor, configured to execute machine-readable instructions; A graphics card configured to train the deep learning-based brain electromagnetic signal artifact separation method according to any one of claims 1-6; as well as A memory configured to store machine-readable instructions that, when executed by a processor and / or a graphics card, perform the steps of the deep learning-based brain electromagnetic signal artifact separation method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, It stores computer-readable instructions, which, when executed by a processor, perform the steps of the brain electromagnetic signal artifact separation method based on deep learning according to any one of claims 1-6.