A few-sample recognition method based on brain-computer interface
By combining pre -training and meta -learning methods in the brain machine interface, the auxiliary test data is used as a model with better trial construction, which solves the problem of poor system performance when the target test training sample is less. Betterization ability.
Patent Information
- Application Number
- CN202210275519.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-21
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2042-03-21
AI Technical Summary
In the prior art, the system performance is poor when the target test training samples are small.
Obtain the EEG data of the target subject and the auxiliary subject, use the auxiliary subject data to learn the EEG feature encoder in the pre-training stage, and use it as the initial model parameters in the meta-learning stage. In the meta-learning stage, optimization is performed at the task scale so that the model can better adapt to the few-sample tasks constructed from the target subject data.
Through the combination of pre-training and meta-learning, the system performance can be improved and better generalization ability can be achieved when the target subject training samples are small.
Smart Images

Figure CN114847973B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electroencephalogram (EEG) signal classification and recognition, and in particular to a small sample recognition method based on a brain-computer interface. Background Art
[0002] Brain-Computer Interface (BCI) can convert human thinking activities or intentions into corresponding computer instructions by identifying a series of electroencephalogram (EEG) signals, thereby realizing direct communication or control of external devices by the brain. Motor imagery (MI), as an active control paradigm, is widely used in medical rehabilitation and other fields, and has become a research hotspot in the current BCI field.
[0003] Although this fully autonomous BCI system has been favored by many scholars and has been widely studied, its development still faces many challenges, the most important of which is that the initial calibration time of the current BCI system based on motor imagery is relatively long. That is, due to the autonomous control characteristics of this system, users often need to go through a long calibration phase before they can learn how to control their brains to produce easily distinguishable EEG signals. However, due to the complex EEG data acquisition process, this phase takes a long time. For healthy subjects, the whole process is boring, and for hemiplegic patients, it is more likely to cause physical and mental fatigue or even unbearable. Therefore, a few-sample recognition algorithm that reduces the number of training samples required for the target subject and ensures stable and reliable BCI performance is urgently needed.
[0004] At present, most methods use transfer learning to solve this problem, and most of the algorithms still require at least 10 samples per class of the target subject to help transfer training. Few studies focus on the MI task classification problem when the target subject has very few labeled samples (such as 1 or 5 training samples per class), especially in the context of deep learning models. Although deep transfer techniques (such as fine-tune) can use data from other subjects, their adaptability is limited when there is little training data for the target subject. As meta-learning has gradually become a highly promising learning paradigm in the few-sample classification problem, relevant studies have applied it to the field of brain-computer interfaces. However, some recent work combining the advantages of transfer learning and meta-learning has established new state-of-the-art results in the field of vision. However, this type of method is still less explored in the field of brain-computer interfaces. Summary of the invention
[0005] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.
[0006] In view of the above existing problems, the present invention is proposed.
[0007] Therefore, the technical problem solved by the present invention is that the system performance is poor when there are fewer target subject training samples in the prior art.
[0008] In order to solve the above technical problems, the present invention provides the following technical solutions: obtaining EEG data of 1 target subject and m auxiliary subjects performing N types of motor imagery tasks; in the pre-training stage, using the auxiliary subject data to learn the EEG feature encoder f θ , and use it as the initial model parameters in the subsequent meta-learning stage; the meta-learning stage optimizes the model based on the pre-training on a task-by-task basis, so that the model can better adapt to the few-sample tasks constructed with the target subject data.
[0009] As a preferred solution of the few-sample recognition method based on brain-computer interface described in the present invention, wherein: each category of the target subject has only K labeled samples, where K≤5, and each category of the auxiliary subject has a relatively large amount of labeled data;
[0010] The data from the auxiliary subjects are used to build a model with better performance for the target subject, and the overall process includes two stages: pre-training and meta-learning.
[0011] As a preferred solution of the few-sample recognition method based on brain-computer interface described in the present invention, the pre-training stage includes: taking the original EEG signal of the auxiliary subject as the input of the deep network, and performing convolution in the time and space directions in the first two layers; applying a batch normalization layer to normalize the output of the spatial filtering convolution layer by subtracting the mean and dividing it by the standard deviation to reduce the internal covariate shift of the network; using a square nonlinear function, mean pooling and a logarithmic activation function to transform the data; adding a Dropout layer to randomly set part of the input to zero with a preset probability to prevent excessive co-adaptation of different neural units; using a layer of convolution to convert multiple feature maps of different categories into an overall feature vector, and input it into the fully connected layer for final classification.
[0012] As a preferred solution of the few-sample recognition method based on brain-computer interface described in the present invention, the original EEG signal is two-dimensional data, recording the voltage values changing with time under different electrode channels.
[0013] As a preferred solution of the few-sample recognition method based on brain-computer interface described in the present invention, the data of the same MI task for different subjects are defined into different categories, that is, for the m auxiliary subjects to perform N types of motor imagery tasks, there are a total of m×N categories.
[0014] As a preferred solution of the few-sample recognition method based on brain-computer interface described in the present invention, the meta-learning stage includes: randomly selecting one auxiliary subject from the m auxiliary subjects, and then randomly selecting K samples from each category of their training data as training samples in the task and Q samples as test samples in the task to construct a few-sample task; in each task, N×K support set samples are mapped using a feature encoder to obtain corresponding feature vectors, and the average feature vector of each category is calculated as the centroid of the category; for a query sample x in the training task, the probability that the sample x belongs to category i is calculated based on the cosine similarity between its feature vector and the centroid of category i.
[0015] As a preferred solution of the few-sample recognition method based on brain-computer interface described in the present invention, the calculation formula of the centroid includes: defining S i is a subset of K supporting samples under category i (i=1,…,N), then the centroid w of each category is i It is expressed as follows:
[0016]
[0017] Among them, f θ (x) represents the support sample x after feature encoder f θ The resulting feature vector.
[0018] As a preferred solution of the few-sample recognition method based on brain-computer interface described in the present invention, the calculation formula of the probability that the sample x belongs to category i includes:
[0019]
[0020] Among them, cos<·,·> represents the cosine similarity of two vectors, w j represents the centroid of class j, y represents the predicted label, and N represents the number of categories.
[0021] As a preferred solution of the few-sample recognition method based on brain-computer interface described in the present invention, the pre-training stage uses a standard cross-entropy loss function to iteratively update the parameters of the network.
[0022] Beneficial effects of the present invention: The present invention uses meta-learning on the basis of the pre-training model to further improve the performance, and can be applied to the few-sample classification problem in different BCI scenarios by simply changing the feature encoding module; in the pre-training stage, the present invention for the first time regards the data under the same imagination task of different subjects as different classification categories. This feature extraction mode can implicitly learn the differences between individuals. In addition, meta-learning learns transferable knowledge from tasks constructed at the scale of different individuals. Therefore, when faced with new tasks constructed with target subject data, the present invention can show better generalization performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:
[0024] Figure 1 A basic flow chart of a method for identifying a small number of samples in a brain-computer interface provided by an embodiment of the present invention;
[0025] Figure 2 A schematic diagram of the detailed structure of a deep network based on a few-sample recognition method in a brain-computer interface is provided for one embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0027] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0028] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0029] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.
[0030] At the same time, in the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0031] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0032] Example 1
[0033] Reference Figure 1 , as an embodiment of the present invention, provides a few-sample recognition method based on brain-computer interface, comprising:
[0034] S1: Obtain EEG data of 1 target subject and m auxiliary subjects performing N types of motor imagery tasks.
[0035] It should be noted that the target subjects have only K labeled samples for each category, where K is usually ≤ 5, and the auxiliary subjects have a relatively large amount of labeled data for each task;
[0036] The goal of the present invention is to use data from auxiliary subjects to build a better performance model for the target subject, and its overall process includes two stages: pre-training and meta-learning.
[0037] S2: In the pre-training stage, the EEG feature encoder fθ is learned using auxiliary subject data and used as the initial model parameters in the subsequent meta-learning stage.
[0038] It should be noted that this step specifically includes:
[0039] (1) The original EEG signal of the auxiliary subject (two-dimensional data, recording the voltage values of different electrode channels over time) is used as the input of the deep network, and convolutions in the time direction and spatial direction are performed in the first two layers. The convolution operations of these two layers are similar to the bandpass filtering and spatial filtering steps in the traditional algorithm FBCSP;
[0040] (2) After that, a batch normalization layer is applied to normalize the output of the spatial filter convolution layer by subtracting the mean and dividing it by the standard deviation to reduce the internal covariate shift of the network;
[0041] (3) Next, the data is transformed using a square nonlinear function, mean pooling, and a logarithmic activation function. The above operations are similar to the logarithmic variance calculation of the transformed signal in the traditional algorithm FBCSP.
[0042] (4) Subsequently, a Dropout layer is added to randomly set part of the input to zero with a certain probability to prevent excessive co-adaptation of different neural units;
[0043] (5) Finally, a layer of convolution is used to convert multiple feature maps of different categories into an overall feature vector, and then input it into the fully connected layer for final classification. For the classification training strategy, in the method that also combines the pre-training stage and uses auxiliary subjects to promote the classification of target subject data before the present invention, the data from different auxiliary subjects under the same motor imagery task are merged into one category. However, simply mixing the data of different subjects may cause the key differences between different individuals to be offset, which is not conducive to the subsequent meta-training learning. Therefore, the present invention regards the data of different subjects under the same MI task as different categories, that is, for m auxiliary subjects performing N types of motor imagery tasks, we have a total of m×N categories, instead of the traditional N categories. During training, the standard cross-entropy loss function is used to iteratively update the parameters of the network. Finally, remove the fully connected layer of the network to obtain the feature encoder f θ , which maps the input EEG signal to the corresponding feature space.
[0044] S3: The meta-learning stage optimizes the model based on the pre-training task, so that the model can better adapt to the few-sample tasks constructed with the target subject data.
[0045] It should be noted that this step specifically includes:
[0046] (1) First, randomly select one of the m auxiliary subjects, and then randomly select K samples from each category of its training data as training samples (or support samples) within the task, and Q samples as test samples (or query samples) within the task to construct a few-shot task;
[0047] (2) In each task, the N×K support set samples are first mapped using the feature encoder obtained in step (5) of step S2 to obtain the corresponding feature vectors, and then the average feature vector of each class is calculated as the centroid of the class. The calculation formula of the centroid is as follows, denoted by S i is a subset of K supporting samples under category i (i=1,…,N), so the centroid w of each category i It can be expressed as follows:
[0048]
[0049] Among them, f θ (x) represents the support sample x after feature encoder f θ The resulting feature vector.
[0050] (3) For a query sample x in the training task, the probability that the sample x belongs to category i is calculated based on the cosine similarity between its feature vector and the centroid of category i:
[0051]
[0052] Among them, cos<·,·> represents the cosine similarity of two vectors, w j represents the centroid of class j, y represents the predicted label, and N represents the number of categories.
[0053] Since the training tasks are selected from the labeled data of the auxiliary subjects, the cross entropy loss between the predicted probability and the sample label can be calculated, and the parameters can be updated by back propagation. By extracting tasks from the auxiliary subjects individually and iteratively updating the network training method, the model learns how to generalize between tasks, and this is consistent with the idea of separating different object categories in step (5) of step S2. Therefore, when facing the target subject, the model can adapt quickly and accurately; after completing the meta-training stage, the labeled samples of the target subject and the test data can be used to construct a few-sample task with the same structure to test the performance of the model.
[0054] The present invention uses meta-learning on the basis of the pre-trained model to further improve the performance, and can be applied to the few-sample classification problem in different BCI scenarios by simply changing the feature encoding module; in the pre-training stage, the present invention for the first time regards the data under the same imagination task of different subjects as different classification categories. This feature extraction mode can implicitly learn the differences between individuals. In addition, meta-learning learns transferable knowledge from tasks constructed at the scale of different individuals. Therefore, when faced with new tasks constructed with target subject data, the present invention can show better generalization performance.
[0055] Example 2
[0056] like Figure 1 ~ is another embodiment of the present invention. This embodiment is different from the first embodiment in that it provides a verification test of a small sample recognition method based on a brain-computer interface. In order to verify and illustrate the technical effect adopted in this method, this embodiment adopts a traditional technical solution and the method of the present invention for comparative testing, and compares the test results by means of scientific demonstration to verify the real effect of this method. Specifically:
[0057] (1) Obtain EEG data of one target subject and eight auxiliary subjects performing two types of motor imagery tasks (left-hand motor imagery and right-hand motor imagery), wherein each type of target subject has K (K is 1 or 5) labeled samples, and each type of auxiliary subject has a relatively large amount of labeled data. This embodiment is described in detail using an EEG dataset based on motor imagery.
[0058] Specifically, step (1) comprises:
[0059] (1.1) The experiment collected EEG data from 9 subjects, with 22 electrode channels and a sampling frequency of 250Hz. In this embodiment, one subject is selected as the target subject each time, and the remaining 8 subjects are selected as auxiliary subjects. The auxiliary subjects provide training data in the pre-training and meta-training stages, and the target subjects provide a small number of labeled samples and a large number of test samples in the meta-test stage to evaluate the performance of the algorithm. The entire experiment is repeated 9 times, and finally the average classification accuracy of the 9 subjects is taken as the overall result of the data set;
[0060] (1.2) Perform 4-38 Hz bandpass filtering on the collected continuous EEG signals to remove interference noise and artificial artifacts of other frequencies in the data. Then, perform exponential moving average (EMA) to calculate the exponential moving average and corresponding variance within the range of each electrode to standardize the original EEG data. Finally, intercept the motor imagery EEG data 1-4 seconds after the start of the arrow prompt of each trial as the input of the deep network. Therefore, the final form of a trial sample is: 22 electrodes × 750 sampling points;
[0061] (2) In the pre-training stage, the deep network input of this embodiment is the original two-dimensional EEG data of 22 electrodes × 750 sampling points. Then, a 40-dimensional feature vector is obtained through operations such as temporal convolution, spatial convolution, mean pooling, and classification convolution. Finally, the feature vector is fully connected to a 16-dimensional output vector, which represents the predicted probability of 16 categories (8-bit source subjects × 2 MI task categories). The specific convolution kernel and the detailed structure of each layer are as follows: Figure 2As shown. During the training process, this embodiment uses a stochastic gradient descent (SGD) optimizer with a momentum size of 0.9, and sets the learning rate to 0.000625. This embodiment is trained on a single Quadro RTX 5000 GPU, all training data are iterated 100 times, and the batch size (batch_size) is set to 64.
[0062] (3) In the meta-training phase, this embodiment uses the same optimizer settings and learning rate as the pre-training phase. The whole process is trained for 30 rounds (epochs), and each epoch contains 100 few-sample tasks. In each task, this embodiment randomly selects an auxiliary subject, and randomly selects K samples from each class as the support set and 15 samples as the query set. Therefore, the data scale of each task is 2×(K+15). In the meta-testing phase, this embodiment randomly constructs 200 few-sample tasks from the target subject's data, and takes the average result of all test tasks as the final few-sample learning accuracy of the target subject.
[0063] As shown in Tables 1 and 2, this embodiment lists the classification accuracy of 5 methods on the EEG dataset, of which 4 are used as comparison methods of the present invention, namely: a traditional baseline method (subject-dependent scheme: Subject-Dependent scheme, SD), two meta-learning methods (relation network: RelationNet, model-independent meta-learning algorithm: MAML), and a deep migration method (Fine-tune).
[0064] Table 1: When K=1, the classification accuracy of all subjects of different algorithms (%).
[0065]
[0066] Table 2: When K=5, the classification accuracy of all subjects of different algorithms (%).
[0067]
[0068]
[0069] As shown in Table 1, when there is only one labeled sample per category of the target subject, the average accuracy of the baseline method is 64.33%, and the three comparison methods are all improved on this basis. The algorithm proposed in the present invention that combines pre-training with meta-learning has the most significant improvement over the baseline method (significance test: p = 0.025 < 0.05), reaching 67.33%, an increase of 3%, and is also 2.56%, 2.33% and 1.5% higher than the average results of RelationNet, MAML and Fine-tune algorithms respectively; As shown in Table 2, when there are only 5 labeled samples per category of the target subject, the algorithm proposed in the present invention is also significantly improved over the baseline method (significance test: p = 0.022 < 0.05), and achieved the highest average result, reaching 71.67%, which is 5.22%, 3.33%, 3.00%, and 2.78% higher than the baseline, RelationNet, MAML, and Fine-tune, respectively. Experimental results show that the proposed method can achieve higher classification accuracy than the baseline method, the early meta-learning framework and the fine-tuning method of transfer learning, showing its effectiveness in classifying motor imagery EEG data when there are insufficient training samples of the target subjects.
[0070] It should be appreciated that embodiments of the present invention may be implemented or enforced by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable memory. The method may be implemented in a computer program using standard programming techniques - including a non-transitory computer-readable storage medium configured with a computer program, wherein the storage medium so configured causes the computer to operate in a specific and predefined manner - according to the methods and drawings described in the specific embodiments. Each program may be implemented in a high-level procedural or object-oriented programming language to communicate with a computer system. However, if desired, the program may be implemented in an assembly or machine language. In any case, the language may be a compiled or interpreted language. In addition, the program may be run on a programmed ASIC for this purpose.
[0071] Furthermore, the operations of the processes described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described herein (or variations and / or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) that is executed collectively on one or more processors, by hardware, or a combination thereof. The computer program includes a plurality of instructions that may be executed by one or more processors.
[0072] Further, the method can be implemented in any type of computing platform that is operably connected to a suitable computer, including but not limited to a personal computer, a minicomputer, a mainframe, a workstation, a network or distributed computing environment, a separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, etc. Aspects of the present invention can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, an optical read and / or write storage medium, a RAM, a ROM, etc., so that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the process described herein. In addition, the machine-readable code, or part thereof, can be transmitted via a wired or wireless network. When such media includes instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor, the invention described herein includes these and other different types of non-transitory computer-readable storage media. When programmed according to the methods and techniques described in the present invention, the present invention also includes the computer itself. The computer program can be applied to input data to perform the functions described herein, thereby converting the input data to generate output data stored in a non-volatile memory. The output information can also be applied to one or more output devices such as a display. In a preferred embodiment of the present invention, the converted data represents a physical and tangible object, including a specific visual depiction of the physical and tangible object produced on a display.
[0073] As used in this application, the terms "component", "module", "system", etc. are intended to refer to a computer-related entity, which can be hardware, firmware, a combination of hardware and software, software, or software in operation. For example, a component can be, but is not limited to: a process running on a processor, a processor, an object, an executable file, a thread in execution, a program, and / or a computer. As an example, an application running on a computing device and the computing device can both be components. One or more components can exist in a process and / or thread in execution, and a component can be located in a computer and / or distributed between two or more computers. In addition, these components can be executed from various computer-readable media having various data structures thereon. These components can communicate in a local and / or remote process manner, such as according to a signal having one or more data packets (e.g., data from a component that interacts with another component in a local system, a distributed system, and / or interacts with other systems in a signal manner through a network such as the Internet).
[0074] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A few-sample recognition method based on brain-computer interface, characterized in that: include: Obtain EEG data of 1 target subject and m auxiliary subjects performing N types of motor imagery tasks; In the pre-training stage, the EEG feature encoder f is learned using auxiliary subject data. θ , and use it as the initial model parameters in the subsequent meta-learning stage; The meta-learning stage optimizes the model based on the pre-training process at the task scale, so that the model can better adapt to the few-shot tasks constructed with the target test data. The data of the same MI task of different subjects are defined into different categories, that is, the m auxiliary subjects perform N types of motor imagery tasks, that is, there are m×N categories in total; The standard cross entropy loss function is used to iteratively update the network parameters and remove the fully connected layer of the network to obtain the feature encoder f θ , mapping the input EEG signal to the corresponding feature space.
2. The method for identifying a small number of samples in a brain-computer interface according to claim 1, characterized in that: Each category of the target subject data has only K labeled samples, where K≤5, which assists the subject in having a relatively large amount of labeled data when performing N types of motor imagery tasks; The data from the auxiliary subjects are used to build a model with better performance for the target subject, and the overall process includes two stages: pre-training and meta-learning.
3. The method for identifying a small number of samples in a brain-computer interface according to claim 2, characterized in that: The pre-training stage includes: The raw EEG signal of the auxiliary subject is used as the input of the deep network, and convolution in the temporal and spatial directions is performed in the first two layers; Apply a batch normalization layer to normalize the output of the spatial filter convolution layer by subtracting the mean and dividing it by the standard deviation to reduce the internal covariate shift of the network; Transform the data using square nonlinearity, mean pooling, and logarithmic activation functions; Add a Dropout layer to randomly set part of the input to zero with a preset probability to prevent excessive co-adaptation of different neural units; A layer of convolution is used to convert multiple feature maps of different categories into an overall feature vector, which is then input into the fully connected layer for final classification.
4. The method for identifying a small number of samples in a brain-computer interface according to claim 1, characterized in that: The original EEG signal of the auxiliary subject is two-dimensional data, recording the voltage values of different electrode channels that change with time.
5. The method for identifying a small number of samples in a brain-computer interface according to claim 1 or 2, characterized in that: The meta-learning stage includes: Randomly select one of the m auxiliary subjects, and then randomly select K samples from each type of training data as training samples in the task and Q samples as test samples in the task to construct a few-sample task; In each task, the N×K support set samples are mapped using the feature encoder to obtain the corresponding feature vectors, and the average feature vector of each class is calculated as the centroid of the class; For a query sample x in the training task, the probability that sample x belongs to category i is calculated based on the cosine similarity between its feature vector and the centroid of category i.
6. The method for identifying a small number of samples in a brain-computer interface according to claim 5, characterized in that: The calculation formula of the centroid includes: Definition S i is a subset of K supporting samples under category i (i=1,…,N), then the centroid w of each category is i It is expressed as follows: Among them, f θ (x) represents the support sample x after feature encoder f θ The resulting feature vector.
7. The method for identifying a small number of samples in a brain-computer interface according to claim 6, characterized in that: The calculation formula for the probability that the sample x belongs to category i includes: Among them, cos<·,·> represents the cosine similarity of two vectors, w j represents the centroid of class j, y represents the predicted label, and N represents the number of categories.
8. The method for identifying a small number of samples in a brain-computer interface according to any one of claims 1 to 3, characterized in that: The pre-training stage uses a standard cross entropy loss function to iteratively update the parameters of the network.
Citation Information
Patent Citations
Few-sample human body behavior recognition method and system based on feature transformation metric network
CN112001345A
Electroencephalogram data element learning and human-based intelligent interaction system for multi-robot control
CN114115546A