EEG signal artifact removal, artifact removal model training method and device

By constructing the graph structure of EEG signals and training the artifact removal model, the problem of poor artifact removal of EEG signals in the prior art is solved, and higher accuracy and smoothness are achieved.

CN117251774BActive Publication Date: 2025-04-25COMP APPL TECH INST OF CHINA NORTH IND GRP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311049672.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-18
Publication Date
2025-04-25
Estimated Expiration
2043-08-18

AI Technical Summary

Technical Problem

The prior art has poor effect in removing artifacts of EEG signals, making it difficult to effectively identify and remove artifact signals.

Method used

By constructing the graph structure of the EEG signal, using the intra-class edge matrix and the inter-class edge matrix, the artifact removal model is trained, and the model parameters are updated to remove the artifact signal.

Benefits of technology

The accuracy of eEEG signals is improved, so that EEG signals of the same type are close to each other, and EEG signals of different types are mutually repelling each other, with good smoothness, so that clean signals and artifact signals can be accurately separated.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117251774B_ABST
    Figure CN117251774B_ABST
Patent Text Reader

Abstract

The disclosed embodiment of the present invention discloses a method and device for removing artifacts from EEG signals and training an artifact removal model. The method includes: obtaining an EEG signal to be processed; obtaining a trained artifact removal model; and performing artifact removal on the EEG signal to be processed according to the trained artifact removal model to obtain a clean signal in the EEG signal to be processed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of electroencephalogram (EEG) signal processing, and more specifically, to an EEG signal artifact removal and an artifact removal model training method and device. Background Art

[0002] Electroencephalogram (EEG) is a biopotential generated by electrical activity inside the human brain. In related technologies, artifacts are usually identified using time domain features or frequency domain features in the EEG, and then the artifacts are removed using a specific algorithm. However, the artifact removal effect based on this artifact removal method is not good. Summary of the invention

[0003] The disclosed embodiments provide a method and device for removing artifacts from electroencephalogram signals and training an artifact removal model.

[0004] According to a first aspect of the present disclosure, a method for removing artifacts from an electroencephalogram signal is provided, the method comprising:

[0005] Obtaining the EEG signal to be processed;

[0006] Obtain the trained artifact removal model;

[0007] According to the trained artifact removal model, performing artifact removal on the EEG signal to be processed to obtain a clean signal in the EEG signal to be processed;

[0008] The training method of the artifact removal model includes:

[0009] Acquire a sample EEG signal and labeling information of the sample EEG signal; wherein the labeling information of the sample EEG signal includes a clean signal in the sample EEG signal;

[0010] Constructing a graph structure of the sample EEG signals; wherein the nodes of the graph structure are the signal strengths corresponding to the respective EEG signals in the sample EEG signals, the edges between any two nodes in the graph structure are determined based on an intra-class edge matrix or an inter-class edge matrix, and the weights corresponding to the edges between any two nodes constitute an intra-class edge matrix or an inter-class edge matrix;

[0011] Constructing a first loss according to the intra-class edge matrix, the intra-class weight matrix, the inter-class weight matrix, a clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained, and the labeling information of the sample EEG signal;

[0012] Model parameters of the artifact removal model to be trained are updated based on the first loss.

[0013] Optionally, obtaining a sample EEG signal includes:

[0014] Collecting EEG signals of the target object when it sequentially executes the states involved in the preset rules as the sample EEG signals;

[0015] The preset rules at least involve the following states in sequence: resting state, frowning state, resting state, clenching teeth state, resting state, and eye movement state.

[0016] Optionally, constructing the graph structure of the sample EEG signal includes:

[0017] Using the signal strength corresponding to each EEG signal in the sample EEG signal as a node of the graph structure;

[0018] Randomly shuffle each EEG signal in the sample EEG signal to obtain the shuffled sample EEG signal;

[0019] Based on the K-nearest neighbor algorithm, determine the EEG signal set corresponding to each EEG signal in the shuffled sample EEG signal; wherein the EEG signal set includes K EEG signals;

[0020] According to the EEG signal sets corresponding to the EEG signals, a first subsequence and a second subsequence corresponding to the EEG signals are constructed; wherein the EEG signals included in the first subsequence corresponding to any EEG signal are of the same signal type as the arbitrary EEG signal, and the EEG signals included in the second subsequence corresponding to the arbitrary EEG signal are of different signal type from the arbitrary EEG signal;

[0021] According to the first subsequences corresponding to the respective EEG signals, the intra-class edge matrix is ​​obtained, and according to the second subsequences corresponding to the respective EEG signals, the inter-class edge matrix is ​​obtained;

[0022] According to the intra-class edge matrix, when it is determined that there is an intra-class edge between the arbitrary two nodes, the intra-class edge between the arbitrary two nodes is used as the edge between the arbitrary two nodes; and according to the inter-class edge matrix, when it is determined that there is an inter-class edge between the arbitrary two nodes, the inter-class edge between the arbitrary two nodes is used as the edge between the arbitrary two nodes;

[0023] In the case where there is an intra-class edge or an inter-class edge between the arbitrary two nodes, the distance between the arbitrary two nodes is used as the weight corresponding to the intra-class edge or the inter-class edge between the arbitrary two nodes.

[0024] Optionally, constructing a first loss according to the intra-class edge matrix, the intra-class weight matrix, the inter-class weight matrix, a clean signal of the sample EEG signal after artifacts are removed output by the artifact removal model to be trained, and the labeling information of the sample EEG signal comprises:

[0025] Constructing a second loss according to the intra-class weight matrix, the labeling information of the sample EEG signal, and a clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained;

[0026] Constructing a third loss according to the inter-class weight matrix, the labeling information of the sample EEG signal, and a clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained;

[0027] Determine an intra-class Laplacian matrix according to the intra-class edge matrix;

[0028] Constructing a fourth loss according to the intra-class Laplacian matrix and a clean signal after removing artifacts from the sample EEG signal output by the artifact removal model to be trained;

[0029] The first loss is constructed according to the second loss, the third loss and the fourth loss.

[0030] Optionally, determining the intra-class Laplacian matrix according to the intra-class edge matrix includes:

[0031] Obtaining the sum of each row of the intra-class edge matrix;

[0032] Copying the intra-class edge matrix to obtain the copied intra-class edge matrix;

[0033] The sum of the values ​​of each row of the intra-class edge matrix is ​​used as the value of the main diagonal in the corresponding row of the copied intra-class edge matrix; and

[0034] The values ​​of the copied intra-class edge matrix at positions other than the main diagonal are set to zero to obtain an intra-class degree matrix;

[0035] The intra-class Laplacian matrix is ​​obtained according to the intra-class degree matrix and the intra-class edge matrix.

[0036] According to a second aspect of the present disclosure, a method for training an EEG signal artifact removal model is provided, the method comprising:

[0037] Acquire a sample EEG signal and labeling information of the sample EEG signal; wherein the labeling information of the sample EEG signal includes a clean signal in the sample EEG signal;

[0038] Constructing a graph structure of the sample EEG signals; wherein the nodes of the graph structure are the signal strengths corresponding to the respective EEG signals in the sample EEG signals, the edges between any two nodes in the graph structure are determined based on an intra-class edge matrix or an inter-class edge matrix, and the weights corresponding to the edges between any two nodes constitute an intra-class edge matrix or an inter-class edge matrix;

[0039] Constructing a first loss according to the intra-class edge matrix, the intra-class weight matrix, the inter-class weight matrix, a clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained, and the labeling information of the sample EEG signal;

[0040] Model parameters of the artifact removal model to be trained are updated based on the first loss.

[0041] According to a fourth aspect of the present disclosure, there is provided a device for removing artifacts of an electroencephalogram signal, the device comprising:

[0042] A first acquisition module is used to acquire the EEG signal to be processed;

[0043] A second acquisition module is used to acquire the trained artifact removal model;

[0044] A processing module, used for performing artifact removal on the EEG signal to be processed according to the trained artifact removal model to obtain a clean signal in the EEG signal to be processed;

[0045] A training module, used to obtain sample EEG signals and labeling information of the sample EEG signals; wherein the labeling information of the sample EEG signals includes clean signals in the sample EEG signals;

[0046] Constructing a graph structure of the sample EEG signals; wherein the nodes of the graph structure are the signal strengths corresponding to the respective EEG signals in the sample EEG signals, the edges between any two nodes in the graph structure are determined based on an intra-class edge matrix or an inter-class edge matrix, and the weights corresponding to the edges between any two nodes constitute an intra-class edge matrix or an inter-class edge matrix;

[0047] Constructing a first loss according to the intra-class edge matrix, the intra-class weight matrix, the inter-class weight matrix, a clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained, and the labeling information of the sample EEG signal;

[0048] Model parameters of the artifact removal model to be trained are updated based on the first loss.

[0049] According to a fifth aspect of the present disclosure, a training device for an EEG signal artifact removal model is provided, the device comprising:

[0050] A third acquisition module is used to acquire a sample EEG signal and labeling information of the sample EEG signal; wherein the labeling information of the sample EEG signal includes a clean signal in the sample EEG signal;

[0051] A first construction module is used to construct a graph structure of the sample EEG signals; wherein the nodes of the graph structure are the signal strengths corresponding to the respective EEG signals in the sample EEG signals, the edges between any two nodes in the graph structure are determined based on an intra-class edge matrix or an inter-class edge matrix, and the weights corresponding to the edges between any two nodes constitute an intra-class edge matrix or an inter-class edge matrix;

[0052] A second construction module is used to construct a first loss according to the intra-class edge matrix, the intra-class weight matrix, the inter-class weight matrix, a clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained, and the labeling information of the sample EEG signal;

[0053] An updating module is used to update model parameters of the artifact removal model to be trained based on the first loss.

[0054] According to a sixth aspect of the present disclosure, an electronic device is provided, comprising a memory for storing executable computer instructions; and a processor for executing, under the control of the executable computer instructions, the method for removing EEG signal artifacts according to the first aspect or the training method for the EEG signal artifact removal model according to the second aspect.

[0055] According to a seventh aspect of the present disclosure, a computer-readable storage medium is provided, on which computer instructions are stored. When the computer instructions are executed by a processor, the method for removing EEG signal artifacts described in the first aspect or the method for training an EEG signal artifact removal model described in the second aspect is executed.

[0056] According to the EEG signal artifact removal method of the disclosed embodiment, the artifact removal is performed on the EEG signal to be processed according to the trained artifact removal model, so as to obtain the clean signal in the EEG signal to be processed. Since the first loss when training the artifact removal model is constructed based on the intra-class edge matrix, the intra-class weight matrix and the inter-class weight matrix, the EEG signals of the same type in the EEG signal can be close to each other, and the EEG signals of different types can be mutually repelled, and the smoothness is very good, so the clean signal and the artifact signal in the EEG signal can be accurately separated. Therefore, when the artifact removal is performed on the EEG signal to be processed based on the trained artifact removal model, the accuracy of the EEG signal artifact removal can be improved.

[0057] Other features and advantages of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0059] Figure 1 is a schematic diagram of the hardware configuration of a system for removing artifacts from EEG signals and training an artifact removal model according to an embodiment of the present disclosure;

[0060] Figure 2 is a flowchart of a method for removing artifacts from an EEG signal according to an embodiment of the present disclosure;

[0061] Figure 3 is a flowchart of a method for training an EEG signal artifact removal model according to an embodiment of the present disclosure;

[0062] Figure 4 is a principle block diagram of a device for removing artifacts from an EEG signal according to an embodiment of the present disclosure;

[0063] Figure 5 is a principle block diagram of a training device for an EEG signal artifact removal model according to an embodiment of the present disclosure;

[0064] Figure 6 is a schematic diagram of the hardware configuration of an electronic device according to another embodiment of the present disclosure. DETAILED DESCRIPTION

[0065] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.

[0066] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.

[0067] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.

[0068] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0069] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0070] <Hardware Configuration>

[0071] Figure 1 4 is a block diagram of the hardware configuration of the system 100 for removing artifacts from EEG signals and training an artifact removal model according to an embodiment of the present disclosure.

[0072] according to Figure 1 As shown, the system 100 for training EEG signal artifact removal and artifact removal model includes an EEG signal acquisition device 1000 and an electronic device 2000. The EEG signal acquisition device 1000 may be a single-channel EEG signal acquisition device, which is used to acquire sample EEG signals or EEG signals to be processed, and send the sample EEG signals or EEG signals to be processed to the electronic device 2000. The electronic device 2000 receives the sample EEG signals or the EEG signals to be processed, and trains the artifact removal model to be trained according to the sample EEG signals to obtain the trained artifact removal model; or when the trained artifact removal model is stored in the electronic device 2000, the electronic device 2000 performs artifact removal on the EEG signals to be processed according to the trained artifact removal model to obtain a clean signal in the EEG signals to be processed.

[0073] In one embodiment, the electronic device 2000 may be a server or a terminal device. The server may be an integrated server or a distributed server across multiple computers or computer data centers. The terminal device may be a portable computer, a desktop computer, a wearable device, or any other device having a computing device such as a processor and a storage device such as a memory, which is not limited in this embodiment.

[0074] like Figure 1 As shown, the electronic device 2000 may include a processor 2100, a memory 2200, an interface device 2300, a communication device 2400, a display device 2500, an input device 2600, a speaker 2700, a microphone 2800, and the like.

[0075] The processor 2100 may be a mobile version processor. The memory 2200 may include, for example, a ROM (read-only memory), a RAM (random access memory), a non-volatile memory such as a hard disk, etc. The interface device 2300 may include, for example, a USB interface, a headphone interface, etc. The communication device 2400 may, for example, be capable of wired or wireless communication. The communication device 2400 may include a short-range communication device, for example, any device for short-range wireless communication based on short-range wireless communication protocols such as Hilink protocol, WiFi (IEEE 802.11 protocol), Mesh, Bluetooth, ZigBee, Thread, Z-Wave, NFC, UWB, LiFi, etc. The communication device 2400 may also include a remote communication device, for example, any device for WLAN, GPRS, 2G / 3G / 4G / 5G remote communication. The display device 2500 may be, for example, a liquid crystal display, a touch display, etc. The input device 2600 may include, for example, a touch screen, a keyboard, etc. The terminal device 2000 may output audio information through a speaker 2700, and may collect audio information through a microphone 2800.

[0076] Despite Figure 1 In the figure, multiple devices are shown for the electronic device 2000, but the present disclosure may only involve some of the devices, for example, the electronic device 2000 only involves the memory 2200 and the processor 2100.

[0077] In the embodiment of the present disclosure, the memory 2200 of the electronic device 2000 is used to store instructions, which are used to control the processor 2100 to execute the EEG signal artifact removal method or the EEG signal artifact removal model training method provided in the embodiment of the present disclosure.

[0078] In the above description, the technician can design instructions according to the scheme disclosed in the present disclosure. How instructions control the processor to operate is well known in the art, so it will not be described in detail here.

[0079] The network 3000 may be a wireless communication network or a wired communication network, and may be a local area network or a wide area network. Figure 1 In the EEG signal artifact removal and artifact removal model training system 100 shown, the EEG signal acquisition device 1000 and the electronic device 2000 can communicate through the network 3000.

[0080] It should be understood that although Figure 1 Only one EEG signal acquisition device 1000 and electronic device 2000 are shown, but this does not mean that their respective numbers are limited. The EEG signal artifact removal and artifact removal model training system 100 may include multiple EEG signal acquisition devices 1000 and multiple electronic devices 2000.

[0081] <Method Example 1>

[0082] In this embodiment, a method for removing artifacts from an electroencephalogram signal is provided. The method for removing artifacts from an electroencephalogram signal can be implemented by an electronic device, and the electronic device can be, for example, Figure 1 An electronic device 2000 is shown.

[0083] according to Figure 2 As shown, the method for removing EEG signal artifacts in the embodiment of the present disclosure may include the following steps S2100 to S2300.

[0084] Step S2100, obtaining the electroencephalogram signal to be processed.

[0085] The EEG signal to be processed may be a single-channel EEG signal of any user collected by an EEG signal collection device, and the EEG signal to be processed includes a clean signal of the user in a resting state, and an artifact signal other than the clean signal. The artifact signal may be referred to as a noise signal, and the artifact signal may include, for example but not limited to, electromagnetic waves outside the human body, the body electricity and activity current of the human body itself, and stray magnetic fields.

[0086] It should be noted that artifact signals will interfere with the acquisition and transmission of clean signals in EEG signals. Therefore, it is crucial to remove artifact signals in EEG signals.

[0087] After obtaining the EEG signal to be processed, enter:

[0088] Step S2200, obtaining the trained artifact removal model.

[0089] The trained artifact removal model is used to perform artifact removal processing on the EEG signal to be processed, thereby obtaining a clean signal in the EEG signal to be processed. That is, the input of the trained artifact removal model is the EEG signal to be processed, and the output is a clean signal in the EEG signal to be processed. Usually, the trained artifact removal model is pre-trained and stored in an electronic device.

[0090] In an optional embodiment, the training method of the artifact removal model includes the following steps S3100 to S3400:

[0091] Step S3100, obtaining sample EEG signals and annotation information of the sample EEG signals.

[0092] The labeling information of the sample EEG signal includes the clean signal in the sample EEG signal. The labeling signal of the sample EEG signal may also include the artifact signal in the sample EEG signal.

[0093] In this embodiment, the electronic device can collect the EEG signals of the target object when it sequentially executes the states involved in the preset rules as sample EEG signals. The preset rules at least sequentially involve the following states: resting state, frowning state, resting state, clenching teeth state, resting state, and eye movement state.

[0094] For example, 20 target subjects are recruited in advance, including 12 male subjects and 8 female subjects, aged between 21 and 27 years old, and none of the target subjects have a history of mental illness or use of psychiatric drugs. In addition, the target subjects sign an informed consent form after learning the experimental process in detail. Through the human intervention experiment, different sample EEG signals are obtained. The experimental process is as follows:

[0095] (1) Resting state: the target subjects were asked to maintain resting state with eyes open and eyes closed for 90 seconds each through voice prompts;

[0096] (2) Frowning state: through voice prompts, the target subject is instructed to frown and relax alternately while keeping eyes open or closed. The prompt voice uses pre-recorded "frown" and "relax" human voices. Each frowning action is maintained for 3-5 seconds, and the total number is 20;

[0097] (3) Resting state: the target subjects were asked to maintain resting state with eyes open and eyes closed for 90 seconds each through voice prompts;

[0098] (4) Teeth clenching state: through voice prompts, the target subject is instructed to perform intermittent teeth clenching and relaxation actions while keeping eyes open or closed. The prompt voice uses pre-recorded "teeth clenching" and "relaxation" human voices. The duration of each teeth clenching action is 3-5 seconds, and the total number is 20;

[0099] (5) Resting state: the target subjects were asked to maintain resting state with eyes open and eyes closed for 90 seconds each through voice prompts;

[0100] (6) Eye movement state: through voice prompts, the target subject is asked to keep the head still and move the eyeballs with the light spot on the screen. After hearing the voice prompt, close the eyes and wait for the next voice prompt. The prompt voice uses the pre-recorded "eye movement" and "eyes closed" human voice. The movement process lasts for 3-5 seconds, and the total number is 20.

[0101] In this embodiment, after acquiring the sample EEG signals, the electronic device may label the sample EEG signals, wherein the EEG signals in a resting state are clean signals, and other signals are artifact signals.

[0102] In this embodiment, after collecting the sample EEG signal, the electronic device can evaluate whether the signal power spectrum of the sample EEG signal conforms to the power-law distribution by fitting. If it conforms to the power-law distribution, the signal quality of the sample EEG signal is obtained, and the EEG signals with poor signal quality in the sample EEG signal are eliminated.

[0103] Step S3200, constructing a graph structure of the sample EEG signal.

[0104] Among them, the nodes of the graph structure are the signal strengths corresponding to each EEG signal in the sample EEG signals, the edges between any two nodes in the graph structure are determined based on the intra-class edge matrix or the inter-class edge matrix, and the weights corresponding to the edges between any two nodes constitute the intra-class edge matrix or the inter-class edge matrix.

[0105] Optionally, step S3200 of constructing the graph structure of the sample EEG signal may further include the following steps S3210 to S3270:

[0106] Step S3210: Using the signal strength corresponding to each EEG signal in the sample EEG signals as a node of the graph structure.

[0107] In this step S3210, the electronic device may use the signal strengths of the EEG signals at different times in the sample EEG signals as nodes of the graph structure.

[0108] Step S3220: randomly shuffle each EEG signal in the sample EEG signal to obtain the shuffled sample EEG signal.

[0109] It should be noted that in order to construct the edges of the graph structure, the electronic device needs to determine which nodes are connected.

[0110] In this step S3220, the electronic device randomly shuffles each EEG signal in the sample EEG signal. Different shuffling methods will produce different results. This process can greatly increase the number of training samples to facilitate the construction of the subsequent artifact removal model. The artifact removal model constructed in this way has better robustness.

[0111] Step S3230: Based on the K-nearest neighbor algorithm, determine the EEG signal sets corresponding to each EEG signal in the shuffled sample EEG signal.

[0112] The EEG signal set includes K EEG signals.

[0113] In this step S3230, it is assumed that x i represents the EEG signal at time i in the scrambled sample EEG signal. The electronic device determines the EEG signal x at time i based on the K nearest neighbor algorithm. iThe most recent K EEG signals constitute the EEG signal x at time i i Corresponding EEG signal set The present disclosure constructs a graph structure through a K-nearest neighbor algorithm, which can better select EEG signals of the same type and different types within a neighborhood.

[0114] Step S3240: constructing first subsequences and second subsequences corresponding to the respective EEG signals according to the EEG signal sets corresponding to the respective EEG signals.

[0115] The EEG signals included in the first subsequence corresponding to any EEG signal are of the same signal type as the any EEG signal, and the EEG signals included in the second subsequence corresponding to any EEG signal are of a different signal type from the any EEG signal.

[0116] It should be noted that the signal types of the EEG signals corresponding to any two nodes may be the same, and the EEG signals corresponding to any two nodes may be both clean signals in the sample EEG signals, or both artifact signals in the sample EEG signals. The signal types of the EEG signals corresponding to any two nodes may be different, and the EEG signal corresponding to one node may be a clean signal in the sample EEG signals, and the EEG signal corresponding to the other node may be an artifact signal in the sample EEG signals.

[0117] In step S3240, the electronic device constructs two disjoint first and second subsequences for the EEG signal sets corresponding to each EEG signal. i The first subsequence corresponding to Represents the EEG signal x i The K nearest neighbor EEG signal set and the EEG signal x i A sequence of EEG signals of the same category. For example, EEG signal x i The corresponding second subsequence Represents the EEG signal x i The K nearest neighbor EEG signal set and the EEG signal x i A sequence composed of different types of EEG signals.

[0118] Step S3250: obtaining an intra-class edge matrix according to the first subsequences corresponding to the respective EEG signals, and obtaining an inter-class edge matrix according to the second subsequences corresponding to the respective EEG signals.

[0119] In step S3250, the electronic device will generate a signal according to the first subsequence n corresponding to each EEG signal. w (x i ), construct the intra-class edge matrix And the second subsequence n corresponding to each EEG signal b (xi ), construct the inter-class edge matrix

[0120] Step S3260: According to the intra-class edge matrix, when it is determined that there is an intra-class edge between any two nodes, the intra-class edge between the any two nodes is used as the edge between the any two nodes; and according to the inter-class edge matrix, when it is determined that there is an inter-class edge between the any two nodes, the inter-class edge between the any two nodes is used as the edge between the any two nodes.

[0121] Step S3270: When there is an intra-class edge or an inter-class edge between the arbitrary two nodes, the distance between the arbitrary two nodes is used as the weight corresponding to the intra-class edge or the inter-class edge between the arbitrary two nodes.

[0122] In this step S3270, the EEG signal x at time i in the disrupted sample EEG signal i The signal strength is y i , when there is an edge between any two nodes in the graph structure, the distance between the EEG signals corresponding to the two nodes is used to represent the weight corresponding to the edge, that is, When there is no edge between any two nodes in the graph structure, the weight is 0. In this way, the electronic device can obtain the intra-class weight matrix W w and the inter-class weight matrix W b .

[0123] Step S3300, constructing a first loss according to the intra-class edge matrix, the intra-class weight matrix, the inter-class weight matrix, the clean signal of the sample EEG signal after artifacts are removed output by the artifact removal model to be trained, and the annotation information of the sample EEG signal.

[0124] Optionally, this step S3300 may further include the following steps S3310 to S3350 to construct the first loss according to the intra-class edge matrix, the intra-class weight matrix, the inter-class weight matrix, the clean signal of the sample EEG signal after artifacts are removed output by the artifact removal model to be trained, and the annotation information of the sample EEG signal:

[0125] Step S3310, constructing a second loss according to the intra-class weight matrix, the labeling information of the sample EEG signal, and the clean signal of the sample EEG signal after artifacts are removed, which is output by the artifact removal model to be trained.

[0126] It should be noted that the second loss L1 is usually constructed based on data fidelity, and the smaller the second loss L1 is, the better the artifact removal effect is.

[0127] In this step S3310, the second loss L1 satisfies the following formula (1):

[0128]

[0129] Among them, W w represents the intra-class weight matrix, z represents the clean signal of the sample EEG signal output by the artifact removal model to be trained after removing the artifacts, and y represents the clean signal in the sample EEG signal.

[0130] Step S3320, constructing a third loss according to the inter-class weight matrix, the labeling information of the sample EEG signal, and the clean signal of the sample EEG signal after artifacts are removed, which is output by the artifact removal model to be trained.

[0131] It should be noted that after removing the artifacts, the inter-class weight matrix W b The difference will become larger, therefore, a second loss L2 can be constructed based on the data difference. The smaller the second loss L2 is, the more obvious the artifact removal effect is.

[0132] In this step S3320, the third loss L2 satisfies the following formula (2):

[0133]

[0134] Among them, W b represents the inter-class weight matrix, z represents the clean signal of the sample EEG signal output by the artifact removal model to be trained after removing the artifacts, and y represents the clean signal in the sample EEG signal.

[0135] Step S3330: Determine the intra-class Laplacian matrix according to the intra-class edge matrix.

[0136] Optionally, the step S3330 of determining the intra-class Laplacian matrix according to the intra-class edge matrix may further include: obtaining the intra-class edge matrix The sum of the values ​​of each row of ; copy the edge matrix within the class Obtain the copied intra-class edge matrix; The sum of the values ​​of each row of is taken as the value of the main diagonal in the corresponding row of the copied intra-class edge matrix; and the values ​​of other positions of the copied intra-class edge matrix except the main diagonal are set to zero to obtain the intra-class degree matrix D w According to the intra-class degree matrix D w and the intra-class edge matrix Get the Laplace matrix L within the class w .

[0137] Specifically, the intra-class Laplacian matrix L w Satisfies the following formula (3):

[0138]

[0139] Among them, D w is the intra-class degree matrix, is the intra-class edge matrix.

[0140] It should be noted that, based on the same method, the electronic device can obtain the inter-class Laplace matrix L b Specifically, get the inter-class edge matrix The sum of the values ​​in each row of ; copy the edge matrix between classes Obtain the copied inter-class edge matrix; take the sum of the values ​​of each row of the inter-class edge matrix as the value of the main diagonal in the copied inter-class edge matrix in the corresponding row; and set the values ​​of other positions of the copied inter-class edge matrix except the main diagonal to zero to obtain the inter-class degree matrix D b ; According to the inter-class degree matrix D b and the inter-class edge matrix Get the inter-class Laplace matrix L b .

[0141] Specifically, the inter-class Laplacian matrix L b Satisfies the following formula (4):

[0142]

[0143] Among them, D b is the inter-class degree matrix, is the inter-class edge matrix.

[0144] Step S3340, constructing a fourth loss according to the intra-class Laplacian matrix and the clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained.

[0145] It should be noted that in order to obtain a smoother z as the optimal solution, the electronic device needs to construct a fourth loss, that is, a smoothness loss function. The smaller the fourth loss, the smoother z.

[0146] In this step S3340, the fourth loss L3 satisfies the following formula (5):

[0147] L3=z T L w z (5)

[0148] Where z is the clean signal after removing artifacts from the sample EEG signal output by the artifact removal model to be trained, and L w is the intra-class Laplacian matrix.

[0149] Step S3350: construct the first loss according to the second loss, the third loss and the fourth loss.

[0150] In this step S3350, the first loss satisfies the following formula (6):

[0151]

[0152] Step S3400: updating the model parameters of the artifact removal model to be trained based on the first loss.

[0153] Specifically, the electronic device obtains the optimal solution by calculating the first loss gradient. First, the derivative of E(z) with respect to the variable z is calculated:

[0154]

[0155] Setting the derivative to 0, we get:

[0156]

[0157] At the same time, considering the intra-class weight matrix W w and the inter-class weight matrix W b The time complexity of inversion is too high, so the gradient descent method is used to solve it, namely:

[0158]

[0159] Among them, μ k Represents the step size of each update of the gradient descent method.

[0160] That is to say, the present disclosure can directly obtain a clean signal after removing artifacts by optimizing the function.

[0161] According to the method of the embodiment of the present disclosure, artifacts are removed from the EEG signal to be processed based on the trained artifact removal model, so as to obtain a clean signal in the EEG signal to be processed. Since the first loss when training the artifact removal model is constructed based on the intra-class edge matrix, the intra-class weight matrix and the inter-class weight matrix, EEG signals of the same type in the EEG signal can be close to each other, and EEG signals of different types can repel each other, and the smoothness is very good, so the clean signal and the artifact signal in the EEG signal can be accurately separated. Therefore, when artifacts are removed from the EEG signal to be processed based on the trained artifact removal model, the accuracy of artifact removal of the EEG signal can be improved.

[0162] <Method Example 2>

[0163] In this embodiment, a training method for an EEG signal artifact removal model is provided. The training method for an EEG signal artifact removal model can be implemented by an electronic device, and the electronic device can be as follows: Figure 1 An electronic device 2000 is shown.

[0164] according to Figure 3 As shown, the training method of the EEG signal artifact removal model in the embodiment of the present disclosure may include the following steps S4100 to S4400.

[0165] Step S4100, obtaining a sample EEG signal and labeling information of the sample EEG signal; wherein the labeling information of the sample EEG signal includes a clean signal in the sample EEG signal.

[0166] Step S4200, constructing a graph structure of the sample EEG signals; wherein the nodes of the graph structure are the signal strengths corresponding to each EEG signal in the sample EEG signals, and the edges between any two nodes in the graph structure are determined based on an intra-class edge matrix or an inter-class edge matrix, and the weights corresponding to the edges between any two nodes constitute an intra-class edge matrix or an inter-class edge matrix.

[0167] Step S4300, constructing a first loss according to the intra-class edge matrix, the intra-class weight matrix, the inter-class weight matrix, the clean signal of the sample EEG signal after artifacts are removed output by the artifact removal model to be trained, and the annotation information of the sample EEG signal.

[0168] Step S4400: updating model parameters of the artifact removal model to be trained based on the first loss.

[0169] According to the embodiment of the present disclosure, the first loss when training the artifact removal model is constructed based on the intra-class edge matrix, the intra-class weight matrix and the inter-class weight matrix. In this way, EEG signals of the same type in the EEG signals can be close to each other, and EEG signals of different types can repel each other, and the smoothness is very good, and the clean signals and artifact signals in the EEG signals can be accurately separated. Then, when the artifact removal is performed on the EEG signals to be processed based on the trained artifact removal model, the accuracy of the EEG signal artifact removal can be improved.

[0170] <Device Example 1>

[0171] In this embodiment, a device 4000 for removing artifacts from an electroencephalogram signal is provided. Figure 4 As shown, the EEG signal artifact removal device 4000 may include a first acquisition module 4100 , a second acquisition module 4200 , a processing module 4300 and a training module 4400 .

[0172] A first acquisition module 4100 is used to acquire the EEG signal to be processed;

[0173] The second acquisition module 4200 is used to acquire the trained artifact removal model;

[0174] The processing module 4300 is used to perform artifact removal on the EEG signal to be processed according to the trained artifact removal model to obtain a clean signal in the EEG signal to be processed;

[0175] Training module 4400 is used to obtain sample EEG signals and annotation information of the sample EEG signals; wherein the annotation information of the sample EEG signals includes clean signals in the sample EEG signals; construct a graph structure of the sample EEG signals; wherein the nodes of the graph structure are the signal strengths corresponding to each EEG signal in the sample EEG signals, and the edges between any two nodes in the graph structure are determined based on an intra-class edge matrix or an inter-class edge matrix, and the weights corresponding to the edges between any two nodes constitute an intra-class edge matrix or an inter-class edge matrix; construct a first loss based on the intra-class edge matrix, the intra-class weight matrix, the inter-class weight matrix, the clean signal of the sample EEG signal after artifacts are removed output by the artifact removal model to be trained, and the annotation information of the sample EEG signal; and update the model parameters of the artifact removal model to be trained based on the first loss.

[0176] In one embodiment, the training module 4400 is specifically used to: collect EEG signals when the target object executes the states involved in the preset rules in sequence, as the sample EEG signals; wherein the preset rules at least involve the following states in sequence: resting state, frowning state, resting state, clenching teeth state, resting state, and eye movement state.

[0177] In one embodiment, the training module 4400 is specifically used to: use the signal strength corresponding to each EEG signal in the sample EEG signal as a node of the graph structure; randomly shuffle each EEG signal in the sample EEG signal to obtain the shuffled sample EEG signal; based on the K-nearest neighbor algorithm, determine the EEG signal set corresponding to each EEG signal in the shuffled sample EEG signal; wherein the EEG signal set includes K EEG signals; according to the EEG signal sets corresponding to each EEG signal, construct a first subsequence and a second subsequence corresponding to each EEG signal; wherein the EEG signal included in the first subsequence corresponding to any EEG signal is of the same signal type as the arbitrary EEG signal, and the EEG signal included in the second subsequence corresponding to any EEG signal is of the same signal type as the arbitrary EEG signal. The signal types of the electrical signals are different; according to the first subsequences corresponding to each EEG signal, the intra-class edge matrix is ​​obtained, and according to the second subsequences corresponding to each EEG signal, the inter-class edge matrix is ​​obtained; according to the intra-class edge matrix, when it is determined that there is an intra-class edge between any two nodes, the intra-class edge between the any two nodes is used as the edge between the any two nodes, and according to the inter-class edge matrix, when it is determined that there is an inter-class edge between any two nodes, the inter-class edge between the any two nodes is used as the edge between the any two nodes; when there is an intra-class edge or an inter-class edge between any two nodes, the distance between the any two nodes is used as the weight corresponding to the intra-class edge or the inter-class edge between the any two nodes.

[0178] In one embodiment, the training module 4400 is specifically used to: construct a second loss according to the intra-class weight matrix, the annotation information of the sample EEG signal and the clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained; construct a third loss according to the inter-class weight matrix, the annotation information of the sample EEG signal and the clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained; determine the intra-class Laplace matrix according to the intra-class edge matrix; construct a fourth loss according to the intra-class Laplace matrix and the clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained; construct the first loss according to the second loss, the third loss and the fourth loss.

[0179] Optionally, the training module 4400 is specifically used to: obtain the sum of the values ​​of each row of the intra-class edge matrix; copy the intra-class edge matrix to obtain the copied intra-class edge matrix; use the sum of the values ​​of each row of the intra-class edge matrix as the value of the main diagonal in the copied intra-class edge matrix in the corresponding row; and set the values ​​of other positions of the copied intra-class edge matrix except the main diagonal to zero to obtain the intra-class degree matrix; and obtain the intra-class Laplace matrix based on the intra-class degree matrix and the intra-class edge matrix.

[0180] According to this embodiment, artifacts are removed from the EEG signal to be processed based on the trained artifact removal model, so as to obtain clean signals in the EEG signal to be processed. Since the first loss when training the artifact removal model is constructed based on the intra-class edge matrix, the intra-class weight matrix and the inter-class weight matrix, EEG signals of the same type in the EEG signal can be close to each other, and EEG signals of different types can repel each other, and the smoothness is very good, so the clean signal and the artifact signal in the EEG signal can be accurately separated. Therefore, when artifacts are removed from the EEG signal to be processed based on the trained artifact removal model, the accuracy of artifact removal of the EEG signal can be improved.

[0181] <Device Example 2>

[0182] In this embodiment, a training device 5000 for an EEG signal artifact removal model is provided. Figure 5 As shown, the training device 5000 for the EEG signal artifact removal model may include a third acquisition module 5100 , a first construction module 5200 , a second construction module 5300 and an update module 5400 .

[0183] The third acquisition module 5100 is used to acquire a sample EEG signal and labeling information of the sample EEG signal; wherein the labeling information of the sample EEG signal includes a clean signal in the sample EEG signal;

[0184] A first construction module 5200 is used to construct a graph structure of the sample EEG signals; wherein the nodes of the graph structure are the signal strengths corresponding to the respective EEG signals in the sample EEG signals, the edges between any two nodes in the graph structure are determined based on an intra-class edge matrix or an inter-class edge matrix, and the weights corresponding to the edges between any two nodes constitute an intra-class edge matrix or an inter-class edge matrix;

[0185] A second construction module 5300 is used to construct a first loss according to the intra-class edge matrix, the intra-class weight matrix, the inter-class weight matrix, a clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained, and the labeling information of the sample EEG signal;

[0186] The updating module 5400 is used to update the model parameters of the artifact removal model to be trained based on the first loss.

[0187] According to this embodiment, the first loss when training the artifact removal model is constructed based on the intra-class edge matrix, the intra-class weight matrix and the inter-class weight matrix. In this way, EEG signals of the same type in the EEG signals can be close to each other, and EEG signals of different types can repel each other, and the smoothness is very good, and the clean signals and artifact signals in the EEG signals can be accurately separated. Then, when the artifact removal is performed on the EEG signals to be processed based on the trained artifact removal model, the accuracy of EEG signal artifact removal can be improved.

[0188] <Equipment Embodiment>

[0189] Figure 6 FIG. 1 is a schematic diagram of the hardware structure of an electronic device according to an embodiment. Figure 6 As shown, the electronic device 6000 includes a processor 6100 and a memory 6200 .

[0190] The memory 6200 can be used to store executable computer instructions.

[0191] The processor 6100 can be used to execute the EEG signal artifact removal method or the EEG signal artifact removal model training method according to the method embodiment of the present disclosure under the control of the executable computer instructions.

[0192] The electronic device 6000 may be Figure 1 The electronic device 2000 shown may also be a device with other hardware structures, which is not limited here.

[0193] In another embodiment, the electronic device 6000 may include the above-mentioned device 4000 for removing EEG signal artifacts or the device 5000 for removing EEG signal artifacts model.

[0194] In one embodiment, each module of the above-mentioned device 4000 for removing EEG signal artifacts or device 5000 for removing EEG signal artifacts model can be implemented by the processor 6100 running computer instructions stored in the memory 6200 .

[0195] <Computer Readable Storage Medium>

[0196] The present disclosure also provides a computer-readable storage medium having computer instructions stored thereon. When the computer instructions are executed by a processor, the method for removing artifacts from an EEG signal or the method for training an EEG signal artifact removal model provided by the present disclosure is executed.

[0197] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0198] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0199] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0200] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0201] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0202] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0203] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0204] The flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of an instruction, and the module, a program segment or a part of an instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.

[0205] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes are obvious to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present disclosure is defined by the appended claims. .

Claims

1. A method for removing artifacts from an electroencephalogram signal, characterized in that: The method comprises: Obtaining the EEG signal to be processed; Obtain the trained artifact removal model; According to the trained artifact removal model, performing artifact removal on the EEG signal to be processed to obtain a clean signal in the EEG signal to be processed; The training method of the artifact removal model includes: Acquire a sample EEG signal and labeling information of the sample EEG signal; wherein the labeling information of the sample EEG signal includes a clean signal in the sample EEG signal; Constructing a graph structure of the sample EEG signals; wherein the nodes of the graph structure are the signal strengths corresponding to the respective EEG signals in the sample EEG signals, the edges between any two nodes in the graph structure are determined based on an intra-class edge matrix or an inter-class edge matrix, and the weights corresponding to the edges between any two nodes constitute an intra-class weight matrix or an inter-class weight matrix; Constructing a first loss according to the intra-class edge matrix, the intra-class weight matrix, the inter-class weight matrix, a clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained, and the labeling information of the sample EEG signal; updating a model parameter of an artifact removal model to be trained based on the first loss; The first loss is constructed according to the intra-class edge matrix, the intra-class weight matrix, the inter-class weight matrix, the clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained, and the labeling information of the sample EEG signal, including: Constructing a second loss according to the intra-class weight matrix, the labeling information of the sample EEG signal, and a clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained; Constructing a third loss according to the inter-class weight matrix, the labeling information of the sample EEG signal, and a clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained; Determine an intra-class Laplacian matrix according to the intra-class edge matrix; Constructing a fourth loss according to the intra-class Laplacian matrix and a clean signal after removing artifacts from the sample EEG signal output by the artifact removal model to be trained; The first loss is constructed according to the second loss, the third loss and the fourth loss.

2. The method according to claim 1, characterized in that Get sample EEG signals, including: Collecting EEG signals of the target object when it sequentially executes the states involved in the preset rules as the sample EEG signals; The preset rules at least involve the following states in sequence: resting state, frowning state, resting state, clenching teeth state, resting state, and eye movement state.

3. The method according to claim 1, characterized in that: The step of constructing the graph structure of the sample EEG signal comprises: Using the signal strength corresponding to each EEG signal in the sample EEG signals as a node of the graph structure; Randomly shuffle each EEG signal in the sample EEG signal to obtain the shuffled sample EEG signal; Based on the K-nearest neighbor algorithm, determine the EEG signal set corresponding to each EEG signal in the shuffled sample EEG signal; wherein the EEG signal set includes K EEG signals; According to the EEG signal sets corresponding to the EEG signals, a first subsequence and a second subsequence corresponding to the EEG signals are constructed; wherein the EEG signals included in the first subsequence corresponding to any EEG signal are of the same signal type as the arbitrary EEG signal, and the EEG signals included in the second subsequence corresponding to the arbitrary EEG signal are of different signal type from the arbitrary EEG signal; According to the first subsequences corresponding to the respective EEG signals, the intra-class edge matrix is ​​obtained, and according to the second subsequences corresponding to the respective EEG signals, the inter-class edge matrix is ​​obtained; According to the intra-class edge matrix, when it is determined that there is an intra-class edge between the arbitrary two nodes, the intra-class edge between the arbitrary two nodes is used as the edge between the arbitrary two nodes; and according to the inter-class edge matrix, when it is determined that there is an inter-class edge between the arbitrary two nodes, the inter-class edge between the arbitrary two nodes is used as the edge between the arbitrary two nodes; In the case where there is an intra-class edge or an inter-class edge between the arbitrary two nodes, the distance between the arbitrary two nodes is used as the weight corresponding to the intra-class edge or the inter-class edge between the arbitrary two nodes.

4. The method according to claim 1, characterized in that: The step of determining the intra-class Laplacian matrix according to the intra-class edge matrix comprises: Obtaining the sum of each row of the intra-class edge matrix; Copying the intra-class edge matrix to obtain the copied intra-class edge matrix; The sum of the values ​​of each row of the intra-class edge matrix is ​​used as the value of the main diagonal in the corresponding row of the copied intra-class edge matrix; and The values ​​of the copied intra-class edge matrix at positions other than the main diagonal are set to zero to obtain an intra-class degree matrix; The intra-class Laplacian matrix is ​​obtained according to the intra-class degree matrix and the intra-class edge matrix.

5. A training method for an EEG signal artifact removal model, characterized in that: The method comprises: Acquire a sample EEG signal and labeling information of the sample EEG signal; wherein the labeling information of the sample EEG signal includes a clean signal in the sample EEG signal; Constructing a graph structure of the sample EEG signals; wherein the nodes of the graph structure are the signal strengths corresponding to the respective EEG signals in the sample EEG signals, the edges between any two nodes in the graph structure are determined based on an intra-class edge matrix or an inter-class edge matrix, and the weights corresponding to the edges between any two nodes constitute an intra-class weight matrix or an inter-class weight matrix; Constructing a first loss according to the intra-class edge matrix, the intra-class weight matrix, the inter-class weight matrix, a clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained, and the labeling information of the sample EEG signal; updating a model parameter of an artifact removal model to be trained based on the first loss; The first loss is constructed according to the intra-class edge matrix, the intra-class weight matrix, the inter-class weight matrix, the clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained, and the labeling information of the sample EEG signal, including: Constructing a second loss according to the intra-class weight matrix, the labeling information of the sample EEG signal, and a clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained; Constructing a third loss according to the inter-class weight matrix, the labeling information of the sample EEG signal, and a clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained; Determine an intra-class Laplacian matrix according to the intra-class edge matrix; Constructing a fourth loss according to the intra-class Laplacian matrix and a clean signal after removing artifacts from the sample EEG signal output by the artifact removal model to be trained; The first loss is constructed according to the second loss, the third loss and the fourth loss.

6. A device for removing artifacts from electroencephalogram signals, characterized in that: The device comprises: A first acquisition module is used to acquire the EEG signal to be processed; A second acquisition module is used to acquire a trained artifact removal model; A processing module, used for performing artifact removal on the EEG signal to be processed according to the trained artifact removal model to obtain a clean signal in the EEG signal to be processed; A training module, used to obtain sample EEG signals and labeling information of the sample EEG signals; wherein the labeling information of the sample EEG signals includes clean signals in the sample EEG signals; Constructing a graph structure of the sample EEG signals; wherein the nodes of the graph structure are the signal strengths corresponding to the respective EEG signals in the sample EEG signals, the edges between any two nodes in the graph structure are determined based on an intra-class edge matrix or an inter-class edge matrix, and the weights corresponding to the edges between any two nodes constitute an intra-class weight matrix or an inter-class weight matrix; Constructing a first loss according to the intra-class edge matrix, the intra-class weight matrix, the inter-class weight matrix, a clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained, and the labeling information of the sample EEG signal; updating a model parameter of an artifact removal model to be trained based on the first loss; The training module is also used to construct a second loss based on the intra-class weight matrix, the annotation information of the sample EEG signal and the clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained; construct a third loss based on the inter-class weight matrix, the annotation information of the sample EEG signal and the clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained; determine the intra-class Laplace matrix based on the intra-class edge matrix; construct a fourth loss based on the intra-class Laplace matrix and the clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained; and construct the first loss based on the second loss, the third loss and the fourth loss.

7. A training device for an EEG signal artifact removal model, characterized in that: The device comprises: A third acquisition module is used to acquire a sample EEG signal and labeling information of the sample EEG signal; wherein the labeling information of the sample EEG signal includes a clean signal in the sample EEG signal; A first construction module is used to construct a graph structure of the sample EEG signals; wherein the nodes of the graph structure are the signal strengths corresponding to the respective EEG signals in the sample EEG signals, the edges between any two nodes in the graph structure are determined based on an intra-class edge matrix or an inter-class edge matrix, and the weights corresponding to the edges between any two nodes constitute an intra-class weight matrix or an inter-class weight matrix; A second construction module is used to construct a first loss according to the intra-class edge matrix, the intra-class weight matrix, the inter-class weight matrix, a clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained, and the labeling information of the sample EEG signal; An updating module, used for updating model parameters of the artifact removal model to be trained based on the first loss; The second construction module is used to construct a second loss according to the intra-class weight matrix, the annotation information of the sample EEG signal and the clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained; construct a third loss according to the inter-class weight matrix, the annotation information of the sample EEG signal and the clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained; determine the intra-class Laplace matrix according to the intra-class edge matrix; construct a fourth loss according to the intra-class Laplace matrix and the clean signal of the sample EEG signal after removing artifacts output by the artifact removal model to be trained; and construct the first loss according to the second loss, the third loss and the fourth loss.

8. An electronic device, characterized in that: include: Memory for storing executable computer instructions; A processor is used to execute the method for removing EEG signal artifacts according to any one of claims 1 to 4 or the training method for the EEG signal artifact removal model according to claim 5 under the control of the executable computer instructions.

9. A computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions, when executed by a processor, execute the method for removing artifacts of an electroencephalogram signal as described in any one of claims 1 to 4 or the method for training an electroencephalogram signal artifact removal model as described in claim 5.

Citation Information

Patent Citations

  • SSDA-based electroencephalogram signal ocular artifact removal method

    CN111543984A

  • Method for removing BCG artifacts through synchronous EEG-fMRI electroencephalogram signals

    CN113081001A