Electroencephalogram signal classification method based on pre-training language model reprogramming
Through the method of reprogramming based on the pre-trained language model, cross-attention mechanism and self-supervised learning are used to solve the problems of channel inconsistency and subject heterogeneity in EEG signal classification, and a more efficient EEG signal classification effect is achieved.
Patent Information
- Application Number
- CN202510666062.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-08-29
AI Technical Summary
The existing EEG signal classification methods lack the ability to generalize data of different subjects, are difficult to adapt to different acquisition equipment and channel configurations, and lack mature basic model architecture, resulting in poor model performance.
Using a method based on pre-trained language model reprogramming, a single-channel pre-training learning task is constructed, and the cross-attention mechanism is used to fuse EEG signals and text data, combined with self-supervised learning, the model's cross-domain adaptability and classification accuracy are improved.
It realizes efficient EEG signal classification between different channel configurations and subjects, improves the generalization ability and classification performance of the model, and is better than the existing methods.
Smart Images

Figure CN120561730A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of EEG signal processing and deep learning, and more specifically, to a classification method that applies a pre-trained language model to EEG signals. Background Art
[0002] Electroencephalography (EEG) is the spontaneous fluctuation of electrical potentials generated by neural activity in the brain, reflecting the electrical activity of different brain regions in real time. With the continuous advancement of technology, EEG has been widely used in various fields, including brain-computer interfaces, cognitive status assessment, and healthcare. To fully realize the potential of EEG in these fields, developing efficient and accurate EEG signal classification methods is of great research significance in multiple areas, such as healthcare, intelligent assessment, and brain-computer interfaces.
[0003] In recent years, with the continuous development of deep learning technology and the increase in computing power, researchers have widely applied it to EEG signal classification, and it has now become a mainstream approach in EEG signal classification. Deep learning methods utilize a data-driven approach, eliminating the need for complex artificial feature design, and their classification performance often outperforms traditional machine learning methods. Common EEG signal classification models include convolutional neural networks, recurrent neural networks, and Transformers. However, current EEG signal classification methods are mostly designed for specific subjects or specific datasets, fitting only a small amount of existing data distribution and lacking the ability to infer and predict the data itself, resulting in insufficient generalization to new subject data. Moreover, these methods often struggle to adapt to subjects or datasets with varying channel counts due to factors such as acquisition equipment and conditions. In EEG signal classification tasks, significant heterogeneity exists between subjects, and the signals themselves are non-stationary, resulting in significant differences in data distribution across subjects, leading to poor model classification performance. Therefore, how to address diverse EEG data formats and establish generalizable deep learning models for EEG signal classification has become an urgent challenge in this field.
[0004] In data-intensive fields such as natural language processing and computer vision, deep learning technology demonstrates two significant advantages: the ability to build high-performance models for specific tasks and the ability to automatically extract generalizable representations through self-supervised learning. These task-independent general representations can be adapted to diverse downstream tasks through transfer learning techniques, effectively enhancing the model's cross-domain and cross-task adaptability. However, the development of EEG signal classification faces two major constraints: from a data perspective, EEG data, which involves sensitive neural information and personal privacy, faces strict restrictions on its access and sharing, making the available training sample size insufficient for deep learning. From a technical development perspective, building basic EEG models requires both massive multi-source data and ultra-large-scale computing resources, significantly raising the bar for technological development. Currently, the field lacks mature foundational model architectures similar to ChatGPT or DeepSeek, making it difficult for researchers to rapidly develop specific EEG signal classification tasks through transfer learning methods such as parameter fine-tuning. Summary of the Invention
[0005] The present invention aims to address the shortcomings of the above-mentioned existing technologies and proposes an EEG signal classification method based on reprogramming of a pre-trained language model. It aims to design a single-channel pre-training learning task through the cross-domain knowledge and powerful reasoning and generalization ability of the pre-trained model, thereby improving the accuracy of EEG signal classification and solving the data format problem caused by channel inconsistency, and efficiently realizing specific EEG signal classification tasks.
[0006] In order to achieve the above-mentioned object, the present invention adopts the following technical solutions:
[0007] The present invention provides an EEG signal classification method based on pre-trained language model reprogramming, which comprises the following steps:
[0008] Step 1: Get the Types of EEG signal datasets, and after denoising and windowing the original EEG signal in the EEG signal dataset, the preprocessed EEG signal sample set is obtained ,in, After preprocessing, EEG signal samples, represents the total number of EEG signal samples, represents the duration of each EEG signal sample, represents the sampling rate, Indicates the The number of channels of each type of EEG signal dataset; and , express Middle EEG signal sequence of channels; ; ;
[0009] Get the word vector set in the pre-trained language model ,in, Indicates vocabulary size, Represents the feature dimension of the word vector;
[0010] Step 2: Construct an EEG signal prediction network, which includes a feature encoding module, a pre-trained language model, and a prediction module. Processing is performed to obtain the future amplitude characteristic prediction value and future phase feature predictions ;
[0011] Step 3: Based on and , use formula (17) to construct the mean square error loss , use AdamW optimizer to pre-train the feature encoding module and prediction module, and minimize To update the module parameters, so as to obtain the optimal parameters of the feature encoding module and the optimal parameters of the prediction module ;
[0012] (17)
[0013] Step 4: Build an EEG classification network, including: optimal parameters The feature encoding module, pre-trained language model and classifier are used to Optimal parameters for different types of EEG signal classification task datasets Fine-tune the feature encoding module and classifier to obtain a fine-tuned feature encoding module and a fine-tuned classifier, and output an EEG signal category probability value;
[0014] The EEG signal classification method based on pre-trained language model reprogramming according to the present invention is also characterized in that step 2 includes the following steps:
[0015] Step 2.1: Get the prompt word prefix , and with Input them into the feature encoding module for encoding to obtain the EEG signal text prototype fusion representation ;in, express The number of markers;
[0016] Step 2.2: Pre-training language model Perform reasoning to obtain fusion reasoning features Then, through the linear layer Projection as EEG inference features ;
[0017] Step 2.3, After flattening, it is input into the prediction module for prediction to obtain the future amplitude feature prediction value and future phase feature predictions .
[0018] Furthermore, step 2.1 includes the following steps:
[0019] Step 2.1.1, After short-time Fourier transform, it is divided into the current EEG time-frequency characteristics according to the time dimension and the label value of future EEG time-frequency features ,in, express The size of the time dimension, express The size of the time dimension, Indicates the number of frequency points;
[0020] Step 2.1.2, calculate separately Current amplitude characteristics of and current phase characteristics as well as The future amplitude feature label and future phase feature labels ;
[0021] Step 2.1.3: Set the current amplitude feature With the current phase characteristics After integration, the integrated EEG signal features are obtained ,in, Represents the dimension of the adjusted EEG signal features;
[0022] Step 2.1.4: Set word vectors After linear projection, the text prototype is obtained ,in, Indicates the number of text prototypes, ;
[0023] Step 2.1.5: Use the cross attention mechanism to and After cross-modal fusion, the aligned fusion representation is obtained ;
[0024] Step 2.1.6, prefix the prompt word and After splicing, the EEG signal text prototype fusion representation feature is obtained ,in, Indicates the prefix of the prompt word The number of words in .
[0025] Furthermore, step 2.1.3 includes the following steps:
[0026] Step 2.1.3.1, 、 Perform standardization operations respectively and obtain the standardized current amplitude characteristics , standardized future amplitude characteristics ;
[0027] Step 2.1.3.2, removal 、 After the phase jump, the normalization operation is performed, and the normalized current phase characteristics are obtained accordingly. , standardized future phase characteristics ;
[0028] Step 2.1.3.3, and After splicing, adjust the dimension to obtain the integrated EEG signal features .
[0029] Furthermore, step 2.1.5 includes the following steps:
[0030] Step 2.1.5.1, use the multi-head attention mechanism to and Processing is performed to obtain multi-head fusion representation ,in, Represents the sum of feature dimensions of all attention heads;
[0031] Step 2.1.5.2, through the linear projection layer and After alignment, the aligned fusion representation is obtained .
[0032] Furthermore, step 4 includes the following steps:
[0033] Step 4.1, get the The sample set of the type of EEG signal classification task is preprocessed according to the process of step 1 to obtain the preprocessed sample set ; After preprocessing, EEG signal samples, and ; express Middle The EEG signal sequence of channels, The corresponding category label is ;in, , Indicates the number of samples for the EEG signal classification task;
[0034] Step 4.2, Enter optimal parameters The feature encoding module is then inferred through the pre-trained language model to obtain EEG inference features across all channels ;
[0035] Step 4.3, After flattening, input the classifier and get The predicted probability value of belonging to each category ;
[0036] Step 4.4: Use formula (18) to construct cross entropy loss , and use AdamW optimizer to optimize the optimal parameters The feature encoding module and classifier are fine-tuned and trained to minimize To update the module parameters, the fine-tuned feature encoding module and the fine-tuned classifier are obtained to achieve the Sample classification for types of EEG signal classification tasks:
[0037] (18).
[0038] The electronic device of the present invention includes a memory and a processor, and is characterized in that the memory is used to store a program that supports the processor to execute the EEG signal classification method, and the processor is configured to execute the program stored in the memory.
[0039] The present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program executes the steps of the EEG signal classification method when the computer program is executed by a processor.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] 1. This paper proposes a new framework for EEG signal classification. It uses a reprogrammed pre-trained language model to classify EEG signals and designs a single-channel pre-training strategy to efficiently reprogram the pre-trained language model, thereby solving the channel inconsistency problem caused by different acquisition devices and different channel configurations, making the model suitable for data with different EEG classification task types and channel configurations.
[0042] 2. Taking into account the characteristics of EEG signals and text data, the present invention constructs an EEG signal classification network based on a large language model, adopts a cross-attention mechanism to fuse cross-domain knowledge between EEG signals and text data, alleviates the differences between EEG signals and text data, and learns the time dependency of EEG signals through self-supervised tasks, utilizing the cross-domain generalization ability of the pre-trained language model, thereby improving the performance of specific EEG signal classification tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 Schematic diagram of model reprogramming of the present invention;
[0044] Figure 2 It is the overall framework diagram of the model of the present invention;
[0045] Figure 3 Schematic diagram of the multi-head cross attention mechanism of the method of the present invention;
[0046] Figure 4 This is a diagram showing the method of the present invention in reconstructing the original signal through amplitude and phase. DETAILED DESCRIPTION
[0047] In this embodiment, a method for classifying EEG signals based on reprogramming of a pre-trained language model mainly utilizes the powerful generalization and reasoning capabilities of the pre-trained language model to perform cross-domain knowledge transfer, thereby achieving data-efficient EEG signal classification. Figure 2 As shown, the EEG signal classification method includes the following steps:
[0048] Step 1: Get the Types of EEG signal datasets are collected, and the original EEG signal in the EEG signal dataset is denoised and windowed. A 0.1-75Hz bandpass filter is first used to remove low-frequency and high-frequency noise. Depending on the dataset, 50Hz or 60Hz power frequency interference is eliminated. The preprocessed EEG signal sample set is obtained. ,in, After preprocessing, EEG signal samples, represents the total number of EEG signal samples, represents the duration of each EEG signal sample, represents the sampling rate, Indicates the The number of channels of each type of EEG signal dataset; and , express Middle EEG signal sequence of channels; ; .
[0049] Get the word vector set in the pre-trained language model ,in, Indicates vocabulary size, Represents the feature dimension of the word vector;
[0050] In this embodiment, for the sliding window method, the window length is 5 seconds, the sliding step is 5 seconds, and the sampling rate is set to 256; the word vector set There are word vectors, word vector feature dimensions is 1536, .
[0051] Step 2: Construct an EEG signal prediction network, which includes a feature encoding module, a pre-trained language model, and a prediction module. Processing is performed to obtain the future amplitude characteristic prediction value and future phase feature predictions
[0052] Step 2.1: Get the prompt word prefix , and with Input them into the feature encoding module for encoding to obtain the EEG signal text prototype fusion representation ;in, express The number of markers;
[0053] In this embodiment, The content is set to "Task description: "Predict the amplitude and phase of the next three time frames based on the amplitude and phase information of the first eight time frames"; Input features:", =43.
[0054] Step 2.1.1, After short-time Fourier transform, it is divided into the current EEG time-frequency characteristics according to the time dimension and the label value of future EEG time-frequency features ,in, Indicates the length is The window function, represents the frequency component index, Indicates the number of fast Fourier transform points (frequency resolution), represents the number of time windows obtained by short-time Fourier transform, express The size of the time dimension, express The size of the time dimension, Indicates the number of frequency points; in this embodiment, the window function length is , the sliding step length is , then The starting position of the window is , Set to 256, Set to 8 time frame data, Set to 3 time frame data; the calculation process is as follows:
[0055] (1)
[0056] Step 2.1.2: Use equations (2) and (3) to calculate Current amplitude characteristics of and current phase characteristics as well as The future amplitude feature label and future phase feature labels ;
[0057] (2)
[0058] (3)
[0059] In formula (2) and formula (3), , Respectively , The real part of , Respectively , The imaginary part of .
[0060] Step 2.1.3: Set the current amplitude feature With the current phase characteristics After integration, the integrated EEG signal features are obtained ,in, Represents the dimension of the adjusted EEG signal features:
[0061] Step 2.1.3.1, use formula (4) and formula (5) to respectively 、 Perform standardization operations respectively and obtain the standardized current amplitude characteristics , standardized future amplitude characteristics ;
[0062] (4)
[0063] (5)
[0064] In formula (4) and formula (5), Indicates standardized operations;
[0065] Step 2.1.3.2, removal 、 After the phase jump, the normalization operation is performed, and the normalized current phase characteristics are obtained accordingly. , standardized future phase characteristics The calculation process is shown in formula (6) and formula (7):
[0066] (6)
[0067] (7)
[0068] In formula (6) and formula (7), Indicates the elimination of the jump operation.
[0069] Step 2.1.3.3, and After splicing, adjust the dimension to obtain the integrated EEG signal features The calculation process is shown in formula (8):
[0070] (8)
[0071] In formula (8), express The convolution operation adjusts the dimension, Represents a splicing operation, Set to 256.
[0072] Step 2.1.4: Use formula (9) to transform the word vector set After linear projection, the text prototype is obtained , thereby reducing the computational complexity in the cross-fusion process; among them, Indicates the number of text prototypes, ;
[0073] (9)
[0074] Step 2.1.5: Use the cross attention mechanism to and After cross-modal fusion, the aligned fusion representation is obtained .
[0075] Step 2.1.5.1, use the multi-head attention mechanism to and Processing is performed to perform cross-modal fusion of text prototypes and EEG signal features to obtain multi-head fusion representation ,in, represents the sum of the feature dimensions of all attention heads; Figure 3Specifically, setting For each attention head, the query matrix is defined using equations (10), (11) and (12) respectively. , bond matrix Sum Matrix :
[0076] (10)
[0077] (11)
[0078] (12)
[0079] In formula (10), formula (11) and formula (12), In this embodiment, Set to 2048, Set to 8; the calculation process of re-encoding EEG features in each attention head is as shown in formula (13), integrating the output of each attention head Get fusion representation ;
[0080] (13)
[0081] Step 2.1.5.2, through the linear projection layer and After alignment, the aligned fusion representation is obtained The calculation process is shown in formula (14):
[0082] (14)
[0083] Step 2.1.6, prefix the prompt word and After splicing, the EEG signal text prototype fusion representation feature is obtained ,in, Indicates the prefix of the prompt word The number of words in ;
[0084] Step 2.2: Pre-training language model Perform reasoning to obtain fusion reasoning features Then, through the linear layer Projection as EEG inference features The calculation process is shown in formula (15):
[0085] (15)
[0086] Step 2.3, After flattening, it is input into the prediction module for prediction to obtain the future amplitude feature prediction value and future phase feature predictions The calculation process is shown in formula (16):
[0087] (16)
[0088] Step 3: Based on and , use formula (17) to construct the mean square error loss , use AdamW optimizer to pre-train the feature encoding module and prediction module, and minimize To update the module parameters, so as to obtain the optimal parameters of the feature encoding module and the optimal parameters of the prediction module ;
[0089] (17)
[0090] The model input encoding module and prediction module are pre-trained through a single-channel self-supervised strategy. As input, to solve the problem of inconsistent number of channels in different data sets; self-supervised learning is used to guide the model to learn the time dependency in EEG signals; in this embodiment, TUSZ, "Dataset of EEG recordings of pediatric patients with epilepsy based on the 10-20 system" epilepsy EEG signal dataset is used. In the pre-training stage, the training data is divided into 90% training set and 10% validation set, and the validation set is used to monitor whether the model is overfitting. The AdamW optimizer is used for parameter optimization, and the learning rate is set to , the number of training iterations is set to 50 cycles.
[0091] Step 4: Build an EEG classification network, including: optimal parameters The feature encoding module, pre-trained language model and classifier are used to Optimal parameters for different types of EEG signal classification task datasets The feature encoding module and classifier are fine-tuned to obtain the EEG signal category probability value.
[0092] Step 4.1, get the The sample set of the type of EEG signal classification task is preprocessed according to the process of step 1 to obtain the preprocessed sample set ; After preprocessing, EEG signal samples, and ; express Middle The EEG signal sequence of channels, The corresponding category label is ;in, , Indicates the number of samples for the EEG signal classification task.
[0093] Step 4.2, Input the feature encoding module and obtain it through pre-trained language model reasoning. EEG inference features of all channels ;
[0094] Step 4.3, After flattening, input the classifier and get The predicted probability value of belonging to each category ;
[0095] Step 4.3: Use formula (18) to construct cross entropy loss , use AdamW optimizer to optimize the optimal parameters The feature encoding module and classifier are fine-tuned and trained to minimize To update the module parameters, so as to obtain the optimal parameters of the feature encoding module and the optimal parameters for classification , used to implement the Classification tasks of the EEG signal classification task dataset:
[0096] (18)
[0097] In this embodiment, the downstream EEG signal classification task is the epilepsy signal classification task, and three epilepsy EEG signal datasets CHB-MIT, Freburg, and private datasets are used for verification. In the fine-tuning stage, the training data is divided into 80% training set and 20% validation set, and the validation set is used to monitor whether the model is overfitting. The AdamW optimizer is used for parameter optimization, and the learning rate is set to , the number of training iterations is set to 20 cycles.
[0098] In order to verify the performance and effectiveness of the scheme of the present invention, the EEG signal classification performance method published in recent journal literature was used for comparison with the above scheme of the present invention. The comparison indicators used the commonly used evaluation indicators of EEG signal classification, namely AUC, sensitivity and false positive rate.
[0099] In the specific implementation, two public datasets and one private dataset were used for cross-subject experiments. All experiments were evaluated using leave-one-out cross-validation. The datasets included the CHB-MIT dataset, the Freiburg dataset, and a private dataset. The experimental comparison method uses 7 methods reported in journal literature for comparison, as shown in Tables 1, 2, and 3: 1. Transformer-guided CNN (TGCNN), which combines the Transformer's ability to capture long-range dependencies with the CNN's ability to learn local features, integrating the complementary advantages of the Transformer and CNN; 2. Uncertainty-guided Fourier-based data augmentation method (UFA), which uses uncertainty-guided Fourier transform data augmentation technology to improve the overall generalization ability of the model; 3. Transformer-based spatiotemporal feature learning model (ST-Transformer), which introduces a multi-level EEG transformer that can simultaneously learn spatial and temporal features; 4. CNN-LSTM feature fusion network (FFCL), which combines the local feature learning ability of CNN and the temporal dependency learning ability of LSTM to improve the classification performance of the model; 5. Epilepsy seizure rhythmicity and periodicity learning model (SpaRCNet), which is a model based on one-dimensional CNN and dense residual connections, has a significant improvement in performance compared to traditional ConvNet and 1DCNN models; 6. Biosignal The transformer (BIOT) integrates EEG segment encoding, channel encoding, and position encoding, and uses contrastive loss for unsupervised pre-training to learn task-independent features. 7. The GPT-based EEG model (Neuro-GPT) is a base model consisting of an encoder and a GPT model, which performs self-supervised learning through a causal mask task.
[0100] Table 1. Classification performance of different methods on the CHB-MIT dataset
[0101]
[0102] The data sources of the above-mentioned comparison methods are all the public CHB-MIT dataset. Table 1 shows the comparison results between the present invention and the above-mentioned methods. Under the cross-subject experimental paradigm, the method of the present invention achieved an AUC of 0.725, an average sensitivity of 0.622, and an average false positive rate of 0.279 on the CHB-MIT dataset, and its performance is better than all the above-mentioned comparison methods.
[0103] Table 2. Classification performance of different methods on the Freiburg dataset
[0104]
[0105] The data source of the above-mentioned comparison methods is the public Freiburg dataset. Table 2 shows the comparison results between the present invention and the above-mentioned methods. Under the cross-subject experimental paradigm, the method of the present invention achieved an AUC of 0.732, an average sensitivity of 0.665, and an average false positive rate of 0.308 on the Freiburg dataset, and its performance is better than all the above-mentioned comparison methods.
[0106] Table 3. Classification performance of different methods on private datasets
[0107]
[0108] The data sources of the above-mentioned comparison methods are all private datasets. Table 3 shows the comparison results of the present invention and the above-mentioned methods. Under the cross-subject experimental paradigm, the method of the present invention achieved an AUC of 0.702, an average sensitivity of 0.565, and an average false positive rate of 0.316 on the private dataset, and its performance is better than all the above-mentioned comparison methods.
[0109] also, Figure 4 The figure shows the amplitude and phase predicted by the proposed method during pre-training, as well as the signal reconstructed by inverse short-time Fourier transform of the amplitude and phase, and compared with the original signal. As can be seen from the figure, the method can effectively predict amplitude and phase information, capture the overall trend of EEG signals, and learn effective EEG signal representation from EEG data.
[0110] In summary, the present invention proposes a new method for EEG signal classification using a pre-trained language model. This method fully utilizes the cross-domain generalization ability of the pre-trained language model, uses multi-head cross-attention to fuse EEG signals and text prototype information, and constructs EEG signals into representations compatible with the large language model, thereby efficiently activating the large language model's reasoning and generalization capabilities for EEG signals, achieving more accurate cross-subject EEG signal classification results. In binary classification tests on the public datasets CHB-MIT, Freiburg, and private datasets, it can more accurately classify EEG data in the pre-ictal class while reducing the false positive rate in the interictal class, outperforming existing Transformer-based and cross-subject methods.
Claims
1. A method for classifying EEG signals based on reprogramming of a pre-trained language model, characterized in that: The steps include: Step 1: Get the Types of EEG signal datasets, and after denoising and windowing the original EEG signal in the EEG signal dataset, the preprocessed EEG signal sample set is obtained ,in, After preprocessing, EEG signal samples, represents the total number of EEG signal samples, Indicates the duration of each EEG signal sample, represents the sampling rate, Indicates the The number of channels of each type of EEG signal dataset; and , express Middle EEG signal sequence of channels; ; ; Get the word vector set in the pre-trained language model ,in, Indicates vocabulary size, Represents the feature dimension of the word vector; Step 2: Construct an EEG signal prediction network, which includes a feature encoding module, a pre-trained language model, and a prediction module. Processing is performed to obtain the future amplitude characteristic prediction value and future phase feature predictions ; Step 3: Based on and , use formula (17) to construct the mean square error loss , use AdamW optimizer to pre-train the feature encoding module and prediction module, and minimize To update the module parameters, so as to obtain the optimal parameters of the feature encoding module and the optimal parameters of the prediction module ; (17) Step 4: Build an EEG classification network, including: optimal parameters The feature encoding module, pre-trained language model and classifier are used to Optimal parameters for different types of EEG signal classification task datasets The feature encoding module and classifier are fine-tuned to obtain a fine-tuned feature encoding module and a fine-tuned classifier, and the EEG signal category probability value is output.
2. The method for classifying EEG signals based on reprogramming of a pre-trained language model according to claim 1, characterized in that: Step 2 includes the following steps: Step 2.1: Get the prompt word prefix , and with Input them into the feature encoding module for encoding to obtain the EEG signal text prototype fusion representation ;in, express The number of markers; Step 2.2: Pre-training language model Perform reasoning to obtain fusion reasoning features Then, through the linear layer Projection as EEG inference features ; Step 2.3, After flattening, it is input into the prediction module for prediction to obtain the future amplitude feature prediction value and future phase feature predictions .
3. The method for classifying EEG signals based on reprogramming of a pre-trained language model according to claim 2, characterized in that: Step 2.1 includes the following steps: Step 2.1.1, After short-time Fourier transform, it is divided into the current EEG time-frequency characteristics according to the time dimension and the label value of future EEG time-frequency features ,in, express The size of the time dimension, express The size of the time dimension, Indicates the number of frequency points; Step 2.1.2, calculate separately Current amplitude characteristics of and current phase characteristics as well as The future amplitude feature label and future phase feature labels ; Step 2.1.3: Set the current amplitude feature With the current phase characteristics After integration, the integrated EEG signal features are obtained ,in, Represents the dimension of the adjusted EEG signal features; Step 2.1.4: Set word vectors After linear projection, the text prototype is obtained ,in, Indicates the number of text prototypes, ; Step 2.1.5: Use the cross attention mechanism to and After cross-modal fusion, the aligned fusion representation is obtained ; Step 2.1.6, prefix the prompt word and After splicing, the EEG signal text prototype fusion representation feature is obtained ,in, Indicates the prefix of the prompt word The number of words in .
4. The method for classifying EEG signals based on reprogramming of a pre-trained language model according to claim 3, characterized in that: Step 2.1.3 includes the following steps: Step 2.1.3.1, 、 Perform standardization operations respectively and obtain the standardized current amplitude characteristics , standardized future amplitude characteristics ; Step 2.1.3.2, removal 、 After the phase jump, the normalization operation is performed, and the normalized current phase characteristics are obtained accordingly. , standardized future phase characteristics ; Step 2.1.3.3, and After splicing, adjust the dimension to obtain the integrated EEG signal features .
5. The method for classifying EEG signals based on reprogramming of a pre-trained language model according to claim 4, characterized in that: Step 2.1.5 includes the following steps: Step 2.1.5.1, use the multi-head attention mechanism to and Processing is performed to obtain multi-head fusion representation ,in, Represents the sum of feature dimensions of all attention heads; Step 2.1.5.2, through the linear projection layer and After alignment, the aligned fusion representation is obtained .
6. The method for classifying EEG signals based on reprogramming of a pre-trained language model according to claim 5, characterized in that: Step 4 includes the following steps: Step 4.1, get the The sample set of the type of EEG signal classification task is preprocessed according to the process of step 1 to obtain the preprocessed sample set ; After preprocessing, EEG signal samples, and ; express Middle The EEG signal sequence of channels, The corresponding category label is ;in, , Indicates the number of samples for the EEG signal classification task; Step 4.2, Enter optimal parameters The feature encoding module is then inferred through the pre-trained language model to obtain EEG inference features across all channels ; Step 4.3, After flattening, input the classifier and get The predicted probability value of belonging to each category ; Step 4.4: Use formula (18) to construct cross entropy loss , and use AdamW optimizer to optimize the optimal parameters The feature encoding module and classifier are fine-tuned and trained to minimize To update the module parameters, the fine-tuned feature encoding module and the fine-tuned classifier are obtained to achieve the Sample classification for types of EEG signal classification tasks: (18)。 7. An electronic device comprising a memory and a processor, characterized in that: The memory is used to store a program that supports the processor to execute the EEG signal classification method according to any one of claims 1 to 6, and the processor is configured to execute the program stored in the memory.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the EEG signal classification method according to any one of claims 1 to 6 are executed.
