A cross-subject brain-computer interface continuous decoding method and system based on a sudden insight mechanism
Patent Information
- Application Number
- CN202611384144.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-08
- Publication Date
- 2026-10-13
AI Technical Summary
也就是说,现有技术通常能够解决“如何对齐不同被试分布”、“如何被动缓解灾难性遗忘”中的某一方面问题,而人脑顿悟过程中“预测冲突感知-表征重组-知识整合”机制能够同事解决这两种问题,但当前脑机接口解码研究中缺乏一种能够模拟人脑顿悟机制的主动式持续学习方法
[0070]第一,通过跨被试分布对齐减少不同被试、不同采集被试之间的边缘分布差异;第二,通过预测误差和表征变化双重监测,避免模型仅根据单一误差波动作出调整;第三,通过元知识图谱记录不同被试、不同任务和不同神经模式之间的关系,使模型具备结构化知识组织能力;第四,通过触发式动态调节减少无意义的频繁更新,使模型在关键冲突时刻进行知识重组。
Smart Images

Figure CN122904044A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of brain-computer interface signal processing, cross-subject generalization, domain adaptation, and continuous learning, specifically to a cross-subject brain-computer interface continuous decoding method and system based on insight mechanism. Background Technology
[0002] Brain-computer interfaces (BCIs) establish communication channels between brain activity and external devices, software systems, and feedback environments by collecting and analyzing neural signals such as electroencephalograms (EEGs). Common BCI paradigms include motor imagery, steady-state visual evoked potentials (SVPs), P300 event-related potentials (ERPs), error-related potentials (ERPs), cognitive load monitoring, emotion recognition, fatigue monitoring, and rehabilitation training feedback control. Due to the characteristics of neural signals, such as low signal-to-noise ratio, strong non-stationarity, and significant individual distribution differences, BCI models often face significant performance degradation issues in cross-subject applications.
[0003] To address the issue of distributional discrepancies in cross-subject brain-computer interfaces, existing research has proposed cross-subject transfer learning and distribution alignment methods. For example, Euclidean space data alignment methods whiten the covariance structure of different subject EEG samples, making the data from different subjects more similar in Euclidean space, thereby reducing cross-subject marginal distributional discrepancies. These methods can reduce input distribution shifts caused by subject differences to some extent, but their main role is concentrated in data preprocessing and feature distribution alignment stages. They typically do not address the problem of catastrophic forgetting of the model; that is, they cannot solve the knowledge retention problem during continuous learning of new subject data distributions, nor can they proactively determine when the model encounters conflicts between old and new knowledge.
[0004] To address the catastrophic forgetting problem in deep models for brain-computer interface decoding during sequential continuous learning tasks, existing continuous learning methods have proposed strategies such as regularization, replay, and parameter allocation. For example, the elastic weight consolidation method estimates important parameters from old tasks and restricts their changes, reducing the destruction of knowledge from old tasks when learning new tasks; incremental classification and representation learning methods preserve old category samples and feature representations for replay, enabling the model to maintain the discrimination ability of old categories when learning new categories; parameter freezing and pruning methods reduce inter-task interference by allocating and retaining some network parameters for different tasks. While these methods can alleviate the forgetting problem in continuous learning to some extent, most methods primarily focus on parameter protection, sample replay, and model capacity allocation, typically employing fixed constraints and fixed replay strategies. They lack an active perception mechanism for the current model state, making it difficult to determine whether the model has truly encountered prediction anomalies and representation conflicts caused by new subjects.
[0005] In cross-subject brain-computer interface (BCI) continuous learning scenarios, simply aligning cross-subject distributions is insufficient to address the problem of forgetting old knowledge during continuous learning; traditional continuous learning constraints alone are also inadequate to adapt to the dynamic distribution changes in BCI signals caused by new subjects and new neural patterns. Existing technologies have not yet disclosed a cross-subject BCI continuous learning decoding scheme that simultaneously combines prediction error anomaly monitoring, potential representation change monitoring, meta-knowledge graph organization, and triggered knowledge reorganization. In other words, existing technologies typically address one aspect of the problem: "how to align different subject distributions" or "how to passively mitigate catastrophic forgetting." The "prediction conflict perception-representation reorganization-knowledge integration" mechanism in human insight can simultaneously solve both problems, but current BCI decoding research lacks an active continuous learning method that can simulate the human insight mechanism.
[0006] Therefore, there is an urgent need for a new method for continuous decoding of brain-computer interfaces across subjects, so that the model can continuously monitor the current prediction error and potential representation changes when learning data from different subjects sequentially. Summary of the Invention
[0007] To address the problems existing in the prior art, this invention proposes a cross-subject brain-computer interface continuous decoding method based on the insight mechanism. This method is based on the mechanism of "prediction conflict-representation reorganization-knowledge integration" in the human brain insight process. During the model training process, prediction error and representation changes are monitored simultaneously. When both indicate that the model has encountered a conflict between new and old knowledge, knowledge reorganization and dynamic adjustment are triggered.
[0008] The method proposed in this invention first preprocesses and aligns the distribution of neural signals from multiple subjects to reduce the differences in input distribution among different subjects. Then, it utilizes a brain-computer interface feature extraction network to extract task-related representations and performs continuous learning and training with each subject as a learning task. During training, a prediction error monitoring module records the model's decoding error for the current data, and a representation change monitoring module calculates the difference between the current feature and existing nodes in the meta-knowledge graph, obtaining a representation change score (RC score). When both the prediction error and the RC score meet the triggering conditions, an insight trigger initiates a knowledge reorganization process, including updating the meta-knowledge graph, enhancing old task features, replaying prototypes, and adjusting learning constraints, thereby mitigating catastrophic forgetting. This enables the brain-computer interface decoder to adapt to new subject data while reducing forgetting of old subject knowledge, improving the stability, generalization ability, and scalability of cross-subject brain-computer interface systems in long-term use and low-calibration scenarios.
[0009] To achieve the above-mentioned technical objectives, the present invention provides the following technical solution:
[0010] A cross-subject brain-computer interface continuous decoding method based on insight mechanism, which specifically includes:
[0011] Brain-computer interface neural signals were collected from different subjects, preprocessed, and aligned across subject distributions to obtain neural signal aligned samples;
[0012] A continuous learning task sequence was constructed according to the time sequence of different subjects. The neural signal alignment samples were input into the brain-computer interface feature extraction network to obtain task-related features. Each subject was treated as a learning task, and learning and training were carried out in batches within each learning task.
[0013] During the continuous learning training process according to the continuous learning task sequence, the task decoding loss and prediction error are calculated for the neural signal alignment samples of the current batch, and the prediction error history sequence is recorded; the prediction error anomaly score is calculated based on the prediction error and the prediction error history sequence.
[0014] Construct a meta-knowledge graph; based on task-related features, calculate the similarity relationship between the neural signal alignment samples of the current batch and the nodes of the meta-knowledge graph, obtain the representation change score, and update the meta-knowledge graph;
[0015] An insight trigger signal is generated based on the prediction error anomaly score, the characterization change score, and constraints on the number of preheating, cooling, and triggering cycles.
[0016] When the insight trigger signal meets the triggering conditions, the insight mechanism is triggered, and knowledge reorganization and dynamic adjustment are performed;
[0017] The decoder output after continuous learning is used to decode the results of brain-computer interface tasks across subjects, and continuous learning evaluation indicators are calculated.
[0018] Furthermore, the process of collecting brain-computer interface neural signals from different subjects, performing preprocessing and cross-subject distribution alignment to obtain neural signal aligned samples specifically involves:
[0019] Brain-computer interface neural signals were collected from different subjects. The brain-computer interface neural signals were then filtered, artifact suppressed, segmented, resampled, and standardized to obtain neural signal samples. The neural signal samples were then transformed using a cross-subject distribution alignment method to obtain neural signal aligned samples.
[0020] Furthermore, the process of calculating the task decoding loss and prediction error for the current batch of neural signal alignment samples and recording the prediction error history sequence during continuous learning training according to the continuous learning task sequence specifically involves:
[0021] Task-related features are input into the brain-computer interface decoder to obtain the predicted probability that the neural signal alignment samples of the current batch belong to each learning task category; the task decoding loss of the current batch is calculated based on the deviation between the predicted probability and the true label. ;
[0022] Decoding loss of the current batch of tasks As the prediction error of the current batch ,in This represents the current batch; according to the preset historical sliding window length m, the prediction errors of historical batches are obtained, resulting in the historical sequence of prediction errors for the current batch. .
[0023] Furthermore, the calculation of the prediction error anomaly score based on the prediction error and the historical sequence of prediction errors specifically involves:
[0024] The prediction error anomaly score is calculated using robust statistics, including the median and interquartile range of the historical prediction error series. The prediction error anomaly score for the current batch is calculated using the following formula:
[0025] ;
[0026] in, This represents the outlier score of the prediction error for the current batch. This indicates the prediction error for the current batch. This represents the historical sequence of prediction errors for the current batch; , These represent the median and interquartile range of the historical prediction error sequence, respectively. Indicates the current batch.
[0027] Furthermore, the construction of the meta-knowledge graph, specifically calculating the similarity relationship between the neural signal alignment samples of the current batch and the nodes of the meta-knowledge graph based on task-related features, obtaining the representation change score, and updating the meta-knowledge graph, involves:
[0028] Constructing a meta-knowledge graph based on existing historical knowledge ,in This represents a set of atlas nodes, where each node represents a historical feature prototype obtained from historical subject data, historical task data, or typical neural pattern data. This represents the node edge weight matrix, where each node edge weight represents the strength of the relationship between node pairs. Node similarity is used as the initial node edge weight between node pairs.
[0029] For the neural signal alignment samples in the current batch, calculate the similarity between the task-related features of each neural signal alignment sample and the feature vector of each meta-knowledge graph node, and take the maximum value of the similarity as the matching degree between each neural signal alignment sample and the meta-knowledge graph; calculate the representation change score of the current batch based on the matching degree, expressed by the formula:
[0030] ;
[0031] in, Indicates the current batch The percentage of change in the representation, This refers to the batch size, i.e., the number of samples within the batch. Indicates the sample index; Indicates the first The degree of matching between each neural signal alignment sample and the meta-knowledge graph;
[0032] Initialize node similarity threshold Set the threshold for the proportion of new samples in a batch. Set the conditions for adding a new node as follows:
[0033] ;
[0034] in, Indicates the current batch The new sample ratio; Indicates an indicator function, when When, take 1, when Take 0 at the time; This represents the number of nodes in the current meta-knowledge graph. This indicates the preset maximum number of nodes; the node similarity threshold is adjusted for each batch based on the representation change score and the growth rate of nodes within the current learning task.
[0035] If the neural signal alignment samples in the current batch do not meet the conditions for adding new nodes, then perform routine graph maintenance: select the existing node that is most similar to the features of the current batch. Use the current batch feature centroid pair The feature vectors are updated using an exponential moving average, and based on the updated... The feature vectors are used to recalculate the node similarity between existing node pairs; after recalculation, the node similarity exceeds the edge weight gating threshold. For existing node pairs that satisfy the Top-K nearest neighbor rule, update the node edge weights using an exponential moving average of the original edge weights and the recalculated node similarity; for node similarities that do not exceed the edge weight gating threshold... If an existing pair of nodes does not satisfy the Top-K nearest neighbor rule, then add a decay coefficient to the original edge weight, or do not establish an effective node edge weight.
[0036] If the neural signal alignment samples in the current batch meet the conditions for adding a new node, then the task-related feature with the lowest similarity to existing nodes in the current batch is selected as the new node and added to the meta-knowledge graph; and based on the regular graph maintenance, the node edge weights between the new node and existing nodes are updated according to the node similarity between the new node and existing nodes.
[0037] Furthermore, the generation of the insight trigger signal based on the prediction error anomaly score, the characterization change score, and the constraints of preheating, cooling, and triggering counts specifically involves:
[0038] After truncating the prediction error anomaly score and the characteristic change score respectively, a weighted sum is performed to obtain the comprehensive insight score;
[0039] Set the overall trigger threshold Error anomaly threshold Characterization of change threshold Preheating steps Cooling interval and maximum allowed number of triggers Based on the comprehensive insight score, an insight trigger signal is generated; current batch The signal that triggers enlightenment Represented as:
[0040] ;
[0041] in, Indicates the current batch The overall insight score, Indicates the current batch The prediction anomaly error score, Current batch The percentage of change in the representation, Indicates the batch in which the insight mechanism was last triggered; This indicates the number of times the insight mechanism has been triggered within the k-th learning task; This indicates an indicator function that, when all triggering conditions within the function are met, ,otherwise .
[0042] Furthermore, the specific steps for triggering the insight mechanism and performing knowledge restructuring and dynamic adjustment when the insight trigger signal meets the triggering conditions are as follows:
[0043] When the insight trigger signal does not meet the triggering condition, the model performs normal parameter updates, that is, updates the parameters of the feature extraction network and decoder based on the current task decoding loss and the basic continuous learning constraints. The training objective during normal parameter updates is... for:
[0044] ;
[0045] in For task decoding loss, This is a basic continuous learning constraint, which is one of the following: EWC parameter constraint, sample / feature replay constraint, and parameter freeze constraint. The weights of the constraints are used for continuous learning based on the foundation.
[0046] When the insight trigger signal meets the triggering conditions, a knowledge reorganization operation is performed, and the nodes and edge weights of the meta-knowledge graph are strengthened and updated, including:
[0047] If the number of nodes has not reached the upper limit, the representative features in the current batch are incorporated into the graph structure as new nodes and the node edge weight matrix is updated. The representative features are one of the following: the task-related features with the lowest similarity to existing nodes, the centroid of the current batch features, and the task-related features with the highest decoding loss of the sample task. If the number of nodes has reached the upper limit, the nodes are updated or the node edge weight matrix is updated based on the representative features.
[0048] Simultaneously, feature replay is performed based on historical feature prototypes, and feature replay loss is calculated based on the differences between historical feature prototypes and task-related features in the current batch. The knowledge distillation loss is calculated based on the difference between the output probability distribution of the current batch of samples from the historical model saved before the insight was triggered and the output probability distribution of the current model for the same batch of samples. Design the overall training objective after triggering the insight mechanism. for:
[0049] ;
[0050] in, , These are replay weights and knowledge distillation weights, respectively. The signal that triggers enlightenment, when At that time, the epiphany mechanism is triggered. It is not triggered at all times; each time the insight mechanism is triggered, the weights of replay weights, distillation weights, learning rate, and basic continuous learning constraints are dynamically adjusted; the parameters of the feature extraction network and decoder are updated based on the overall training objective.
[0051] More specifically, if the number of nodes reaches the upper limit, then updating only the nodes or only the node edge weight matrix based on representative features specifically means:
[0052] When the number of nodes reaches the limit, one of the following strategies will be adopted:
[0053] Node replacement strategy: Calculate the utilization rate or representative score of each existing node, and replace the existing node with the lowest utilization rate or representative score with the representative feature;
[0054] The nearest neighbor fusion strategy is to use representative features to update the existing nodes that are most similar to the representative features using an exponential moving average, and then incorporate the updated nodes into the graph structure.
[0055] Edge weight adjustment strategy: Update only the node edge weight matrix without updating the node itself.
[0056] Furthermore, the step of utilizing the decoder output after continuous learning to decode the brain-computer interface task across subjects and calculating the continuous learning evaluation index specifically involves:
[0057] The brain-computer interface decoder, after continuous learning and training, outputs decoding results across brain-computer interface tasks for test neural signal samples, and a task-level performance matrix is constructed after each learning task is completed. any element in the matrix This represents the test performance of the brain-computer interface decoder on the j-th known task after learning the t-th subject task;
[0058] The average performance of the observed tasks, the final average performance, the backward transfer index, the forgetting rate, and the number of insight triggers were calculated based on the task-level performance matrix to evaluate the brain-computer interface decoder's ability to adapt to new subjects, retain old knowledge, and reorganize insightful knowledge during cross-subject continuous learning.
[0059] Furthermore, this application also discloses a cross-subject brain-computer interface continuous decoding system based on insight mechanism, which is used to perform the method described above, specifically including:
[0060] The data preprocessing and distribution alignment module is used to collect brain-computer interface neural signals from multiple subjects, perform preprocessing and cross-subject distribution alignment, and obtain neural signal aligned samples.
[0061] The cross-subject task sequence construction module is used to construct continuous learning task sequences according to the time sequence of collection from different subjects;
[0062] The brain-computer interface feature extraction module is used to align neural signals with the sample input feature extraction network to obtain task-related features.
[0063] The task decoding module is used to input task-related features into the brain-computer interface decoder, obtain the predicted probability that the current sample belongs to each preset decoding target, and calculate the task decoding loss based on the predicted probability and the real label.
[0064] The prediction error monitoring module is used to record the task decoding loss of the current batch as the prediction error, construct a prediction error history sequence, and calculate the prediction error anomaly score based on the prediction error of the current batch and the historical error sequence.
[0065] The representation change monitoring and meta-knowledge graph update module is used to construct and maintain the meta-knowledge graph, calculate the similarity relationship between the current batch features and the nodes of the meta-knowledge graph, obtain the representation change score, and add new nodes and update edge weights to the meta-knowledge graph according to the new conditions.
[0066] The insight trigger determination module is used to generate an insight trigger signal based on the prediction error anomaly score, the characterization change score, the number of warm-up steps, the cooling interval, and the number of times it has been triggered in the current task.
[0067] The knowledge restructuring and dynamic adjustment module is used to perform knowledge restructuring and dynamic adjustment when the insight trigger signal is valid;
[0068] The performance evaluation module is used to construct a task-level performance matrix and calculate continuous learning evaluation indicators by utilizing the decoder output after continuous learning to decode the brain-computer interface tasks across subjects.
[0069] Based on the above technical solution, the present invention has at least the following beneficial effects:
[0070] First, alignment across subject distributions reduces marginal distribution differences between different subjects and subjects collected from different sources. Second, dual monitoring of prediction error and representation changes prevents the model from adjusting based solely on single error fluctuations. Third, a meta-knowledge graph records the relationships between different subjects, tasks, and neural patterns, enabling the model to organize structured knowledge. Fourth, trigger-based dynamic adjustment reduces meaningless frequent updates, allowing the model to reorganize knowledge at critical moments of conflict. Attached Figure Description
[0071] Figure 1 This is a flowchart illustrating a cross-subject brain-computer interface continuous learning decoding method based on insight mechanism proposed in this invention.
[0072] Figure 2 This is a schematic diagram of the cross-subject brain-computer interface continuous learning decoding framework structure inspired by insight mechanism in the embodiment.
[0073] Figure 3 This is a diagram illustrating the insight mechanism triggering method proposed in this invention.
[0074] Figure 4 This is a diagram showing the changes in the meta-knowledge graph in the method proposed in this invention. Detailed Implementation
[0075] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0076] Although the steps in this invention are arranged by reference numerals, this is not intended to limit the order of the steps. Unless the order of the steps is explicitly stated or the execution of a step requires other steps as a basis, the relative order of the steps can be adjusted. It is understood that the term "and / or" as used herein refers to and covers any and all possible combinations of one or more of the associated listed items.
[0077] like Figure 1 , Figure 2 As shown, this invention proposes a flowchart of a continuous decoding method for cross-subject brain-computer interfaces based on insight mechanisms, which specifically includes the following steps:
[0078] S1. Collect brain-computer interface neural signals from different subjects, perform preprocessing and cross-subject distribution alignment to obtain neural signal aligned samples;
[0079] As a preferred embodiment, in this embodiment, such as Figure 2 As shown, step S1 specifically involves:
[0080] Brain-computer interface neural signals were collected from different subjects. The continuous signals were segmented into neural signal samples according to task prompts, stimulus events, control intentions, and state labels. The effective time window was extracted. Then, the brain-computer interface neural signals were filtered, artifact suppression was performed, data segmentation was performed, resampling was performed, and standardization was performed to obtain neural signal samples at the neural signal sample level.
[0081] A cross-subject distribution alignment method is used to transform neural signal samples to obtain aligned neural signal samples. In this embodiment, taking multi-subject EEG signals as an example, assuming a total of k subjects are collected, for the i-th neural signal sample of the k-th subject, the mean of each channel signal is first removed, and then the spatial covariance matrix is calculated, expressed by the formula:
[0082] ;
[0083] in, Let represent the spatial covariance matrix of the i-th neural signal sample of the k-th subject. This is the i-th neural signal sample for the k-th learning task; Let I denote the trace of the matrix, ε denote the identity matrix, and ε be a stabilizing term to prevent matrix singularities.
[0084] Then, for the same subject n kThe reference covariance matrix is obtained by averaging the covariance matrices of the neural signal samples. And use its inverse square root Perform Euclidean alignment (EA alignment); the formula is as follows:
[0085] ; ; ;
[0086] in, This represents the neural signal alignment sample of the i-th neural signal sample of the k-th subject. Through the above changes, the average covariance of the aligned samples of the same subject approaches the identity matrix, thereby reducing the marginal distribution shift caused by differences in neural structure, sensor position, signal amplitude and spatial activation between different subjects.
[0087] S2. Construct a continuous learning task sequence according to the time order of data collection from different subjects. Input the neural signal-aligned samples into the brain-computer interface feature extraction network to obtain task-related features. Each subject serves as a learning task, and learning and training are conducted in batches within each learning task. The formula for task-related features is expressed as:
[0088] ;
[0089] in, The i-th neural signal alignment sample represents the task-related features (the subject number is omitted here for simplicity). This represents the mapping function of the brain-computer interface feature extraction network. For example, this embodiment provides network parameters for feature extraction. Figure 2 As shown, an Attention-based Temporal Convolutional Network (ATCNet) is used to extract temporal rhythm features, spatial channel features, frequency domain features, event-related features, and multimodal joint representations.
[0090] In this embodiment, each subject and each new subject is treated as an independent task, and a task sequence T1, T2, ..., T is constructed. K This task sequence can correspond to different subjects in the motor imagery dataset, or to different subjects in steady-state visual evoked potentials (SSVEP), P300 event-related potentials, passive brain-computer interfaces, and rehabilitation feedback scenarios; for each learning task T kFirst, construct training and testing sets. Then, learn sequentially according to the task order. When learning the t-th task, the model can only use the data from the current task, along with the allowed statistical information, feature prototypes, graph nodes, and historical constraints. It is not required to revisit all the original data from previous tasks.
[0091] S3. During the continuous learning training process according to the continuous learning task sequence, calculate the task decoding loss and prediction error for the neural signal alignment samples of the current batch, and record the prediction error history sequence; calculate the prediction error anomaly score based on the prediction error and the prediction error history sequence.
[0092] In a preferred embodiment, the process of obtaining the prediction error history sequence in step S3 is as follows:
[0093] The task-related features are input into the brain-computer interface decoder to obtain the predicted probability that the neural signal alignment samples in the current batch belong to each learning task category (i.e., the preset decoding target). The formula is expressed as:
[0094] ;
[0095] in, express The probability distribution of each brain-computer interface task category. Indicates decoder parameters;
[0096] Calculate the task decoding loss for the current batch based on the deviation between the predicted probability and the actual label. For categorized BCI tasks, the task decoding loss can be expressed as:
[0097] ;
[0098] Where B represents the current training batch size, and C represents the number of task categories; Represents an indicator variable, indicating that when the true label of the i-th sample is the same as the first sample, the true label of the i-th sample is the first sample. Class Time ,otherwise , This indicates that the model predicts the i-th sample belongs to the i-th sample. The probability of a class; minimizing the task decoding loss during training allows the model to learn the discriminative features in the current subject task;
[0099] Decoding loss of the current batch of tasks As the prediction error of the current batch ,in The current batch represents the number of training steps within the k-th learning task. The prediction errors of historical batches are obtained according to a preset historical sliding window length m, thus yielding the historical prediction error sequence for the current batch. .
[0100] In a preferred embodiment, the specific process of obtaining the prediction error anomaly score in step S3 is as follows:
[0101] To avoid false triggering caused by noise in a single batch, robust statistics are used to calculate the prediction error anomaly score. These robust statistics include the median and interquartile range of the historical prediction error sequence. The prediction error anomaly score for the current batch is calculated using the following formula:
[0102] ;
[0103] in, This represents the anomaly score of the prediction error for the current batch. The larger the value, the more abnormal the prediction error of the current batch is relative to recent historical levels, and the more likely the model is not adapted to the current subject data. This indicates the prediction error for the current batch. This represents the historical sequence of prediction errors for the current batch; , These represent the median and interquartile range of the historical prediction error sequence, respectively. Indicates the current batch.
[0104] S4. Construct a meta-knowledge graph; Based on task-related features, calculate the similarity relationship between the neural signal alignment samples of the current batch and the nodes of the meta-knowledge graph, obtain the representation change score, and update the meta-knowledge graph.
[0105] As a preferred embodiment, in this embodiment, such as Figure 2 As shown, step S4 specifically involves:
[0106] Constructing a meta-knowledge graph based on existing historical knowledge ,in This represents a set of atlas nodes, where each node represents a historical feature prototype obtained from historical subject data, historical task data, or typical neural pattern data. This represents the node edge weight matrix, where each node edge weight represents the strength of the relationship between node pairs. Node similarity is used as the initial node edge weight between node pairs.
[0107] For the current batch of neural signal alignment samples, calculate the similarity between the task-related features of each neural signal alignment sample and the feature vector of each meta-knowledge graph node. Take the maximum value of the similarity as the matching degree between each neural signal alignment sample and the meta-knowledge graph. The formula is expressed as:
[0108] , ;
[0109] in, Indicates the first Align the task-related features of the neural signals with the samples. Indicates the first Feature vectors of individual knowledge graph nodes for and Similarity between them; Indicates the first The degree of matching between each neural signal alignment sample and the meta-knowledge graph;
[0110] The characteristic change score for the current batch is calculated based on the matching degree, expressed by the formula:
[0111] ;
[0112] in, Indicates the current batch The larger the value of the representation change score, the greater the difference between the current batch features (the current batch features refer to the task-related features within the current batch) and the existing meta-knowledge graph. The model may encounter new subject patterns and new task representation conflicts. This refers to the batch size, i.e., the number of samples within the batch. Indicates the sample index; Indicates the first The degree of matching between each neural signal alignment sample and the meta-knowledge graph;
[0113] Initialize node similarity threshold Set the threshold for the proportion of new samples in a batch. Set the conditions for adding a new node as follows:
[0114] ;
[0115] in, Indicates the current batch The new sample ratio; Indicates an indicator function, when When, take 1, when Take 0 at the time; This represents the number of nodes in the current meta-knowledge graph. This represents the preset maximum number of nodes. Each batch adjusts the node similarity threshold based on the representation change score and the growth rate of nodes within the current learning task. If the number of nodes in the current task grows too rapidly, the threshold for new nodes is lowered to make it more difficult for new nodes to be added later. If there are no new nodes for a long time and the recent representation change score remains consistently high, the threshold is appropriately increased to make it easier for new nodes to be included in the graph.
[0116] If the neural signal alignment samples in the current batch do not meet the conditions for adding new nodes, then perform routine graph maintenance: select the existing node that is most similar to the feature centroid of the current batch. Use the centroid of the current batch feature (i.e., the mean vector of all task-related features in the current batch) to... The feature vectors are updated using an exponential moving average, and based on the updated... The feature vectors are used to recalculate the node similarity between existing node pairs; after recalculation, the node similarity exceeds the edge weight gating threshold. For existing node pairs that satisfy the Top-K nearest neighbor rule, update the node edge weights using an exponential moving average of the original edge weights and the recalculated node similarity; for node similarities that do not exceed the edge weight gating threshold... If an existing pair of nodes does not satisfy the Top-K nearest neighbor rule, then add a decay coefficient to the original edge weight, or do not establish an effective node edge weight.
[0117] If the neural signal alignment samples in the current batch meet the conditions for adding a new node, then the task-related feature with the lowest similarity to existing nodes in the current batch is selected as the new node and added to the meta-knowledge graph; and based on the regular graph maintenance, the node edge weights between the new node and existing nodes are updated according to the node similarity between the new node and existing nodes.
[0118] In this embodiment, the formula for updating node edge weights using exponential moving average is expressed as:
[0119] ;
[0120] in, Indicates the first Each knowledge graph node and the first The original edge weights between nodes in the knowledge graph (if it is a new node, its edge weight with other existing nodes is 0). Indicates the updated number Each knowledge graph node and the first The edge weights between nodes in a knowledge graph. , For the first Each knowledge graph node, the first The feature vector of each knowledge graph node; α is the graph update rate, which is 0.1 in this embodiment. The graph update rate will also be adjusted according to the representation change score. The higher the representation change score, the more conservative the update.
[0121] This application controls the sensitivity of the meta-knowledge graph to features relevant to new subjects / tasks and the graph size by adjusting the node similarity threshold and graph update rate. This avoids excessive node additions due to noisy batches and prevents genuine new patterns from being unrecorded for extended periods. Through node addition and node edge weight updates, the meta-knowledge graph can continuously record the relationships between different subjects, different tasks, and different neural patterns, providing a structured basis for subsequent insight triggering and knowledge reorganization.
[0122] S5. Generate an insight trigger signal based on the prediction error anomaly score, the characterization change score, and the constraints of preheating, cooling, and triggering times;
[0123] In a preferred embodiment, step S5 specifically comprises:
[0124] After truncating the prediction error anomaly score and the characteristic change score respectively, a weighted sum is performed to obtain the comprehensive insight score, expressed by the formula:
[0125] ;
[0126] in, Indicates the current batch The comprehensive insight score; This indicates truncation. , To predict the error anomaly score and the upper limit of the truncation score representing the change score, truncation processing is used to reduce the impact of extreme batch noise on the trigger judgment; , These are the weights used when calculating the overall insight score based on the prediction error anomaly score and the characterization change score, respectively.
[0127] Set the overall trigger threshold (In this embodiment, 1.3 is used) Error anomaly threshold (In this embodiment, 1.7 is used) Characterizing the threshold of change (In this embodiment, the value is 0.18), number of preheating steps (10 is used in this embodiment) Cooling interval (In this embodiment, 120 is used) and the maximum allowed number of triggers (In this embodiment, the value is 1), and an insight trigger signal is generated by combining the comprehensive insight score; current batch The signal that triggers enlightenment Represented as:
[0128] ;
[0129] in, Indicates the current batch The prediction anomaly error score, Current batch The percentage of change in the representation, Indicates the batch in which the insight mechanism was last triggered; This indicates the number of times the insight mechanism has been triggered within the k-th learning task; This indicates an indicator function that, when all triggering conditions within the function are met, ,otherwise .
[0130] S6. When the insight trigger signal meets the triggering conditions, the insight mechanism is triggered to perform knowledge reorganization and dynamic adjustment.
[0131] In a preferred embodiment, step S6 specifically comprises:
[0132] When the insight trigger signal does not meet the trigger condition (i.e.) (At that time), the model performs normal parameter updates, that is, updates the parameters of the feature extraction network and decoder based on the current task decoding loss and the basic continuous learning constraints. The training objective during normal parameter updates is... for:
[0133] ;
[0134] in, For task decoding loss, Based on continuous learning constraints, The weights of the basic continuous learning constraint term are one of the following: EWC (Elastic Weight Consolidation) parameter constraints, sample / feature replay constraints, and parameter freeze constraints.
[0135] When the insight trigger signal meets the trigger condition (i.e.) At that time, a knowledge restructuring operation is performed, and the nodes and edge weights of the meta-knowledge graph are reinforced and updated, including:
[0136] If the number of nodes has not reached the upper limit, the representative features in the current batch are incorporated into the graph structure as new nodes and the node edge weight matrix is updated. The representative features are one of the following: the task-related features with the lowest similarity to existing nodes, the centroid of the current batch features, and the task-related features with the highest decoding loss of the sample task. If the number of nodes has reached the upper limit, the nodes are updated or the node edge weight matrix is updated based on the representative features.
[0137] In a preferred embodiment, if the number of nodes reaches the upper limit, then updating only the nodes or only the node edge weight matrix based on representative features specifically means:
[0138] When the number of nodes reaches the limit, one of the following strategies will be adopted:
[0139] Node replacement strategy: Calculate the utilization rate or representativeness score of each existing node, and replace the existing node with the lowest utilization rate or representativeness score with the representative feature; in this embodiment, the utilization rate of an existing node is calculated based on the number of times the node is selected as the nearest node by the current batch centroid within the sliding time window, expressed by the formula:
[0140] ;
[0141] in, , Assigning to the window number respectively , The number of samples or batches for each existing node. For the first The utilization rate of existing nodes;
[0142] The representative score is derived from the usage rate, the average similarity between an existing node and its assigned samples, and the edge weights and weighted average of the existing node and other existing nodes. The formula is as follows:
[0143] ;
[0144] in, To be allocated to the The average similarity between the sample features of an existing node and the feature vector of the node. For the first The sum of the edge weights of each existing node and other existing nodes; , , They are respectively , , The weighted weights; For the first The representative score of each existing node.
[0145] The nearest neighbor fusion strategy is to use representative features to update the existing nodes that are most similar to the representative features using an exponential moving average, and then incorporate the updated nodes into the graph structure.
[0146] Edge weight adjustment strategy: Only update the node edge weight matrix without updating the nodes themselves. When only the edge weight matrix is updated, the eigenvectors of existing nodes remain unchanged; no nodes are added or replaced. By calculating the similarity between the representative features of the current batch and each existing node, the set of most similar existing nodes affected by the current batch is determined. Then, the relevant edge weights are updated based on the similarity between existing nodes in the set of most similar existing nodes.
[0147] Simultaneously, feature replay is performed based on historical feature prototypes, using these prototypes as representatives of existing historical knowledge for learning during training. Feature replay includes prototype-level replay and feature-level replay. Prototype-level replay uses the average vector of task-related features of all samples within a category, while feature-level replay uses the task-related features of each sample. In this embodiment, prototype-level replay is used. For the c-th class sample of the q-th known task, its historical feature prototype... Represented as:
[0148] ;
[0149] in, Indicates the first Among the tasks that have been identified, the first one belongs to... A sample set of classes;
[0150] Calculate feature replay loss based on the differences between historical feature prototypes and task-related features in the current batch. This makes features of the same category closer to their original historical feature prototypes. The formula for feature replay loss is expressed as:
[0151] ;
[0152] in, express The true category label of the corresponding neural signal sample. This represents the historical feature prototype under this real category;
[0153] The knowledge distillation loss is calculated based on the difference between the output probability distribution of the current batch of samples from the historical model saved before the insight was triggered and the output probability distribution of the current model for the same batch of samples. This ensures that the current model output remains consistent with the historical model output. The formula for knowledge distillation loss is expressed as:
[0154] ;
[0155] in, Indicates the number of the current batch One neural signal sample (the learning task index is hidden). This represents the output of the historical model saved before the epiphany was triggered. The probability of belonging to the c-th category. Indicates the current model output. The probability of belonging to the c-th category;
[0156] Design the overall training objective after triggering the insight mechanism. for:
[0157] ;
[0158] in, , These are replay weights and knowledge distillation weights, respectively. The signal that triggers enlightenment, when At that time, the epiphany mechanism is triggered. It is not triggered at all; each time the insight mechanism is triggered, the weights of replay weights, distillation weights, learning rate, and basic continuous learning constraints are dynamically adjusted. For example, a smaller basic replay weight is used in normal update batches to allow the model to learn the current subject normally; when... Increase replay weight when the epiphany mechanism is triggered. And knowledge distillation weight This makes the historical feature prototypes impose stronger constraints on current training; the learning rate can remain constant or increase briefly upon triggering / then decay; the weights of the basic continuous learning constraint terms. The model can be improved based on the degree of forgetting from previous tasks. Through the above dynamic adjustment, the model learns normally from the current subject in normal batches, and strengthens the retention of historical knowledge and the reorganization of the feature space in critical conflict batches. The parameters of the feature extraction network and the decoder are updated based on the overall training objective.
[0159] S7. Utilize the decoder output after continuous learning to decode the cross-subject brain-computer interface task and calculate the continuous learning evaluation index.
[0160] In a preferred embodiment, step S7 specifically comprises:
[0161] The brain-computer interface decoder, after continuous learning and training, outputs decoding results across brain-computer interface tasks for the test neural signal samples (the highest probability term is used as the decoding result), and a task-level performance matrix is constructed after each learning task is completed. any element in the matrix This represents the performance of the brain-computer interface decoder on the j-th known task after learning the t-th subject task; for the classification BCI task, It can be the accuracy rate; for regression-type and continuous control-type BCI tasks, it can also be replaced by the correlation coefficient, mean square error, information transmission rate, and task success rate.
[0162] The average performance of known tasks was calculated based on the task-level performance matrix. Final average performance Backward migration index The number of insight triggers was also used to evaluate the brain-computer interface decoder's ability to adapt to new subjects, retain old knowledge, and reorganize insightful knowledge during cross-subject continuous learning.
[0163] After completing the t-th learning task, the average performance of the known tasks is expressed as follows: The final average performance is expressed as The backward migration metric is expressed as , This represents the test performance on the j-th known task after learning the k-th subject task. BWT represents the test performance on the j-th known task after learning the j-th subject task. The closer BWT is to 0 and the more positive it is, the less the model forgets. If it is significantly negative, it means that the model forgets the old subjects after learning the new subjects.
[0164] The experimental results obtained on the BCI Competition IV 2a dataset are shown in Table 1. The results show that the representation-driven insight-based continuous learning method (RC-Insight) has a stable enhancing effect on existing continuous learning methods, especially when combined with Incremental Classifier and Representation Learning (iCaRL) and Elastic Weight Consolidation (EWC). Regarding the final average accuracy, the combination of insight mechanism with Incremental Classifier and Representation Learning (RC-Insight+iCaRL) achieves the highest result, approximately 0.44, higher than iCaRL alone (approximately 0.43); the combination of insight mechanism with Elastic Weight Consolidation (RC-Insight+EWC) achieves approximately 0.405, higher than EWC alone (approximately 0.389), indicating that insight mechanism can further alleviate the forgetting problem in cross-subject continuous learning based on sample replay and regularization constraints. Specific data comparisons of average accuracy and backward transfer metrics are also shown in Table 1 below, indicating that insight mechanism has added value as a dynamic conflict monitoring and knowledge reorganization module.
[0165] Table 1. Comparison of various continuous learning methods in the BCI Competition IV 2a dataset.
[0166]
[0167] In addition, the number of insight triggers and the trigger location of each learning task are counted in this embodiment as follows: Figure 3 As shown, the horizontal axis represents the training step or batch number, and the vertical axis represents the prediction error, the representation change score, the comprehensive insight score, and the adaptive threshold. The trigger point in the figure represents the key batch where both the prediction error anomaly and the representation change simultaneously meet the conditions.
[0168] For example Figure 4As shown, the graph displays the trends of the number of nodes, total edge weights, average edge weights, or effective edge density as the number of update steps during the training process, reflecting the process by which the graph continuously records new subject patterns and historical knowledge relationships.
[0169] Based on the experiments, the advantage of the insight mechanism lies not in significantly improving the performance of the classifier alone, but in identifying cross-subject distribution mutations during continuous learning through meta-knowledge graphs, RC scores, dynamic thresholds, and centroid replays. It also enhances knowledge reorganization and protection of old knowledge at critical moments. Therefore, RC-Insight+iCaRL and RC-Insight+EWC outperform their respective baseline methods, demonstrating good resistance to forgetting, adaptability, and interpretability.
[0170] The above summarizes all the steps of the method proposed in this invention. Furthermore, this application also discloses a cross-subject brain-computer interface continuous decoding system based on insight mechanisms. This system is used to execute the method described above, specifically including:
[0171] The data preprocessing and distribution alignment module is used to collect brain-computer interface neural signals from multiple subjects, perform preprocessing and cross-subject distribution alignment, and obtain neural signal aligned samples.
[0172] The cross-subject task sequence construction module is used to construct continuous learning task sequences according to the time sequence of collection from different subjects;
[0173] The brain-computer interface feature extraction module is used to align neural signals with the sample input feature extraction network to obtain task-related features.
[0174] The task decoding module is used to input task-related features into the brain-computer interface decoder, obtain the predicted probability that the current sample belongs to each preset decoding target, and calculate the task decoding loss based on the predicted probability and the real label.
[0175] The prediction error monitoring module is used to record the task decoding loss of the current batch as the prediction error, construct a prediction error history sequence, and calculate the prediction error anomaly score based on the prediction error of the current batch and the historical error sequence.
[0176] The representation change monitoring and meta-knowledge graph update module is used to construct and maintain the meta-knowledge graph, calculate the similarity relationship between the current batch features and the nodes of the meta-knowledge graph, obtain the representation change score, and add new nodes and update edge weights to the meta-knowledge graph according to the new conditions.
[0177] The insight trigger determination module is used to generate an insight trigger signal based on the prediction error anomaly score, the characterization change score, the number of warm-up steps, the cooling interval, and the number of times it has been triggered in the current task.
[0178] The knowledge restructuring and dynamic adjustment module is used to perform knowledge restructuring and dynamic adjustment when the insight trigger signal is valid;
[0179] The performance evaluation module is used to construct a task-level performance matrix and calculate continuous learning evaluation indicators by utilizing the decoder output after continuous learning to decode the brain-computer interface tasks across subjects.
[0180] In summary, this invention achieves a complete process of "continuous learning training - prediction error monitoring - representation change monitoring - insight triggering - knowledge reorganization - performance evaluation" through the above steps. Compared with traditional methods that rely solely on regularization, replay, and architecture freezing, this invention can proactively identify changes in model state when new subjects arrive, and perform knowledge reorganization and dynamic adjustment at critical moments when prediction error anomalies and representation conflicts occur simultaneously. This improves the stability, generalization ability, and resilience to catastrophic forgetting of the cross-subject brain-computer interface continuous learning model.
[0181] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.
[0182] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).
[0183] The above embodiments provide a detailed description of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for continuous decoding of brain-computer interfaces across subjects based on insight mechanisms, characterized in that, Specifically, the following steps are included: Brain-computer interface neural signals were collected from different subjects, preprocessed, and aligned across subject distributions to obtain neural signal aligned samples; A continuous learning task sequence was constructed according to the time sequence of different subjects. The neural signal alignment samples were input into the brain-computer interface feature extraction network to obtain task-related features. Each subject was treated as a learning task, and learning and training were carried out in batches within each learning task. During the continuous learning training process according to the continuous learning task sequence, the task decoding loss and prediction error are calculated for the neural signal alignment samples of the current batch, and the prediction error history sequence is recorded; the prediction error anomaly score is calculated based on the prediction error and the prediction error history sequence. Construct a meta-knowledge graph; based on task-related features, calculate the similarity relationship between the neural signal alignment samples of the current batch and the nodes of the meta-knowledge graph, obtain the representation change score, and update the meta-knowledge graph; An insight trigger signal is generated based on the prediction error anomaly score, the characterization change score, and constraints on the number of preheating, cooling, and triggering cycles. When the insight trigger signal meets the triggering conditions, the insight mechanism is triggered, and knowledge reorganization and dynamic adjustment are performed; The decoder output after continuous learning is used to decode the results of brain-computer interface tasks across subjects, and continuous learning evaluation indicators are calculated.
2. The method for continuous decoding of cross-subject brain-computer interfaces based on insight mechanisms according to claim 1, characterized in that, The process of collecting brain-computer interface neural signals from different subjects, preprocessing them, and aligning them across subject distributions to obtain aligned neural signal samples is as follows: Brain-computer interface neural signals were collected from different subjects. The brain-computer interface neural signals were then filtered, artifact suppressed, segmented, resampled, and standardized to obtain neural signal samples. The neural signal samples were then transformed using a cross-subject distribution alignment method to obtain neural signal aligned samples.
3. The method for continuous decoding of cross-subject brain-computer interfaces based on insight mechanisms according to claim 1, characterized in that, The process of continuous learning and training according to the continuous learning task sequence, specifically calculating the task decoding loss and prediction error for the current batch of neural signal alignment samples, and recording the historical sequence of prediction errors, is as follows: Task-related features are input into the brain-computer interface decoder to obtain the predicted probability that the neural signal alignment samples of the current batch belong to each learning task category; the task decoding loss of the current batch is calculated based on the deviation between the predicted probability and the true label. ; Decoding loss of the current batch of tasks As the prediction error of the current batch ,in This represents the current batch; according to the preset historical sliding window length m, the prediction errors of historical batches are obtained, resulting in the historical sequence of prediction errors for the current batch. .
4. The method for continuous decoding of a cross-subject brain-computer interface based on insight mechanism according to claim 1, characterized in that, The calculation of the prediction error anomaly score based on the prediction error and the historical sequence of prediction errors is specifically as follows: The prediction error anomaly score is calculated using robust statistics, including the median and interquartile range of the historical prediction error series. The prediction error anomaly score for the current batch is calculated using the following formula: ; in, This represents the outlier score of the prediction error for the current batch. This indicates the prediction error for the current batch. This represents the historical sequence of prediction errors for the current batch; , These represent the median and interquartile range of the historical prediction error sequence, respectively. Indicates the current batch.
5. The method for continuous decoding of cross-subject brain-computer interfaces based on insight mechanisms according to claim 1, characterized in that, The construction of the meta-knowledge graph, specifically calculating the similarity relationship between the neural signal alignment samples of the current batch and the nodes of the meta-knowledge graph based on task-related features, obtaining the representation change score, and updating the meta-knowledge graph, involves the following steps: Constructing a meta-knowledge graph based on existing historical knowledge ,in This represents a set of atlas nodes, where each node represents a historical feature prototype obtained from historical subject data, historical task data, or typical neural pattern data. This represents the node edge weight matrix, where each node edge weight represents the strength of the relationship between node pairs. Node similarity is used as the initial node edge weight between node pairs. For the neural signal alignment samples in the current batch, calculate the similarity between the task-related features of each neural signal alignment sample and the feature vector of each meta-knowledge graph node, and take the maximum value of the similarity as the matching degree between each neural signal alignment sample and the meta-knowledge graph; calculate the representation change score of the current batch based on the matching degree, expressed by the formula: ; in, Indicates the current batch The percentage of change in the representation, This refers to the batch size, i.e., the number of samples within the batch. Indicates the sample index; Indicates the first The degree of matching between each neural signal alignment sample and the meta-knowledge graph; Initialize node similarity threshold Set the threshold for the proportion of new samples in a batch. Set the conditions for adding a new node as follows: ; in, Indicates the current batch The new sample ratio; Indicates an indicator function, when When, take 1, when Take 0 at the time; This represents the number of nodes in the current meta-knowledge graph. This indicates the preset maximum number of nodes; the node similarity threshold is adjusted for each batch based on the representation change score and the growth rate of nodes within the current learning task. If the neural signal alignment samples in the current batch do not meet the conditions for adding new nodes, then perform routine graph maintenance: select the existing node that is most similar to the feature centroid of the current batch. Use the current batch feature centroid pair The feature vectors are updated using an exponential moving average, and based on the updated... The feature vectors are used to recalculate the node similarity between existing node pairs; after recalculation, the node similarity exceeds the edge weight gating threshold. For existing node pairs that satisfy the Top-K nearest neighbor rule, update the node edge weights using an exponential moving average of the original edge weights and the recalculated node similarity; for node similarities that do not exceed the edge weight gating threshold... If an existing pair of nodes does not satisfy the Top-K nearest neighbor rule, then add a decay coefficient to the original edge weight, or do not establish an effective node edge weight. If the neural signal alignment samples in the current batch meet the conditions for adding a new node, then the task-related feature with the lowest similarity to existing nodes in the current batch is selected as the new node and added to the meta-knowledge graph; and based on the regular graph maintenance, the node edge weights between the new node and existing nodes are updated according to the node similarity between the new node and existing nodes.
6. The method for continuous decoding of a cross-subject brain-computer interface based on insight mechanism according to claim 1, characterized in that, The specific steps for generating the insight trigger signal based on the prediction error anomaly score, the characterization change score, and constraints on the number of preheating, cooling, and triggering cycles are as follows: After truncating the prediction error anomaly score and the characteristic change score respectively, a weighted sum is performed to obtain the comprehensive insight score; Set the overall trigger threshold Error anomaly threshold Characterization of change threshold Preheating steps Cooling interval and maximum allowed number of triggers Based on the comprehensive insight score, an insight trigger signal is generated; current batch The signal that triggers enlightenment Represented as: ; in, Indicates the current batch The overall insight score, Indicates the current batch The prediction anomaly error score, Current batch The percentage of change in the representation, Indicates the batch in which the insight mechanism was last triggered; This indicates the number of times the insight mechanism has been triggered within the k-th learning task; This indicates an indicator function that, when all triggering conditions within the function are met, ,otherwise .
7. The method for continuous decoding of cross-subject brain-computer interfaces based on insight mechanisms according to claim 1, characterized in that, When the insight trigger signal meets the triggering conditions, the insight mechanism is triggered to perform knowledge reorganization and dynamic adjustment. Specifically, this means: When the insight trigger signal does not meet the triggering condition, the model performs normal parameter updates, that is, updates the parameters of the feature extraction network and decoder based on the current task decoding loss and the basic continuous learning constraints. The training objective during normal parameter updates is... for: ; in For task decoding loss, This is a basic continuous learning constraint, which is one of the following: EWC parameter constraint, sample / feature replay constraint, and parameter freeze constraint. The weights of the constraints are used for continuous learning based on the foundation. When the insight trigger signal meets the triggering conditions, a knowledge reorganization operation is performed, and the nodes and edge weights of the meta-knowledge graph are strengthened and updated, including: If the number of nodes has not reached the upper limit, the representative features in the current batch are incorporated into the graph structure as new nodes and the node edge weight matrix is updated. The representative features are one of the following: the task-related features with the lowest similarity to existing nodes, the centroid of the current batch features, and the task-related features with the highest decoding loss of the sample task. If the number of nodes has reached the upper limit, the nodes are updated or the node edge weight matrix is updated based on the representative features. Simultaneously, feature replay is performed based on historical feature prototypes, and feature replay loss is calculated based on the differences between historical feature prototypes and task-related features in the current batch. The knowledge distillation loss is calculated based on the difference between the output probability distribution of the current batch of samples from the historical model saved before the insight was triggered and the output probability distribution of the current model for the same batch of samples. Design the overall training objective after triggering the insight mechanism. for: ; in, , These are replay weights and knowledge distillation weights, respectively. The signal that triggers enlightenment, when At that time, the epiphany mechanism is triggered. It is not triggered at all times; each time the insight mechanism is triggered, the weights of replay weights, distillation weights, learning rate, and basic continuous learning constraints are dynamically adjusted; the parameters of the feature extraction network and decoder are updated based on the overall training objective.
8. The method for continuous decoding of a cross-subject brain-computer interface based on insight mechanism according to claim 7, characterized in that, If the number of nodes reaches the upper limit, then updating only the nodes or only the node edge weight matrix based on representative features is specifically as follows: When the number of nodes reaches the limit, one of the following strategies will be adopted: Node replacement strategy: Calculate the utilization rate or representative score of each existing node, and replace the existing node with the lowest utilization rate or representative score with the representative feature; The nearest neighbor fusion strategy is to use representative features to update the existing nodes that are most similar to the representative features using an exponential moving average, and then incorporate the updated nodes into the graph structure. Edge weight adjustment strategy: Update only the node edge weight matrix without updating the node itself.
9. The method for continuous decoding of a cross-subject brain-computer interface based on insight mechanism according to claim 1, characterized in that, The specific steps for utilizing the decoder output after continuous learning to decode the brain-computer interface task across subjects and calculating the continuous learning evaluation index are as follows: The brain-computer interface decoder, after continuous learning and training, outputs decoding results across brain-computer interface tasks for test neural signal samples, and a task-level performance matrix is constructed after each learning task is completed. any element in the matrix This represents the test performance of the brain-computer interface decoder on the j-th known task after learning the t-th subject task; The average performance of the observed tasks, the final average performance, the backward transfer index, the forgetting rate, and the number of insight triggers were calculated based on the task-level performance matrix to evaluate the brain-computer interface decoder's ability to adapt to new subjects, retain old knowledge, and reorganize insightful knowledge during cross-subject continuous learning.
10. A cross-subject brain-computer interface continuous decoding system based on insight mechanism, the system being used to perform the method as described in any one of claims 1-9, characterized in that, Specifically, it includes: The data preprocessing and distribution alignment module is used to collect brain-computer interface neural signals from multiple subjects, perform preprocessing and cross-subject distribution alignment, and obtain neural signal aligned samples. The cross-subject task sequence construction module is used to construct continuous learning task sequences according to the time sequence of collection from different subjects; The brain-computer interface feature extraction module is used to align neural signals with the sample input feature extraction network to obtain task-related features. The task decoding module is used to input task-related features into the brain-computer interface decoder, obtain the predicted probability that the current sample belongs to each preset decoding target, and calculate the task decoding loss based on the predicted probability and the real label. The prediction error monitoring module is used to record the task decoding loss of the current batch as the prediction error, construct a prediction error history sequence, and calculate the prediction error anomaly score based on the prediction error of the current batch and the historical error sequence. The representation change monitoring and meta-knowledge graph update module is used to construct and maintain the meta-knowledge graph, calculate the similarity relationship between the current batch features and the nodes of the meta-knowledge graph, obtain the representation change score, and add new nodes and update edge weights to the meta-knowledge graph according to the new conditions. The insight trigger determination module is used to generate an insight trigger signal based on the prediction error anomaly score, the characterization change score, the number of warm-up steps, the cooling interval, and the number of times it has been triggered in the current task. The knowledge restructuring and dynamic adjustment module is used to perform knowledge restructuring and dynamic adjustment when the insight trigger signal is valid; The performance evaluation module is used to construct a task-level performance matrix and calculate continuous learning evaluation indicators by utilizing the decoder output after continuous learning to decode the brain-computer interface tasks across subjects.