A general eeg signal decoding method based on cross-task continual learning

By employing a cross-task continuous learning framework, combined with task replay, adaptive normalization, and knowledge distillation mechanisms, the limitations of EEG base models in generalization and scalability in heterogeneous EEG tasks are addressed, enabling efficient decoding of multiple tasks using a single model.

CN122133754APending Publication Date: 2026-06-02ZHEJIANG UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG UNIV
Filing Date
2026-04-29
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing basic EEG models suffer from insufficient cross-task generalization ability and limited multi-task scalability due to their static and task-isolated post-training strategies. They cannot effectively adapt to heterogeneous EEG tasks and also suffer from bottlenecks in computational overhead and storage requirements.

Method used

We design a general EEG signal decoding method based on cross-task continuous learning. By constructing a cross-task continuous learning framework, we utilize time-dependent task playback mechanism, task adaptive normalization mechanism, and cross-task knowledge distillation mechanism to dynamically balance learning plasticity and memory stability, thereby achieving a model that can decode a variety of heterogeneous EEG tasks.

Benefits of technology

Without compromising the performance of old tasks, it effectively adapts to new heterogeneous EEG tasks, improves the model's cross-task generalization ability and multi-task scalability, and realizes a single unified model for universal decoding of multiple heterogeneous EEG downstream tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122133754A_ABST
    Figure CN122133754A_ABST
Patent Text Reader

Abstract

This invention discloses a general EEG signal decoding method based on cross-task continuous learning. By designing a cross-task continuous learning framework and introducing a task-adaptive normalization mechanism and a cross-task knowledge distillation mechanism, the pre-trained EEG base model can continuously acquire new knowledge from sequentially arriving heterogeneous EEG tasks. While effectively adapting to new tasks, it retains the performance of learned tasks, dynamically balancing learning plasticity and memory stability. This solves the problems of insufficient cross-task generalization ability and limited multi-task scalability of existing EEG base models due to static and task-isolated post-training strategies. Ultimately, it achieves a single unified model for universal decoding of multiple heterogeneous downstream EEG tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of EEG signal decoding technology, specifically relating to a general EEG signal decoding method based on cross-task continuous learning. Background Technology

[0002] Brain-computer interfaces (BCIs) provide a communication pathway that directly translates neural activity into control signals for external devices. As the most prevalent non-invasive BCI technology, electroencephalography (EEG) records the electrical activity of the cerebral cortex with high temporal resolution, and is therefore widely used in various practical scenarios, including clinical diagnosis and daily life, covering areas such as sleep staging, emotion recognition, and motor imagery. Early EEG signal analysis research typically relied on manually designed features combined with traditional machine learning algorithms to decode EEG signals. With the development of deep learning technology, researchers have proposed various deep learning models capable of automatically decoding EEG signal patterns and identifying brain states under different experimental paradigms. However, these models are usually designed for specific tasks, have different network architectures, and are trained and evaluated on the same dataset, which inherently limits their generalization ability and scalability across heterogeneous EEG tasks.

[0003] To overcome the aforementioned bottlenecks, researchers have proposed the concept of EEG base models in recent years. EEG base models learn general, task-independent neural representations through self-supervised pre-training on large-scale unlabeled EEG data. They then adopt a unified backbone network architecture and only need to attach task-specific classifiers. Through post-training (i.e. fine-tuning), they can effectively adapt to various downstream tasks and achieve performance comparable to or even better than traditional task-specific models.

[0004] Despite the significant success of EEG base models, existing research has focused excessively on the pre-training phase, with a serious lack of exploration into adaptation strategies for the post-training phase. Current methods generally employ a task-isolated full-scale fine-tuning strategy, meaning that for each new downstream task, full fine-tuning is performed independently from the pre-trained weights. This approach has two fundamental limitations: First, task-isolated adaptation strategies hinder cross-task knowledge transfer. Unlike large language models, which can demonstrate emergent capabilities through scalable or cross-task learning, EEG-based models in the current post-training paradigm are confined to narrow, single-task boundaries. This isolation prevents the model from comprehensively extracting higher-order, task-invariant neural patterns, thus severely limiting its generalization potential beyond a single task.

[0005] Second, this static adaptation strategy is difficult to meet the needs of dynamic expansion of the EEG base model. Whenever adapting to a new EEG task, a complete retraining process is required from the pre-trained initial state, and a set of independent model parameters needs to be stored; therefore, the computational overhead and storage requirements increase linearly with the number of tasks, creating a significant bottleneck for scalable multi-task deployment.

[0006] In summary, current static and task-isolated post-training strategies fundamentally hinder the realization of universal brain decoding models. A dynamic, task-aware post-training strategy is urgently needed to enable a single, unified EEG base model to generalize to multiple heterogeneous EEG tasks, ultimately achieving the goal of "one model solving all tasks." Essentially, this dynamic adaptation naturally constitutes a continuous learning (CL) problem: the base model needs to incrementally acquire knowledge from a series of sequentially arriving heterogeneous EEG tasks while avoiding catastrophic forgetting. To successfully accomplish this process, the framework must maintain an appropriate balance between learning plasticity (i.e., the ability to adapt to new tasks) and memory stability (i.e., the ability to retain knowledge from learned tasks).

[0007] However, enabling the pre-trained base model to continuously adapt to successive EEG paradigms while retaining generalizable representations of previously learned paradigms presents a significant challenge. There are two main obstacles: On the one hand, the inherent significant heterogeneity of EEG signals hinders the achievement of high learning plasticity. The large distributional shifts between different tasks cause severe nonstationarity, making it difficult for the model to effectively adapt to new tasks with large distributional differences.

[0008] On the other hand, stability on previously learned tasks may deteriorate. The model tends to overfit to newly encountered tasks, forming overly task-specific representations that impair its ability to retain knowledge from previous tasks.

[0009] Existing continuous learning methods mainly focus on incremental learning scenarios for homogeneous task sequences, such as class incremental learning or domain incremental learning. There is a lack of continuous learning frameworks for cross-heterogeneous EEG tasks, failing to effectively address both of the aforementioned challenges simultaneously. Therefore, designing a continuous learning framework that can dynamically balance learning plasticity and memory stability, and achieve cross-task knowledge transfer and retention, is a key technical problem urgently needing to be solved in the field of post-training of EEG base models. Summary of the Invention

[0010] In view of the above, the present invention provides a general EEG signal decoding method based on cross-task continuous learning, which can solve the problems of insufficient cross-task generalization ability and limited multi-task scalability of existing EEG basic models due to static and task-isolated post-training strategies, and finally realize the general decoding of multiple heterogeneous EEG downstream tasks by a single unified model.

[0011] A general EEG signal decoding method based on cross-task continuous learning includes the following steps: (1) Obtain EEG datasets based on multiple different brain-computer interface downstream tasks, with each dataset corresponding to an independent EEG decoding task; (2) Obtain the pre-training weights and model architectures of multiple different EEG base models; (3) Preprocess the EEG signals in each dataset for model training; (4) Construct a brain-computer interface cross-task continuous learning model that includes a backbone network and a cross-task distillation network; (5) The brain-computer interface cross-task continuous learning model is jointly trained by a time-dependent task replay mechanism, and a task adaptive normalization mechanism is adopted to adapt to the data distribution of new tasks. The cross-task knowledge distillation mechanism is used to retain the knowledge of the learned tasks while learning new tasks, so as to continuously expand the model's decoding ability for new tasks without forgetting the performance of old tasks.

[0012] Furthermore, in step (4), the brain-computer interface cross-task continuous learning model uses the core architecture of any EEG pedestal model as its backbone network to extract the low-level feature representation of EEG signals. At the same time, the backbone network is copied and the first layer Patch Embedding module is removed to construct a cross-task distillation network as a teacher model to provide prior feature distribution of old tasks in subsequent learning. Both the backbone network and the cross-task distillation network are initialized by directly loading the pre-trained weights of the same EEG pedestal model and are shared across all tasks. When a new task arrives, a classification head specific to the new task is dynamically introduced at the output of the backbone network to output the predicted probability of the corresponding task category.

[0013] Furthermore, the specific implementation of the task replay mechanism in step (5) is as follows: given a cross-task continuous learning sequence The model learns to adapt to each task in the sequence sequentially; for a new task... The learning process involves extracting historical task data from the replay pool in a weighted manner based on time dependencies, and then utilizing the extracted historical task data along with new tasks. The corresponding dataset is used to train the model, when the task... After completing the learning, the task will be... The corresponding dataset is added to the replay pool for use in subsequent tasks.

[0014] Furthermore, for any historical task that has been learned , t < i ,calculate New mission Depth of time during learning , i and t Tasks and Task sequence number; then based on time depth Calculate the task Replay weight ,in The hyperparameter represents the replay weight factor, which is the distance from the current task. The further back in time the historical task is, the greater its temporal depth and the higher its replay weight, thus placing greater emphasis on replaying to extract earlier learned task data to combat catastrophic forgetting.

[0015] Furthermore, the specific implementation of the task adaptive normalization mechanism in step (5) is as follows: a task adaptive normalization module is added before the backbone network. This module maintains independent scaling parameters and offset parameters for each task. When processing different task data, the task data is normalized using the following formula:

[0016] Where: for any task , and Tasks Input data before and after normalization and Tasks The scaling and offset parameters are defined. The task-adaptive normalization module utilizes prior knowledge encoded from previously learned tasks to align the distribution of input data for new tasks, mitigating distribution offsets between heterogeneous EEG tasks and enhancing the model's learning plasticity during continuous adaptation.

[0017] Furthermore, the scaling parameter and offset parameters The expression is as follows:

[0018]

[0019]

[0020]

[0021]

[0022]

[0023] in: and Tasks Mean and standard deviation of batch data and These are the target mean and the target standard deviation, respectively. and For the target normalized moments, σ ( ) represents the Sigmoid function. and Tasks Historical mission prototype collection The mean and standard deviation, and For the task Affine parameters; any mission prototype Indicates task The long-term stable estimate of the first moment of the data distribution is... d A feature vector of dimension , which is the feature vector for the task The batch data, excluding the embedding dimension, is compressed into a 1-dimensional array by averaging all other dimensions and then updated using EMA (Exponential Moving Average) during the first round of training. t < i , d This indicates the dimension size of the Patch Embedding.

[0024] Furthermore, the specific implementation of the cross-task knowledge distillation mechanism in step (5) is as follows: new task data and historical task data are input into the backbone network and the cross-task distillation network respectively, and the intermediate layer output of the new task data and historical task data is obtained layer by layer; a cross-task distillation loss function is constructed, and the feature representation of the distillation network on the old task and the feature representation of the backbone network on the new task are aligned layer by layer, so as to enhance the backbone network's representation of the new task while retaining its representation ability of the old task, and enhance the distillation network's ability to extract cross-task representations.

[0025] Furthermore, the expression for the cross-task distillation loss function is as follows:

[0026] in: and This corresponds to the new task data input and the historical task input being in the backbone network and the cross-task distillation network, respectively. lLayer feature output, for and The losses between L This represents the number of layers in the cross-task distillation network.

[0027] Furthermore, the total loss function used by the brain-computer interface cross-task continuous learning model during task learning and training is... The expression is as follows:

[0028] in: The cross-entropy loss function learned for the new task. For cross-task distillation loss function, ω These are the weighting coefficients.

[0029] A computer device includes a memory and a processor, wherein the memory stores a computer program and the processor executes the computer program to implement the above-described general EEG signal decoding method based on cross-task continuous learning.

[0030] A computer-readable storage medium storing a computer program, which, when executed by a processor, implements the aforementioned general EEG signal decoding method based on cross-task continuous learning.

[0031] This invention designs a cross-task continuous learning framework and trains a brain-computer interface cross-task continuous learning model. This effectively adapts to new heterogeneous EEG tasks while preserving the model's performance on previously learned tasks, thus addressing the limitations of existing EEG pedestal models in cross-task generalization and multi-task scalability caused by static, task-isolated post-training strategies. The invention utilizes a time-dependent task replay mechanism to select historical task data for joint training, and employs a task-adaptive normalization mechanism to align the data distribution of heterogeneous tasks to reduce cross-task domain bias. Furthermore, a progressive cross-task knowledge distillation mechanism aligns model features layer by layer to preserve task-invariant high-order neural representations. This allows the model to dynamically balance learning plasticity and memory stability while continuously expanding its decoding capabilities for new tasks without forgetting performance on old tasks, ultimately achieving a single, unified model for universal decoding of multiple heterogeneous downstream EEG tasks. Attached Figure Description

[0032] Figure 1 This is a schematic diagram of the general EEG signal decoding method based on cross-task continuous learning of the present invention.

[0033] Figure 2 This is a flowchart illustrating the cross-task continuous learning phase of the present invention.

[0034] Figure 3This is a schematic diagram of the overall framework for decoding general EEG signals based on cross-task continuous learning, as described in this invention. Detailed Implementation

[0035] To describe the present invention in more detail, the technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0036] like Figure 1 As shown in the figure, this embodiment provides a general EEG signal decoding method based on cross-task continuous learning. The specific steps are as follows: (1) Obtain EEG datasets based on multiple downstream tasks of different brain-computer interfaces.

[0037] To verify the effectiveness of this invention in cross-task continuous learning scenarios, this embodiment selects six heterogeneous EEG datasets covering different paradigms such as affective computing, motor imagery, sleep staging, imaginary language, and disease diagnosis, as follows: The FACED dataset (emotion recognition) contains 123 subjects, collected using 32 channels, and covers 9 emotion state categories.

[0038] PhysioNet-MI dataset (motor imagery): Contains 109 subjects, collected using 64 channels, covering 4 categories of limb motor imagery.

[0039] BCIC-IV-2a dataset (motor imagery): Includes 9 subjects, collected using 22 channels, covering 4 specific imagery tasks (left / right hand, both feet, tongue).

[0040] ISRUC dataset (sleep stages): Subgroup I was selected, containing full-night sleep records of 100 subjects, using 6 standard channels, covering 5 sleep stages.

[0041] BCIC2020-3 dataset (Imaginative Language): Contains 15 subjects, collected using 64 channels, covering 5 categories of imaginative phrases.

[0042] Mumtaz2016 dataset (disease diagnosis): Contains 34 patients with major depressive disorder and 30 healthy controls, collected using 19 channels, and used for binary classification diagnosis.

[0043] (2) Obtain the pre-training weights and model architectures of multiple different EEG base models.

[0044] To verify the effectiveness and architecture-independent portability of the method of this invention, this embodiment selects four mainstream EEG base models covering Transformer and Mamba architectures, as follows: Transformer-based models include CBraMod, which employs a cross-attention mechanism, CSBrain, which uses hierarchical structured sparse attention, and DeeperBrain, which incorporates neurophysiological principles and dual pre-training objectives.

[0045] Models based on the Mamba architecture include EEGMamba, which utilizes a bidirectional state-space model for spatiotemporal modeling.

[0046] All of the above models are loaded with weights pre-trained on a large-scale EEG corpus as the initialization basis for subsequent cross-task continuous learning.

[0047] (3) Preprocess the EEG signals in each dataset.

[0048] To ensure the consistency of model input features and eliminate noise interference, this embodiment performs a unified standard preprocessing procedure on each EEG task dataset, mainly including: signal resampling and filtering, data segmentation and dataset partitioning. The preprocessing procedure in this embodiment is completely consistent with the preprocessing procedure of mainstream EEG baseline models, eliminating potential impacts caused by differences in preprocessing pipelines.

[0049] (4) Construct and initialize a brain-computer interface cross-task continuous learning model.

[0050] For cross-task continuous learning of EEG tasks, this embodiment constructs the model architecture and completes initialization as follows: The core architecture of the aforementioned pre-trained base model is selected as the backbone network of the continuous learning model, used to extract the low-level feature representation of EEG signals; this backbone network is copied and the first-layer Patch Embedding module is removed to construct a cross-task distillation network as a teacher model, used to provide prior feature distributions of old tasks in subsequent learning. Both the aforementioned base model backbone network and the cross-task distillation network are initialized by directly loading the pre-trained weights obtained during the large-scale pre-training phase of the corresponding base model; when a new EEG task arrives, a task-specific classification head is dynamically introduced at the output of the backbone network to output the predicted probability of the corresponding task category, while the backbone network and the cross-task distillation network remain shared across all tasks.

[0051] (5) Design task replay, adaptive normalization and cross-task distillation modules for continuous training.

[0052] The continuous learning process of this invention is as follows: Figure 2 As shown, the aim is to enable the pre-trained EEG base model to continuously adapt to a series of heterogeneous EEG decoding task sequences. While maintaining performance from previous tasks. Each task Corresponding to a unique data distribution This reflects the significant differences in signal statistical characteristics and label space among different tasks; This indicates a continuous learning model. For the initial pre-trained base model, To adapt to the i The update model after each task. The core objective of this invention is to simultaneously optimize the following two competing criteria: Learning plasticity: Model Should be able to adapt effectively to new tasks That is, to minimize the prediction error on the new task:

[0053] in: For model parameters, L A task-specific loss function.

[0054] Memory stability: Updated model Should remain on all previously learned tasks Performance on, that is, for all :

[0055] To address the challenge of acquiring new knowledge while avoiding catastrophic forgetting, this invention constructs the following continuous learning objective function to dynamically balance the plasticity of adapting to new tasks with the stability of retaining old knowledge:

[0056] in: R This is the regularization term, which is composed of the subsequent cross-task continuous learning loss function.

[0057] This implementation method adopts, as follows: Figure 3 The general EEG signal decoding framework shown is a continuous cross-task EEG decoding framework. This framework integrates a time-dependent task playback mechanism, a task adaptive normalization mechanism, and a cross-task knowledge distillation mechanism, and specifically includes the design and implementation of the following three sub-step modules: ① Time-dependent task replay mechanism.

[0058] Given a cross-task continuous learning sequence The model adapts sequentially to each task in the sequence. For the current learning task... Based on time dependencies, historical task data is replayed from the replay pool in a weighted manner. Specifically, for historical tasks... Calculate its performance in the task Depth of time during learning Its expression is ,ini Indicates the current task Serial number t Representing historical tasks Serial number; then calculate the replay weight based on the time depth. Its expression is:

[0059] in: is a hyperparameter representing the replay weight factor; the further back in time the historical task is from the current task, the greater its temporal depth, and the higher its replay weight, thus placing greater emphasis on replaying earlier learned task data to combat catastrophic forgetting. Whenever an EEG task... After completing the study, The data and its labels are added to the replay pool for use in subsequent tasks.

[0060] ②Task adaptive normalization mechanism.

[0061] For each EEG task Maintain a task prototype ,in d This prototype serves as a task for pre-training EEG pedestal models with fixed patch embedding dimensions. Long-term stable estimation of the first moment of the data distribution. When a new task... When the data is first introduced, given the input tensor (B, C, and D represent batch size, number of channels, and duration, respectively). First, calculate their empirical mean values ​​in the batch, channel, and time dimensions. The expression is as follows:

[0062] During the first round of training, the task prototype is updated once using an exponential moving average (EMA). :

[0063] in: ρ ∈(0,1) is the EMA decay factor.

[0064] set up For the current task This mechanism does not force data alignment to a global reference statistic, but instead introduces learnable affine parameters, based on the prototype set of all previous historical tasks. ∈R, dynamically adjust the normalization target of the current task data. Let and For the current task Mean and standard deviation of batch data and Based on the historical mission prototype set The calculated global reference statistic. This mechanism fuses the current statistic with the global statistic using a Sigmoid gating mechanism to calculate the objective normalized moment:

[0065]

[0066] in: σ ( ) is the Sigmoid function.

[0067] Next, calculate the target mean and standard deviation:

[0068]

[0069] Affine transformation parameters derived from the target moment. (scaling parameters) and (Offset parameter):

[0070]

[0071] Finally, based on the affine parameters calculated above, the input data... x Normalization is performed:

[0072] It should be noted that this mechanism performs the above normalization operation on the current task data and the replayed historical task data during both the training and testing phases, and then inputs the normalized data into the model, thereby effectively mitigating cross-task distribution differences.

[0073] ③ Cross-task knowledge distillation mechanism.

[0074] After achieving homogenization of basic statistics through task-adaptive normalization, this invention proposes a cross-task distillation mechanism inspired by knowledge distillation to effectively extract generalizable neural representations across heterogeneous EEG tasks. The core of this mechanism lies in constructing a cross-task distiller with an architecture identical to the pre-trained basic encoder, and initializing it using pre-trained weights to ensure robust initial feature representations. Addressing the hierarchical nature of EEG signal representations and significant domain shifts between tasks, this invention designs a progressive cross-task alignment strategy. By aligning the feature distributions of the encoder and distiller layer by layer, it gradually achieves cross-task transfer from low-order statistics to high-order semantic representations from shallow to deep layers. The specific implementation is as follows: make and These represent the intermediate feature outputs of the encoder and distiller in the L corresponding layers, respectively. Based on network depth, the features are divided into three parts: shallow, medium, and deep. To address the differences in channel count and time duration between heterogeneous tasks, Z and [the remaining features] are [adjusted] before alignment. Perform global average pooling on the channel dimension C and the time dimension D, projecting them to a unified dimension space.

[0075] Furthermore, the present invention employs a progressive alignment strategy, which adaptively selects the alignment loss function based on the layer depth and training process to avoid unstable optimization of high-level representations.

[0076] In the early and shallow stages of training ( The features primarily encode time-frequency primitives that are sensitive to neighborhood offset. In this case, only low-order statistics are forced to align, and the MSE loss is calculated using the mean, standard deviation, and covariance.

[0077] in: μ , σ and Σ are the characteristic tensors respectively. and The empirical mean, standard deviation, and covariance.

[0078] After several adaptation cycles (e.g., epoch > 5), for the middle layer ( Unfreeze and align. Mid-level features exhibit moderate distributional complexity, which cannot be adequately described by simple low-order statistics, while perfect distribution matching is too stringent. Therefore, the maximum mean difference (MMD) loss is employed, utilizing the RBF (radial basis function) kernel to measure distribution similarity in the reproducing kernel Hilbert space.

[0079] In the later stages of training (e.g., epoch > 10), activate deeper layers. ( Alignment, deep features reflect task-invariant high-order abstract semantics, and are usually distributed on complex low-dimensional manifolds; therefore, entropy-regularized Sinkhorn-Wasserstein distance is used. Using geometric perception properties to handle non-overlapping support set problems:

[0080] in: ε is the entropy regularization coefficient.

[0081] Cross-task distillation loss The average loss across all layers, and the loss of each layer. Adaptively select based on layer depth and current training round:

[0082] in: and These represent the new task input and the old task input in the backbone network and distillation network, respectively. The feature output of the layer, e This indicates the current training round.

[0083] Finally, the expression for the total loss function for model training is as follows:

[0084] in: This represents the cross-entropy loss during training on a new task. These are dynamic hyperparameters used to control the weighting balance between classification loss and distillation loss. Through joint optimization of the above loss functions, the model can continuously expand its decoding capability for new tasks without forgetting the performance of old tasks, ultimately achieving a single unified model for universal decoding of various heterogeneous EEG downstream tasks.

[0085] After each model has adapted to a new task, this invention evaluates its adaptability to the new task on a new task test set, while simultaneously evaluating its ability to remember old tasks on an old task test set. For multi-class tasks, B-ACC (Balanced Accuracy), WF1 (Weighted F1 Score), and Cohen's Kappa (Cohen's Kappa coefficient k) are used for evaluation; for binary tasks, B-ACC, AUROC (Area Under the ROC Curve), and AUC-PR (Area Under the PR Curve) are used for evaluation.

[0086] Table 1 presents the performance comparison results of the method of this invention and existing mainstream EEG basic models in cross-task continuous learning scenarios. The selected comparison methods include four representative models: CBraMod, EEGMamba, CSBrain, and DeeperBrain, which correspond to EEG basic models based on Transformer architecture, state-space model, and cross-scale and neurophysiological mechanism modeling, respectively, and can reflect the current technical level from different modeling perspectives. This indicates that the model has completed the first... i The test performance on a task after learning a task is used to measure the model's ability to adapt to new tasks. This indicates that the model, after completing all task learning, is at the [number]th [time / level]. iThe final performance on each task is used to measure the model's ability to retain memories of historical tasks; RFR represents the relative forgetting rate, which measures the degree of performance degradation of the model on learned tasks during continuous learning. The lower the value, the less forgetting. When RFR is negative, it indicates that the model has achieved positive transfer in subsequent learning. Data shows that the model trained using the method of this invention has excellent generalization and adaptation ability to new tasks, while maintaining its discrimination performance on historical EEG tasks to the greatest extent, achieving synergistic optimization of performance on new and old tasks.

[0087] Table 1

[0088] The above description of the embodiments is provided to enable those skilled in the art to understand and apply the present invention. Those skilled in the art can readily make various modifications to the above embodiments and apply the general principles described herein to other embodiments without creative effort. Therefore, the present invention is not limited to the above embodiments, and any improvements and modifications made to the present invention by those skilled in the art based on the disclosure thereof should be within the scope of protection of the present invention.

Claims

1. A general EEG signal decoding method based on cross-task continuous learning, characterized in that, Includes the following steps: (1) Obtain EEG datasets based on multiple different brain-computer interface downstream tasks, with each dataset corresponding to an independent EEG decoding task; (2) Obtain the pre-training weights and model architectures of multiple different EEG base models; (3) Preprocess the EEG signals in each dataset for model training; (4) Construct a brain-computer interface cross-task continuous learning model that includes a backbone network and a cross-task distillation network; (5) The brain-computer interface cross-task continuous learning model is jointly trained by a time-dependent task replay mechanism, and a task adaptive normalization mechanism is adopted to adapt to the data distribution of new tasks. The cross-task knowledge distillation mechanism is used to retain the knowledge of the learned tasks while learning new tasks, so as to continuously expand the model's decoding ability for new tasks without forgetting the performance of old tasks.

2. The general EEG signal decoding method based on cross-task continuous learning according to claim 1, characterized in that: The brain-computer interface cross-task continuous learning model in step (4) uses the core architecture of any EEG pedestal model as its backbone network to extract the low-level feature representation of EEG signals. At the same time, the backbone network is copied and the PatchEmbedding module of the first layer is removed to construct a cross-task distillation network as a teacher model to provide prior feature distribution of old tasks in subsequent learning. Both the backbone network and the cross-task distillation network are initialized by directly loading the pre-trained weights of the same EEG pedestal model and are shared among all tasks. When a new task arrives, a classification head specific to the new task is dynamically introduced at the output of the backbone network to output the predicted probability of the corresponding task category.

3. The general EEG signal decoding method based on cross-task continuous learning according to claim 1, characterized in that, The specific implementation of the task replay mechanism in step (5) is as follows: given a cross-task continuous learning sequence The model learns to adapt to each task in the sequence sequentially; for a new task... The learning process involves extracting historical task data from the replay pool in a weighted manner based on time dependencies, and then utilizing the extracted historical task data along with new tasks. The corresponding dataset is used to train the model, when the task... After completing the learning, the task will be... The corresponding dataset is added to the replay pool for use in subsequent tasks.

4. The general EEG signal decoding method based on cross-task continuous learning according to claim 3, characterized in that: For any learned historical task , t < i ,calculate New mission Depth of time during learning , i and t Tasks and Task sequence number; then based on time depth Calculate the task Replay weight ,in The hyperparameter represents the replay weight factor, which is the distance from the current task. The further back in time the historical task is, the greater its temporal depth and the higher its replay weight, thus placing greater emphasis on replaying to extract earlier learned task data to combat catastrophic forgetting.

5. The general EEG signal decoding method based on cross-task continuous learning according to claim 1, characterized in that, The specific implementation of the task adaptive normalization mechanism in step (5) is as follows: a task adaptive normalization module is added before the backbone network. This module maintains independent scaling parameters and offset parameters for each task. When processing different task data, the task data is normalized using the following formula: Where: for any task , and Tasks Input data before and after normalization and Tasks The scaling and offset parameters.

6. The general EEG signal decoding method based on cross-task continuous learning according to claim 5, characterized in that, The scaling parameters and offset parameters The expression is as follows: in: and Tasks Mean and standard deviation of batch data and These are the target mean and the target standard deviation, respectively. and For the target normalized moments, σ ( ) represents the Sigmoid function. and Tasks Historical mission prototype collection The mean and standard deviation, and For the task Affine parameters; any mission prototype Indicates task The long-term stable estimate of the first moment of the data distribution is... d A feature vector of dimension , which is the feature vector for the task The batch data, excluding the embedding dimension, is averaged and compressed into a 1-dimensional structure, and then updated using EMA during the first round of training. t < i , d This indicates the dimension size of the Patch Embedding.

7. The general EEG signal decoding method based on cross-task continuous learning according to claim 1, characterized in that, The specific implementation of the cross-task knowledge distillation mechanism in step (5) is as follows: new task data and historical task data are input into the backbone network and the cross-task distillation network respectively, and the intermediate layer output of new task data and historical task data is obtained layer by layer; a cross-task distillation loss function is constructed, and the feature representation of the distillation network on the old task and the feature representation of the backbone network on the new task are aligned layer by layer, so as to enhance the backbone network's representation of the new task while retaining its representation ability of the old task, and enhance the distillation network's ability to extract cross-task representations.

8. The general EEG signal decoding method based on cross-task continuous learning according to claim 7, characterized in that, The expression for the cross-task distillation loss function is as follows: in: and This corresponds to the new task data input and the historical task input being in the backbone network and the cross-task distillation network, respectively. l Layer feature output, for and The losses between L This represents the number of layers in the cross-task distillation network.

9. The general EEG signal decoding method based on cross-task continuous learning according to claim 7, characterized in that, The total loss function used by the brain-computer interface cross-task continuous learning model during task learning and training. The expression is as follows: in: The cross-entropy loss function learned for the new task. For cross-task distillation loss function, ω These are the weighting coefficients.