Brain electrical signal classification model training method, brain electrical signal classification method and device
Through the gradual training of EEG signals in the source and target domains, deep spatial features are extracted and cross-user EEG signal classification model is constructed, which solves the problems of low accuracy and low training efficiency in cross-user applications, and achieves more efficient EEG signal classification and model adaptability.
Patent Information
- Application Number
- CN202310277262.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-21
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2043-03-21
AI Technical Summary
When existing EEG signal classification models are applied across users, there are problems such as low classification accuracy and low training efficiency, especially due to the reduction in classification accuracy caused by the difference in EEG signal between new users and current users, as well as the difficulty of collecting new users' data and long collection time.
By obtaining the original EEG signals of the source and target domains, using the progressive training methods of electrode convolution layers, electrode area convolution layers and left and right brain regions, the characteristics of each electrode and different brain regions are extracted, and a cross-user EEG signal classification model is constructed, and multiple small spatial convolutions are used to replace large spatial convolutions to reduce the number of model parameters.
It improves the accuracy of EEG signal classification and the generalization of the model, enhances the training effectiveness and usage efficiency of the model, adapts to the EEG signal characteristics of different users, and solves the problems of miniaturization and wearability of the model.
Smart Images

Figure CN116196017B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to signal processing technology, and in particular to an electroencephalogram (EEG) signal classification model training method, an EEG signal classification method and a device. Background Art
[0002] Electroencephalogram (EEG) can be used to record and describe various brain activities. Its low cost, high portability, and high temporal resolution make it widely used in fields such as brain science and medicine. EEG classification is a key area of EEG research.
[0003] In actual EEG classification experiments, the current user's EEG signal is usually used to train the classification model. When the EEG signal of a new user needs to be classified, if this classification model is used, the classification accuracy may be reduced due to the differences between the EEG signals of the new user and the current user. If the EEG signal of the new user is collected to re-train the classification model, the classification efficiency may be reduced due to problems such as the difficulty and long collection time of the new user's data. Summary of the Invention
[0004] The present invention provides an EEG signal classification model training method, an EEG signal classification method and an apparatus to improve the effectiveness and efficiency of model training.
[0005] According to one aspect of the present invention, a method for training an EEG signal classification model is provided, the method comprising:
[0006] Obtaining original source-domain EEG signals of a source-domain user and original target-domain EEG signals of a target-domain user; wherein the original source-domain EEG signals and the original target-domain EEG signals are motor imagery EEG signals;
[0007] Inputting the original source domain EEG signal and the original target domain EEG signal into an electrode convolution layer of a pre-constructed model to be trained, obtaining source domain electrode region features and target domain electrode region features, and determining a first training process of the model to be trained based on the source domain electrode region features and the target domain electrode region features;
[0008] Inputting the source domain electrode region features and the target domain electrode region features into the electrode region convolution layer in the to-be-trained model to obtain source domain left and right brain region features and target domain left and right brain region features, and determining a second training process of the to-be-trained model based on the source domain left and right brain region features and the target domain left and right brain region features;
[0009] Inputting the source domain left and right brain region features and the target domain left and right brain region features into the left and right brain region convolutional layers of the to-be-trained model to obtain source domain overall brain region features and target domain overall brain region features, and determining a third training process of the to-be-trained model based on the source domain overall brain region features and the target domain overall brain region features;
[0010] The model to be trained is trained according to at least one of the first training process, the second training process and the third training process to obtain a trained EEG signal classification model.
[0011] According to another aspect of the present invention, a method for classifying EEG signals is provided, the method comprising:
[0012] Acquire an EEG signal to be identified of a target domain user; wherein the EEG signal to be identified is a motor imagery EEG signal;
[0013] The EEG signal to be identified is input into a pre-trained EEG signal classification model to obtain a signal classification result of the EEG signal to be identified, wherein the EEG signal classification model is trained based on the EEG signal classification model training method described in any embodiment of the present invention.
[0014] According to another aspect of the present invention, there is provided a device for training an EEG signal classification model, the device comprising:
[0015] an EEG signal acquisition module, configured to acquire original source-domain EEG signals of a source-domain user and original target-domain EEG signals of a target-domain user; wherein the original source-domain EEG signals and the original target-domain EEG signals are motor imagery EEG signals;
[0016] a first training process determination module, configured to input the original source domain EEG signal and the original target domain EEG signal into an electrode convolution layer of a pre-constructed model to be trained, obtain source domain electrode region features and target domain electrode region features, and determine a first training process of the model to be trained based on the source domain electrode region features and the target domain electrode region features;
[0017] a second training process determination module, configured to input the source domain electrode region features and the target domain electrode region features into the electrode region convolution layer in the to-be-trained model, obtain source domain left and right brain region features and target domain left and right brain region features, and determine the second training process of the to-be-trained model based on the source domain left and right brain region features and the target domain left and right brain region features;
[0018] a third training process determination module, configured to input the source domain left and right brain region features and the target domain left and right brain region features into the left and right brain region convolutional layers of the to-be-trained model, obtain the source domain overall brain region features and the target domain overall brain region features, and determine the third training process of the to-be-trained model based on the source domain overall brain region features and the target domain overall brain region features;
[0019] The model training module is used to train the model to be trained according to at least one of the first training process, the second training process and the third training process to obtain a trained EEG signal classification model.
[0020] According to another aspect of the present invention, there is provided an electroencephalogram (EEG) signal classification device, the device comprising:
[0021] A signal acquisition module to be identified is used to acquire an EEG signal to be identified of a target domain user; wherein the EEG signal to be identified is a motor imagery EEG signal;
[0022] The signal classification module inputs the EEG signal to be identified into a pre-trained EEG signal classification model to obtain a signal classification result of the EEG signal to be identified, wherein the EEG signal classification model is trained based on the EEG signal classification model training method described in any embodiment of the present invention.
[0023] According to another aspect of the present invention, an electronic device is provided, comprising:
[0024] at least one processor; and
[0025] a memory communicatively connected to the at least one processor; wherein,
[0026] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the EEG signal classification model training method and / or EEG signal classification method described in any embodiment of the present invention.
[0027] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer instructions, and the computer instructions are used to enable a processor to implement the EEG signal classification model training method and / or EEG signal classification method described in any embodiment of the present invention when executed.
[0028] The technical solution of the embodiment of the present invention jointly trains the EEG signal classification model through the original source domain EEG signals and the original target domain EEG signals to achieve domain adaptation of the original target domain EEG signal features, thereby realizing cross-user EEG signal classification. It solves the problem of using only the original source domain EEG signals to train the classification model. When the original target domain EEG signals need to be classified, if this classification model is used, the classification accuracy may be reduced due to the differences in EEG signals between individual target domain users and source domain users; if the EEG signals of the target domain users are collected to re-train the classification model, the classification efficiency may be reduced due to problems such as the difficulty and long collection time of the target domain users' data. It achieves the effect of improving the classification accuracy of the original target domain EEG signals and enhancing the generalization of the EEG signal classification model.
[0029] By dividing the convolutional network structure of the model to be trained into an electrode convolution layer, an electrode region convolution layer, and a left and right brain region convolution layer, a progressive approach is used to extract features from each electrode and different brain regions. Compared to directly extracting overall brain features by focusing only on features in the time and frequency dimensions, this method obtains deeper spatial features, enriches the amount of information obtained from the features, and improves the effectiveness of model training. Furthermore, by replacing a large spatial convolution with multiple small spatial convolutions, the number of model parameters is significantly reduced, resulting in faster reasoning and computational speeds for the trained model. This solves the existing problem of performing overall convolution on EEG signals. With the deepening of residual connections and convolution depth, the network's computational load, training time, and reasoning speed all increase significantly, which is detrimental to the miniaturization and wearability of brain-computer interface systems. This improves the efficiency of model use.
[0030] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A flowchart of a method for training an EEG signal classification model provided in Example 1 of the present invention;
[0032] Figure 2a A schematic diagram of the original numbering of an EEG signal provided in the first embodiment of the present invention;
[0033] Figure 2b A schematic diagram of the current number of an EEG signal provided in the first embodiment of the present invention;
[0034] Figure 3 A flowchart of a method for training an EEG signal classification model provided in the second embodiment of the present invention;
[0035] Figure 4aA schematic diagram of electrode area division provided in the second embodiment of the present invention;
[0036] Figure 4b A schematic diagram of the convolution result of the electrode region convolution layer provided in the second embodiment of the present invention;
[0037] Figure 4c A schematic diagram of the convolution results of the left and right brain regions convolution layer provided in Example 2 of the present invention;
[0038] Figure 5 A schematic diagram of the convolutional network structure of an EEG signal classification model provided in Example 2 of the present invention;
[0039] Figure 6 This is a flowchart of a method for training an EEG signal classification model provided in Example 3 of the present invention;
[0040] Figure 7a A schematic diagram of calculating electrode distribution difference loss within a single electrode region provided by the third embodiment of the present invention;
[0041] Figure 7b A schematic diagram of calculating the distribution difference loss between different electrode regions in the left and right brain regions provided in Example 3 of the present invention;
[0042] Figure 7c A schematic diagram of calculating the distribution difference loss between the left brain electrode regions in the source domain and the target domain provided in the third embodiment of the present invention;
[0043] Figure 7d A schematic diagram of calculating the difference loss between left and right brain regions provided in Example 3 of the present invention;
[0044] Figure 7e A schematic diagram of calculating the overall distribution difference loss between the source domain and the target domain provided in the third embodiment of the present invention;
[0045] Figure 8 A schematic diagram of an adaptive network structure of an EEG signal classification model provided in Example 3 of the present invention;
[0046] Figure 9 This is a flowchart of a method for classifying EEG signals provided in Example 4 of the present invention;
[0047] Figure 10 A schematic diagram of the structure of an EEG signal classification model training device provided in Example 5 of the present invention;
[0048] Figure 11 A schematic diagram of the structure of an EEG signal classification device provided in Example 5 of the present invention;
[0049] Figure 12 FIG. 1 is a schematic structural diagram of an electronic device for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0051] It should be noted that the terms "first," "second," "target," and the like in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this way are interchangeable where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatus.
[0052] Example 1
[0053] Figure 1 This is a flowchart of a method for training an EEG signal classification model provided in the first embodiment of the present invention. This embodiment is applicable to the training of a model for classifying motor imagery EEG signals. This method can be performed by the EEG signal classification model training device provided in the embodiment of the present invention, which can be implemented in software and / or hardware. Figure 1 The EEG signal classification model training method provided in this embodiment includes:
[0054] Step 110: Obtain original source-domain EEG signals of the source-domain user and original target-domain EEG signals of the target-domain user; wherein the original source-domain EEG signals and the original target-domain EEG signals are motor imagery EEG signals.
[0055] The source domain users are users who have acquired more EEG signal data, and the target domain users are users who need to classify EEG signals but have acquired less EEG signal data.
[0056] The original source domain EEG signal of the source domain user is the EEG signal obtained from the source domain user, and the original target domain EEG signal of the target domain user is the EEG signal obtained from the target domain user.
[0057] Motor imagery refers to imagining limb movements without actually performing limb movements. EEG signals can be obtained by collecting EEG signals through the signal collection electrodes in the EEG caps worn by the source domain users and the target domain users when they perform motor imagery.
[0058] Step 120: Input the original source domain EEG signal and the original target domain EEG signal into the electrode convolution layer of the pre-built model to be trained to obtain the source domain electrode area features and the target domain electrode area features, and determine the first training process of the model to be trained based on the source domain electrode area features and the target domain electrode area features.
[0059] The pre-built network structure of the model to be trained can include a convolutional network structure and other network structures. The convolutional network structure includes multiple spatial convolution layers, such as an electrode convolution layer, an electrode area convolution layer, and a left and right brain area convolution layer. The electrode convolution layer is used to divide the electrodes into different electrode areas and convolve the EEG features of the electrodes in each electrode area; the electrode area convolution layer is used to convolve the EEG features of different electrode areas; the left and right brain area convolution layer is used to convolve the EEG features of the left and right brain areas. It should be noted that each spatial convolution layer also contains a time convolution layer and a frequency convolution layer to extract the time and frequency features of the EEG signal.
[0060] The original source domain EEG signal and the original target domain EEG signal are input into the electrode convolution layer to obtain the source domain electrode area features and the target domain electrode area features, wherein the electrode area features are the features of each area obtained by dividing the electrodes for acquiring the EEG signals into areas according to the electrode positions; a preset number of electrodes with close distribution can be divided into the same area according to the electrode coordinates, and this embodiment does not limit this.
[0061] Motor imagery EEG signals usually have quite different characteristics between the left and right brains. Therefore, when dividing the regions, the left and right brains can be divided symmetrically. For example, the left and right brains can be divided into 5 regions respectively, and each region corresponds to each other.
[0062] The first training process of the model to be trained is determined based on the source domain electrode area characteristics and the target domain electrode area characteristics. A loss function between the source domain and the target domain electrode area can be constructed based on the source domain electrode area characteristics and the target domain electrode area characteristics. By making the loss value corresponding to the loss function meet the preset conditions, the model parameters of the model to be trained are adjusted to determine the first training process.
[0063] In this embodiment, optionally, the electrode numbering status of the signal acquisition electrodes corresponding to the original source domain EEG signal and the original target domain EEG signal is updated according to a preset numbering rule; wherein the preset numbering rule includes the left and right brain numbering rules, and one of the horizontal electrode numbering rules and the vertical electrode numbering rule.
[0064] The EEG signal is obtained by collecting EEG signals through the signal collecting electrodes, so the preset numbering rule is the numbering rule for the signal collecting electrodes. Figure 2a A schematic diagram of the original numbering of EEG signals provided in Example 1 of the present invention is provided by the BCI Competition IV IIa dataset. The dataset contains 118 electrodes, and the format of its EEG data matrix cnt is [sampling point, electrode channel]. The electrodes are numbered according to the column number of each electrode in the data matrix, and a schematic diagram of the electrode position and the corresponding number of the electrode is drawn according to the position coordinates of each electrode. The horizontal and vertical axes indicate the relative distribution of the electrodes, where the electrodes in the negative half of the horizontal axis are left-brain electrodes, the electrodes in the positive half of the horizontal axis are right-brain electrodes, and the eight electrodes in the middle of the horizontal axis are reference electrodes.
[0065] Figure 2b A schematic diagram of the current number of an EEG signal provided in the first embodiment of the present invention is Figure 2a The electrode numbering states of the signal acquisition electrodes corresponding to the original source domain EEG signal and the original target domain EEG signal are updated according to the left and right brain numbering rules and the horizontal electrode numbering rules in the preset numbering rules.
[0066] The left and right brain numbering rules are rules for numbering the left and right brain respectively, the horizontal electrode numbering rules are rules for numbering electrodes in the horizontal direction, and the vertical electrode numbering rules are rules for numbering electrodes in the vertical direction.
[0067] like Figure 2b As shown, the electrode distribution diagram includes four relative positions, namely the nose, the back of the head, the left ear and the right ear.
[0068] The electrodes are rearranged laterally using the horizontal electrode numbering rule so that the divided electrode areas are distributed as horizontally as possible. The horizontal electrode numbering rule may specifically include: for all electrodes in the left brain (excluding the reference electrode), starting from the nose and heading towards the occipital region, the electrodes in the left-ear-right-ear direction are numbered in sequence; under the condition that the nose-occipital direction is met, the electrode numbering order in the left-ear-right-ear direction is initially from the right ear to the left ear, and then whenever there are no more numberable electrodes in the same nose-occipital direction, the left-ear-right-ear direction is reversed, such as switching from right ear to left ear to left ear to left ear.
[0069] For all electrodes in the right brain (excluding the reference electrode), the numbering rules are similar to those for the left brain. The electrodes are numbered from the nose to the occipital region in the left-ear-right-ear direction. However, when numbering horizontally, the initial electrode numbering order is from the left ear to the right ear.
[0070] The electrodes are vertically rearranged using the vertical electrode numbering rule so that the divided electrode areas are distributed as vertically as possible ( Figure 2b (not shown in the figure), the vertical electrode numbering rules may specifically include: for all electrode channels in the left brain (excluding the reference electrode), starting from the right ear to the left ear, number the electrodes in different nose-occipital directions in sequence; under the condition that the left ear-right ear direction is met, the initial numbering order of the electrodes in the nose-occipital direction is from the nose to the occipital, and then whenever there are no numberable electrodes in the same left ear-right ear direction, the nose-occipital direction is switched, such as switching the initial direction from the nose to the occipital to the occipital pointing from the occipital pointing to the nose.
[0071] For all electrode channels in the right brain (excluding the reference electrode), the numbering rules are similar to those for the left brain, starting from the right ear and heading towards the left ear, and numbering the electrodes in different nose-occipital directions in sequence; however, when numbering vertically, the initial electrode numbering order is from the occipital region to the nose.
[0072] According to the left and right brain numbering rules, and one of the horizontal electrode numbering rules and the vertical electrode numbering rules, the electrode numbering status of the signal acquisition electrodes corresponding to the original source domain EEG signal and the original target domain EEG signal is updated to avoid directly inputting the original source domain EEG signal and the original target domain EEG signal into the electrode convolution layer according to the original number, resulting in the subsequent electrode area division in the form of horizontally spanning the left and right brain. Since most of the classification tasks of motor imagery EEG signals are to classify the left hand and the right hand, the training targeting of the EEG signal classification model is reduced, thereby improving the targeting of the EEG signal classification model training and the accuracy of subsequent classification by the EEG signal classification model.
[0073] Step 130: Input the source domain electrode area features and the target domain electrode area features into the electrode area convolution layer in the model to be trained to obtain the source domain left and right brain area features and the target domain left and right brain area features, and determine the second training process of the model to be trained based on the source domain left and right brain area features and the target domain left and right brain area features.
[0074] The source domain electrode area features and the target domain electrode area features are respectively input into the electrode area convolution layer for convolution to obtain the source domain left and right brain area features and the target domain left and right brain area features, where the left and right brain area features are the overall features of the left brain area and the overall features of the right brain area.
[0075] The second training process of the model to be trained is determined based on the characteristics of the left and right brain regions of the source domain and the left and right brain regions of the target domain. A loss function between the left and right brain regions of the source domain and the target domain can be constructed based on the characteristics of the left and right brain regions of the source domain and the left and right brain regions of the target domain. The second training process is determined by making the loss value corresponding to the loss function meet the preset conditions.
[0076] Step 140: Input the left and right brain region features of the source domain and the left and right brain region features of the target domain into the left and right brain region convolutional layers in the model to be trained to obtain the overall brain region features of the source domain and the overall brain region features of the target domain, and determine the third training process of the model to be trained based on the overall brain region features of the source domain and the overall brain region features of the target domain.
[0077] The left and right brain area features of the source domain and the left and right brain area features of the target domain are respectively input into the left and right brain area convolution layers for convolution. The left and right brain area convolution layers fuse the extracted brain area features of the left and right brain areas to obtain the characteristics of the user's overall brain area.
[0078] The third training process of the model to be trained is determined based on the overall brain region characteristics of the source domain and the overall brain region characteristics of the target domain. A loss function between the overall brain region of the source domain and the overall brain region of the target domain can be constructed based on the overall brain region characteristics of the source domain and the overall brain region characteristics of the target domain. The third training process is determined by making the loss value corresponding to the loss function meet the preset conditions.
[0079] Step 150: Train the model to be trained according to at least one of the first training process, the second training process, and the third training process to obtain a trained EEG signal classification model.
[0080] The model to be trained may be trained through at least one of the first training process, the second training process, and the third training process. Specifically, the model to be trained may be trained through a single first training process, a single second training process, and a single third training process, or may be trained through a combination of the first training process, the second training process, and the third training process. This embodiment does not limit this. For example, when the model to be trained is first trained, the first training process, the second training process, and the third training process may be included. In subsequent training, the parameters obtained from one training process may be retained unchanged while the other training processes are performed.
[0081] Exemplarily, when training is performed in combination with the first training process, the second training process and the third training process, the first training process can be used to perform a first adjustment operation on the model parameters of the model to be trained, the second training process can be performed on the model to be trained after the first adjustment operation, and the second adjustment operation can be performed on the model parameters, the third training process can be performed on the model to be trained after the second adjustment operation, and the third adjustment operation can be performed on the model parameters.
[0082] The technical solution provided in this embodiment jointly trains the EEG signal classification model through the original source domain EEG signals and the original target domain EEG signals to achieve domain adaptation of the original target domain EEG signal features, thereby realizing cross-user EEG signal classification. It solves the problem of using only the original source domain EEG signals to train the classification model. When the original target domain EEG signals need to be classified, if this classification model is used, the classification accuracy may be reduced due to the differences in EEG signals between individual target domain users and source domain users; if the EEG signals of target domain users are collected to re-train the classification model, the classification efficiency may be reduced due to problems such as the difficulty and long collection time of target domain users' data. It achieves the effect of improving the classification accuracy of the original target domain EEG signals and enhancing the generalization of the EEG signal classification model.
[0083] By dividing the convolutional network structure of the model to be trained into an electrode convolution layer, an electrode region convolution layer, and a left and right brain region convolution layer, a progressive approach is used to extract features from each electrode and different brain regions. Compared to directly extracting overall brain features by focusing only on features in the time and frequency dimensions, this method obtains deeper spatial features, enriches the amount of information obtained from the features, and improves the effectiveness of model training. Furthermore, by replacing a large spatial convolution with multiple small spatial convolutions, the number of model parameters is significantly reduced, resulting in faster reasoning and computational speeds for the trained model. This solves the existing problem of performing overall convolution on EEG signals. With the deepening of residual connections and convolution depth, the network's computational load, training time, and reasoning speed all increase significantly, which is detrimental to the miniaturization and wearability of brain-computer interface systems. This improves the efficiency of model use.
[0084] Example 2
[0085] Figure 3 This is a flowchart of a method for training an EEG signal classification model provided in Example 2 of the present invention. This technical solution provides a supplementary explanation of the process of building an EEG signal classification model. Compared with the above solution, this solution is specifically optimized to input the original source domain EEG signal and the original target domain EEG signal into the electrode convolution layer of the pre-built training model to obtain the source domain electrode area features and the target domain electrode area features, including:
[0086] Obtaining a first preset convolution kernel and a first preset step size of the electrode convolution layer; wherein the first preset convolution kernel includes information about the number of electrodes in each electrode region, and the first preset step size includes information about the number of electrodes overlapping between the electrode regions;
[0087] Determining source domain electrode region features according to a first preset convolution kernel, a first preset step size, and an original source domain EEG signal;
[0088] According to the first preset convolution kernel, the first preset step size and the original target domain EEG signal, the target domain electrode area features are determined. Specifically, the flowchart of the EEG signal classification model training method is as follows: Figure 3 As shown:
[0089] Step 310: Obtain original source-domain EEG signals of the source-domain user and original target-domain EEG signals of the target-domain user; wherein the original source-domain EEG signals and the original target-domain EEG signals are motor imagery EEG signals.
[0090] Step 320: Obtain a first preset convolution kernel and a first preset step size of the electrode convolution layer; wherein the first preset convolution kernel includes information about the number of electrodes in each electrode area, and the first preset step size includes information about the number of electrodes overlapping between the electrode areas.
[0091] The first preset convolution kernel size can be (ch1,1), and the first preset step size is (st1,1), where ch1 in the first preset convolution kernel indicates that ch1 electrodes are divided into one area when dividing the electrode area; the first preset step size st1 determines how many overlapping electrodes there are in the intersection area between different electrode areas, and the number of overlapping electrodes is ch1-st1.
[0092] The ch1 value can be set to 10%-20% of the total number of electrodes, so that the electrodes contained in each divided electrode area can characterize the characteristics of the electrode area to a certain extent. For example, when the total number of electrodes is 118, ch1 can be set to 15, that is, 15 electrodes are divided into one electrode area.
[0093] Figure 4a A schematic diagram of electrode area division provided in the second embodiment of the present invention is shown in FIG. Figure 4a As shown, every 15 electrodes are divided into one area, and due to the setting of the first preset step length, different electrode areas are not independent of each other.
[0094] Step 330: Determine the source domain electrode area characteristics based on the first preset convolution kernel, the first preset step size, and the original source domain EEG signal; determine the target domain electrode area characteristics based on the first preset convolution kernel, the first preset step size, and the original target domain EEG signal.
[0095] The electrodes corresponding to the original source domain EEG signal are divided into regions through the first preset convolution kernel, the first preset step size and the original source domain EEG signal of the electrode convolution layer, and the regional features corresponding to each divided electrode region are extracted through the electrode convolution layer, which are the source domain electrode region features.
[0096] The electrodes corresponding to the original target domain EEG signal are divided into regions through the first preset convolution kernel, the first preset step size and the original target domain EEG signal of the electrode convolution layer, and the regional features corresponding to each divided electrode region are extracted through the electrode convolution layer, which are the target domain electrode region features.
[0097] Step 340: Determine a first training process of the to-be-trained model based on the source domain electrode region characteristics and the target domain electrode region characteristics.
[0098] Step 350: Input the source domain electrode area features and the target domain electrode area features into the electrode area convolution layer in the model to be trained to obtain the source domain left and right brain area features and the target domain left and right brain area features, and determine the second training process of the model to be trained based on the source domain left and right brain area features and the target domain left and right brain area features.
[0099] In this embodiment, optionally, the source domain electrode region features and the target domain electrode region features are input into the electrode region convolution layer in the model to be trained to obtain the source domain left and right brain region features and the target domain left and right brain region features, including:
[0100] Obtaining a second preset convolution kernel and a second preset step size of the electrode region convolution layer; wherein the second preset convolution kernel includes information on the number of electrode regions in the left hemisphere or the right hemisphere;
[0101] Determining the left and right brain region features of the source domain according to the second preset convolution kernel, the second preset step size, and the source domain electrode region features;
[0102] The left and right brain region features of the target domain are determined according to the second preset convolution kernel, the second preset step size and the target domain electrode region features.
[0103] The second preset convolution kernel size may be (loc2, 1), and the second preset step size may be (1, 1), where loc2 in the first preset convolution kernel represents the number of electrode areas obtained by dividing the left or right hemisphere of the brain. As shown in FIG4 , the number of electrode areas is 5.
[0104] The features of different source domain electrode regions are convolved using the second preset convolution kernel and the second preset step size of the electrode region convolution layer. The features extracted based on the left or right hemisphere of the brain are the features of the left and right brain regions of the source domain.
[0105] The electrode area features of different target domains are convolved through the second preset convolution kernel and the second preset step size of the electrode area convolution layer. The features extracted in units of the left or right hemisphere are the left and right brain area features of the target domain.
[0106] Figure 4b A schematic diagram of the convolution result of the electrode region convolution layer provided in the second embodiment of the present invention is shown as follows: Figure 4bAs shown in FIG, the features of each electrode region in the left hemisphere are convolved to obtain the features of the left hemisphere brain region, and the features of each electrode region in the right hemisphere are convolved to obtain the features of the right hemisphere brain region.
[0107] By convolving the EEG features of different electrode areas, the feature focus is expanded from the electrode area to the left and right brain areas, so that the extracted left and right brain area features of the source domain and the left and right brain area features of the target domain contain deeper spatial features.
[0108] Step 360: Input the left and right brain region features of the source domain and the left and right brain region features of the target domain into the left and right brain region convolutional layers of the model to be trained to obtain the overall brain region features of the source domain and the overall brain region features of the target domain, and determine the third training process of the model to be trained based on the overall brain region features of the source domain and the overall brain region features of the target domain.
[0109] Figure 4c A schematic diagram of the convolution results of the left and right brain regions convolution layer provided in the second embodiment of the present invention is shown as follows: Figure 4c As shown, by convolving the features of different left and right brain regions according to a preset convolution kernel and a preset step size, such as (2,1)(1,1), and performing a final fusion, the EEG depth features of the user's entire brain region are obtained.
[0110] Figure 5 A convolutional network structure diagram of an EEG signal classification model provided in the second embodiment of the present invention is shown in FIG. Figure 5 As shown in the figure, the left half is the network structure, and the right half is a schematic diagram of the features extracted by each convolution layer. The electrode area feature z is extracted through the electrode convolution layer 1 , z 1 Input electrode area convolution layer to obtain left and right brain area features z 2 , z 2 Input the left and right brain area convolution layers to obtain the overall brain area feature z 3 .
[0111] Step 370: Train the model to be trained according to at least one of the first training process, the second training process, and the third training process to obtain a trained EEG signal classification model.
[0112] In an embodiment of the present invention, the electrode region division range is determined based on a first preset convolution kernel, so that region division can be performed based on the number, simply by ensuring that the electrode numbers satisfy a certain arrangement pattern. Constructing this arrangement pattern only requires obtaining the coordinates of each electrode. Since coordinate data is relatively easy to obtain, the difficulty of electrode region division is reduced accordingly, eliminating the need for manual division of each electrode region, thereby improving the efficiency of electrode region division. The first preset step size ensures that the divided electrode regions are no longer independent regions, but are interconnected through the intersection of the electrode regions, making the region division more consistent with the physiological structure of the brain, thereby improving the effectiveness of the extracted electrode region features.
[0113] Example 3
[0114] Figure 6 This is a flowchart of a method for training an EEG signal classification model provided in Example 3 of the present invention. This technical solution provides a supplementary explanation of the model training process. Compared with the above solution, this solution is specifically optimized to further include the following before obtaining the source domain electrode region features and the target domain electrode region features:
[0115] Input the original source domain EEG signal and the original target domain EEG signal into the first electrode subconvolution layer in the electrode convolution layer to obtain the source domain electrode features and the target domain electrode features;
[0116] The source domain electrode distribution difference loss function is determined according to the source domain electrode characteristics, the number of source domain electrode regions, the number of source domain electrodes, and the number of source domain EEG signal samples;
[0117] Determine the target domain electrode distribution difference loss function according to the target domain electrode characteristics, the number of target domain electrode areas, the number of target domain electrodes, and the number of target domain EEG signal samples;
[0118] Determining a fourth training process of the to-be-trained model by shortening the electrode distribution distance within each source domain electrode region according to the source domain electrode distribution difference loss function, and shortening the electrode distribution distance within each target domain electrode region according to the target domain electrode distribution difference loss function;
[0119] The source domain electrode features and the target domain electrode features are input into the second electrode sub-convolution layer in the electrode convolution layer to obtain the source domain electrode region features and the target domain electrode region features. Specifically, the flowchart of the EEG signal classification model training method is as follows: Figure 6 As shown:
[0120] Step 610: Obtain original source-domain EEG signals of the source-domain user and original target-domain EEG signals of the target-domain user; wherein the original source-domain EEG signals and the original target-domain EEG signals are motor imagery EEG signals.
[0121] Step 620: Input the original source domain EEG signal and the original target domain EEG signal into the first electrode subconvolution layer in the electrode convolution layer of the pre-built model to be trained to obtain source domain electrode features and target domain electrode features.
[0122] Among them, the first electrode sub-convolution layer is used to divide and fuse different electrodes into different electrode areas, and each electrode area should be able to characterize the EEG characteristics of the corresponding area of the user's EEG to a certain extent.
[0123] Electrode features and electrode features are features extracted from each electrode after dividing the electrode area.
[0124] Step 630: Determine a source domain electrode distribution difference loss function according to the source domain electrode characteristics, the number of source domain electrode regions, the number of source domain electrodes, and the number of source domain EEG signal samples.
[0125] The source domain electrode distribution difference loss function is the distribution difference loss function of the electrodes in the source domain user electrode area. The source domain electrode distribution difference loss function is determined according to the source domain electrode characteristics, the number of source domain electrode areas, the number of source domain electrodes, and the number of source domain EEG signal samples. It can be expressed as the following formula:
[0126]
[0127] in, represents the source domain electrode distribution difference loss function, l S Indicates the number of electrode regions where the source domain EEG signal is divided, e S Indicates the number of electrodes corresponding to the source domain EEG signal, represents the source domain electrode characteristics, n S represents the number of source domain EEG signal samples, represents the expectation of the source domain with respect to the electrode area, represents the expectation of the source domain related to the electrode, E S represents the expectation of the source domain EEG signal, φ() represents the mapping function, which is responsible for mapping the deep features to the regenerated Hilbert space (RKHS), H represents the Hilbert space, MMD represents the maximum mean difference, and sup represents the supremum. Represents the electrode-related deep features in the source domain.
[0128] The number of source domain EEG signal samples is the number of EEG signal samples of source domain users participating in the training. For example, if a total of 100 original source domain EEG signals of source domain users are collected and used, the number of EEG signal samples is 100.
[0129] Step 640: Determine the target domain electrode distribution difference loss function according to the target domain electrode characteristics, the number of target domain electrode regions, the number of target domain electrodes, and the number of target domain EEG signal samples.
[0130] The target domain electrode distribution difference loss function is the distribution difference loss function of the electrodes in the target domain user electrode area. The target domain electrode distribution difference loss function is determined according to the target domain electrode characteristics, the number of target domain electrode areas, the number of target domain electrodes, and the number of target domain EEG signal samples. It can be expressed as the following formula:
[0131]
[0132] in, is the target domain electrode distribution difference loss function, l T Indicates the number of electrode regions where the target domain EEG signal is divided, e T Indicates the number of electrodes corresponding to the target domain EEG signal, represents the target domain electrode features, n T represents the number of EEG signal samples in the target domain, represents the expectation of the target domain being related to the electrode area, represents the expectation of the target domain related to the electrode, E T represents the expectation of the target domain EEG signal, Represents the deep features associated with electrodes in the target domain.
[0133] The number of target domain EEG signal samples is the number of EEG signal samples of target domain users participating in the training.
[0134] Combining Formula 1 and Formula 2, the distribution difference loss function of electrodes in the electrode area is It can be expressed as:
[0135]
[0136] in, and are the weights corresponding to the source domain electrode distribution difference loss function and the target domain electrode distribution difference loss function, respectively.
[0137] Step 650: Determine the fourth training process of the model to be trained by shortening the electrode distribution distance within each source domain electrode area according to the source domain electrode distribution difference loss function, and shortening the electrode distribution distance within each target domain electrode area according to the target domain electrode distribution difference loss function.
[0138] The fourth training process of the model to be trained is to calculate the source domain electrode distribution difference loss value through the source domain electrode distribution difference loss function, and reduce the source domain electrode distribution difference loss value by changing the model parameters, that is, shortening the electrode distribution distance within each source domain electrode region, and ultimately making the source domain electrode distribution difference loss value meet the preset threshold. The target domain electrode distribution difference loss value is calculated through the target domain electrode distribution difference loss function, and reduce the target domain electrode distribution difference loss value by changing the model parameters, that is, shortening the electrode distribution distance within each target domain electrode region, and ultimately making the target domain electrode distribution difference loss value meet the preset threshold.
[0139] Figure 7a A schematic diagram of calculating electrode distribution difference loss within a single electrode region provided by the third embodiment of the present invention is shown in FIG. Figure 7a As shown, the electrode area includes electrodes 1-15, and calculating the electrode distribution difference loss is to calculate the loss of the electrodes 1-15 themselves and each other in the electrode area.
[0140] Step 660: Input the source domain electrode features and the target domain electrode features into the second electrode sub-convolution layer in the electrode convolution layer to obtain the source domain electrode region features and the target domain electrode region features, and determine the first training process of the to-be-trained model based on the source domain electrode region features and the target domain electrode region features.
[0141] Through the second electrode sub-convolution layer, the source domain electrode features and the target domain electrode features are fused by region to obtain the features of each source domain electrode region and the features of each target domain electrode region.
[0142] In this embodiment, optionally, the first training process of determining the to-be-trained model according to the source domain electrode region features and the target domain electrode region features includes:
[0143] Determine the first source domain region weights of the corresponding regions of the left and right brain of the source domain, and determine the source domain left and right brain electrode region distribution difference loss function based on the first source domain region weights, source domain electrode region characteristics, the number of source domain electrode regions, and the number of source domain EEG signal samples;
[0144] Determine the first target domain region weights of the corresponding regions of the left and right brain of the target domain, and determine the target domain left and right brain electrode region distribution difference loss function based on the first target domain region weights, target domain electrode region characteristics, the number of target domain electrode regions, and the number of target domain EEG signal samples;
[0145] The first training process is determined by expanding the regional distribution distance between the corresponding electrode regions of the left and right brain of the source domain according to the loss function of the difference in regional distribution of the left and right brain electrodes in the source domain, and by expanding the regional distribution distance between the corresponding electrode regions of the left and right brain of the target domain according to the loss function of the difference in regional distribution of the left and right brain electrodes in the target domain.
[0146] The first source domain region weight is used to achieve one-to-one source domain electrode region alignment; the source domain left and right brain electrode region distribution difference loss function is determined based on the first source domain region weight, source domain electrode region characteristics, the number of source domain electrode regions, and the number of source domain EEG signal samples, which can be expressed as the following formula:
[0147]
[0148] in, Represents the difference loss function of the source domain left and right brain electrode area distribution, represents the weight of the first source domain, Represents the source domain electrode area feature, l1 and l2 represent the variables of the electrode area, n1 and n2 represent the variables of the EEG signal sample, Represents the depth features in the source domain associated with the electrode region.
[0149] The weight of the first source domain area can be determined by the following formula:
[0150]
[0151] The first target domain region weight is used to achieve one-to-one alignment of the target domain electrode regions. The target domain left and right brain electrode region distribution difference loss function is determined based on the first target domain region weight, target domain electrode region characteristics, target domain electrode region number, and target domain EEG signal sample number, which can be expressed as the following formula:
[0152]
[0153] in, Represents the difference loss function of the target domain left and right brain electrode area distribution, represents the weight of the first target domain area, represents the target domain electrode area characteristics, Represents the deep features associated with the electrode area in the target domain.
[0154] The first training process of the model to be trained may include calculating a source domain left-brain electrode regional distribution difference loss value through a source domain left-brain electrode regional distribution difference loss function, increasing the source domain left-brain electrode regional distribution difference loss value by changing model parameters, that is, expanding the regional distribution distance between the corresponding electrode regions of the source domain left and right brain, and ultimately making the source domain left-brain electrode regional distribution difference loss value meet a preset threshold. Calculating a target domain left-brain electrode regional distribution difference loss value through a target domain left-brain electrode regional distribution difference loss function, increasing the target domain left-brain electrode regional distribution difference loss value by changing model parameters, that is, expanding the regional distribution distance between the corresponding electrode regions of the target domain left and right brain, and ultimately making the target domain left-brain electrode regional distribution difference loss value meet a preset threshold.
[0155] Figure 7b A schematic diagram of calculating the distribution difference loss between different electrode regions in the left and right brain regions provided in the third embodiment of the present invention is shown as follows: Figure 7b As shown, the left brain area includes electrode areas 1-5, and the right brain area includes electrode areas 6-10, among which electrode areas 1 and 6, 2 and 7, 3 and 8, 4 and 9, 5 and 10 correspond to each other. Then, the difference loss of the distribution of left and right brain electrode areas is calculated as the loss between electrode areas 1 and 6, 2 and 7, 3 and 8, 4 and 9, 5 and 10.
[0156] Since the classification task of motor imagery EEG signals distinguishes between the left and right brain, the EEG features of the left and right brain regions will have different data distributions in the same task. Through the first training process, the regional distribution distance between the corresponding electrode areas of the left and right brain in the source domain is expanded, and the regional distribution distance between the corresponding electrode areas of the left and right brain in the target domain is expanded, the feature distribution difference between the left and right brain electrode areas is increased in an orderly manner, thereby improving the accuracy of subsequent left and right classification judgments.
[0157] In this embodiment, optionally, the first training process of determining the to-be-trained model according to the source domain electrode region features and the target domain electrode region features includes:
[0158] Determine the second source domain region weight and the second target domain region weight of each corresponding region of the source domain and the target domain, and determine the source domain and target domain region distribution difference loss function based on the second source domain region weight, the second target domain region weight, the source domain electrode region characteristics, the number of source domain electrode regions, the number of source domain EEG signal samples, the target domain electrode region characteristics, the number of target domain electrode regions, and the number of target domain EEG signal samples;
[0159] The first training process is determined by shortening the regional distribution distance between the corresponding electrode regions of the source domain and the target domain according to the regional distribution difference loss function of the source domain and the target domain.
[0160] The second source domain region weight and the second target domain region weight are used to achieve one-to-one alignment of the source domain electrode region and the target domain electrode region. According to the second source domain region weight, the second target domain region weight, the source domain electrode region characteristics, the number of source domain electrode regions, the number of source domain EEG signal samples, the target domain electrode region characteristics, the number of target domain electrode regions and the number of target domain EEG signal samples, the source domain and target domain region distribution difference loss function is determined, which can be expressed as the following formula:
[0161]
[0162] in, Represents the difference loss function between the source domain and the target domain. represents the weight of the second source domain, Represents the second target domain area weight.
[0163] The second source domain area weight and the second target domain area weight can be determined by the following formula:
[0164]
[0165] The first training process of the model to be trained may include calculating the regional distribution difference loss value of the left and right brain electrodes in the source domain and the target domain through the regional distribution difference loss function of the source domain and the target domain, and reducing the regional distribution difference loss value of the left and right brain electrodes in the source domain and the target domain by changing the model parameters, that is, shortening the regional distribution distance between the corresponding electrode areas of the source domain and the target domain, and finally making the regional distribution difference loss value of the left and right brain electrodes in the source domain and the target domain meet the preset threshold.
[0166] Figure 7c This is a schematic diagram of calculating the distribution difference loss between the left brain electrode regions of the source domain and the target domain provided by the third embodiment of the present invention, as shown in FIG. Figure 7c As shown, the left brain regions of the source domain and the target domain both contain electrode regions 1-5 and correspond to each other. The distribution difference between the left brain electrode regions of the source domain and the target domain is calculated by calculating the loss between the electrode regions 1-5 of the source domain and the target domain respectively.
[0167] Since it is necessary to train the EEG signal classification model to achieve cross-user classification, the first training process is used to orderly shorten the regional distribution distance between the corresponding electrode areas in the source domain and the target domain, increase the similarity between the source domain electrode area characteristics and the target domain electrode area characteristics, and improve the accuracy of subsequent cross-user classification judgments.
[0168] Step 670: Input the source domain electrode area features and the target domain electrode area features into the electrode area convolution layer in the model to be trained to obtain the source domain left and right brain area features and the target domain left and right brain area features, and determine the second training process of the model to be trained based on the source domain left and right brain area features and the target domain left and right brain area features.
[0169] In this embodiment, optionally, a second training process of determining a model to be trained based on the left and right brain region features of the source domain and the left and right brain region features of the target domain includes:
[0170] Determine the difference loss function of the source domain left and right brain region distribution according to the source domain left and right brain region characteristics, the number of source domain EEG signal samples, and the number of brain hemispheres;
[0171] Determine the target domain left and right brain region distribution difference loss function based on the target domain left and right brain region characteristics, the target domain EEG signal sample number, and the number of brain hemispheres;
[0172] The second training process is determined by expanding the distribution distance between the left and right brain regions of the source domain according to the distribution difference loss function of the left and right brain regions of the source domain, and expanding the distribution distance between the left and right brain regions of the target domain according to the distribution difference loss function of the left and right brain regions of the target domain.
[0173] The difference loss function of the distribution of the left and right brain regions of the source domain is determined according to the characteristics of the left and right brain regions of the source domain, the number of EEG signal samples in the source domain, and the number of brain hemispheres. The difference loss function of the distribution of the left and right brain regions of the target domain is determined according to the characteristics of the left and right brain regions of the target domain, the number of EEG signal samples in the target domain, and the number of brain hemispheres. It can be expressed as the following formula:
[0174]
[0175] in, Represents the difference loss function of the left and right brain regions distribution in the source domain, It represents the difference loss function between the left and right brain regions of the target domain, h represents the correlation with the brain hemisphere, and h in the formula represents the number of brain hemispheres, which is usually 2. represents the deep features related to the brain hemisphere in the source domain, represents the deep features related to the brain hemisphere in the target domain, represents the characteristics of the left brain area of the source domain, represents the characteristics of the right brain area of the source domain, represents the left brain area characteristics of the target domain, Represents the right brain area characteristics of the target domain.
[0176] The second training process of the to-be-trained model may include calculating a source domain left-right brain region distribution difference loss value through a source domain left-right brain region distribution difference loss function, increasing the source domain left-right brain region distribution difference loss value by changing model parameters, i.e., expanding the distance between the source domain left-right brain region feature distributions, ultimately causing the source domain left-right brain region distribution difference loss value to meet a preset threshold. Calculating a target domain left-right brain region distribution difference loss value through a target domain left-right brain region distribution difference loss function, increasing the target domain left-right brain region distribution difference loss value by changing model parameters, i.e., expanding the distance between the target domain left-right brain region feature distributions, ultimately causing the target domain left-right brain region distribution difference loss value to meet a preset threshold.
[0177] Figure 7d A schematic diagram of calculating the difference loss between left and right brain regions provided in the third embodiment of the present invention is shown as follows: Figure 7d As shown, calculating the difference loss in the distribution between the left and right brain regions is calculating the loss between the left brain region and the right brain region.
[0178] Since the classification task of motor imagery EEG signals distinguishes between the left and right brain, the EEG features of the left and right brain regions will have different data distributions in the same task. By expanding the brain region distribution distance between the left and right brain regions in the source domain and the brain region distribution distance between the left and right brain regions through the second training process, the feature distribution difference between the left and right brain regions is increased in an orderly manner, thereby improving the accuracy of subsequent left and right classification judgments.
[0179] Step 680: Input the left and right brain region features of the source domain and the left and right brain region features of the target domain into the left and right brain region convolutional layers in the model to be trained to obtain the overall brain region features of the source domain and the overall brain region features of the target domain, and determine the third training process of the model to be trained based on the overall brain region features of the source domain and the overall brain region features of the target domain.
[0180] In this embodiment, optionally, a third training process of determining a to-be-trained model based on the overall brain region features of the source domain and the overall brain region features of the target domain includes:
[0181] Determine the overall distribution difference loss function of the source domain and the target domain based on the overall brain region characteristics of the source domain, the overall brain region characteristics of the target domain, the number of source domain EEG signal samples, and the number of target domain EEG signal samples;
[0182] The third training process is determined by shortening the distribution distance between the overall brain regions of the source domain and the target domain based on the overall distribution difference loss function of the source domain and the target domain.
[0183] According to the overall brain region characteristics of the source domain, the overall brain region characteristics of the target domain, the number of source domain EEG signal samples, and the number of target domain EEG signal samples, the overall distribution difference loss function of the source domain and the target domain is determined, which can be expressed as the following formula:
[0184]
[0185] in, Represents the overall distribution difference loss function between the source domain and the target domain, Represents the overall brain region characteristics of the source domain, Represents the overall brain region characteristics of the target domain, represents the deep features related to the whole brain region in the source domain, Represents deep features related to the overall brain region in the target domain.
[0186] The third training process of the model to be trained may include calculating the overall brain area distribution difference loss value of the source domain and the target domain through the overall distribution difference loss function of the source domain and the target domain, and reducing the overall brain area distribution difference loss value of the source domain and the target domain by changing the model parameters, that is, shortening the overall distribution distance between the source domain and the target domain, and finally making the overall brain area distribution difference loss value of the source domain and the target domain meet the preset threshold.
[0187] like Figure 7e As shown in , calculating the overall distribution difference loss between the source domain and the target domain is to calculate the loss of the overall data of the source domain and the target domain.
[0188] Since it is necessary to train the EEG signal classification model to achieve cross-user classification, the third training process shortens the distribution distance between the overall brain regions of the source domain and the target domain, increases the similarity between the overall brain region characteristics of the source domain and the overall brain region characteristics of the target domain, and improves the accuracy of subsequent cross-user classification judgments.
[0189] Step 690: Train the model to be trained according to at least one of the first training process, the second training process, and the third training process to obtain a trained EEG signal classification model.
[0190] The source domain electrode features and target domain electrode features obtained by the first electrode sub-convolution layer are used through the fourth training process to shorten the distribution distance between the electrodes within each electrode area as much as possible, so that the depth features contained in the electrode area are more compact and unique, thereby improving the effectiveness of obtaining the source domain electrode area features and target domain electrode area features obtained by the subsequent second electrode sub-convolution layer, and improving the accuracy of subsequent classification judgment.
[0191] Figure 8 This is a schematic diagram of an adaptive network structure of an EEG signal classification model provided in the third embodiment of the present invention, as shown in FIG. Figure 8 As shown in the figure, the left half is the network structure, and the right half is the feature adaptation diagram. The electrode feature z is extracted through the first electrode sub-convolution layer. 1 , shorten the electrode distribution distance in each electrode area through the fourth training process; extract the electrode area feature z through the second electrode sub-convolution layer 2 Through the first training process, the regional distribution distance between the corresponding electrode areas of the left and right brain of the source domain is expanded, the regional distribution distance between the corresponding electrode areas of the left and right brain of the target domain is expanded, and the regional distribution distance between the corresponding electrode areas of the source domain and the target domain is shortened; the left and right brain region features z are extracted through the electrode region convolution layer 3 Through the second training process, the distribution distance between the left and right brain regions of the source domain is expanded, as well as the distribution distance between the left and right brain regions of the target domain; the overall brain region feature z is extracted through the left and right brain region convolution layer 4 , through the third training process, shorten the distribution distance between the source domain and the target domain; and z 4 Finally, input the fully connected layer.
[0192] Because different users have varying degrees of head shape, head circumference, and excitability in various brain regions, the low spatial resolution of EEG data can also lead to differences between electrodes and electrode regions. By constructing various loss functions to describe the distribution differences between electrodes, electrode regions, and left and right brain regions, we can adaptively align the deep features of each electrode, region, left and right brain region, and the entire brain region during model training, completing the alignment of EEG data at the electrode and electrode region scales.
[0193] Example 4
[0194] Figure 9This is a flowchart of a method for classifying EEG signals provided in the fourth embodiment of the present invention. This embodiment is applicable to the classification of motor imagery EEG signals. This method can be performed by the EEG signal classification device provided in the embodiment of the present invention, which can be implemented in software and / or hardware. Figure 9 The EEG signal classification model training method provided in this embodiment includes:
[0195] Step 910: Obtain the EEG signal to be identified of the target domain user; wherein the EEG signal to be identified is a motor imagery EEG signal.
[0196] The EEG signals to be identified are EEG signals obtained from the target domain user and that need to be classified and identified. For example, they are collected when the target domain user imagines a specific action. The EEG signals to be identified are usually different from the original target domain EEG signals used in training the EEG signal classification model.
[0197] Step 920: Input the EEG signal to be identified into a pre-trained EEG signal classification model to obtain a signal classification result of the EEG signal to be identified.
[0198] The EEG signal to be identified is input into a pre-trained EEG signal classification model to obtain a signal classification result of the EEG signal to be identified. The signal classification result may be whether the target domain user imagines the action to be issued by the left hand or the right hand. This embodiment does not limit this.
[0199] The EEG signal classification model is trained based on the EEG signal classification model training method of any embodiment of the present invention.
[0200] By inputting the EEG signal to be identified into the EEG signal classification model trained by the EEG signal classification model training method based on any embodiment of the present invention, a signal classification result of the EEG signal to be identified is obtained, thereby improving the accuracy and efficiency of signal classification.
[0201] Example 5
[0202] Figure 10 This is a schematic diagram of the structure of an EEG signal classification model training device provided by the fifth embodiment of the present invention. The device can be implemented by hardware and / or software, can execute an EEG signal classification model training method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. Figure 10 As shown, the device includes:
[0203] The EEG signal acquisition module 1010 is configured to acquire original source-domain EEG signals of a source-domain user and original target-domain EEG signals of a target-domain user; wherein the original source-domain EEG signals and the original target-domain EEG signals are motor imagery EEG signals;
[0204] A first training process determination module 1020 is configured to input the original source domain EEG signal and the original target domain EEG signal into an electrode convolution layer in a pre-constructed model to be trained, obtain source domain electrode region features and target domain electrode region features, and determine a first training process of the model to be trained based on the source domain electrode region features and the target domain electrode region features;
[0205] A second training process determination module 1030 is configured to input the source domain electrode region features and the target domain electrode region features into the electrode region convolution layer in the to-be-trained model, obtain source domain left and right brain region features and target domain left and right brain region features, and determine a second training process of the to-be-trained model based on the source domain left and right brain region features and the target domain left and right brain region features;
[0206] A third training process determination module 1040 is configured to input the source domain left and right brain region features and the target domain left and right brain region features into the left and right brain region convolutional layers of the to-be-trained model, obtain the source domain overall brain region features and the target domain overall brain region features, and determine the third training process of the to-be-trained model based on the source domain overall brain region features and the target domain overall brain region features;
[0207] The model training module 1050 is used to train the model to be trained according to at least one of the first training process, the second training process and the third training process to obtain a trained EEG signal classification model.
[0208] Based on the above technical solutions, optionally, the first training process determination module includes:
[0209] a first convolution kernel step length acquisition unit, configured to acquire a first preset convolution kernel and a first preset step length of the electrode convolution layer; wherein the first preset convolution kernel includes information about the number of electrodes in each electrode region, and the first preset step length includes information about the number of electrodes overlapping between the electrode regions;
[0210] a source domain electrode region feature determination unit, configured to determine the source domain electrode region feature according to the first preset convolution kernel, the first preset step size, and the original source domain EEG signal;
[0211] The target domain electrode area feature determination unit is used to determine the target domain electrode area feature according to the first preset convolution kernel, the first preset step size and the original target domain EEG signal.
[0212] Based on the above technical solutions, optionally, the second training process determination module includes:
[0213] a second convolution kernel step size acquisition unit, configured to acquire a second preset convolution kernel and a second preset step size of the electrode region convolution layer; wherein the second preset convolution kernel includes information on the number of electrode regions in the left hemisphere or the right hemisphere;
[0214] a source domain left and right brain region feature determination unit, configured to determine the source domain left and right brain region features according to the second preset convolution kernel, the second preset step size, and the source domain electrode region features;
[0215] The target domain left and right brain region feature determination unit is used to determine the target domain left and right brain region features according to the second preset convolution kernel, the second preset step size and the target domain electrode area features.
[0216] On the basis of the above technical solutions, optionally, the device further includes:
[0217] an electrode feature obtaining unit, configured to input the original source domain EEG signal and the original target domain EEG signal into the first electrode subconvolution layer in the electrode convolution layer before the first training process determination module executes to obtain the source domain electrode region feature and the target domain electrode region feature, to obtain the source domain electrode feature and the target domain electrode feature;
[0218] a source domain electrode distribution difference loss function determining unit, configured to determine a source domain electrode distribution difference loss function according to the source domain electrode characteristics, the number of source domain electrode regions, the number of source domain electrodes, and the number of source domain EEG signal samples;
[0219] a target domain electrode distribution difference loss function determining unit, configured to determine a target domain electrode distribution difference loss function according to the target domain electrode features, the number of target domain electrode regions, the number of target domain electrodes, and the number of target domain EEG signal samples;
[0220] a fourth training process determining unit, configured to determine a fourth training process of the to-be-trained model by shortening the electrode distribution distance within each of the source domain electrode regions according to the source domain electrode distribution difference loss function, and shortening the electrode distribution distance within each of the target domain electrode regions according to the target domain electrode distribution difference loss function;
[0221] The electrode region feature obtaining unit is configured to input the source domain electrode feature and the target domain electrode feature into the second electrode sub-convolution layer in the electrode convolution layer to obtain the source domain electrode region feature and the target domain electrode region feature.
[0222] Based on the above technical solutions, optionally, the first training process determination module includes:
[0223] a source domain left and right brain electrode area distribution difference loss function determination unit, configured to determine first source domain area weights for respective corresponding areas of the source domain left and right brain, and determine the source domain left and right brain electrode area distribution difference loss function based on the first source domain area weights, the source domain electrode area characteristics, the number of source domain electrode areas, and the number of source domain EEG signal samples;
[0224] a target domain left and right brain electrode area distribution difference loss function determination unit, configured to determine first target domain area weights for respective corresponding areas of the left and right brain in the target domain, and determine the target domain left and right brain electrode area distribution difference loss function based on the first target domain area weights, the target domain electrode area features, the number of target domain electrode areas, and the number of target domain EEG signal samples;
[0225] The first determination unit of the first training process is used to determine the first training process by expanding the regional distribution distance between the corresponding electrode areas of the left and right brain of the source domain according to the regional distribution difference loss function of the left and right brain electrodes of the source domain, and expanding the regional distribution distance between the corresponding electrode areas of the left and right brain of the target domain according to the regional distribution difference loss function of the left and right brain electrodes of the target domain.
[0226] Based on the above technical solutions, optionally, the first training process determination module includes:
[0227] a source domain and target domain regional distribution difference loss function determination unit, configured to determine a second source domain regional weight and a second target domain regional weight for each corresponding region of the source domain and the target domain, and determine the source domain and target domain regional distribution difference loss function based on the second source domain regional weight, the second target domain regional weight, the source domain electrode region characteristics, the number of source domain electrode regions, the number of source domain EEG signal samples, the target domain electrode region characteristics, the number of target domain electrode regions, and the number of target domain EEG signal samples;
[0228] The second determination unit of the first training process is used to determine the first training process by shortening the regional distribution distance between the corresponding electrode areas of the source domain and the target domain according to the regional distribution difference loss function of the source domain and the target domain.
[0229] Based on the above technical solutions, optionally, the second training process determination module includes:
[0230] a source domain left and right brain region distribution difference loss function determination unit, configured to determine the source domain left and right brain region distribution difference loss function according to the source domain left and right brain region characteristics, the number of source domain EEG signal samples, and the number of cerebral hemispheres;
[0231] a target domain left and right brain region distribution difference loss function determination unit, configured to determine the target domain left and right brain region distribution difference loss function according to the target domain left and right brain region characteristics, the number of target domain EEG signal samples, and the number of cerebral hemispheres;
[0232] The second training process determination unit is used to determine the second training process by expanding the distribution distance of the left and right brain areas of the source domain according to the distribution difference loss function of the left and right brain areas of the source domain, and expanding the distribution distance of the left and right brain areas of the target domain according to the distribution difference loss function of the left and right brain areas of the target domain.
[0233] Based on the above technical solutions, optionally, the third training process determination module includes:
[0234] a source domain and target domain overall distribution difference loss function determination unit, configured to determine the source domain and target domain overall distribution difference loss function based on the source domain overall brain region characteristics, the target domain overall brain region characteristics, the number of source domain EEG signal samples, and the number of target domain EEG signal samples;
[0235] The third training process determination unit is used to determine the third training process by shortening the distribution distance between the overall brain regions of the source domain and the target domain according to the overall distribution difference loss function of the source domain and the target domain.
[0236] On the basis of the above technical solutions, optionally, the device further includes:
[0237] An electrode numbering status updating module is used for updating the electrode numbering status of the signal acquisition electrodes corresponding to the original source domain EEG signal and the original target domain EEG signal according to a preset numbering rule before the first training process determination module executes the input of the original source domain EEG signal and the original target domain EEG signal into the electrode convolution layer of the pre-built model to be trained; wherein the preset numbering rule includes the left and right brain numbering rule, and one of the horizontal electrode numbering rule and the vertical electrode numbering rule.
[0238] Figure 11 This is a structural diagram of an EEG signal classification device provided in Example 5 of the present invention. The device can be implemented by hardware and / or software, can execute an EEG signal classification method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. Figure 11 As shown, the device includes:
[0239] The signal acquisition module 1110 is configured to acquire an EEG signal to be identified of a user in the target domain; wherein the EEG signal to be identified is a motor imagery EEG signal;
[0240] The signal classification module 1120 inputs the EEG signal to be identified into a pre-trained EEG signal classification model to obtain a signal classification result of the EEG signal to be identified, wherein the EEG signal classification model is trained based on the EEG signal classification model training method described in any embodiment of the present invention.
[0241] Example 6
[0242] Figure 12 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0243] like Figure 12 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0244] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0245] The processor 11 can be various general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the EEG signal classification model training method and / or the EEG signal classification method.
[0246] In some embodiments, the EEG signal classification model training method and / or the EEG signal classification method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the EEG signal classification model training method and / or the EEG signal classification method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the EEG signal classification model training method and / or the EEG signal classification method in any other appropriate manner (for example, by means of firmware).
[0247] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system comprising at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0248] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0249] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0250] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0251] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0252] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0253] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0254] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A method for training an EEG signal classification model, characterized in that: include: Obtaining original source-domain EEG signals of a source-domain user and original target-domain EEG signals of a target-domain user; wherein the original source-domain EEG signals and the original target-domain EEG signals are motor imagery EEG signals; Inputting the original source domain EEG signal and the original target domain EEG signal into an electrode convolution layer of a pre-constructed model to be trained, obtaining source domain electrode region features and target domain electrode region features, and determining a first training process of the model to be trained based on the source domain electrode region features and the target domain electrode region features; Inputting the source domain electrode region features and the target domain electrode region features into the electrode region convolution layer in the to-be-trained model to obtain source domain left and right brain region features and target domain left and right brain region features, and determining a second training process of the to-be-trained model based on the source domain left and right brain region features and the target domain left and right brain region features; Inputting the source domain left and right brain region features and the target domain left and right brain region features into the left and right brain region convolutional layers of the to-be-trained model to obtain source domain overall brain region features and target domain overall brain region features, and determining a third training process of the to-be-trained model based on the source domain overall brain region features and the target domain overall brain region features; The model to be trained is trained according to the first training process, the second training process and the third training process to obtain a trained EEG signal classification model.
2. The method according to claim 1, characterized in that Inputting the original source domain EEG signal and the original target domain EEG signal into the electrode convolution layer of the pre-built model to be trained to obtain source domain electrode region features and target domain electrode region features, including: Obtaining a first preset convolution kernel and a first preset step size of the electrode convolution layer; wherein the first preset convolution kernel includes information about the number of electrodes in each electrode area, and the first preset step size includes information about the number of electrodes overlapping between the electrode areas; Determining the source domain electrode region feature according to the first preset convolution kernel, the first preset step size, and the original source domain EEG signal; The target domain electrode area feature is determined according to the first preset convolution kernel, the first preset step size and the original target domain EEG signal.
3. The method according to claim 2, characterized in that Inputting the source domain electrode region features and the target domain electrode region features into the electrode region convolution layer in the to-be-trained model to obtain source domain left and right brain region features and target domain left and right brain region features, including: Obtaining a second preset convolution kernel and a second preset step size of the electrode area convolution layer; wherein the second preset convolution kernel includes information on the number of electrode areas in the left hemisphere or the right hemisphere; Determining the left and right brain region features of the source domain according to the second preset convolution kernel, the second preset step size, and the source domain electrode region features; The left and right brain region features of the target domain are determined according to the second preset convolution kernel, the second preset step size and the target domain electrode area features.
4. The method according to claim 1, wherein Before obtaining the source domain electrode region features and the target domain electrode region features, the following steps are also included: Inputting the original source domain EEG signal and the original target domain EEG signal into the first electrode subconvolution layer in the electrode convolution layer to obtain source domain electrode features and target domain electrode features; Determining a source domain electrode distribution difference loss function according to the source domain electrode characteristics, the number of source domain electrode regions, the number of source domain electrodes, and the number of source domain EEG signal samples; Determining a target domain electrode distribution difference loss function according to the target domain electrode characteristics, the number of target domain electrode regions, the number of target domain electrodes, and the number of target domain EEG signal samples; Determining a fourth training process of the to-be-trained model by shortening the electrode distribution distance within each of the source domain electrode regions according to the source domain electrode distribution difference loss function, and shortening the electrode distribution distance within each of the target domain electrode regions according to the target domain electrode distribution difference loss function; The source domain electrode features and the target domain electrode features are input into the second electrode sub-convolution layer in the electrode convolution layer to obtain the source domain electrode region features and the target domain electrode region features.
5. The method according to claim 1, wherein The first training process of determining the to-be-trained model according to the source domain electrode region feature and the target domain electrode region feature includes: Determining first source domain region weights for respective corresponding regions of the left and right brain of the source domain, and determining a source domain left and right brain electrode region distribution difference loss function based on the first source domain region weights, the source domain electrode region characteristics, the number of source domain electrode regions, and the number of source domain EEG signal samples; Determining first target domain region weights for respective regions of the left and right brain of the target domain, and determining a target domain left and right brain electrode region distribution difference loss function based on the first target domain region weights, the target domain electrode region characteristics, the number of target domain electrode regions, and the number of target domain EEG signal samples; The first training process is determined by expanding the regional distribution distance between the corresponding electrode regions of the left and right brain of the source domain according to the regional distribution difference loss function of the left and right brain electrodes of the source domain, and expanding the regional distribution distance between the corresponding electrode regions of the left and right brain of the target domain according to the regional distribution difference loss function of the left and right brain electrodes of the target domain.
6. The method according to claim 1, characterized in that The first training process of determining the to-be-trained model according to the source domain electrode region feature and the target domain electrode region feature includes: Determine a second source domain region weight and a second target domain region weight for each corresponding region of the source domain and the target domain, and determine a source domain and target domain region distribution difference loss function based on the second source domain region weight, the second target domain region weight, the source domain electrode region characteristics, the number of source domain electrode regions, the number of source domain EEG signal samples, the target domain electrode region characteristics, the number of target domain electrode regions, and the number of target domain EEG signal samples; The first training process is determined by shortening the regional distribution distance between the corresponding electrode regions of the source domain and the target domain according to the regional distribution difference loss function of the source domain and the target domain.
7. The method according to claim 1, characterized in that The second training process of determining the to-be-trained model according to the left and right brain region features of the source domain and the left and right brain region features of the target domain includes: Determine a source domain left and right brain region distribution difference loss function according to the source domain left and right brain region characteristics, the source domain EEG signal sample number, and the number of brain hemispheres; Determine a target domain left and right brain region distribution difference loss function according to the target domain left and right brain region characteristics, the target domain EEG signal sample number, and the number of brain hemispheres; The second training process is determined by expanding the distribution distance between the left and right brain regions of the source domain according to the distribution difference loss function of the left and right brain regions of the source domain, and expanding the distribution distance between the left and right brain regions of the target domain according to the distribution difference loss function of the left and right brain regions of the target domain.
8. The method according to claim 1, characterized in that The third training process of determining the to-be-trained model according to the overall brain region features of the source domain and the overall brain region features of the target domain includes: Determining a loss function for the overall distribution difference between the source domain and the target domain according to the overall brain region characteristics of the source domain, the overall brain region characteristics of the target domain, the number of source domain EEG signal samples, and the number of target domain EEG signal samples; The third training process is determined by shortening the distribution distance between the overall brain regions of the source domain and the target domain according to the overall distribution difference loss function of the source domain and the target domain.
9. The method according to any one of claims 1 to 8, characterized in that Before inputting the original source domain EEG signal and the original target domain EEG signal into the electrode convolution layer of the pre-built to-be-trained model, the method further includes: According to the preset numbering rules, the electrode numbering status of the signal acquisition electrodes corresponding to the original source domain EEG signal and the original target domain EEG signal is updated; wherein the preset numbering rules include left and right brain numbering rules, and one of the horizontal electrode numbering rules and the vertical electrode numbering rules.
10. A method for classifying EEG signals, characterized in that: include: Acquire an EEG signal to be identified of a target domain user; wherein the EEG signal to be identified is a motor imagery EEG signal; The EEG signal to be identified is input into a pre-trained EEG signal classification model to obtain a signal classification result of the EEG signal to be identified, wherein the EEG signal classification model is trained based on the EEG signal classification model training method according to any one of claims 1 to 9.
11. A device for training an EEG signal classification model, characterized in that: include: an EEG signal acquisition module, configured to acquire original source-domain EEG signals of a source-domain user and original target-domain EEG signals of a target-domain user; wherein the original source-domain EEG signals and the original target-domain EEG signals are motor imagery EEG signals; a first training process determination module, configured to input the original source domain EEG signal and the original target domain EEG signal into an electrode convolution layer of a pre-constructed model to be trained, obtain source domain electrode region features and target domain electrode region features, and determine a first training process of the model to be trained based on the source domain electrode region features and the target domain electrode region features; a second training process determination module, configured to input the source domain electrode region features and the target domain electrode region features into the electrode region convolution layer in the to-be-trained model, obtain source domain left and right brain region features and target domain left and right brain region features, and determine the second training process of the to-be-trained model based on the source domain left and right brain region features and the target domain left and right brain region features; a third training process determination module, configured to input the source domain left and right brain region features and the target domain left and right brain region features into the left and right brain region convolutional layers of the to-be-trained model, obtain the source domain overall brain region features and the target domain overall brain region features, and determine the third training process of the to-be-trained model based on the source domain overall brain region features and the target domain overall brain region features; The model training module is used to train the model to be trained according to the first training process, the second training process and the third training process to obtain a trained EEG signal classification model.
12. An electroencephalogram signal classification device, characterized in that: include: A signal acquisition module to be identified is used to acquire an EEG signal to be identified of a target domain user; wherein the EEG signal to be identified is a motor imagery EEG signal; A signal classification module inputs the EEG signal to be identified into a pre-trained EEG signal classification model to obtain a signal classification result of the EEG signal to be identified, wherein the EEG signal classification model is trained based on the EEG signal classification model training method according to any one of claims 1 to 9.
13. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the EEG signal classification model training method described in any one of claims 1 to 9 and / or the EEG signal classification method described in claim 10.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the EEG signal classification model training method according to any one of claims 1 to 9 and / or the EEG signal classification method according to claim 10 when executed.
Citation Information
Patent Citations
Wasserstein distance-based similar adversarial network characterization model
CN113673347A
Cross-time individual identification method and system based on electroencephalogram signal deep learning
CN114912492A