Electroencephalogram signal classification method and device for RSVP task

By constructing the training sample set and controlling the sample proportion with equilibrium coefficients, the problem of unbalanced sample category distribution in RSVP tasks is solved, the accuracy and generalization ability of EEG signal classification are improved, and efficient classification under imbalance situations is achieved Effect.

CN119106346APending Publication Date: 2024-12-10天津(滨海)人工智能创新中心
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411063865.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-05
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

In RSVP tasks, due to the imbalance of sample categories, it is difficult for the existing technology to effectively improve the accuracy of EEG signal classification, resulting in low improvement in high false alarm rates and classification performance.

Method used

By constructing the first and second training sample sets, comparative learning of feature extraction models is performed using training samples with positive or negative group labels, and using the equilibrium coefficient to control the sample ratio, an optimized EEG signal classification model is constructed to improve classification results accuracy.

Benefits of technology

In the case of unbalanced distribution of sample categories, the distinction and generalization ability of the feature extraction model are enhanced, the accuracy and generalization ability of the EEG signal classification model are improved, and the accuracy of classification results is significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119106346A_ABST
    Figure CN119106346A_ABST
Patent Text Reader

Abstract

The invention discloses an electroencephalogram signal classification method and device for an RSVP task, and the method comprises the steps: constructing a first training sample set and a second training sample set based on a preset electroencephalogram training data set; training a preset feature extraction model by using the first training sample set and a preset first loss function to obtain an optimized feature extraction model; constructing an electroencephalogram signal classification model based on the optimized feature extraction model and a preset classifier module; training the electroencephalogram signal classification model by using the second training sample set and a second loss function to obtain an optimized electroencephalogram signal classification model; acquiring electroencephalogram signals to be classified; processing the to-be-classified electroencephalogram signals by using the optimized electroencephalogram signal classification model to obtain the corresponding classification probability values; and processing based on the classification probability value to determine a classification result. According to the method, the accuracy of the classification result can be improved when the sample category distribution is unbalanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of brain-computer interface, and specifically relates to a method and device for classifying electroencephalogram (EEG) signals for RSVP tasks. Background Art

[0002] In the field of brain-computer interface (BCI), the Rapid Serial Visual Presentation (RSVP) task is an important experimental paradigm used to study human visual attention and information processing ability. The RSVP task presents a series of visual stimuli (such as letters, words, pictures, etc.) in a rapid sequence, requiring the subject to identify a specific target stimulus. This paradigm is particularly suitable for studying how the brain quickly and accurately selects and processes information in a high-speed information flow.

[0003] In RSVP tasks, the number of non-target samples is usually much larger than the number of target samples for the following reasons: (1) In visual presentation, a sufficient time interval must be maintained between two consecutive target images in order to evoke the P300 EEG signal of the experimental subjects. (2) In order to maintain a high refresh rate, many non-target images need to be included in the rapid serial visual presentation. However, a large number of studies have shown that the imbalance in the distribution of sample categories seriously hinders the classification performance of EEG in RSVP tasks, because the main category often dominates the decision, resulting in a high false alarm rate.

[0004] Existing solutions usually adopt rebalancing strategies (such as reweighting and redistribution) to mitigate the impact of class imbalance. Although these strategies enhance the learning ability of the classifier (by changing the distribution of training data to pay more attention to the samples of the minority class) and reduce the model's bias towards the majority class, they inadvertently damage the representativeness of the learned deep features, and thus the classification performance improvement on the RSVP task is not significant. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide an EEG signal classification method and device for RSVP task, which can improve the accuracy of classification results when the distribution of sample categories is unbalanced.

[0006] In order to solve the above technical problems, an embodiment of the present invention discloses an EEG signal classification method for RSVP task, the method comprising:

[0007] S1. Constructing a first training sample set and a second training sample set based on a preset EEG training data set;

[0008] The EEG training data set and the second training sample set both include EEG training samples; the EEG training samples include EEG signals and target information; the value of the target information is existence or non-existence;

[0009] The first training sample set includes classification training samples; the classification training samples include training sample pairs and group labels; the training sample pairs include two EEG signals; the value of the group label is positive or negative;

[0010] S2. Using the first training sample set and a preset first loss function, training a preset feature extraction model to obtain an optimized feature extraction model;

[0011] S3, constructing an EEG signal classification model based on the optimized feature extraction model and a preset classifier module; the classifier module includes an input module, a linear module and an output module connected in sequence; the output module outputs a classification probability value;

[0012] S4, using the second training sample set and the second loss function to train the EEG signal classification model to obtain an optimized EEG signal classification model;

[0013] S5, obtaining the EEG signal to be classified;

[0014] S6. Using the optimized EEG signal classification model, the EEG signal to be classified is processed to obtain the corresponding classification probability value; and processing is performed based on the classification probability value to determine the classification result.

[0015] As an optional implementation, in the first aspect of the embodiment of the present invention, constructing the first training sample set and the second training sample set based on the preset EEG training data set includes:

[0016] S11, based on the target information, segmenting and extracting the EEG training data set to obtain a first training subset and a second training subset;

[0017] S12, performing a first processing on the first training subset and the second training subset to obtain the first training sample set;

[0018] S13: Perform a second process on the first training subset and the second training subset to obtain the second training sample set.

[0019] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the performing a first processing on the first training subset and the second training subset to obtain the first training sample set includes:

[0020] S121, presetting a first sampling number N1, a second sampling number N2, and a third sampling number N3;

[0021] S122, randomly selecting N1 pairs of the EEG signals from the first training subset to obtain N1 training sample pairs; the N1 training sample pairs together constitute a first sample pair set;

[0022] S123, randomly selecting N2 pairs of the EEG signals from the second training subset to obtain N2 training sample pairs; the N2 training sample pairs together constitute a second sample pair set;

[0023] S124, randomly selecting N3 EEG signals from the first training subset to obtain a positive sample set;

[0024] S125. Randomly select N3 EEG signals from the second training subset to obtain a negative sample set;

[0025] S126. Merge the first sample pair set and the second sample pair set to obtain a positive sample pair set;

[0026] S127, combining the positive sample set and the negative sample set to obtain the negative sample pair set;

[0027] S128. Construct the first training sample set based on the positive sample pair set and the negative sample pair set.

[0028] As an optional implementation manner, in the first aspect of the embodiment of the present invention, performing a second process on the first training subset and the second training subset to obtain the second training sample set includes:

[0029] S131, preset a fourth sampling number N4 and a balance coefficient Q, Q>0;

[0030] S132, using a sampling times calculation model, processing the fourth sampling times N4 and the balance coefficient Q to obtain a fifth sampling times N5;

[0031] The sampling times calculation model is:

[0032] N5=[QN4]

[0033] In the formula, [·] represents the rounding operation;

[0034] S133, randomly selecting N4 EEG signals from the first training subset to obtain a first classification sample set;

[0035] S134, randomly selecting N5 of the EEG signals from the second training subset to obtain a second classification sample set;

[0036] S135: Combine the first classification sample set and the second classification sample set to obtain the second training sample set.

[0037] As an optional implementation, in the first aspect of the embodiment of the present invention, the feature extraction model includes an input module, an encoder module and a projection module;

[0038] The input module is connected to the encoder module and is used to send the two input EEG signals to the encoder module in sequence;

[0039] The encoder module is connected to the projection module and is used to process the two input EEG signals in sequence to obtain the corresponding first EEG feature vector and second EEG feature vector, and send them to the projection module;

[0040] The projection module is used to process the first EEG feature vector and the second EEG feature vector in sequence to obtain a first projection vector and a second projection vector.

[0041] As an optional implementation, in the first aspect of the embodiment of the present invention, the projection module includes a linear unit and an activation unit;

[0042] The input end of the linear unit is configured as the input end of the projection module; the output end of the linear unit is connected to the input end of the activation unit; and the output end of the activation unit is configured as the output end of the projection module.

[0043] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the expression of the first loss function is:

[0044]

[0045] Wherein, L1 is the value of the first loss function, M is the number of the classification training samples in the first training sample set, m is an integer, and 1≤m≤M; m,1 and z m,2 are respectively the first projection vector and the second projection vector obtained after the mth training sample pair is processed by the feature extraction model; and are the first intermediate value and the second intermediate value respectively; q m is the group label corresponding to the mth training sample pair; sim m is the mth similarity value.

[0046] As an optional implementation, in the first aspect of the embodiment of the present invention, constructing an EEG signal classification model based on the optimized feature extraction model and a preset classifier module includes:

[0047] S31, obtaining the encoder module in the optimized feature extraction model to obtain a classification encoder module;

[0048] S32. Connect the output end of the classification encoder module to the input end of the classifier module to obtain the EEG signal classification model; the input end of the classification encoder module is configured as the input end of the EEG signal classification model; the output end of the classifier module is configured as the output end of the EEG signal classification model.

[0049] A second aspect of an embodiment of the present invention discloses an electroencephalogram signal classification device for RSVP task, the device comprising:

[0050] A memory storing executable program code;

[0051] a processor coupled to the memory;

[0052] The processor calls the executable program code stored in the memory to execute part or all of the steps in the EEG signal classification method for RSVP task disclosed in the first aspect of the embodiment of the present invention.

[0053] The third aspect of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute some or all of the steps in the EEG signal classification method for RSVP task disclosed in the first aspect of the embodiment of the present invention.

[0054] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0055] (1) By using the first training sample set consisting of training sample pairs with positive or negative group labels, the feature extraction model is subjected to comparative learning, so as to enhance the discrimination of different categories by the feature extraction model and improve the generalization ability of the encoder module when the sample category distribution is unbalanced.

[0056] (2) By using the balance coefficient to accurately control the proportion of samples of different categories in the second training sample set, a balanced distribution of EEG training sample categories is achieved, the generalization ability of the EEG signal classification model is improved, and the accuracy of the classification results is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of 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 work.

[0058] Figure 1 It is a flowchart of a method for classifying EEG signals for RSVP tasks disclosed in an embodiment of the present invention.

[0059] Figure 2 It is a structural schematic diagram of a feature extraction model of an electroencephalogram signal classification method for RSVP task disclosed in an embodiment of the present invention.

[0060] Figure 3 It is a structural schematic diagram of another EEG signal classification device for RSVP task disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0061] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0062] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship 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 orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0063] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be 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.

[0064] Embodiment 1

[0065] See also Figure 1 , Figure 1 : is a flow chart of a method for classifying EEG signals for RSVP tasks disclosed in an embodiment of the present invention. Figure 1The described EEG signal classification method for RSVP task is applied to the field of brain-to-body interface, such as EEG signal classification for RSVP task, which is not limited in the embodiments of the present invention. Figure 1 As shown, the method includes:

[0066] S1. Constructing a first training sample set and a second training sample set based on a preset EEG training data set;

[0067] The EEG training data set and the second training sample set both include EEG training samples; the EEG training samples include EEG signals and target information; the value of the target information is existence or non-existence;

[0068] The first training sample set includes classification training samples; the classification training samples include training sample pairs and group labels; the training sample pairs include two EEG signals; and the value of the group label is positive or negative.

[0069] It should be noted that the above target information exists, which means that the subject saw the image containing the target when performing the corresponding RSVP task; the above target information does not exist, which means that the subject did not see the image containing the target when performing the corresponding RSVP task.

[0070] S2. Using the first training sample set and a preset first loss function, train a preset feature extraction model to obtain an optimized feature extraction model.

[0071] S3. Constructing an EEG signal classification model based on the optimized feature extraction model and a preset classifier module; the classifier module comprises an input module, a linear module and an output module connected in sequence; the output module outputs a classification probability value.

[0072] It should be noted that the above-mentioned input module is used to normalize the input data in sequence to obtain a classification vector, which is not limited in the embodiment of the present invention.

[0073] It should be noted that the above-mentioned linear module is constructed based on the fully connected layer, which is composed of a series of weight matrices and bias vectors, and is used to perform linear transformation on the classification vector to obtain an embedding vector, which is not limited in the embodiment of the present invention.

[0074] It should be noted that the above output module is constructed based on the softmax function, processes the input embedding vector, and outputs the classification probability value, which is not limited in the embodiment of the present invention.

[0075] S4. Use the second training sample set and the second loss function to train the EEG signal classification model to obtain an optimized EEG signal classification model.

[0076] It should be noted that the above-mentioned feature extraction model and EEG signal classification model are trained by the gradient descent method, wherein the training of the feature extraction model ends when the value of the first loss function is less than the preset first threshold, and the training of the EEG signal classification model ends when the value of the second loss function is less than the preset second threshold, and the embodiment of the present invention does not limit this.

[0077] S5. Obtain the EEG signal to be classified.

[0078] It should be noted that the above-mentioned EEG signals to be classified can be obtained by asking the subject to perform the RSVP task and collecting them using an OpenBCI EEG collection cap worn on the subject's head, which is not limited in the embodiment of the present invention.

[0079] S6. Using the optimized EEG signal classification model, the EEG signal to be classified is processed to obtain the corresponding classification probability value; and processing is performed based on the classification probability value to determine the classification result.

[0080] In an optional embodiment, the first training sample set and the second training sample set are constructed based on a preset EEG training data set, including:

[0081] S11. Based on the target information, segment and extract the EEG training data set to obtain a first training subset and a second training subset.

[0082] It should be noted that the first training subset includes all EEG signals whose corresponding target information exists in the EEG training data set; and the second training subset includes all EEG signals whose corresponding target information does not exist in the EEG training data set.

[0083] S12: Perform a first processing on the first training subset and the second training subset to obtain the first training sample set.

[0084] S13: Perform a second process on the first training subset and the second training subset to obtain the second training sample set.

[0085] In another optional embodiment, performing the first processing on the first training subset and the second training subset to obtain the first training sample set includes:

[0086] S121, presetting a first sampling number N1, a second sampling number N2, and a third sampling number N3;

[0087] S122. Randomly select N1 pairs of the EEG signals from the first training subset to obtain N1 training sample pairs; the N1 training sample pairs together constitute a first sample pair set.

[0088] S123. Randomly select N2 pairs of the EEG signals from the second training subset to obtain N2 training sample pairs; the N2 training sample pairs together constitute a second sample pair set.

[0089] S124. Randomly select N3 EEG signals from the first training subset to obtain a positive sample set.

[0090] S125. Randomly select N3 EEG signals from the second training subset to obtain a negative sample set.

[0091] S126: Merge the first sample pair set and the second sample pair set to obtain a positive sample pair set.

[0092] It should be noted that the above positive sample pair set includes N1+N2 pairs of EEG signals, which is not limited in the embodiment of the present invention.

[0093] S127: Combine the positive sample set and the negative sample set to obtain the negative sample pair set.

[0094] It should be noted that the above negative sample pair set includes N3 pairs of EEG signals. In each pair of EEG signals, one EEG signal comes from the positive sample set, and the other EEG signal comes from the negative sample set, which is not limited in the embodiment of the present invention.

[0095] S128. Construct the first training sample set based on the positive sample pair set and the negative sample pair set.

[0096] In yet another optional embodiment, the step of constructing the first training sample set based on the positive sample pair set and the negative sample pair set includes:

[0097] Initialize the first training sample set to be empty;

[0098] Add positive group labels to N1+N2 pairs of EEG signals in the positive sample pair set to obtain N1+N2 classification training samples; the above N1+N2 classification training samples constitute the first classification training sample subset;

[0099] Add negative group labels to N3 pairs of EEG signals in the negative sample pair set to obtain N3 classification training samples; the above N3 classification training samples constitute the second classification training sample subset;

[0100] The first classification training sample subset and the second classification training sample subset are combined to obtain a first training sample set.

[0101] It should be noted that the first training sample set includes N1+N2+N3 classification training samples.

[0102] It can be seen that the first training sample set obtained by the above first processing contains training sample pairs with positive or negative group labels at the same time, wherein the two EEG signals of the sample pairs with positive group labels contain the same features (representing the presence or absence of the target at the same time), while the two EEG signals of the sample pairs with negative group labels contain different features (one represents the presence of the target and the other represents the absence of the target).

[0103] In yet another optional embodiment, performing a second process on the first training subset and the second training subset to obtain the second training sample set includes:

[0104] S131, preset a fourth sampling number N4 and a balance coefficient Q, Q>0;

[0105] S132, using a sampling times calculation model, processing the fourth sampling times N4 and the balance coefficient Q to obtain a fifth sampling times N5;

[0106] The sampling times calculation model is:

[0107] N5=[QN4]

[0108] In the formula, [·] represents the rounding operation;

[0109] S133, randomly selecting N4 EEG signals from the first training subset to obtain a first classification sample set;

[0110] S134, randomly selecting N5 of the EEG signals from the second training subset to obtain a second classification sample set;

[0111] S135: Combine the first classification sample set and the second classification sample set to obtain the second training sample set.

[0112] Preferably, the balance coefficient is 1.

[0113] It should be noted that the second training sample set includes N4+N5 EEG signals.

[0114] In yet another optional embodiment, the combining of the first classification sample set and the second classification sample set includes:

[0115] Initialize the second training sample set to be empty;

[0116] Combine the N4 EEG signals in the first classification sample set with the target information whose values ​​are present, respectively, to obtain N4 EEG training samples; and add the N4 EEG training samples to the second training sample set;

[0117] The N5 EEG signals in the second classification sample set are respectively combined with N5 target information whose values ​​are non-existent to obtain N5 EEG training samples; and the N5 EEG training samples are added to the second training sample set.

[0118] It can be seen that the introduction of the balance coefficient in the second processing process can accurately control the proportion of EEG training samples with and without target information in the second training sample set, thereby avoiding the EEG signal classification model being significantly biased towards the majority class and ignoring the minority class during the training process due to the imbalance in the distribution of EEG training sample categories, thereby affecting the generalization ability and accuracy of the model.

[0119] In yet another optional embodiment, Figure 2 As shown, the feature extraction model includes an input module, an encoder module and a projection module;

[0120] The input module is connected to the encoder module and is used to send the two input EEG signals to the encoder module in sequence;

[0121] The encoder module is connected to the projection module and is used to process the two input EEG signals in sequence to obtain the corresponding first EEG feature vector and second EEG feature vector, and send them to the projection module;

[0122] The projection module is used to process the first EEG feature vector and the second EEG feature vector in sequence to obtain a first projection vector and a second projection vector.

[0123] It should be noted that the above encoder module is an EEGNet model, which is not limited in the embodiment of the present invention.

[0124] It should be noted that the EEGNet model is a compact convolutional neural network designed specifically for processing EEG signals. Its processing process includes two main steps:

[0125] The first step includes the following sub-steps: (a) using a 2D convolution filter (Conv2D) with a convolution kernel size of (1, F) to process the input data, and further perform batch normalization (BatchNorm), where F is half of the preset data sampling rate, thereby allowing the capture of frequency information of 2 Hz and above; (b) using a depthwise convolution (DepthwiseConv2D) with a size of (C, 1) to process the result of step a, and further perform batch normalization, where C is the number of preset channels, to reduce the number of fitting trainable parameters; (c) applying an exponential linear unit (ELU activation function) to perform nonlinear processing on the result of step b; (d) applying a pooling layer (AvgPool2d) with an average size of (1, 4) to process the result of step c; (e) performing a dropout operation on the result of step d to help regularization or modeling.

[0126] The second step includes the following sub-steps: (f) Process the data output from the first step using a separable convolution (SeparableConv2D), which includes a depthwise convolution and a (1, 1) point convolution; (g) Perform batch normalization on the result of step f; (h) Apply an exponential linear unit to perform nonlinear processing on the result of step g; (i) Apply a pooling layer (AvgPool2d) with an average size of (1, 8) to process the result of step h; (j) Perform a dropout operation on the result of step i; (k) Flatten the result of step j to obtain one-dimensional data. The second step process can reduce the number of fitting parameters and decouple the relationship within and across feature maps by first learning a kernel to summarize each feature map separately and then optimally merging the outputs.

[0127] It should be noted that, after being processed by the projection module, the first EEG feature vector and the second EEG feature vector respectively obtain a first projection vector and a second projection vector, which is not limited in the embodiment of the present invention.

[0128] In yet another optional embodiment, the projection module includes a linear unit and an activation unit;

[0129] The input end of the linear unit is configured as the input end of the projection module; the output end of the linear unit is connected to the input end of the activation unit; and the output end of the activation unit is configured as the output end of the projection module.

[0130] It should be noted that the above-mentioned linear unit is constructed based on the fully connected layer, and is used to perform a linear transformation on the input first EEG feature vector or the second EEG feature vector; further, the linear unit compresses the dimension of the first EEG feature vector or the second EEG feature vector through simple mathematical operations to cooperate with subsequent activation operations, thereby increasing the nonlinear expression capability of the projection module, which is not limited in the embodiments of the present invention.

[0131] Preferably, the linear unit comprises two fully connected layers connected in sequence.

[0132] Preferably, the above activation module is constructed based on the ELU activation function.

[0133] In another optional embodiment, the expression of the first loss function is:

[0134]

[0135] Wherein, L1 is the value of the first loss function, M is the number of the classification training samples in the first training sample set, m is an integer, and 1≤m≤M; m,1 and z m,2 are respectively the first projection vector and the second projection vector obtained after the mth training sample pair is processed by the feature extraction model; and are the first intermediate value and the second intermediate value respectively; q m is the group label corresponding to the mth training sample pair; sim m is the mth similarity value.

[0136] It should be noted that when training the feature extraction model, the two EEG signals of each training sample pair in the first training sample set are input into the training feature extraction model each time to obtain the corresponding first projection vector and second projection vector.

[0137] It can be seen that by training with the first loss function and the first training sample set, the comparative learning of the feature extraction model is realized, the discrimination of the model for different categories is enhanced, and the generalization ability of the encoder module is improved.

[0138] In another optional embodiment, the second loss function is a cross entropy loss function, which is expressed as:

[0139] L2=-ylogp-(1-y)log(1-p)

[0140] In the formula, L2 is the value of the second loss function, y is the label value corresponding to the EEG signal input by the EEG signal classification model, and p is the classification probability value output by the EEG signal classification model.

[0141] It should be noted that when training the EEG signal classification model, the EEG signals in the second training sample set are input into the EEG signal classification model to obtain the corresponding classification probability value, and the corresponding label value can be determined by the following formula, which is not limited in the embodiment of the present invention:

[0142]

[0143] In yet another optional embodiment, the EEG signal classification model is constructed based on the optimized feature extraction model and the preset classifier module, including:

[0144] S31. Obtain the encoder module in the optimized feature extraction model to obtain a classification encoder module.

[0145] S32. Connect the output end of the classification encoder module to the input end of the classifier module to obtain the EEG signal classification model; the input end of the classification encoder module is configured as the input end of the EEG signal classification model; the output end of the classifier module is configured as the output end of the EEG signal classification model.

[0146] It should be noted that when training the above-mentioned EEG signal classification model, the parameters of the classification encoder module remain fixed, and only the parameters of the classifier module need to be trained, thereby reducing the training time.

[0147] It should be noted that the classification encoder module of the above-mentioned EEG signal classification model is completely consistent with the structure and parameters of the encoder module in the optimized feature extraction model, but the former only processes the input EEG signal to be classified, obtains the corresponding EEG feature vector and sends it to the classifier module for further processing, while the latter processes two EEG signals in succession to obtain the corresponding first EEG feature vector and second EEG feature vector in turn.

[0148] In yet another optional embodiment, the above processing based on the classification probability value to determine the classification result includes:

[0149] S61, preset a judgment threshold;

[0150] S62, judging the classification probability value;

[0151] When the classification probability value is greater than the judgment threshold, the classification result is determined to be the existence of the target;

[0152] When the classification probability value is less than or equal to the judgment threshold, the classification result is determined to be that the target does not exist.

[0153] Preferably, the above judgment threshold is 0.5.

[0154] It can be seen that the implementation of the EEG signal classification method for the RSVP task described in the embodiment of the present invention can improve the accuracy of the classification result.

[0155] Embodiment 2

[0156] See also Figure 3 , Figure 3 : is a schematic diagram of a structure of an EEG signal classification device for RSVP task disclosed in an embodiment of the present invention. Figure 3 The described EEG signal classification device for RSVP task can be applied to the field of brain-computer interface, such as EEG signal classification of RSVP task, etc., which is not limited in the embodiment of the present invention. Figure 3 As shown, the EEG signal classification device for RSVP task may include the following parts:

[0157] A memory 201 storing executable program codes;

[0158] a processor 202 coupled to the memory 201;

[0159] The processor 202 calls the executable program code stored in the memory 201 to execute the steps of the EEG signal classification method for the RSVP task described in the first embodiment.

[0160] Embodiment 3

[0161] An embodiment of the present invention discloses a computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program enables a computer to execute the steps of the method for classifying electroencephalogram signals for RSVP tasks described in the first embodiment.

[0162] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0163] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, a magnetic disk storage, a magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0164] Finally, it should be noted that the EEG signal classification method and device for RSVP task disclosed in the embodiment of the present invention only discloses the preferred embodiment of the present invention, which is only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for classifying EEG signals for RSVP tasks, characterized in that: include: S1. Constructing a first training sample set and a second training sample set based on a preset EEG training data set; The EEG training data set and the second training sample set both include EEG training samples; the EEG training samples include EEG signals and target information; The value of the target information is existence or non-existence; The first training sample set includes classification training samples; the classification training samples include training sample pairs and group labels; the training sample pairs include the two EEG signals; The value of the group label is positive or negative; S2. Using the first training sample set and a preset first loss function, training a preset feature extraction model to obtain an optimized feature extraction model; S3, constructing an EEG signal classification model based on the optimized feature extraction model and the preset classifier module; The classifier module includes an input module, a linear module and an output module connected in sequence; The output module outputs a classification probability value; S4, using the second training sample set and the second loss function to train the EEG signal classification model to obtain an optimized EEG signal classification model; S5, obtaining the EEG signal to be classified; S6. Processing the to-be-classified EEG signal using the optimized EEG signal classification model to obtain the corresponding classification probability value; Processing is performed based on the classification probability value to determine a classification result.

2. The EEG signal classification method for RSVP task according to claim 1, characterized in that: The step of constructing a first training sample set and a second training sample set based on a preset EEG training data set includes: S11, based on the target information, segmenting and extracting the EEG training data set to obtain a first training subset and a second training subset; S12, performing a first processing on the first training subset and the second training subset to obtain the first training sample set; S13: Perform a second process on the first training subset and the second training subset to obtain the second training sample set.

3. The EEG signal classification method for RSVP task according to claim 2, characterized in that: The performing a first processing on the first training subset and the second training subset to obtain the first training sample set includes: S121, presetting a first sampling number N1, a second sampling number N2, and a third sampling number N3; S122, randomly selecting N1 pairs of the EEG signals from the first training subset to obtain N1 training sample pairs; the N1 training sample pairs together constitute a first sample pair set; S123, randomly selecting N2 pairs of the EEG signals from the second training subset to obtain N2 training sample pairs; the N2 training sample pairs together constitute a second sample pair set; S124, randomly selecting N3 EEG signals from the first training subset to obtain a positive sample set; S125. Randomly select N3 EEG signals from the second training subset to obtain a negative sample set; S126. Merge the first sample pair set and the second sample pair set to obtain a positive sample pair set; S127, combining the positive sample set and the negative sample set to obtain the negative sample pair set; S128. Construct the first training sample set based on the positive sample pair set and the negative sample pair set.

4. The EEG signal classification method for RSVP task according to claim 2, characterized in that: The performing a second process on the first training subset and the second training subset to obtain the second training sample set includes: S131, preset a fourth sampling number N4 and a balance coefficient Q, Q>0; S132, using a sampling times calculation model, processing the fourth sampling times N4 and the balance coefficient Q to obtain a fifth sampling times N5; The sampling times calculation model is: N5=[QN4] In the formula, [·] represents the rounding operation; S133, randomly selecting N4 EEG signals from the first training subset to obtain a first classification sample set; S134, randomly selecting N5 of the EEG signals from the second training subset to obtain a second classification sample set; S135: Combine the first classification sample set and the second classification sample set to obtain the second training sample set.

5. The EEG signal classification method for RSVP task according to claim 1, characterized in that: The feature extraction model includes an input module, an encoder module and a projection module; The input module is connected to the encoder module and is used to send the two input EEG signals to the encoder module in sequence; The encoder module is connected to the projection module and is used to process the two input EEG signals in sequence to obtain the corresponding first EEG feature vector and second EEG feature vector, and send them to the projection module; The projection module is used to process the first EEG feature vector and the second EEG feature vector in sequence to obtain a first projection vector and a second projection vector.

6. The method for classifying EEG signals for RSVP task according to claim 5, characterized in that: The projection module includes a linear unit and an activation unit; The input end of the linear unit is configured as the input end of the projection module; the output end of the linear unit is connected to the input end of the activation unit; and the output end of the activation unit is configured as the output end of the projection module.

7. The EEG signal classification method for RSVP task according to claim 5 or 6, characterized in that: The expression of the first loss function is: Wherein, L1 is the value of the first loss function, M is the number of the classification training samples in the first training sample set, m is an integer, and 1≤m≤M; m,1 and z m,2 are the first projection vector and the second projection vector respectively obtained after the mth training sample pair is processed by the feature extraction model; φ1 and φ2 are the first intermediate value and the second intermediate value respectively; q m is the group label corresponding to the mth training sample pair; sim m is the mth similarity value.

8. The EEG signal classification method for RSVP task according to claim 5, characterized in that: The method of constructing an EEG signal classification model based on the optimized feature extraction model and the preset classifier module includes: S31, obtaining the encoder module in the optimized feature extraction model to obtain a classification encoder module; S32. Connect the output end of the classification encoder module to the input end of the classifier module to obtain the EEG signal classification model; the input end of the classification encoder module is configured as the input end of the EEG signal classification model; the output end of the classifier module is configured as the output end of the EEG signal classification model.

9. An EEG signal classification device for RSVP task, characterized in that: The device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the EEG signal classification method for RSVP task according to any one of claims 1 to 8.

10. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the EEG signal classification method for RSVP task according to any one of claims 1 to 8.