A hierarchical, progressive domain-adaptive cross-subject EEG decoding method

CN122569754APending Publication Date: 2026-08-14ANHUI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-20
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0007]针对上述现有技术中存在的问题,本发明提出一种分层渐进域自适应的跨被试脑电解码方法,旨在解决现有基于脑电的脑机接口康复设备中存在的被试差异问题,重点解决跨被试脑电信号解码中同一源被试内部试次迁移价值差异利用不充分、深度域适应训练早期不稳定的问题

Benefits of technology

1.本发明根据类别条件最优传输距离对不同源被试赋予不同被试级权重,使与目标被试分布更接近的源被试在训练中发挥更大作用;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122569754A_ABST
    Figure CN122569754A_ABST
Patent Text Reader

Abstract

This invention discloses a hierarchical progressive domain adaptive cross-subject EEG decoding method, comprising: acquiring calibrated EEG data of the target subject and historical EEG data of the source subject; extracting representation vectors of source and target domain trials using a pre-trained EEG signal decoding model; determining source subject-level transfer weights based on the optimal transmission distance under class conditions in the representation space, and determining source trial-level transfer weights based on the target domain category prototype discrimination cost and the optimal transmission matching cost of the source trial local clusters; fusing the subject-level weights and trial-level weights, and then performing intra-class normalization, weight constraints, and progressive injection of training rounds into the model training process; further optimizing the source domain classification loss, domain adaptation loss, and intra-class constraint loss using the weights, and finally outputting the EEG signal decoding result. This invention can simultaneously preserve source domain information, hierarchically reduce interference from unsuitable source subjects and source trials, achieve smooth progressive training, and provide accurate cross-subject decoding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of brain-computer interface, EEG signal processing, pattern recognition and transfer learning, and specifically relates to a hierarchical progressive domain adaptive cross-subject EEG decoding method. Background Technology

[0002] Brain-computer interfaces (BCIs) can convert human brain electrical activity into control signals or intention tags that can be recognized by external devices, and have application value in scenarios such as motor rehabilitation training, assisted control, intelligent interaction, assisted communication, brain state monitoring, and clinical auxiliary analysis. Non-invasive EEG-based BCIs have the advantages of high temporal resolution and relatively easy deployment of acquisition devices, and are widely used for decoding subject intentions.

[0003] However, due to significant individual differences and the non-stationary nature of EEG, the decoding accuracy of EEG-based brain-computer interfaces drops sharply in real-world cross-subject scenarios. Significant individual differences exist among subjects in scalp electrode response, brain region activation patterns, frequency band energy distribution, and temporal characteristics. EEG signals are typically low signal-to-noise ratio, non-stationary physiological signals, and the same subject may be affected by factors such as fatigue level, attentional state, emotional state, and electrode contact status at different acquisition times. When an EEG decoding model trained on a source subject is directly transferred to a new target subject, it typically fails to maintain stable classification performance.

[0004] To reduce cross-subject variability, existing methods typically employ single-source-domain adaptation approaches, addressing the issue at three levels: sample, feature, and model. These strategies include source subject screening, source domain sample deletion, global distribution alignment, extraction of common inter-domain features, and model fine-tuning. While source subject screening can eliminate some ill-fitting source domains, it directly discards source samples that may still have local transfer value. Screening or weighting only at the subject level also fails to characterize reliability differences between different trials within the same source subject. Global distribution alignment usually assumes all source domain data has approximate transfer value, easily overlooking adaptation differences between different source subjects and the target subject under multi-source-domain conditions. Extracting common inter-domain features can decode model failures in scenarios with significant subject variability, while model fine-tuning requires calibration of the model using target subject data.

[0005] On the other hand, existing multi-source transfer methods often perform one-to-one single-source transfer between the target subject and each source subject before fusing the classification results, or treat multiple source subjects as a single source domain for distribution alignment, without simultaneously characterizing source-subject level fit and source-test subfit in a unified deep domain adaptation model. For non-stationary EEG data with cross-subject distribution shifts and inconsistent source-test sub-quality, relying solely on subject-level fusion or global alignment can easily introduce negative transfer.

[0006] Therefore, there is an urgent need for a cross-subject EEG signal decoding method that takes into account the retention of source domain information, the stratified reduction of interference from unsuitable source subjects and source trials, and the achievement of smooth and progressive training. Summary of the Invention

[0007] To address the problems existing in the prior art, this invention proposes a hierarchical progressive domain adaptive cross-subject EEG decoding method. This method aims to solve the subject-specific differences problem in existing EEG-based brain-computer interface rehabilitation devices, focusing on the insufficient utilization of trial transfer value differences within the same source subject and the early instability of deep domain adaptation training in cross-subject EEG signal decoding. By constructing source domain soft weights at both the subject level and trial level, this invention aims to suppress the interference of mismatched source data on the training of the target subject model while preserving effective source domain information.

[0008] To achieve the above-mentioned technical objectives, the present invention provides the following technical solution: A hierarchical, progressive domain-adaptive cross-subject EEG decoding method, which specifically includes the following steps: Acquire labeled calibrated EEG data from the target subjects and labeled historical EEG data from multiple sources of subjects; The EEG signal decoding model was pre-trained using labeled calibrated EEG data and labeled historical EEG data. After the pre-training was completed, the feature extractor in the EEG decoding model was used to extract the source domain trial representation vector from the labeled historical EEG data and the target domain trial representation vector from the labeled calibrated EEG data. Based on the source domain trial representation vector and the target domain trial representation vector, the category conditional distribution distance between each source subject and the target subject is determined; based on the category conditional distribution distance, the subject-level transfer weight of each source subject is determined. For each source domain trial of each source subject, the trial-level transfer weight of each source domain trial is determined based on the discriminant relationship between the source domain trial and the target domain category prototype, and the matching relationship between the local cluster of source domain trials and the distribution of target domain categories. The target domain category prototype is constructed based on the target domain trial representation vector of each category, and the local cluster of source domain trials is obtained by clustering based on the source domain trial representation vector. By combining the subject-level transfer weights and trial-level transfer weights, the source domain trial transfer weights for each source domain trial are obtained. Perform progressive domain adaptation training: During the training of the EEG signal decoding model, source domain trial transfer weights are progressively injected into the training process according to the training rounds to obtain the actual training weights under each training round. The actual training weights are used to weight the model loss and update the model parameters. After training, a cross-subject EEG signal decoding model is obtained. The EEG data to be decoded from the target subject is input into the cross-subject EEG signal decoding model to obtain the EEG signal decoding results.

[0009] Furthermore, the EEG signal decoding model adopts the basic GAT EEG decoding model; the preheating training is carried out under the condition that the actual training weights of each source domain trial are all set to 1; the source domain trial representation vector and the target domain trial representation vector are obtained by mean pooling processing of the feature sequence output by the feature extractor in the basic EEG decoding model.

[0010] Furthermore, the determination of the category conditional distribution distance between each source subject and the target subject based on the source domain trial representation vector and the target domain trial representation vector specifically involves: For any source subject, under each EEG signal category, the source domain trial representation vector set of the source subject and the target domain trial representation vector set of the target subject are obtained respectively. The optimal transmission distance between the source domain trial representation vector set and the target domain trial representation vector set under the same EEG signal category was calculated using the entropy regularized optimal transmission algorithm. Calculate the average of the optimal transmission distances between the source domain trial representation vector set and the target domain trial representation vector set for all EEG signal categories, and use this average as the category conditional distribution distance between the source subject and the target subject.

[0011] Furthermore, the determination of the participant-level transfer weight for each source participant based on the category conditional distribution distance specifically involves: For any source subject i, the initial subject-level transfer weight is determined based on the category conditional distribution distance. ,in, This represents the category-conditional distribution distance between source subject i and target subject i. The temperature parameter is used for the subject-level weight mapping. It is a natural exponential function; The initial subject-level transfer weights of each source subject are normalized and truncated to obtain the subject-level transfer weights of each source subject, expressed by the formula: ; in, This represents the subject-level transfer weight of the source subject i. These are the lower and upper limits of the subject-level transfer weights, respectively. For the number of source subjects, Indicates the source subject index; This indicates truncation.

[0012] Furthermore, for each source domain trial of each source subject, the trial-level transfer weight is determined based on the discriminant relationship between the source domain trial and the target domain category prototype, and the matching relationship between the local clusters of the source domain trials and the distribution of the target domain categories, as follows: For any source domain trial j, calculate the prototype discrimination cost. This characterizes the discriminative relationship between the prototype and the target domain category prototype; the formula for the prototype discriminative cost is expressed as: ; in, This represents the distance from the source domain trial j to the prototype of the same target domain category. This represents the minimum distance from the source domain trial j to the heterogeneous target domain category prototype. This is a preset constant; For any source domain trial j, calculate its local cluster. Local cluster distribution matching cost This characterizes the matching relationship between the local clusters of the source domain and the category distribution of the target domain; the formula for the matching cost of the local cluster distribution is expressed as: ; in, Represents local clusters The optimal transmission distance between trial representation vector sets of similar target domains Represents local clusters The minimum optimal transmission distance between the trial representation vector set of the heterogeneous target domain and the target domain; The prototype discrimination cost and the local cluster distribution matching cost are weighted and fused to obtain the fused cost. The formula is expressed as: ; in, , The preset fusion coefficient; Within each category of EEG signals, the fusion cost is further analyzed. Perform robust normalization and decay mapping to obtain the trial-level transfer weights of trial j in the source domain. .

[0013] Furthermore, the specific method for fusing the subject-level transfer weights and trial-level transfer weights to obtain the source domain trial transfer weights for each source domain trial is as follows: For any source domain trial j, the initial source domain trial transfer weight is determined based on the subject-level transfer weight of the source subject to which it belongs and its own trial-level transfer weight: ; in, This indicates the source subject to which the source domain trial j belongs. For the source subjects Subject-level transfer weights, Let the trial-level transition weights be the trial-level weights of the source domain trial j. Let be the initial source domain trial transition weights for trial j in the source domain; Then, within each EEG signal category, the initial source domain trial transfer weights are normalized and truncated to obtain the source domain trial transfer weights, expressed by the formula: ; in, This represents the set of source domain EEG trials under category c. For the source domain trial index, For source domain trial The initial source domain trial migration weights; Indicates truncation; and These represent the lower and upper bounds of the source domain migration weights for each trial, respectively. Let be the source domain trial transition weight for trial j in the source domain.

[0014] Furthermore, the step of progressively injecting source domain trial transfer weights into the training process according to the training rounds to obtain the actual training weights for each training round is specifically as follows: At the initial stage of training the EEG signal decoding model, uniform weights are applied to each source domain EEG trial. As the training rounds increase, the training weights gradually transition from uniform weights to source domain trial migration weights. In the e-th training round, the progressive injection coefficients of the weights are first calculated based on the current training round. Its formula is: ; in, This indicates the preset number of weighted progressive injection rounds. This indicates the proportion of source domain transfer weights injected in the current training round; Source domain trial In the The actual training weights in each training round are represented as follows: ; in, This represents the source domain trial transition weight for trial j in the source domain. Indicates the source domain trial number j in the th order. The actual training weights in each training round.

[0015] Furthermore, this application also discloses a hierarchical progressive domain adaptive cross-subject EEG decoding system, which is used to perform the method described above, specifically including: The data acquisition module is used to acquire labeled calibrated EEG data of the target subjects and labeled historical EEG data of multiple subjects. The preprocessing and representation extraction module is used to pre-train the EEG signal decoding model and determine the target domain trial representation vector and the source domain trial representation vector, respectively. The subject-level weight calculation module is used to determine the subject-level transfer weight of each source subject based on the category conditional distribution distance. The trial weight calculation module is used to determine the trial transfer weight of each source domain EEG trial by means of the target domain category prototype discrimination relationship and the source domain trial local cluster distribution matching relationship. The weight fusion module is used to determine the source domain trial weights of each source domain EEG trial based on the subject-level transfer weights and the trial-level transfer weights. A progressive training module is used to gradually introduce the source domain trial weights according to the training rounds to obtain a cross-subject EEG signal decoding model; The EEG decoding module is used to input the target EEG data to be decoded into the cross-subject EEG signal decoding model to obtain the EEG signal decoding result.

[0016] An electronic device is also disclosed, comprising a memory and a processor, wherein: Memory is used to store computer programs that can run on a processor; A processor, configured to execute, while running the computer program, a hierarchical progressive domain adaptive cross-subject EEG decoding method as described above.

[0017] Also disclosed is a computer-readable storage medium storing computer instructions for causing a processor to execute a hierarchical progressive domain adaptive cross-subject EEG decoding method as described above.

[0018] Based on the above technical solution, the present invention has at least the following beneficial effects: 1. This invention assigns different subject-level weights to different source subjects based on the optimal transmission distance of the category conditions, so that source subjects that are closer to the distribution of the target subjects can play a greater role in training; 2. This invention combines the target domain category prototype and local cluster distribution matching relationship at the source trial level to perform differentiated weighting, which can identify the transfer value of different trials within the same source subject; 3. This invention uses continuous soft weights instead of directly deleting source domain data, which can reduce the interference of unsuitable source trials while retaining potentially valuable local information. 4. This invention gradually injects target transfer weights into the training process from uniform weights, which can alleviate the instability problem of EEG signal decoding model and domain discriminator in the early stage of training; 5. This invention can serve as a general cross-subject EEG domain adaptation framework, which can be combined with GAT, graph convolutional networks, convolutional networks or other EEG signal decoding models, and is applicable to various EEG decoding tasks such as motor imagery, verbal imagery, emotion recognition, brain state recognition, rehabilitation training control and assisted communication. Attached Figure Description

[0019] Figure 1 This is a flowchart of the overall process of a hierarchical progressive domain adaptive cross-subject EEG decoding method proposed in this invention. Figure 2 This is a flowchart illustrating the calculation of subject-level transfer weights in the embodiment; Figure 3 This is a flowchart illustrating the trial secondary migration weight calculation in the example. Figure 4 This is a flowchart of the two-layer weight fusion and progressive training process in the embodiment; Figure 5 This is a block diagram of a hierarchical progressive domain adaptive cross-subject EEG decoding system proposed in this invention; Figure 6 The figures show the comparative experimental results in the examples. Detailed Implementation

[0020] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. This will allow for a full understanding and implementation of how the present application uses technical means to solve technical problems and achieve technical effects.

[0021] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0022] This embodiment discloses a hierarchical progressive domain-adaptive cross-subject EEG decoding method, which differs from existing cross-subject EEG decoding methods (including data layer transfer, feature layer transfer, and model layer transfer). The significant differences of the method proposed in this application are: First, it does not equally weight all source subjects, but assigns different subject-level soft weights to different source subjects based on the optimal transmission distance according to the category condition; Second, it does not directly delete source domain data, but reduces the training contribution of unsuitable source trials through successive trial weights; Third, it not only compares the overall distribution of source subjects, but also combines the target domain category prototype and the matching relationship of local cluster distribution of source trials to characterize the trial transfer value; Fourth, it progressively injects the final source trial weights into the domain adaptation training through training rounds to adapt to the problem of early feature space instability in deep EEG models. The above comparison of fit is not an independent evaluation result, but directly serves as the basis for subsequent weight calculation and training weighting: the category conditional distribution distance between the source subject and the target subject determines the subject-level weight, and the target domain category prototype and local cluster matching cost determine the trial-level weight. The fusion of these two types of weights further controls the contribution of the source domain trials to the final training loss. For example... Figure 1 As shown, the method specifically includes the following steps:

[0023] S1. Acquire labeled calibrated EEG data of the target subjects and labeled historical EEG data of multiple subjects;

[0024] In this preferred embodiment, the EEG data can be sourced from publicly available datasets, clinically collected data, rehabilitation training data, brain-computer interface control data, or personally collected data. Furthermore, depending on the specific application requirements, preprocessing operations such as filtering, artifact removal, trial segmentation, baseline correction, and standardization can be performed on the EEG data.

[0025] S2. The EEG signal decoding model is pre-trained using labeled calibrated EEG data and labeled historical EEG data. After the pre-training is completed, the feature extractor in the EEG decoding model is used to extract the source domain trial representation vector from the labeled historical EEG data and the target domain trial representation vector from the labeled calibrated EEG data. In the actual processing, the representation vectors can also be adaptively normalized.

[0026] In a preferred embodiment, the EEG signal decoding model uses the basic GAT (Global Adaptive Transformer) EEG decoding model, which includes a feature extractor, a global adapter, a domain discriminator, and a classifier. The feature extractor extracts trial features from the source and target domains and outputs corresponding trial representation vectors. The global adapter guides the source domain feature mapping based on the global correlation of target domain features. The domain discriminator performs adversarial distribution alignment between the source and target domains. The classifier outputs the EEG signal category. During training, an intra-class center constraint loss is set to constrain the aggregation of source and target domain features of the same category towards the target domain category center. The pre-training is performed with the actual training weights for each source domain trial set to 1. The source domain trial representation vectors and the target domain trial representation vectors are obtained by mean pooling the feature sequences output by the feature extractor in the basic EEG decoding model. Through pre-training, the fit between different source subjects and different source domain trials with the target subject can be compared in the representation space related to the target decoding task.

[0027] S3. Based on the source domain trial representation vector and the target domain trial representation vector, determine the category conditional distribution distance between each source subject and the target subject; based on the category conditional distribution distance, determine the subject-level transfer weight for each source subject.

[0028] As a preferred embodiment, in this embodiment, such as Figure 2 As shown, step S3 specifically involves:

[0029] For any source subject, under each EEG signal category, the source domain trial representation vector set of the source subject and the target domain trial representation vector set of the target subject are obtained respectively.

[0030] The optimal transmission distance between the source domain trial representation vector set and the target domain trial representation vector set under the same EEG signal category was calculated using the entropy regularized optimal transmission algorithm.

[0031] Calculate the average of the optimal transmission distances between the source domain trial representation vector set and the target domain trial representation vector set for all EEG signal categories, and use this average as the category conditional distribution distance between the source subject and the target subject; for source subject i, the category conditional distribution distance between it and the target subject is... Represented as:

[0032] ;

[0033] in, This represents the set of EEG signal categories, where c is the index of the EEG signal category. Represents the corresponding set of EEG trial representation vectors, with superscript indicating the number of trials. Indicates the source domain, superscript Indicates the target domain. This represents the set of EEG trial representation vectors for source subject i under category c. Represents the set of EEG trial representation vectors for the target domain trials under category c; This is the function for calculating the Sinkhorn distance, which is an optimal transmission distance.

[0034] For any source subject i, the initial subject-level transfer weight is determined based on the category conditional distribution distance. ,in, This represents the category-conditional distribution distance between source subject i and target subject i. The temperature parameter is used for the subject-level weight mapping. It is a natural exponential function;

[0035] The initial subject-level transfer weights of each source subject are normalized and truncated to obtain the subject-level transfer weights of each source subject, expressed by the formula:

[0036] ;

[0037] in, This represents the subject-level transfer weight of the source subject i. These are the lower and upper limits of the subject-level transfer weights, respectively. For the number of source subjects, Indicates the source subject index; This indicates truncation.

[0038] The lower and upper limits of the subject-level transfer weights mentioned above are preset parameters; in this embodiment, the lower and upper limits can be set to 0.3 and 2.0, respectively. The temperature parameter can be determined by the median of the conditional distribution distance of each source subject category.

[0039] Through the above processing, source subjects whose EEG representation distribution is closer to that of the target subject have higher subject-level transfer weights, while source subjects whose EEG representation distribution differs significantly from that of the target subject have lower subject-level transfer weights.

[0040] S4. For each source domain trial of each source subject, determine the trial-level transfer weight of each source domain trial based on the discriminant relationship between the source domain trial and the target domain category prototype, and the matching relationship between the local cluster of source domain trials and the distribution of target domain categories; the target domain category prototype is constructed based on the target domain trial representation vector of each category, and the local cluster of source domain trials is obtained by clustering based on the source domain trial representation vector;

[0041] As a preferred embodiment, in this embodiment, such as Figure 3 As shown, the calculation process of the trial migration weight is as follows:

[0042] First, construct the target domain category prototype; for any EEG signal category c, obtain the target subject's target domain trial representation vectors under that category, denoted as... ,in Represents the number of trials for the target domain under category c; for the set The target domain trial representation vectors are averaged element-wise along their vector dimensions to obtain the target domain category prototype corresponding to category c. It can be represented as:

[0043] ;

[0044] in, The category prototype of category c in the target domain is used to characterize the central representation of the target subject in that category. Each EEG signal category corresponds to a target domain category prototype. Let r be the target domain trial representation vector, where r is the target domain trial index;

[0045] Secondly, construct local clusters of source domain trials; for any EEG signal category c, obtain the source domain trial representation vectors of all source subjects under that category. The formula is expressed as:

[0046] ;

[0047] in, Indicates the number of trials in the source domain under category c; for The source domain trial representation vectors are clustered to obtain several source domain trial local clusters; the source domain trial local clusters refer to a local set of source domain trial representation vectors that are close in spatial distance and have high feature similarity within the same EEG signal category.

[0048] In this embodiment, clustering can be performed using K-means clustering or mini-batch K-means clustering. Specifically, the number of local clusters is preset. Alternatively, it can be determined based on the number of source domain trials under category c and the preset minimum cluster size. Then initialize For each cluster center, calculate the distance from each source domain trial representation vector to each cluster center, and assign it to the cluster containing the nearest cluster center; then update the cluster centers according to the mean of the source domain trial representation vectors within each cluster, and repeat the trial assignment and cluster center update process until the clustering result meets the convergence condition or reaches the preset number of iterations; thus, several source domain trial local clusters under category c are obtained.

[0049] Through the above processing, the target domain category prototype is used to characterize the central representation of each category of the target subject, and the source domain trial local cluster is used to characterize the local distribution structure of the source domain trials under the same category. Subsequently, the prototype discrimination cost is calculated based on the distance relationship between the source domain trials and the target domain category prototype, and the local cluster distribution matching cost is calculated based on the optimal transmission distance between the local cluster to which the source domain trial belongs and the target domain category distribution. That is, the transfer value is evaluated from two aspects: the target domain category prototype discrimination relationship and the local cluster distribution matching relationship.

[0050] For any source domain trial j, calculate the prototype discrimination cost. This characterizes the discriminative relationship between the prototype and the target domain category prototype; the formula for the prototype discriminative cost is expressed as:

[0051] ;

[0052] in, This represents the distance from the source domain trial j to the prototype of the same target domain category. This represents the minimum distance from the source domain trial j to the heterogeneous target domain category prototype. This is a preset constant used to improve numerical stability;

[0053] In this embodiment, the distance from the source domain trial to the target domain category prototype is the L2-normalized squared Euclidean distance between the source domain trial representation vector and the target domain category prototype.

[0054] Secondly, within each EEG signal category, the source domain EEG trial representations are clustered; for any source domain trial j, its local cluster is calculated. Local cluster distribution matching cost This characterizes the matching relationship between the local clusters of the source domain and the category distribution of the target domain; the formula for the matching cost of the local cluster distribution is expressed as:

[0055] ;

[0056] in, Represents local clusters The optimal transmission distance between trial representation vector sets of similar target domains Represents local clusters The minimum value of the optimal transmission distance between the trial representation vector set of the heterogeneous target domain and the target domain (the Sinkhorn distance can be calculated as in step S3);

[0057] The prototype discrimination cost and the local cluster distribution matching cost are weighted and fused to obtain the fused cost. The formula is expressed as:

[0058] ;

[0059] in, , The preset fusion coefficient;

[0060] Within each category of EEG signals, the fusion cost is further analyzed. Perform robust normalization and decay mapping: obtain the trial-level transfer weights of trial j in the source domain. ;

[0061] In this embodiment, the robust normalization is performed by normalizing the median and median absolute deviation of the fusion cost within the same category. The robust normalization formula is as follows:

[0062] ;

[0063] in, This represents the set of fusion costs for all source domain trials within category c. This represents the median absolute deviation of the set. When the median absolute deviation is too small, the standard deviation or a preset constant can be used instead. This represents the median of the set; The cost of integration after robust standardization;

[0064] The attenuation mapping is for values ​​greater than zero. Perform an exponential decay mapping, with the decay mapping formula as follows:

[0065]

[0066] in, To preset the lower limit of the trial migration weight, The temperature parameter is used for attenuation mapping; the upper limit of the trial migration weight is 1;

[0067] Therefore, source domain trials with lower costs (higher migration value) have higher trial-level migration weights, while source domain trials with higher costs have lower trial-level migration weights.

[0068] S5. Combine the subject-level transfer weights and trial-level transfer weights to obtain the source domain trial transfer weights for each source domain trial.

[0069] As a preferred embodiment, in this embodiment, such as Figure 4 As shown, step S5 specifically involves:

[0070] For any source domain trial j, the initial source domain trial transfer weight is determined based on the subject-level transfer weight of the source subject to which it belongs and its own trial-level transfer weight:

[0071] ;

[0072] in, This indicates the source subject to which the source domain trial j belongs. For the source subjects Subject-level transfer weights, Let the trial-level transition weights be the trial-level weights of the source domain trial j. Let be the initial source domain trial transition weights for trial j in the source domain;

[0073] To avoid an overall low weight for a particular category and an excessively high weight for a few source domain EEG trials, the initial source domain trial transfer weights are normalized and truncated within each EEG signal category to obtain the source domain trial transfer weights, expressed by the formula: ; in, This represents the set of source domain EEG trials under category c. For the source domain trial index, For source domain trial The initial source domain trial migration weights; Indicates truncation; and These represent the lower and upper bounds of the source domain migration weights for each trial, respectively. Let be the source domain trial transition weight for trial j in the source domain. and These are also preset hyperparameters, which can be set to 0.2 and 2.0 respectively in this embodiment.

[0074] In this application, source domain trial transfer weights are used to continuously adjust the contribution of different source domain trials to the training of the cross-subject EEG signal decoding model, rather than directly deleting some source domain data. Compared to directly deleting some source domain data, continuous soft weights can retain potentially valuable local information while reducing interference from ill-fitting source domain trials, reducing the risk of overfitting caused by a sudden decrease in sample size, thereby enhancing the generalization ability and decoding performance of the decoding model.

[0075] S6. Perform progressive domain adaptation training: During the training of the EEG signal decoding model, the source domain trial transfer weights are progressively injected into the training process according to the training rounds to obtain the actual training weights under each training round. The actual training weights are used to weight the model loss and update the model parameters. After training, a cross-subject EEG signal decoding model is obtained.

[0076] As a preferred embodiment, in this embodiment, such as Figure 4 As shown, step S6 specifically involves:

[0077] At the initial stage of training the EEG signal decoding model, uniform weights are applied to each source domain EEG trial. As the training rounds increase, the training weights gradually transition from uniform weights to source domain trial migration weights. In the e-th training round, the progressive injection coefficients of the weights are first calculated based on the current training round. Its formula is:

[0078] ;

[0079] in, This indicates the preset number of weighted progressive injection rounds. ∈[0,1] represents the proportion of source domain trial transfer weights injected in the current training round; ∈[0,1] represents the proportion of source domain trial transfer weights injected in the current training round. When hour, =0, and uniform weights are used for each source domain trial; as e gradually increases... Gradually increase, the source domain trial transfer weights gradually participate in training; when hour, =1, meaning that the actual training weights are completely transitioned to the source domain trial transfer weights;

[0080] Source domain trial The actual training weights in the e-th training round are represented as follows:

[0081] ;

[0082] in, This represents the source domain trial transition weight for trial j in the source domain. This represents the actual training weight of the source domain trial j in the e-th training round.

[0083] In each training round, actual training weights are used to weight the source domain terms in the source domain classification loss, domain adaptation loss, and intra-class constraint loss. This progressive weighting reduces the risk of misweighting in the early stages of training when the EEG representation space is not yet stable, thus improving the training stability of the cross-subject EEG signal decoding model.

[0084] In this embodiment, the source domain classification loss is the source domain trial classification cross-entropy loss. In progressive domain adaptation training, the original cross-entropy loss is weighted and normalized to an average according to the actual training weights. The source domain term in the domain adaptation loss is the source domain trial domain discrimination score. In progressive domain adaptation training, the original discrimination score is weighted and normalized to an average according to the actual training weights. For the intra-class center constraint loss, the target domain trial weight is set to 1, and the distance term from the source domain trial to the corresponding target domain class center is weighted according to the actual training weights.

[0085] The actual training weights are used for weighting the loss term, rather than for directly multiplying the weights by the original features to generate new weighted features.

[0086] S7. Input the EEG data to be decoded of the target subject into the cross-subject EEG signal decoding model to obtain the EEG signal decoding result (if the EEG signal decoding task is a motor imagery classification task, the EEG signal decoding result is the motor imagery category corresponding to the target subject).

[0087] This concludes the description of the entire process of the method proposed in this invention. Furthermore, this application also discloses a hierarchical progressive domain adaptive cross-subject EEG decoding system, which is used to perform the method described above, such as... Figure 5 As shown, it specifically includes:

[0088] The data acquisition module is used to acquire labeled calibrated EEG data of the target subjects and labeled historical EEG data of multiple subjects.

[0089] The preprocessing and representation extraction module is used to pre-train the EEG signal decoding model and determine the target domain trial representation vector and the source domain trial representation vector, respectively.

[0090] The subject-level weight calculation module is used to determine the subject-level transfer weight of each source subject based on the category conditional distribution distance.

[0091] The trial weight calculation module is used to determine the trial transfer weight of each source domain EEG trial by means of the target domain category prototype discrimination relationship and the source domain trial local cluster distribution matching relationship.

[0092] The weight fusion module is used to determine the source domain trial weights of each source domain EEG trial based on the subject-level transfer weights and the trial-level transfer weights.

[0093] A progressive training module is used to gradually introduce the source domain trial weights according to the training rounds to obtain a cross-subject EEG signal decoding model;

[0094] The EEG decoding module is used to input the target EEG data to be decoded into the cross-subject EEG signal decoding model to obtain the EEG signal decoding result.

[0095] An electronic device is also disclosed, comprising a memory and a processor, wherein:

[0096] Memory is used to store computer programs that can run on a processor;

[0097] A processor, configured to execute, while running the computer program, a hierarchical progressive domain adaptive cross-subject EEG decoding method as described above.

[0098] Also disclosed is a computer-readable storage medium storing computer instructions for causing a processor to execute a hierarchical progressive domain adaptive cross-subject EEG decoding method as described above.

[0099] To verify the effectiveness of the method of this invention, this embodiment also uses the BCI Competition IV 2a dataset (a classic publicly available brain-computer interface (BCI) dataset consisting of EEG data from 9 subjects, used for classification studies of four types of motor imagery tasks) to conduct a cross-subject EEG signal decoding experiment. This dataset contains EEG motor imagery data from 9 subjects, with task categories including left hand, right hand, both feet, and tongue. The experiment employs a leave-one-subject cross-subject setup, sequentially designating one subject as the target subject and the remaining 8 subjects as the source subjects.

[0100] The comparison model is the basic GAT model, and the improved model is the cross-subject EEG signal decoding method based on hierarchical source trial weights and progressive domain adaptation proposed in this invention. The evaluation metric is the highest classification accuracy achieved by each target subject during training, and the highest classification accuracy of the nine target subjects is averaged.

[0101] The highest classification accuracy per subject is, for example Figure 6 As shown, the average best classification accuracy of the basic GAT model on 9 target subjects was 81.52%, while the average best classification accuracy of the method of this invention was 82.56%, which is 1.04 percentage points higher than that of the basic GAT.

[0102] Under the same cross-subject setting, the method of this invention achieved a higher average best classification accuracy compared to the basic GAT. Experimental results show that by distinguishing the overall fit between different source subjects and target subjects at the source subject level, and further characterizing the transfer value of different trials within the same source subject at the source trial level, the interference of ill-fitting source domain data on model training can be reduced.

[0103] Meanwhile, progressive domain adaptation training gradually injects target transfer weights from uniform weights into the training process, mitigating the risk of misweighting in the early stages of training when the EEG representation space is not yet stable. These results support the ability of hierarchical source trial weights and progressive domain adaptation mechanisms to reduce the impact of negative transfer and improve the training stability and overall decoding performance of cross-subject EEG signal decoding models.

[0104] In summary, the method proposed in this invention is a cross-subject EEG signal decoding method that balances source domain information retention, hierarchical reduction of interference from mismatched source subjects and source trials, and achieves smooth and progressive training. It addresses the subject differences problem existing in current EEG-based brain-computer interface rehabilitation devices, and specifically solves the problems of insufficient utilization of trial transfer value differences within the same source subject and early instability in deep domain adaptation training during cross-subject EEG signal decoding. The method proposed in this invention, while preserving effective source domain information, suppresses interference from mismatched source data on the training of the target subject model. It can serve as a general cross-subject EEG domain adaptation framework, and can be combined with GAT, graph convolutional networks, convolutional networks, or other EEG signal decoding models. It is applicable to various EEG decoding tasks such as motor imagery, verbal imagery, emotion recognition, brain state recognition, rehabilitation training control, and assisted communication.

[0105] 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.

[0106] 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).

[0107] 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 hierarchical progressive domain adaptive cross-subject EEG decoding method, characterized in that, Specifically, the following steps are included: Acquire labeled calibrated EEG data from the target subjects and labeled historical EEG data from multiple sources of subjects; The EEG signal decoding model was pre-trained using labeled calibrated EEG data and labeled historical EEG data. After the pre-training was completed, the feature extractor in the EEG decoding model was used to extract the source domain trial representation vector from the labeled historical EEG data and the target domain trial representation vector from the labeled calibrated EEG data. Based on the source domain trial representation vector and the target domain trial representation vector, the category conditional distribution distance between each source subject and the target subject is determined. Based on the category conditional distribution distance, the subject-level transfer weight of each source subject is determined; For each source domain trial of each source subject, the trial-level transfer weight of each source domain trial is determined based on the discriminant relationship between the source domain trial and the target domain category prototype, and the matching relationship between the local clusters of the source domain trials and the distribution of the target domain categories. The target domain category prototype is constructed based on the target domain trial representation vector of each category, and the source domain trial local cluster is obtained by clustering based on the source domain trial representation vector. By combining the subject-level transfer weights and trial-level transfer weights, the source domain trial transfer weights for each source domain trial are obtained. Perform progressive domain adaptation training: During the training of the EEG signal decoding model, source domain trial transfer weights are progressively injected into the training process according to the training rounds to obtain the actual training weights under each training round. The actual training weights are then used to weight the model loss and update the model parameters. After training, a cross-subject EEG signal decoding model was obtained; The EEG data to be decoded from the target subject is input into the cross-subject EEG signal decoding model to obtain the EEG signal decoding results.

2. The hierarchical progressive domain adaptive cross-subject EEG decoding method according to claim 1, characterized in that, The EEG signal decoding model adopts the basic GAT EEG decoding model; the warm-up training is carried out under the condition that the actual training weight of each source domain trial is set to 1; the source domain trial representation vector and the target domain trial representation vector are obtained by mean pooling of the feature sequence output by the feature extractor in the basic EEG decoding model.

3. The hierarchical progressive domain adaptive cross-subject EEG decoding method according to claim 1, characterized in that, The determination of the category conditional distribution distance between each source subject and the target subject based on the source domain trial representation vector and the target domain trial representation vector is specifically as follows: For any source subject, under each EEG signal category, the source domain trial representation vector set of the source subject and the target domain trial representation vector set of the target subject are obtained respectively. The optimal transmission distance between the source domain trial representation vector set and the target domain trial representation vector set under the same EEG signal category was calculated using the entropy regularized optimal transmission algorithm. Calculate the average of the optimal transmission distances between the source domain trial representation vector set and the target domain trial representation vector set for all EEG signal categories, and use this average as the category conditional distribution distance between the source subject and the target subject.

4. The hierarchical progressive domain adaptive cross-subject EEG decoding method according to claim 1, characterized in that, The determination of the subject-level transfer weight for each source subject based on the category conditional distribution distance is specifically as follows: For any source subject i, the initial subject-level transfer weight is determined based on the category conditional distribution distance. ,in, This represents the category-conditional distribution distance between source subject i and target subject i. The temperature parameter is used for the subject-level weight mapping. It is a natural exponential function; The initial subject-level transfer weights of each source subject are normalized and truncated to obtain the subject-level transfer weights of each source subject, expressed by the formula: ; in, This represents the subject-level transfer weight of the source subject i. These are the lower and upper limits of the subject-level transfer weights, respectively. For the number of source subjects, Indicates the source subject index; This indicates truncation.

5. The hierarchical progressive domain adaptive cross-subject EEG decoding method according to claim 1, characterized in that, For each source domain trial for each source subject, the trial-level transfer weight for each source domain trial is determined based on the discriminant relationship between the source domain trial and the target domain category prototype, and the matching relationship between the local clusters of the source domain trials and the distribution of the target domain categories, as follows: For any source domain trial j, calculate the prototype discrimination cost. This characterizes the discriminative relationship between the prototype and the target domain category prototype; the formula for the prototype discriminative cost is expressed as: ; in, This represents the distance from the source domain trial j to the prototype of the same target domain category. This represents the minimum distance from the source domain trial j to the heterogeneous target domain category prototype. This is a preset constant; For any source domain trial j, calculate its local cluster. Local cluster distribution matching cost This characterizes the matching relationship between the local clusters of the source domain and the category distribution of the target domain; the formula for the matching cost of the local cluster distribution is expressed as: ; in, Represents local clusters The optimal transmission distance between trial representation vector sets of similar target domains Represents local clusters The minimum optimal transmission distance between the trial representation vector set of the heterogeneous target domain and the target domain; The prototype discrimination cost and the local cluster distribution matching cost are weighted and fused to obtain the fused cost. The formula is expressed as: ; in, , The preset fusion coefficient; Within each category of EEG signals, the fusion cost is further analyzed. Perform robust normalization and decay mapping to obtain the trial-level transfer weights of trial j in the source domain. .

6. The hierarchical progressive domain adaptive cross-subject EEG decoding method according to claim 1, characterized in that, The fusion of subject-level transfer weights and trial-level transfer weights to obtain the source domain trial transfer weights for each source domain trial is as follows: For any source domain trial j, the initial source domain trial transfer weight is determined based on the subject-level transfer weight of the source subject to which it belongs and its own trial-level transfer weight: ; in, This indicates the source subject to which the source domain trial j belongs. For the source subjects Subject-level transfer weights, Let the trial-level transition weights be the trial-level weights of the source domain trial j. Let be the initial source domain trial transition weights for trial j in the source domain; Then, within each EEG signal category, the initial source domain trial transfer weights are normalized and truncated to obtain the source domain trial transfer weights, expressed by the formula: ; in, This represents the set of source domain EEG trials under category c. For the source domain trial index, For source domain trial The initial source domain trial migration weights; Indicates truncation; and These represent the lower and upper bounds of the source domain migration weights for each trial, respectively. Let be the source domain trial transition weight for trial j in the source domain.

7. The hierarchical progressive domain adaptive cross-subject EEG decoding method according to claim 1, characterized in that, The step of progressively injecting source domain trial transfer weights into the training process according to the training rounds to obtain the actual training weights under each training round is as follows: At the initial stage of training the EEG signal decoding model, uniform weights are applied to each source domain EEG trial. As the training rounds increase, the training weights gradually transition from uniform weights to source domain trial migration weights. In the e-th training round, the progressive injection coefficients of the weights are first calculated based on the current training round. Its formula is: ; in, This indicates the preset number of weighted progressive injection rounds. This indicates the proportion of source domain transfer weights injected in the current training round; Source domain trial In the The actual training weights in each training round are represented as follows: ; in, This represents the source domain trial transition weight for trial j in the source domain. Indicates the source domain trial number j in the th order. The actual training weights in each training round.

8. A hierarchical progressive domain adaptive cross-subject EEG decoding system, the system being used to perform the method as described in any one of claims 1-7, characterized in that, Specifically, it includes: The data acquisition module is used to acquire labeled calibrated EEG data of the target subjects and labeled historical EEG data of multiple subjects. The preprocessing and representation extraction module is used to pre-train the EEG signal decoding model and determine the target domain trial representation vector and the source domain trial representation vector, respectively. The subject-level weight calculation module is used to determine the subject-level transfer weight of each source subject based on the category conditional distribution distance. The trial weight calculation module is used to determine the trial transfer weight of each source domain EEG trial by means of the target domain category prototype discrimination relationship and the source domain trial local cluster distribution matching relationship. The weight fusion module is used to determine the source domain trial weights of each source domain EEG trial based on the subject-level transfer weights and the trial-level transfer weights. A progressive training module is used to gradually introduce the source domain trial weights according to the training rounds to obtain a cross-subject EEG signal decoding model; The EEG decoding module is used to input the target EEG data to be decoded into the cross-subject EEG signal decoding model to obtain the EEG signal decoding result.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, wherein: Memory is used to store computer programs that can run on a processor; A processor, configured to, while running the computer program, execute a hierarchical progressive domain adaptive cross-subject EEG decoding method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute a hierarchical progressive domain adaptive cross-subject EEG decoding method as described in any one of claims 1-7.