Electroencephalogram signal adaptive transfer learning method and system, electronic equipment and storage medium

By adopting adaptive transfer learning methods in EEG signal classification technology, including source domain screening, feature extraction and joint loss optimization, the problems of domain differences, data imbalance and negative transfer are solved, and the generalization ability and classification performance of the model are improved.

CN120167977APending Publication Date: 2025-06-20GUANGZHOU UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510242892.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-03
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

The existing EEG signal classification technology based on transfer learning has problems such as domain differences, data imbalance and negative transfer, which affects the generalization ability and performance of the model.

Method used

An adaptive transfer learning method for EEG signals is proposed. By obtaining EEG data for preprocessing, the source domain and target domain are sorted out; each source domain is matched and filtered based on the target domain to obtain similar source domains; a preset source domain feature extractor is used to extract feature of EEG data in the similar source domain, and the EEG data in the target domain is featured through parameter transfer; the classification model is optimized and adjusted through joint loss based on the source domain characteristics, type tags and target domain characteristics.

Benefits of technology

It effectively solves the problems of differences between fields, data imbalance and negative migration, improves the generalization ability and classification performance of the model, simplifies data preparation, and has high practical value and promotion prospects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120167977A_ABST
    Figure CN120167977A_ABST
Patent Text Reader

Abstract

The invention discloses an electroencephalogram signal adaptive transfer learning method and system, electronic equipment and a storage medium, and the method comprises the steps: obtaining electroencephalogram data, preprocessing the electroencephalogram data to obtain EEG data, and then sorting the EEG data to obtain a source domain and a target domain; wherein the source domain is marked with a type label corresponding to the EEG data; based on the target domain, performing matching screening on each source domain to obtain a preset number of similar source domains; performing first feature extraction on the EEG data in the similar source domain based on a preset source domain feature extractor to obtain source domain features; performing second feature extraction on the EEG data of the target domain through parameter transfer to obtain target domain features; and according to the source domain features, the type labels and the target domain features, a preset classification model is optimized and adjusted through joint loss. The method solves the problems of inter-field difference, data imbalance, negative migration and the like in the existing transfer learning-based electroencephalogram signal classification technology, and can be widely applied to the technical field of data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and particularly relates to a method, system, electronic device and storage medium for adaptive transfer learning of electroencephalogram (EEG) signals. Background Art

[0002] Existing EEG signal classification technologies based on transfer learning have some drawbacks, including problems such as domain differences, data imbalance, and negative transfer. Specifically: 1. In practical applications, due to the high cost of obtaining and annotating EEG data, we usually face problems such as incomplete, unbalanced, and inaccurate annotation of the dataset. These problems will affect the generalization ability and performance of the model. And the test data often comes from a different data distribution from the training data, that is, a different domain. In this case, the performance of the model on the test data often drops significantly because the training data does not cover the distribution of the test data. Domain adaptation refers to adapting the model from one domain to another to improve the performance of the model in the target domain. It aims to solve the "data shift" problem caused by the distribution difference between domains. Domain adaptation can help us solve these problems and improve the generalization ability and performance of the model. 2. Negative transfer: Negative transfer refers to the knowledge learned in the source domain having a negative effect on the learning in the target domain. This may be due to the excessive difference or insufficient similarity between the source domain and the target domain. To solve the problem of negative transfer, it is necessary to carefully select the source domain and the target domain and ensure the similarity between them. The data preparation work is too cumbersome. Summary of the Invention

[0003] The present invention aims to solve the problems of related technical limitations to at least a certain extent. For this purpose, the present invention proposes a method, system, electronic device and storage medium for adaptive transfer learning of EEG signals, which can perform adaptive transfer learning of EEG signals efficiently and accurately.

[0004] On the one hand, an embodiment of the present invention provides a method for adaptive transfer learning of EEG signals, including the following steps:

[0005] Obtain EEG data, preprocess the EEG data to obtain EEG data, and then organize to obtain a source domain and a target domain; wherein, the source domain is marked with the type label corresponding to the EEG data;

[0006] Based on the target domain, perform matching and screening on each source domain to obtain a preset number of similar source domains;

[0007] Based on a preset source domain feature extractor, perform first feature extraction on the EEG data in the similar source domains to obtain source domain features;

[0008] Perform second feature extraction on the EEG data in the target domain through parameter transfer to obtain target domain features;

[0009] Optimize and adjust the preset classification model through the combined loss according to the source domain features, type tags, and target domain features.

[0010] Optionally, preprocess the electroencephalogram data to obtain EEG data, including the following steps:

[0011] Based on the first frequency range, perform band-pass filtering on the electroencephalogram data, and then use a notch filter with the target frequency to suppress power line noise;

[0012] Filter the electroencephalogram data after power line noise suppression through a fifth-order Butterworth band-pass filter with the second frequency range to obtain EEG data.

[0013] Optionally, based on the target domain, match and screen each source domain to obtain a preset number of similar source domains, including the following steps:

[0014] Calculate the source centroid of each source domain and the target centroid of the target domain based on the data points in the spatial dimension of the source domain and the target domain;

[0015] Based on the source centroid and the target centroid, process through a preset distance formula to obtain the distance between each source domain and the target domain;

[0016] Determine a preset number of source domains closest to the target domain as similar source domains according to the distance between each source domain and the target domain.

[0017] Optionally, the method further includes the following steps:

[0018] Construct a convolutional block according to the convolutional layer, batch normalization, ELU activation function, average pooling, and Dropout layer;

[0019] Add a wavelet transform convolutional module before the convolutional layer in the convolutional block, and then construct a source domain feature extractor according to the two convolutional blocks.

[0020] Optionally, perform second feature extraction on the EEG data of the target domain through parameter transfer to obtain target domain features, including the following steps:

[0021] Transfer the parameters of the source domain feature extractor to a preset target domain feature extractor through parameter transfer, and then perform second feature extraction on the EEG data of the target domain through the target domain feature extractor to obtain target domain features;

[0022] Among them, the target domain feature extractor has the same structure as the source domain feature extractor.

[0023] Optionally, the combined loss includes a classification loss, a maximum mean discrepancy loss, and a center loss; according to the source domain features, type labels, and target domain features, the preset classification model is optimized and adjusted through the combined loss, including the following steps:

[0024] According to the classification result of the EEG of the source domain by the classification model, the classification loss is calculated by combining the type labels;

[0025] According to the source domain features and target domain features, the maximum mean discrepancy loss is calculated based on the non-linear feature mapping function;

[0026] According to the number of types of type labels included in the source domain, the third feature extraction is performed on each sample of the source domain through a preset feature extraction function, and then the center loss is calculated by combining the center points corresponding to each type;

[0027] According to the classification loss, the maximum mean discrepancy loss, and the center loss, the gradient of the combined loss with respect to the model parameters of the classification model is obtained through backpropagation algorithm processing; based on the gradient, the model parameters of the classification model are optimized and adjusted through an optimization algorithm.

[0028] Optionally, according to the classification result of the EEG of the source domain by the classification model, the classification loss is calculated by combining the type labels, including the following steps:

[0029] Input the EEG data of the source domain into the classification model for classification processing to obtain the classification result corresponding to the source domain; the classification model includes a fully connected layer and a Softmax layer;

[0030] According to the classification result and the type labels of the corresponding source domain, the classification loss is calculated through the cross-entropy loss function.

[0031] On the other hand, an embodiment of the present invention provides an electroencephalogram signal adaptive transfer learning system, including:

[0032] The first module is used to obtain electroencephalogram data, preprocess the electroencephalogram data to obtain EEG data, and then organize to obtain the source domain and the target domain; wherein, the source domain is marked with the type labels corresponding to the EEG data;

[0033] The second module is used to perform matching and screening on each source domain based on the target domain to obtain a preset number of similar source domains;

[0034] The third module is used to perform the first feature extraction on the EEG data in the similar source domains based on a preset source domain feature extractor to obtain source domain features;

[0035] The fourth module is used to perform the second feature extraction on the EEG data of the target domain through parameter transfer to obtain target domain features;

[0036] The fifth module is used to optimize and adjust a preset classification model through a joint loss according to source domain features, type labels, and target domain features.

[0037] Optionally, the system further includes:

[0038] The sixth module is used to construct a convolutional block based on a convolutional layer, batch normalization, ELU activation function, average pooling, and Dropout layer;

[0039] The seventh module is used to add a wavelet transform convolutional module before the convolutional layer in the convolutional block, and then construct a source domain feature extractor according to two convolutional blocks.

[0040] On the other hand, an embodiment of the present invention provides an electronic device, including: a processor and a memory; the memory is used to store a program; the processor executes the program to implement the above-mentioned electroencephalogram signal adaptive transfer learning method.

[0041] On the other hand, an embodiment of the present invention provides a computer storage medium, in which a program executable by a processor is stored, and the program executable by the processor is used to implement the above-mentioned electroencephalogram signal adaptive transfer learning method when executed by the processor.

[0042] In the embodiment of the present invention, electroencephalogram data is obtained, the electroencephalogram data is preprocessed to obtain EEG data, and then the source domain and the target domain are sorted out; among them, the source domain is marked with the type label corresponding to the EEG data; based on the target domain, each source domain is matched and screened to obtain a preset number of similar source domains; based on a preset source domain feature extractor, the EEG data in the similar source domains is subjected to first feature extraction to obtain source domain features; the EEG data of the target domain is subjected to second feature extraction through parameter transfer to obtain target domain features; according to the source domain features, type labels, and target domain features, a preset classification model is optimized and adjusted through a joint loss. The embodiment of the present invention effectively solves problems such as inter-domain differences, data imbalance, and negative transfer in the existing electroencephalogram signal classification technology based on transfer learning through mechanisms such as domain adaptation, similar source domain screening, dual feature extraction, and joint loss optimization. This solution not only improves the generalization ability and classification performance of the model, but also simplifies the data preparation work, and has high practical value and popularization prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The drawings are used to provide a further understanding of the technical solutions of the present invention, and constitute a part of the specification. They are used to explain the technical solutions of the present invention together with the embodiments of the present invention, and do not constitute a limitation to the technical solutions of the present invention.

[0044] Figure 1 It is a schematic diagram of an implementation environment for performing electroencephalogram signal adaptive transfer learning provided by an embodiment of the present invention;

[0045] Figure 2 It is a schematic flowchart of an electroencephalogram (EEG) signal adaptive transfer learning method provided by an embodiment of the present invention;

[0046] Figure 3 It is a schematic diagram of a specific implementation process of the EEG signal adaptive transfer learning method provided by an embodiment of the present invention;

[0047] Figure 4 It is a schematic diagram of the logical architecture of the EEG signal adaptive transfer learning method provided by an embodiment of the present invention;

[0048] Figure 5 It is a schematic diagram of calculating the distance between the source domain and the target domain provided by an embodiment of the present invention;

[0049] Figure 6 It is a schematic diagram of an experimental paradigm applied to the EEG signal adaptive transfer learning method provided by an embodiment of the present invention;

[0050] Figure 7 It is a schematic structural diagram of an EEG signal adaptive transfer learning system provided by an embodiment of the present invention;

[0051] Figure 8 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners

[0052] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0053] It should be noted that although the functional modules are divided in the system schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order from the module division in the system or the order in the flowchart. The terms "first / S100", "second / S200", etc. in the specification and claims and the above drawings are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence.

[0054] Referring to "embodiment" herein means that a specific feature, structure or characteristic described in connection with the embodiment may be included in at least one embodiment of the present invention. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0055] For the convenience of understanding the technical solution of the present invention, first, the technical terms that may appear in the embodiments of the present invention are explained as follows:

[0056] DA: Domain Adaptation (domain adaptation) refers to the ability to transfer the model of the source domain to the target domain by learning the differences between the source domain and the target domain. In practical applications, due to the high cost of data acquisition and annotation, we usually face problems such as incomplete, unbalanced, and inaccurate annotation of the data set, which will affect the generalization ability and performance of the model. It aims to solve the "data shift" problem caused by the distribution difference between domains.

[0057] MMD: Maximum Mean Discrepancy (maximum mean discrepancy) is a commonly used domain adaptation method, and its basic idea is to maximize the mean difference between the source domain and the target domain. Specifically, we calculate the means of the source domain and the target domain in a certain kernel space, calculate the difference between them, and then maximize this difference. The purpose of doing this is to narrow the difference between the source domain and the target domain by maximizing the mean difference, and improve the generalization ability and performance of the model.

[0058] Center Loss: (center loss) is a metric learning loss function that reduces the intra-class difference by mapping features to the class centers in the feature space. The goal of the center loss is to make the features of the same class more compact, thereby improving the recognition ability of the model.

[0059] MMD is applicable to the case where the global distribution difference is large, while the center loss is applicable to the tasks that require emphasizing intra-class compactness.

[0060] It can be understood that the electroencephalogram signal adaptive transfer learning method provided by the embodiments of the present invention can be applied to any computer device with data processing and computing capabilities, and this computer device can be various types of terminals or servers. When the computer device in the embodiment is a server, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network, content delivery network), and big data and artificial intelligence platforms. Optionally, the terminal is a smart phone, a tablet computer, a notebook computer, a desktop computer, etc., but it is not limited thereto.

[0061] Such as Figure 1As shown, it is a schematic diagram of an implementation environment provided by an embodiment of the present invention. Refer to Figure 1 , this implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be network-connected by wireless or wired means to complete data transmission and exchange.

[0062] The server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0063] In addition, the server 101 can also be a node server in a blockchain network. Among them, the blockchain is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithms.

[0064] The terminal 102 can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal 102 and the server 101 can be directly or indirectly connected by wired or wireless communication means, and the embodiments of the present invention do not limit this here.

[0065] Exemplarily based on Figure 1 the shown implementation environment, an embodiment of the present invention provides a method for adaptive transfer learning of electroencephalogram signals. Taking the application of this method for adaptive transfer learning of electroencephalogram signals to the server 101 as an example for description, it can be understood that this method for adaptive transfer learning of electroencephalogram signals can also be applied to the terminal 102.

[0066] Refer to Figure 2 , Figure 2 is a flowchart of the method for adaptive transfer learning of electroencephalogram signals applied to the server provided by an embodiment of the present invention. The execution subject of this method for adaptive transfer learning of electroencephalogram signals can be any of the aforementioned computer devices (including the server or the terminal). Refer to Figure 2 , this method includes the following steps:

[0067] S100. Obtain electroencephalogram data, preprocess the electroencephalogram data to obtain EEG data, and then organize to obtain the source domain and the target domain;

[0068] Among them, the source domain is marked with the type label corresponding to the EEG data;

[0069] It should be noted that in some embodiments, preprocessing the electroencephalogram data to obtain EEG data may include the following steps: performing band-pass filtering on the electroencephalogram data based on a first frequency range, and then using a notch filter with a target frequency to suppress power line noise; filtering the electroencephalogram data after power line noise suppression through a fifth-order Butterworth band-pass filter with a second frequency range to obtain EEG data.

[0070] Exemplarily, in some specific embodiments, first collect the electroencephalogram data of past subjects and their corresponding labels and perform preprocessing, and combine the preprocessed electroencephalogram data of past subjects into the source domain and the target domain where n ∈ {1,....N}; represents the i-th source domain sample, represents the label of the i-th source domain sample, n s is the number of source domain samples; represents the j-th target domain sample, n t is the number of target domain samples.

[0071] In some specific application scenarios, the specific process of preprocessing can be implemented as follows: The data is first band-pass filtered between 0.5 Hz and 100 Hz, and then an additional 50 Hz notch filter is used to suppress power line noise; A fifth-order Butterworth band-pass filter of 4 - 38 Hz is further applied to filter the data.

[0072] S200. Based on the target domain, perform matching and screening on each source domain to obtain a preset number of similar source domains;

[0073] It should be noted that in some embodiments, step S200 may include the following steps: calculating the source centroid of each source domain and the target centroid of the target domain based on the data points in the spatial dimension of the source domain and the target domain; Based on the source centroid and the target centroid, processing through a preset distance formula to obtain the distance between each source domain and the target domain; According to the distance between each source domain and the target domain, determine a preset number of source domains closest to the target domain as similar source domains.

[0074] Exemplarily, in some specific embodiments, a source domain selection module can be used to select the K source domains most similar to the target domain. Specifically, the data processing flow of the source domain selection module can be implemented as follows:

[0075] First, use the formula to calculate the centroid of each source domain and the centroid of the target domain. For a point (x i1 , x i2 ,...., x id ) in the d-dimensional space, the centroid is calculated as follows:

[0076]

[0077] Subsequently, sort according to the distance between each source domain and the target domain, and select the K source domains closest to the target domain. The distance formula can adopt, for example, Euclidean distance and Mahalanobis distance.

[0078] S300. Perform first feature extraction on the EEG data in the similar source domains based on a preset source domain feature extractor to obtain source domain features;

[0079] Among them, in some embodiments, the method may further include the following steps: construct a convolutional block according to a convolutional layer, batch normalization, ELU activation function, average pooling, and Dropout layer; add a wavelet transform convolutional module before the convolutional layer in the convolutional block, and then construct a source domain feature extractor according to the two convolutional blocks.

[0080] Exemplarily, in some specific embodiments, input the selected K most similar source domains into the model (source domain feature extractor) to perform feature extraction on the source domain EEG data; specifically, after the source domain selection module selects the K most similar ones, use a convolutional layer (Conv2D), batch normalization (BatchNorm2D), ELU activation function, average pooling (AvgPool2D), and Dropout layer to extract the features of the EEG data. The feature extractor consists of two convolutional blocks (Conv.Block1 and Conv.Block2), and each block contains a convolutional layer, batch normalization, ELU activation, average pooling, and Dropout layer. Add a wavelet transform (WT) convolutional module before the convolutional layer (Conv2D). Each level of WT will increase the receptive field size of the layer, while the number of trainable parameters will only increase slightly. The design of the WTConv layer can capture low-frequency information better than the standard convolution. This is because after the input low-frequency information is decomposed by repeated wavelet transform (WT), the low-frequency information is emphasized, thereby increasing the response of the layer to low-frequency information.

[0081] S400. Perform second feature extraction on the EEG data of the target domain through parameter transfer to obtain target domain features;

[0082] It should be noted that, in some embodiments, step S400 may include the following steps: transfer the parameters of the source domain feature extractor to a preset target domain feature extractor through parameter transfer, and then perform second feature extraction on the EEG data of the target domain through the target domain feature extractor to obtain target domain features; among them, the structure of the target domain feature extractor is the same as that of the source domain feature extractor.

[0083] Exemplarily, in some specific embodiments, the parameters of the source domain feature extractor can be transferred to the target domain feature extractor through Parameters Transfer. Further, the features of the target domain can be extracted by the target domain feature extractor. Among them, the process of feature extraction for the target domain is the same as that for the source domain.

[0084] S500. Optimize and adjust a preset classification model according to the source domain features, type labels, and target domain features through a joint loss.

[0085] It should be noted that the joint loss includes a classification loss, a maximum mean discrepancy loss, and a center loss. In some embodiments, step S500 may include the following steps: calculating the classification loss according to the classification result of the EEG of the source domain by the classification model and combining the type labels; calculating the maximum mean discrepancy loss based on the source domain features and the target domain features using a non - linear feature mapping function; according to the number of types of type labels included in the source domain, performing third - feature extraction on each sample of the source domain through a preset feature extraction function, and then calculating the center loss in combination with the center point corresponding to each type; calculating the gradient of the joint loss with respect to the model parameters of the classification model through backpropagation algorithm based on the classification loss, the maximum mean discrepancy loss, and the center loss; and optimizing and adjusting the model parameters of the classification model through an optimization algorithm based on the gradient.

[0086] Among them, in some embodiments, calculating the classification loss according to the classification result of the EEG of the source domain by the classification model and combining the type labels may include the following steps: inputting the EEG data of the source domain into the classification model for classification processing to obtain the classification result corresponding to the source domain; the classification model includes a fully - connected layer and a Softmax layer; calculating the classification loss through a cross - entropy loss function according to the classification result and the type labels of the corresponding source domain.

[0087] Exemplarily, in some specific embodiments, after feature extraction, the data is further processed through a fully - connected layer to prepare for the final classification. Finally, the model is optimized according to the joint loss function, and the specific implementation can be as follows:

[0088] S51. After feature extraction, the data is further processed through a fully - connected layer. The Softmax layer converts the output of the fully - connected layer into a probability distribution, and each output node corresponds to a category. The Softmax function ensures that the output values are between 0 and 1, and the sum of all output values is 1. This enables the model to output the probability of each category, facilitating multi - classification tasks.

[0089] S52. After the Softmax layer, the output of the model is compared with the true label to calculate the loss function:

[0090] a. Classification loss: Usually, the Cross-Entropy Loss is used to measure the difference between the probability distribution predicted by the model and the true labels. The specific form of this cross-entropy loss function is:

[0091]

[0092] where is the source domain classification loss, J(·,·) represents the cross-entropy loss function, f(·) represents the neural network function, Ι(·) represents the indicator function which is 1 when the condition holds and 0 otherwise, represents the i-th source domain sample, represents the label of the i-th source domain sample, and m s is the number of source domain samples.

[0093] b. MMD loss (Maximum Mean Discrepancy loss): It is used to measure the distribution difference between the source domain and the target domain. By minimizing the MMD loss, the inter-domain difference can be reduced, and the generalization ability of the model in the target domain can be improved. The MMD loss function can be defined as:

[0094]

[0095] where and represent the deep feature representations of the EEG data in the source domain and the target domain respectively, represents the non-linear feature mapping function that maps the original samples to the Reproducing Kernel Hilbert Space (RKHS), N s and N t represent the number of samples in the source domain and the target domain respectively. represents the norm in the RKHS.

[0096] c. Center Loss: It is only used to reduce the difference within a class (such as the same class), but cannot effectively increase the difference between classes (such as different classes). The Center Loss function can be defined as:

[0097]

[0098] where N is the number of samples, C is the number of classes, x i is the i-th sample. f(.) is the feature extraction function that maps the sample to the feature space. c c is the center point of the c-th class. represents the square of the Euclidean distance.

[0099] S53. After calculating the loss function, the gradient of the loss function with respect to the model parameters is calculated by the backpropagation algorithm. Then, an optimization algorithm (such as SGD, Adam, etc.) is used to update the model parameters to minimize the loss function.

[0100] To explain the principle of the technical solution of the present invention in detail, the overall process of the present invention will be described below in conjunction with some specific embodiments. It is easy to understand that the following is an explanation of the technical principle of the present invention and should not be regarded as a limitation of the present invention.

[0101] First of all, it should be noted that the brain-computer interface (BCI) enables direct communication between the human brain and a computer through the user's neural activities. It can help, enhance, or even repair human cognitive or sensorimotor functions. Three classic paradigms in EEG-based brain-computer interfaces are event-related potentials, steady-state visual evoked potentials, and motor imagery (MI). In MI-based BCI, the user imagines the movement of his / her body parts (e.g., left hand, right hand, feet, or tongue), which regulates different regions of the brain's motor cortex. Then these images are mapped to specific commands for external device control. MI signals are triggered by changes in brain region activation and do not require external stimuli. Therefore, they are widely used in the rehabilitation field, such as stroke rehabilitation and the rehabilitation of paralyzed patients. However, since EEG signals are very weak, vulnerable to other body electrical signals and external environmental interference, have large individual differences, and are non-stationary (EEG signals of the same user at different times will be different), it is very difficult to design a brain-computer interface system with fixed machine learning model parameters that are optimal for different users, different EEG caps, and different tasks. Usually, calibration is required for new users, new devices, and new tasks, but this calibration process is time-consuming and laborious and unfriendly to users. Therefore, shortening or eliminating this calibration process is very important for the popularization and application of the brain-computer interface system.

[0102] The main idea of ​​transfer learning is to help calibrate the current user, device or task (target domain) through data from similar or related other users, devices (source domain) or tasks, which can alleviate individual differences and thus reduce or eliminate the calibration work, and is a promising solution. Recently, the application of transfer learning in networks has attracted great attention. Several studies have focused on using EEG signals to fine-tune pre-trained neural network architectures such as AlexNet, ResNet and VGG. The results of these efforts have shown that classification accuracy has improved through fine-tuning. Although fine-tuning provides a simple and user-friendly method, its effectiveness is significantly reduced when there is a significant difference between the source and target domain distributions. To address this limitation, deep domain adaptive neural networks have emerged. These networks have a common feature: the adaptation layer is incorporated into a specific network architecture to more closely adjust the data distribution between the source and target domains. Notable examples of these methods include DAN, DANN, DSAN, DeepCoral, etc. Networks such as MAtt, DDAF-CORAL and similar networks have been designed with specialized architectures for EEG data feature extraction and combined with adaptation layers. On the other hand, networks like MIDABAN and daSPDnet have replaced the adaptation layer with a generative adversarial mechanism. Adversarial generative methods have achieved superior results in many networks. Regardless of whether domain adaptation methods or adversarial generative mechanisms are used in deep networks, the main goal is still to enhance data distribution similarity. These methods represent advanced and effective methods for deep transfer learning on EEG data.

[0103] In transfer learning, the distribution difference between the source domain and the target domain is a key factor affecting the model performance. Existing transfer learning methods often have difficulty in effectively handling this distribution difference, resulting in insufficient generalization ability of the model on the target domain. Therefore, how to effectively select and utilize source domain data to improve the performance of the model on the target domain is an urgent problem to be solved.

[0104] The purpose of Maximum Mean Difference (MMD) is to measure the difference between two distributions. The larger the difference, the larger the MMD value; the smaller the difference, the smaller the MMD value. When training a model, if the training data and test data come from different distributions, by minimizing the MMD between the training data and the test data, the model can perform more consistently on data from different distributions. The core idea of ​​Center Loss is to dynamically maintain the feature center of each category during the training process and make the feature vector of each sample move closer to the center of the category to which it belongs. This can reduce the intra-class distance and increase the inter-class distance, thereby improving the discriminative ability of the feature.

[0105] To address the drawbacks of existing technologies, the objective of the present invention is to propose a new transfer learning framework that improves the accuracy and efficiency of electroencephalogram (EEG) signal classification by optimizing source domain selection, enhancing the generalization ability of the model, and reducing the impact of negative transfer. As Figure 3 and Figure 4 shown, the adaptive transfer learning method for EEG signals based on multi-source domain selection provided by the present invention can achieve the following:

[0106] S1. Collect the EEG data of past subjects and their corresponding labels, and perform preprocessing. Combine the preprocessed EEG data of past subjects into the source domain and the target domain where n ∈ {1,....N};

[0107] S2. Use the source domain selection module to select the K source domains that are most similar to the target domain;

[0108] S3. Input the selected K most similar source domains into the model to extract features from the source domain EEG data;

[0109] S4. Transfer the parameters of the source domain feature extractor to the target domain feature extractor through parameter transfer to extract features from the target domain EEG data;

[0110] S5. After feature extraction, the data is further processed through a fully connected layer to prepare for final classification, and finally, the model is optimized according to the joint loss function.

[0111] Furthermore, the specific process of preprocessing in step S1 is as follows:

[0112] S11. Perform band-pass filtering on the data between 0.5 Hz and 100 Hz, and use an additional 50 Hz notch filter to suppress power line noise.

[0113] S12. Further apply a fifth-order Butterworth band-pass filter of 4 - 38 Hz to filter the data;

[0114] Furthermore, as Figure 5 shown, the specific process of selecting the optimal source domain in step S2 is as follows:

[0115] S21. Calculate the centroid of each source domain and the centroid of the target domain using the formula. For a point (x i1 , x i2 ,...., x id ) in the d-dimensional space, the centroid is calculated as follows:

[0116]

[0117] S22. Sort according to the distance between each source domain and the target domain, and select the K source domains closest to the target domain. The distance formula is as follows:

[0118] a. Euclidean distance: It refers to the actual distance between two points in an m-dimensional space, or the natural length of a vector (i.e., the distance from this point to the origin). In an n-dimensional space, for x(x1, x2,..., x n ) and y(y1, y2,...., y n ), its calculation formula is as follows:

[0119]

[0120] b. Mahalanobis distance: It is a distance metric method that takes into account the characteristics of data distribution. It not only considers the scale differences between various features but also the correlations between features. The Mahalanobis distance measures the distance between a sample point and a distribution through the covariance matrix of the data.

[0121] There are M sample vectors X1~X m . Denote the covariance matrix as S and the mean as the vector μ. Then the Mahalanobis distance from the sample vector X to μ is expressed as:

[0122]

[0123] For vector X i and Y j , the Mahalanobis distance between them is defined as:

[0124]

[0125] If the covariance matrix is an identity matrix (each sample vector is independently and identically distributed), then the Mahalanobis distance between X i and Y j is equal to their Euclidean distance:

[0126]

[0127] If the covariance matrix is a diagonal matrix, it is the standardized Euclidean distance.

[0128] Furthermore, the specific process of obtaining the source model in step S3 is as follows:

[0129] S31. After the most similar K are selected by the source domain selection module, a convolutional layer (Conv2D), a batch normalization layer (BatchNorm2D), an ELU activation function, an average pooling layer (AvgPool2D), and a Dropout layer are used to extract the features of the EEG data. The feature extractor consists of two convolutional blocks (Conv.Block1 and Conv.Block2), and each block contains a convolutional layer, a batch normalization layer, an ELU activation, an average pooling layer, and a Dropout layer. A wavelet transform (WT) convolutional module is added before the convolutional layer (Conv2D). Each level of the WT increases the receptive field size of the layer, while the number of trainable parameters only increases slightly. The design of the WTConv layer can capture low-frequency information better than the standard convolution. This is because after the input low-frequency information is decomposed by repeated wavelet transforms (WT), the low-frequency information is emphasized, thereby increasing the layer's response to low-frequency information.

[0130] Further, the specific process of step S4 is as follows:

[0131] S41. Transfer the parameters of the source domain feature extractor to the target domain feature extractor through parameter transfer.

[0132] S42. The steps are the same as those in S31 to extract the features of the target domain.

[0133] Further, the specific process of step S5 is as follows:

[0134] S51. After feature extraction, the data is further processed through a fully connected layer. The Softmax layer converts the output of the fully connected layer into a probability distribution, and each output node corresponds to a category. The Softmax function ensures that the output values are between 0 and 1, and the sum of all output values is 1. This enables the model to output the probability of each category, facilitating multi-classification tasks.

[0135] S52. After the Softmax layer, the output of the model is compared with the true label to calculate the loss function:

[0136] a. Classification loss: Usually, the cross-entropy loss is used to measure the difference between the probability distribution predicted by the model and the true label. The specific representation form of this cross-entropy loss function is:

[0137]

[0138] where is the source domain classification loss, J(·,·) represents the cross-entropy loss function, f(·) represents the neural network function, Ι(·) represents the indicator function, which is 1 when the condition holds and 0 otherwise. represents the i-th source domain sample, represents the label of the i-th source domain sample, n s is the number of source domain samples.

[0139] b. MMD loss (Maximum Mean Discrepancy loss): It is used to measure the distribution difference between the source domain and the target domain. By minimizing the MMD loss, the inter-domain difference can be reduced and the generalization ability of the model in the target domain can be improved. The MMD loss function can be defined as:

[0140]

[0141] where and represent the deep feature representations of the EEG data in the source domain and the target domain respectively, represents the non-linear feature mapping function that maps the original samples to the Reproducing Kernel Hilbert Space (RKHS), N s and N t represent the numbers of samples in the source domain and the target domain respectively. represents the norm in the RKHS.

[0142] c. Center Loss: It is only used to reduce the intra-class (such as the same class) difference and cannot effectively increase the inter-class (such as different classes) difference. The Center Loss function can be defined as:

[0143]

[0144] where N is the number of samples, C is the number of classes, x i is the i-th sample. f(.) is the feature extraction function that maps the sample to the feature space. c c is the center point of the c-th class. represents the square of the Euclidean distance.

[0145] S53. After calculating the loss function, the gradient of the loss function with respect to the model parameters is calculated through the Backpropagation algorithm. Then, an optimization algorithm (such as SGD, Adam, etc.) is used to update the model parameters to minimize the loss function.

[0146] In summary, the specific implementation technical solution of the embodiment of the present invention is as follows:

[0147] (1) The present invention provides an adaptive transfer learning method for electroencephalogram (EEG) signals based on multi-source domain selection. It proposes source domain selection, and finds the K source domains most similar to the target domain by calculating the distance between the source domain and the target domain for transfer learning. Most articles use all domains for transfer, some of which are quite different from the target domain and are not very suitable as source domains for transfer.

[0148] (2) The present invention proposes a combined training scheme, using multiple loss functions. Among them, the Maximum Mean Discrepancy (MMD) loss solves the marginal distribution shift. This loss function can effectively measure the distribution difference between the source domain and the target domain, and reduces this difference by minimizing the MMD loss, thereby improving the generalization ability of the model in the target domain. The center loss eliminates the class conditional difference, and the classification loss ensures the prediction accuracy, better training the model.

[0149] (3) The present invention adds a wavelet transform convolutional module to EEGNET. Each level of the Wavelet Transform (WT) increases the receptive field size of the layer, while the number of trainable parameters only increases slightly. The design of the WTConv layer can capture low-frequency information better than the standard convolution. This is because after the input low-frequency information is decomposed by repeated wavelet transform (WT), the low-frequency information is emphasized, thus increasing the layer's response to low-frequency information.

[0150] In some specific application scenarios, compared with other models, the results are as shown in Table 1 below. The model proposed by the present invention achieves an overall accuracy of 75.91%, higher than the average classification results of several other models. Compared with EEGNET, RA, EA, MMD, and DANN, the accuracy rates are increased by 5.0%, 7.13%, 2.9%, 4.09%, and 3.05% respectively. To a certain extent, it can show that the model proposed by the present invention has good performance in the motor imagery decoding of EEG signals.

[0151] Table 1

[0152]

[0153] In some specific application scenarios, the application process of the embodiment of the present invention is as follows:

[0154] 1. Experimental paradigm:

[0155] The publicly available dataset BCI Competition 2008 IV 2a Dataset (BCIC IV2a) is used. The dataset can be obtained from http: / / bnci-horizon-2020.eu / database / data-sets. The specific experimental paradigm is as Figure 6 shown:

[0156] This experimental paradigm describes a typical brain-computer interface (BCI) experimental design, which is usually used to study the relationship between brain activity and specific tasks. The following are the details of this experimental paradigm:

[0157] 1. Fixation Cross: At the beginning of the experiment, a fixation cross will be displayed on the screen, and participants are required to focus their attention on the cross to prepare for the next task.

[0158] 2. Cue: After the fixation cross, a cue signal will appear. This cue usually indicates the type of task that the participant will perform next. The cue can be visual (such as an icon or text) or auditory (such as a sound cue).

[0159] 3. Motor Imagery: After the cue, the participant is required to perform a motor imagery task. This means that they need to imagine performing a certain movement (such as clenching a fist or moving a foot) in their mind without actually making a physical movement. This stage is usually used to study the activity of the motor cortex of the brain.

[0160] 4. Break: After the motor imagery task, there will be a short break to allow the participant to relax and prepare for the next trial.

[0161] The numbers (0 to 9) in the table may represent different time points or trial conditions, and "t(S)" represents time in seconds. This paradigm is usually used in electroencephalography (EEG) or other neuroimaging techniques to record and analyze the brain activity at different task stages.

[0162] 2. Data Description:

[0163] This dataset consists of electroencephalogram (EEG) data from 9 subjects. Each subject recorded two sessions on different days. In this embodiment, only the data of the first session of each subject is used. In the BCI4-2A dataset, in two different sessions, EEG of 9 healthy participants (ID A01 - A09) was collected at a sampling rate of 250 Hz from a 10 - 20 system with 22 EEG channels. Each subject participated in four motor imagery tasks, including imagining the movement of the left hand, right hand, both feet, and tongue. In this embodiment, only two categories (left hand / right hand imagination) are used. Each session contains 144 EEG data trials. A time window of 4 seconds between 0 s and 4 s after the cue information appears is selected, and the corresponding label is the specified action category of the current experiment.

[0164] 3. Data Preprocessing:

[0165] The original EEG signals collected are band-pass filtered with a 5th-order Butterworth band-pass filter in the range of 0.5 - 100 Hz, and then a 50 Hz notch filter is used to remove power frequency interference. Data normalization can improve the training speed and the performance of the model. We perform zero-mean normalization on the original data of each channel to make it conform to the standard normal distribution. The specific calculation process is as follows:

[0166]

[0167] Among them, x i and x0 represent the data of each channel and the normalized output respectively. μ and σ 2 represent the mean and variance respectively. Normalize the training and test data.

[0168] 4. Training details:

[0169] For the BCIIV2a dataset, only two classes (left / right hand imagination) are used, and only the data of the first session of each subject is used for training and testing. A 5th-order Butterworth band-pass filter with a frequency range of 4 - 38 Hz is further applied for filtering. All experiments on the deep neural network are repeated five times to account for randomness. The average accuracy of each subject and the entire dataset is reported. Using EEGNet as the basic model, the model is trained with an Adam optimizer with a batch size of 32, a learning rate of 10-3, and 100 epochs.

[0170] Compared with the prior art, the present invention shows significant advantages in multiple aspects:

[0171] (1) Multi-source domain feature extraction and alignment: The present invention can better adapt to different data sources and improve the generalization ability of the model by selecting the optimal source domain from multiple source domains and performing feature alignment. This design is especially suitable for cross-domain applications, such as the analysis of EEG data, and can effectively handle the diversity and complexity of data.

[0172] (2) Optimization of the loss function: The present invention not only uses the classification loss to optimize the model, but also introduces the Center loss and the MMD loss to reduce the distribution difference between the source domain and the target domain, thereby improving the performance of the model in the target domain. This combination of loss functions can more comprehensively optimize the model and improve its adaptability under different data distributions.

[0173] Compared with the prior art, the present invention has at least the following beneficial effects:

[0174] 1. Solve the problem of domain differences; by matching and screening the EEG data of the source domain and the target domain, and selecting the source domain similar to the target domain, the distribution differences between domains can be effectively reduced. This adaptive mechanism enables the model to better adapt to the data distribution of the target domain, thereby enhancing the generalization ability of the model on the target domain. Through the preset source domain feature extractor and parameter transfer technology, features are extracted from the source domain and the target domain respectively. This dual feature extraction mechanism can capture the common features between the source domain and the target domain, reduce the differences between domains, and thus improve the classification performance of the model.

[0175] 2. Alleviate the problem of data imbalance: by matching and screening the source domain and selecting the source domain similar to the target domain, the problem of data imbalance can be effectively alleviated. The selection of similar source domains ensures the diversity and representativeness of the training data, avoiding the model relying too much on a certain type of data during training, thereby improving the robustness of the model. By optimizing the classification model through the joint loss function, the feature and label information of the source domain and the target domain can be comprehensively considered, further alleviating the negative impact brought by data imbalance and enhancing the classification accuracy of the model.

[0176] 3. Reduce the phenomenon of negative transfer: by screening the source domain similar to the target domain, the differences between the source domain and the target domain can be effectively reduced, and the risk of negative transfer can be lowered. The selection of similar source domains ensures the similarity between the source domain and the target domain, thus avoiding the negative impact of source domain knowledge on target domain learning. By using the parameter transfer technology to extract features from the target domain, the knowledge of the source domain can be effectively transferred to the target domain, reducing the occurrence of negative transfer. The parameter transfer technology ensures that the knowledge transfer between the source domain and the target domain is positive, thereby enhancing the performance of the model.

[0177] 4. Simplify data preparation work: through the automated source domain matching and screening mechanism, the workload of manually selecting the source domain is reduced, simplifying the data preparation work. This automated mechanism not only improves work efficiency but also ensures the accuracy and consistency of source domain selection. By integrating feature extraction and model optimization, the cumbersome steps of data preprocessing are reduced, simplifying the overall process. This integrated design makes data processing and model training more efficient, enhancing the overall work efficiency.

[0178] 5. Enhance model performance: by optimizing the model through the joint loss function, the feature and label information of the source domain and the target domain can be comprehensively considered, enhancing the classification performance of the model. The design of the joint loss function enables the model to better adapt to the data distribution of the target domain, thereby improving the accuracy and robustness of the model. Through the dual feature extraction mechanism of the source domain and the target domain, more common features can be captured, enhancing the classification ability of the model. This dual feature extraction mechanism enables the model to better understand the internal structure of the data, thus improving the performance of the model.

[0179] On the other hand, as Figure 7 shown, an embodiment of the present invention provides an electroencephalogram (EEG) signal adaptive transfer learning system 900, which may include:

[0180] A first module 901, configured to obtain EEG data, preprocess the EEG data to obtain EEG data, and further organize to obtain a source domain and a target domain; wherein, the source domain is labeled with a type label corresponding to the EEG data;

[0181] A second module 902, configured to perform matching and screening on each source domain based on the target domain to obtain a preset number of similar source domains;

[0182] A third module 903, configured to perform first feature extraction on the EEG data in the similar source domains based on a preset source domain feature extractor to obtain source domain features;

[0183] A fourth module 904, configured to perform second feature extraction on the EEG data of the target domain through parameter transfer to obtain target domain features;

[0184] A fifth module 905, configured to optimize and adjust a preset classification model through a joint loss according to the source domain features, type labels, and target domain features.

[0185] In some embodiments, the system may further include:

[0186] A sixth module, configured to construct a convolutional block according to a convolutional layer, batch normalization, ELU activation function, average pooling, and Dropout layer;

[0187] A seventh module, configured to add a wavelet transform convolutional module before the convolutional layer in the convolutional block, and further construct a source domain feature extractor according to two convolutional blocks.

[0188] The content of the method embodiments of the present invention is applicable to the system embodiments of the present invention. The functions specifically implemented by the system embodiments of the present invention are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method.

[0189] On the other hand, an embodiment of the present invention further provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the above-mentioned EEG signal adaptive transfer learning method is implemented. The electronic device may be any intelligent terminal including a tablet computer, in-vehicle computer, etc.

[0190] It can be understood that the content in the above method embodiments is applicable to the device embodiments of the present invention. The functions specifically implemented by the device embodiments of the present invention are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.

[0191] As shown Figure 8 in Figure 8 Figure 1, the hardware structure of an electronic device 1000 according to another embodiment is illustrated. The electronic device 1000 includes:

[0192] A processor 1001, which can be implemented in the form of a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided by the embodiments of the present invention;

[0193] A memory 1002, which can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM), etc. The memory 1002 can store an operating system and other application programs. When implementing the technical solutions provided by the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 1002 and are called by the processor 1001 to execute the network node population optimization method of the embodiments of the present invention;

[0194] An input / output interface 1003, which is used to implement information input and output;

[0195] A communication interface 1004, which is used to implement communication and interaction between this device and other devices, and can implement communication through a wired method (such as USB, network cable, etc.) or through a wireless method (such as a mobile network, WIFI, Bluetooth, etc.);

[0196] A bus 1005, which transmits information between various components of the device (such as the processor 1001, the memory 1002, the input / output interface 1003, and the communication interface 1004);

[0197] Among them, the processor 1001, the memory 1002, the input / output interface 1003, and the communication interface 1004 are communicatively connected to each other inside the device through the bus 1005.

[0198] The above-described embodiments of the electronic device are merely illustrative. The units described as separate components may or may not be physically separated, that is, they may be located in one place or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solutions of this embodiment.

[0199] The content of the method embodiments of the present invention is applicable to the embodiments of this electronic device. The functions specifically implemented by the embodiments of this electronic device are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method.

[0200] Another aspect of the embodiments of the present invention further provides a computer-readable storage medium. The storage medium stores a program, and the program is executed by a processor to implement the foregoing method.

[0201] It should be noted that the computer-readable medium shown in the embodiments of the present invention may be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which computer-readable program code is carried. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0202] The content of the method embodiments of the present invention is applicable to the embodiments of this computer-readable storage medium. The functions specifically implemented by the embodiments of this computer-readable storage medium are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method.

[0203] An embodiment of the present invention also discloses a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the foregoing method.

[0204] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that, in some alternative implementations, the functions marked in the blocks may occur in an order different from that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0205] It should be noted that although several modules of a device for action execution are mentioned in the foregoing detailed description, this division is not mandatory. In fact, according to the embodiments of the present invention, the features and functions of two or more of the foregoing modules or units can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by a plurality of modules or units.

[0206] Through the description of the above embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software, or can be implemented by a combination of software and necessary hardware. Therefore, the technical solutions according to the embodiments of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present invention.

[0207] In some alternative embodiments, the functions / operations recited in the block diagrams may not occur in the order presented in the operational illustrations. For example, depending on the functions / operations involved, two blocks shown in succession may actually be executed substantially simultaneously or the blocks can sometimes be executed in the reverse order. Further, the embodiments presented and described in the flowcharts of the present invention are provided by way of example for the purpose of providing a more thorough understanding of the technology. The disclosed methods are not limited to the operations and logical flows presented herein. Alternative embodiments are contemplated in which the order of various operations is altered and in which sub-operations described as part of a larger operation are performed independently.

[0208] In addition, although the present invention has been described in the context of functional modules, it should be understood that one or more of the functions and / or features, unless otherwise stated to the contrary, may be integrated in a single physical device and / or software module, or one or more functions and / or features may be implemented in separate physical devices or software modules. It should also be understood that a detailed discussion of the actual implementation of each module is not necessary for an understanding of the present invention. Rather, the actual implementation of the module would be understood within the ordinary skill of an engineer, given the attributes, functions, and internal relationships of the various functional modules in the devices disclosed herein. Thus, those skilled in the art can implement the present invention as set forth in the claims without undue experimentation. It should also be understood that the specific concepts disclosed are illustrative only and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.

[0209] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present invention, in essence or the part that contributes to the prior art or a part of this technical solution, can be embodied in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.

[0210] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a definitional sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution apparatus, device or equipment (such as a computer-based device, a device including a processor, or other devices that can fetch instructions from and execute instructions by the instruction execution apparatus, device or equipment), or used in combination with these instruction execution apparatuses, devices or equipment. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in combination with an instruction execution apparatus, device or equipment.

[0211] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection part (electronic device) having one or more wirings, a portable computer disk cartridge (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which a program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or other suitable processing as necessary, and then stored in a computer memory.

[0212] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution apparatus. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.

[0213] In the description of this specification, the description with reference to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0214] Although embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the claims and their equivalents.

[0215] The above has specifically described the preferred embodiments of the present invention, but the present invention is not limited to the embodiments. Those skilled in the art can also make various equivalent deformations or substitutions without departing from the spirit of the present invention, and these equivalent deformations or substitutions are all included within the scope defined by the claims of the present invention.

Claims

1. A method for adaptive transfer learning of EEG signals, characterized in that: The following steps are involved: Acquire electroencephalogram (EEG) data, preprocess the EEG data to obtain EEG data, and then sort them to obtain a source domain and a target domain; wherein the source domain is marked with a type label corresponding to the EEG data; Based on the target domain, matching and screening each of the source domains is performed to obtain a preset number of similar source domains; Performing a first feature extraction on the EEG data in the similar source domain based on a preset source domain feature extractor to obtain a source domain feature; Performing a second feature extraction on the EEG data of the target domain by parameter transfer to obtain a target domain feature; According to the source domain features, the type labels and the target domain features, the preset classification model is optimized and adjusted through joint loss.

2. The method for adaptive transfer learning of EEG signals according to claim 1, characterized in that: The step of preprocessing the EEG data to obtain EEG data comprises the following steps: Based on the first frequency range, the EEG data is bandpass filtered, and then a notch filter of a target frequency is used to suppress power line noise; The EEG data after the power line noise is suppressed is filtered by a fifth-order Butterworth bandpass filter in a second frequency range to obtain the EEG data.

3. The method for adaptive transfer learning of EEG signals according to claim 1, characterized in that: The step of performing matching screening on each of the source domains based on the target domain to obtain a preset number of similar source domains includes the following steps: Calculating a source centroid of each source domain and a target centroid of the target domain according to data points of the spatial dimensions in the source domain and the target domain; Based on the source centroid and the target centroid, the distance between each source domain and the target domain is obtained by processing using a preset distance formula; According to the distance between each of the source domains and the target domain, the preset number of source domains closest to the target domain are determined as the similar source domains.

4. The method for adaptive transfer learning of EEG signals according to claim 1, characterized in that: The method further comprises the following steps: The convolutional block is constructed based on the convolutional layer, batch normalization, ELU activation function, average pooling and Dropout layer; A wavelet transform convolution module is added before the convolution layer in the convolution block, and then the source domain feature extractor is constructed according to the two convolution blocks.

5. The method for adaptive transfer learning of EEG signals according to claim 1 or 4, characterized in that: The step of performing second feature extraction on the EEG data of the target domain by parameter transfer to obtain target domain features comprises the following steps: Transferring the parameters of the source domain feature extractor to a preset target domain feature extractor through parameter transfer, and then performing a second feature extraction on the EEG data of the target domain through the target domain feature extractor to obtain the target domain feature; Wherein, the target domain feature extractor has the same structure as the source domain feature extractor.

6. The method for adaptive transfer learning of EEG signals according to claim 1, characterized in that: The joint loss includes classification loss, maximum mean difference loss and center loss; the optimization adjustment of the preset classification model by the joint loss according to the source domain features, the type label and the target domain features includes the following steps: The classification loss is calculated based on the classification result of the EEG in the source domain by the classification model and in combination with the type label; According to the source domain features and the target domain features, the maximum mean difference loss is calculated based on a nonlinear feature mapping function; According to the number of types of the type labels included in the source domain, a third feature is extracted for each sample in the source domain by using a preset feature extraction function, and then the center loss is calculated in combination with the center point corresponding to each type; According to the classification loss, the maximum mean difference loss and the center loss, the gradient of the joint loss with respect to the model parameters of the classification model is obtained through back propagation algorithm; based on the gradient, the model parameters of the classification model are optimized and adjusted through an optimization algorithm.

7. The method for adaptive transfer learning of EEG signals according to claim 6, characterized in that: The classification loss is calculated based on the classification result of the EEG in the source domain by the classification model and the type label, comprising the following steps: Inputting the EEG data of the source domain into the classification model for classification processing to obtain a classification result corresponding to the source domain; the classification model includes a fully connected layer and a Softmax layer; The classification loss is obtained by calculating the classification loss through a cross entropy loss function according to the classification result and the type label of the corresponding source domain.

8. An electroencephalogram signal adaptive transfer learning system, characterized in that: include: The first module is used to obtain EEG data, pre-process the EEG data to obtain EEG data, and then sort them to obtain a source domain and a target domain; wherein the source domain is marked with a type label corresponding to the EEG data; The second module is used to perform matching screening on each of the source domains based on the target domain to obtain a preset number of similar source domains; A third module is used to extract a first feature from the EEG data in the similar source domain based on a preset source domain feature extractor to obtain a source domain feature; A fourth module is used to extract a second feature of the EEG data of the target domain by parameter transfer to obtain a target domain feature; The fifth module is used to optimize and adjust the preset classification model through joint loss according to the source domain features, the type label and the target domain features.

9. An electronic device, characterized in that: including a processor and a memory; The memory is used to store programs; The processor executes the program to implement the method according to any one of claims 1 to 7.

10. A computer storage medium storing a program executable by a processor, characterized in that: The program executable by the processor is used to implement the method according to any one of claims 1 to 7 when executed by the processor.