Cross-subject intracranial electroencephalogram decoding method and system based on transfer learning

CN122734656APending Publication Date: 2026-09-11XINSHENG VISION (BEIJING) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611223116.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-13
Publication Date
2026-09-11

AI Technical Summary

Technical Problem

[0005]本发明提供一种基于迁移学习的跨被试颅内脑电解码方法及系统,用以解决现有技术中不同被试颅内脑电电极通道异构导致模型难以跨被试复用、新被试迁移数据需求大且收敛慢、跨任务复用能力不足以及环形视觉属性解码存在边界不连续误差的缺陷,实现异构电极通道的显式对齐、新被试的少样本快速迁移、跨任务的灵活复用以及环形视觉属性的鲁棒解码

Benefits of technology

[0018]This invention provides a cross-subject intracranial EEG decoding method and system based on transfer learning. It acquires intracranial EEG data and corresponding task labels from multiple source subjects, where each source subject has a different number of electrode channels, resulting in heterogeneous channel EEG data for each source subject. A channel projection adapter is constructed for each source subject, and using the heterogeneous channel EEG data, the electrode channel dimension of that subject is projected onto a preset unified shared channel dimension through the corresponding channel projection adapter, resulting in fixed-shape shared input data for each source subject. This fixed-shape shared input data is then input into a multi-scale temporal-global spatial shared core for feature extraction, yielding reusable temporal-spatial features across subjects. The temporal-spatial features are decoded using a multi-task decoding head to obtain prediction results. Based on the heterogeneous channel EEG data and the task labels of each source subject, the system generates heterogeneous channel EEG data. Using the task labels and the prediction results, the channel projection adapter, the shared core, and the multi-task decoding head are jointly trained to obtain pre-trained shared core parameters. Based on the pre-trained shared core parameters, a target channel projection adapter is constructed for the target subject, and the task heads in the multi-task decoding head are reconfigured according to the label space of the target task. The reconfiguration includes determining the output dimension and type of the task head and initializing the task head parameters. The task head includes a classification head and a circumgression head. Using the intracranial EEG data of the target subject, and according to the selected fine-tuning strategy, the parameters in the target channel projection adapter, the task head, and the shared core determined according to the fine-tuning strategy are rapidly fine-tuned to obtain the adapted target decoding model. The intracranial EEG data of the target subject is input into the target decoding model for decoding to obtain the intracranial EEG decoding results of the target subject. Compared to existing technologies, which suffer from drawbacks such as the heterogeneity of intracranial EEG electrode channels among different subjects, making it difficult to reuse the model across subjects, requiring large amounts of data for new subjects with slow convergence, insufficient cross-task reuse capability, and boundary discontinuity errors in the decoding of ring visual attributes, this solution achieves explicit alignment of heterogeneous electrode channels, rapid transfer of small samples from new subjects, flexible cross-task reuse, and robust decoding of ring visual attributes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122734656A_ABST
    Figure CN122734656A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of brain-computer interface and neural signal processing, and provides a cross-subject intracranial electroencephalogram decoding method and system based on transfer learning, comprising: acquiring heterogeneous channel intracranial electroencephalogram data and task labels of multiple source subjects; projecting the electrode channel dimension of each source subject to a unified shared channel dimension through a channel projection adapter, extracting cross-subject reusable time-space features through a shared core, and obtaining a prediction result through a multi-task decoding head; jointly training the adapter, the shared core and the decoding head of each source subject to obtain pre-training shared core parameters; constructing a target adapter for a target subject and reconfiguring a task head, performing fast fine-tuning on the target adapter, the task head and the shared core to obtain a target decoding model, and decoding the data of the target subject to obtain an intracranial electroencephalogram decoding result. The present application realizes explicit alignment of heterogeneous electrode channels, fast migration of new subjects with few samples, flexible reuse across tasks and robust decoding of ring visual attributes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of brain-computer interface and neural signal processing technology, and in particular to a cross-subject intracranial EEG decoding method and system based on transfer learning. Background Technology

[0002] Invasive intracranial electroencephalography (iEEG) signals, with their millisecond-level temporal resolution and high spatial resolution, have been widely used in fields such as preoperative epilepsy assessment, visual attribute decoding, motor intention recognition, and cognitive neuroscience research. With the development of deep learning technology, single-subject iEEG decoding models based on convolutional neural networks, recurrent neural networks, and attention mechanisms have achieved significant improvements in classification accuracy and regression precision.

[0003] However, in real-world clinical and research settings, electrode implantation protocols vary significantly among different subjects, including differences in the number of electrodes, implantation location, covered brain regions, and signal quality. This makes it difficult to directly reuse decoding models trained for a single subject across different subjects. To achieve cross-subject transfer, existing technologies typically employ methods such as fixed lead structures, electrode-by-electrode feature tokenization, location encoding, or subject-specific output layers to address electrode differences. While these methods can utilize spatial information to some extent, they still lack a unified, lightweight, and easily deployable transfer framework to address issues such as inconsistent channel numbers, non-standardized implantation locations, and variable target task labels in intracranial EEG scenarios. Furthermore, for ring-shaped visual attributes such as hue and orientation, existing methods often employ direct classification or direct regression of angle values, which easily introduces discontinuity errors at the 0° / 360° boundaries and fails to fully utilize ring-shaped adjacency relationships.

[0004] Therefore, there is an urgent need for an intracranial EEG decoding scheme that can adapt to heterogeneous electrode inputs, support rapid transfer of small samples, and take into account cross-task reuse and robust decoding of ring visual attributes. Summary of the Invention

[0005] This invention provides a cross-subject intracranial EEG decoding method and system based on transfer learning, which addresses the shortcomings of existing technologies such as the difficulty of model reuse across subjects due to heterogeneity of intracranial EEG electrode channels in different subjects, large data requirements and slow convergence for new subjects, insufficient cross-task reuse capability, and boundary discontinuity errors in the decoding of ring visual attributes. It achieves explicit alignment of heterogeneous electrode channels, rapid transfer of small samples from new subjects, flexible reuse across tasks, and robust decoding of ring visual attributes.

[0006] This invention provides a cross-subject intracranial EEG decoding method based on transfer learning, comprising: Intracranial EEG data and corresponding task labels were obtained from multiple source subjects, with each source subject having a different number of electrode channels, resulting in heterogeneous channel EEG data for each source subject. For each source subject, a channel projection adapter is constructed. Using the heterogeneous channel EEG data of each source subject, the electrode channel dimension of the subject is projected to the preset unified shared channel dimension through the corresponding channel projection adapter to obtain the fixed-shape shared input data corresponding to each source subject. The fixed-shape shared input data corresponding to each source subject is input into the multi-scale temporal-global spatial shared core for feature extraction, resulting in reusable temporal-spatial features across subjects; The temporal-spatial features are decoded using a multi-task decoding head to obtain the prediction results; Based on the heterogeneous channel EEG data, task labels and prediction results of each source subject, the channel projection adapter, the shared core and the multi-task decoder are jointly trained to obtain pre-trained shared core parameters. Based on the pre-trained shared core parameters, a target channel projection adapter is constructed for the target subject, and the task head in the multi-task decoding head is reconfigured according to the label space of the target task. The reconfiguration includes determining the output dimension and type of the task head and initializing the task head parameters. The task head includes a classification head and a circumferential regression head. Using the intracranial EEG data of the target subject, and according to the selected fine-tuning strategy, the parameters in the target channel projection adapter, the task head, and the shared core determined according to the fine-tuning strategy are rapidly fine-tuned to obtain the adapted target decoding model. The intracranial EEG data of the target subject is input into the target decoding model for decoding to obtain the intracranial EEG decoding result of the target subject.

[0007] In one possible implementation, the method further includes: The channel projection adapter is an anatomical prior gating adapter; Obtain the electrode MNI coordinates and ROI labels for each source subject; The electrode MNI coordinates of each source subject are hierarchically clustered according to the ROI label to obtain an anatomical anchor point and its corresponding dominant ROI label, which are equal in number to the dimension of the unified shared channel. The Gaussian distance prior is calculated based on the Euclidean distance between each source test electrode and the anatomical anchor point, and a preset reward coefficient or penalty coefficient is applied to the Gaussian distance prior based on the consistency between the electrode ROI label and the dominant ROI label to obtain the ROI modulation term. A gating matrix is ​​generated based on the distance prior and the ROI modulation term. The gating matrix is ​​then used to constrain the projection weights of the channel projection adapter to obtain the anatomical prior gating adapter. The formula for calculating the Gaussian distance prior is as follows: ; in, The prior is Gaussian distance, σ is the Gaussian bandwidth parameter, and e i For the electrode and a j For anchor points; The ROI modulation formula is as follows: ; Where, r i The ROI label to which the i-th electrode belongs; ρ j The dominant ROI label for the j-th anatomical anchor point; [·] is an indicator function, which takes the value 1 if the condition in parentheses is true, and 0 otherwise; β is the ROI consistency reward coefficient, and δ is the ROI incompatibility penalty coefficient.

[0008] In one possible implementation, the method further includes: The multi-scale temporal-global spatial sharing core includes a multi-scale temporal branch and a global spatial aggregation layer; The fixed-shape shared input data is processed in parallel by performing multiple temporal convolutions at different scales through the multi-scale temporal branches to obtain multi-scale temporal features; The multi-scale temporal features are concatenated along the channel dimension by the global spatial aggregation layer, and then global spatial convolution is performed to aggregate cross-channel information to obtain the temporal-spatial features.

[0009] In one possible implementation, the method further includes: The prediction results include discrete classification prediction results and / or circumferential unit vector regression prediction results; The multi-task decoding head includes a classification head and a circumferential regression head; The classification head outputs prediction scores for each category based on the temporal-spatial features, thus obtaining the discrete classification prediction results. The circular regression head outputs a two-dimensional prediction vector based on the temporal-spatial features, and the two-dimensional prediction vector is normalized to obtain a circular unit vector as the circular unit vector regression prediction result.

[0010] In one possible implementation, the method further includes: Based on the heterogeneous channel EEG data, the task labels, and the prediction results of each source subject, training batches are sampled alternately or in combination on each source subject; Based on the heterogeneous channel EEG data and task labels corresponding to the training batch, calculate the classification cross-entropy loss and / or the circumferential unit vector regression loss. The parameters of the channel projection adapter, the shared core, and the multi-task decoder are updated based on the classification cross-entropy loss and / or circular unit vector regression loss, and the shared core parameters with the best verification performance are saved as the pre-trained shared core parameters.

[0011] In one possible implementation, the method further includes: Based on the temporal-spatial features and corresponding task labels extracted by the shared core for each source subject, the cross-subject manifold alignment loss is calculated. The cross-subject manifold alignment loss is used to constrain the temporal-spatial features of similar samples in different subjects to be close to each other in the shared representation space, while the temporal-spatial features of dissimilar samples are far apart from each other.

[0012] In one possible implementation, the method further includes: Based on the amount of intracranial EEG data of the target subjects and the differences between the source task and the target task in output dimension and / or task type, a target fine-tuning strategy is selected from multiple preset fine-tuning strategies. Rapid fine-tuning is then performed on the parameters of the target channel projection adapter, the task head, and the shared core, determined according to the target fine-tuning strategy, to obtain the adapted target decoding model. The difference in output dimension refers to the difference in the number of output paths required by the task head for the target task compared to the number of output paths required by the task head for the source task. The difference in task type refers to the target task and the source task belonging to different task types within discrete classification and circular regression tasks, respectively. The multiple preset fine-tuning strategies include training only the task head, training only the target channel projection adapter, training both the target channel projection adapter and the task head simultaneously, training some or all parameters of the target channel projection adapter, the task head, and the shared core, or progressively unfreezing network parameters from the output end to the input end in a hierarchical manner, setting smaller learning rates for layers closer to the input end.

[0013] In one possible implementation, the method further includes: The task labels include discrete category labels and / or continuous circular labels represented as two-dimensional unit vectors, which are used to characterize the annular visual attributes of hue and / or orientation.

[0014] This invention also provides a cross-subject intracranial EEG decoding system based on transfer learning, comprising the following modules: The multi-subject data management module is used to acquire intracranial EEG data and corresponding task tags from multiple source subjects. Each source subject has a different number of electrode channels, resulting in heterogeneous channel EEG data for each source subject. The channel projection adapter module is used to build a channel projection adapter for each source subject. Using the heterogeneous channel EEG data of each source subject, the electrode channel dimension of the subject is projected to the preset unified shared channel dimension through the corresponding channel projection adapter to obtain the fixed-shape shared input data corresponding to each source subject. The shared core module is used to input the fixed-shape shared input data corresponding to each source subject into the multi-scale temporal-global spatial shared core for feature extraction, so as to obtain reusable temporal-spatial features across subjects. The multi-task decoding head module is used to decode the temporal-spatial features through the multi-task decoding head to obtain the prediction result; The training and transfer control module is used to jointly train the channel projection adapter, the shared core, and the multi-task decoder based on the heterogeneous channel EEG data, the task labels, and the prediction results of each source subject, so as to obtain pre-trained shared core parameters. The training and transfer control module is also used to construct a target channel projection adapter for the target subject based on the pre-trained shared core parameters, and to reconfigure the task head in the multi-task decoding head according to the label space of the target task. The reconfiguration includes determining the output dimension and type of the task head and initializing the task head parameters. The task head includes a classification head and a circumferential regression head. Using the intracranial EEG data of the target subject, and according to the selected fine-tuning strategy, the module performs rapid fine-tuning on the target channel projection adapter, the task head, and the parameters in the shared core determined according to the fine-tuning strategy to obtain the adapted target decoding model. The decoding output module is used to input the intracranial EEG data of the target subject into the target decoding model for decoding, and obtain the intracranial EEG decoding result of the target subject.

[0015] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the cross-subject intracranial EEG decoding method based on transfer learning as described above.

[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the cross-subject intracranial EEG decoding method based on transfer learning as described above.

[0017] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the cross-subject intracranial EEG decoding method based on transfer learning as described above.

[0018] This invention provides a cross-subject intracranial EEG decoding method and system based on transfer learning. It acquires intracranial EEG data and corresponding task labels from multiple source subjects, where each source subject has a different number of electrode channels, resulting in heterogeneous channel EEG data for each source subject. A channel projection adapter is constructed for each source subject, and using the heterogeneous channel EEG data, the electrode channel dimension of that subject is projected onto a preset unified shared channel dimension through the corresponding channel projection adapter, resulting in fixed-shape shared input data for each source subject. This fixed-shape shared input data is then input into a multi-scale temporal-global spatial shared core for feature extraction, yielding reusable temporal-spatial features across subjects. The temporal-spatial features are decoded using a multi-task decoding head to obtain prediction results. Based on the heterogeneous channel EEG data and the task labels of each source subject, the system generates heterogeneous channel EEG data. Using the task labels and the prediction results, the channel projection adapter, the shared core, and the multi-task decoding head are jointly trained to obtain pre-trained shared core parameters. Based on the pre-trained shared core parameters, a target channel projection adapter is constructed for the target subject, and the task heads in the multi-task decoding head are reconfigured according to the label space of the target task. The reconfiguration includes determining the output dimension and type of the task head and initializing the task head parameters. The task head includes a classification head and a circumgression head. Using the intracranial EEG data of the target subject, and according to the selected fine-tuning strategy, the parameters in the target channel projection adapter, the task head, and the shared core determined according to the fine-tuning strategy are rapidly fine-tuned to obtain the adapted target decoding model. The intracranial EEG data of the target subject is input into the target decoding model for decoding to obtain the intracranial EEG decoding results of the target subject. Compared to existing technologies, which suffer from drawbacks such as the heterogeneity of intracranial EEG electrode channels among different subjects, making it difficult to reuse the model across subjects, requiring large amounts of data for new subjects with slow convergence, insufficient cross-task reuse capability, and boundary discontinuity errors in the decoding of ring visual attributes, this solution achieves explicit alignment of heterogeneous electrode channels, rapid transfer of small samples from new subjects, flexible cross-task reuse, and robust decoding of ring visual attributes. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating the cross-subject intracranial EEG decoding method based on transfer learning provided by the present invention.

[0021] Figure 2This is a schematic diagram of the overall data flow of the cross-subject intracranial EEG decoding method based on transfer learning provided by the present invention.

[0022] Figure 3 This is a schematic diagram of the channel projection adapter and anatomical prior gating provided by the present invention.

[0023] Figure 4 This is a flowchart of the joint pre-training in stage A and the target fine-tuning in stage B provided by the present invention.

[0024] Figure 5 This is a schematic diagram of cross-task migration and shared representation alignment provided by the present invention.

[0025] Figure 6 This is a schematic diagram of the structure of the cross-subject intracranial EEG decoding system based on transfer learning provided by the present invention.

[0026] Figure 7 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0028] To facilitate understanding of the embodiments of the present invention, further explanations and descriptions will be provided below with reference to the accompanying drawings and specific embodiments. These embodiments do not constitute a limitation on the embodiments of the present invention.

[0029] Figure 1 This is a flowchart illustrating the cross-subject intracranial EEG decoding method based on transfer learning provided by the present invention, as shown below. Figure 1 As shown, the method includes the following: S11. Obtain intracranial EEG data and corresponding task labels from multiple source subjects, where the number of electrode channels is different for each source subject, thus obtaining heterogeneous channel EEG data for each source subject.

[0030] In this embodiment of the invention, intracranial electroencephalography (iEEG) data from multiple source subjects are acquired, including but not limited to stereotactic electroencephalography (sEEG), electrocorticography (ECoG), and deep electrode arrays. The intracranial electroencephalography data of each subject are organized as tensors. Where B is the batch size. The number of electrode channels for the subject is denoted by T, and the number of time sampling points is denoted by T. Simultaneously, corresponding task labels are acquired. Task labels include discrete category labels and / or continuous circular labels represented as two-dimensional unit vectors. Continuous circular labels are used to characterize annular visual attributes such as hue and / or orientation, for example, represented in the form of (cosθ, sinθ).

[0031] S12. Construct a channel projection adapter for each source subject. Using the heterogeneous channel EEG data of each source subject, project the electrode channel dimension of the subject to a preset unified shared channel dimension through the corresponding channel projection adapter to obtain the fixed-shape shared input data corresponding to each source subject.

[0032] For each source subject s, a trainable channel projection adapter is constructed, with a trainable channel projection matrix W. s The dimension is C shared ×C in C shared To unify the shared channel dimension; in one embodiment, C shared =30, at this time W s The dimension is 30×C in Project the input channel dimension to a unified shared channel dimension. The formula is as follows:

[0033] in, For all subjects, the shared core only receives samples of a fixed shape. Therefore, subsequent network parameters can be strictly shared among all subjects.

[0034] In one implementation, when the subject has electrode MNI coordinates With ROI tag At that time, the channel projection adapter is an anatomically prior gated adapter. The system first collects the source subject electrode coordinates and performs hierarchical clustering according to ROI to obtain... anatomical anchor points and its dominant ROI tag p j Then, the electrode e i With anchor point a j The formula for calculating the distance prior is as follows: in, For distance prior, σ is the Gaussian bandwidth parameter.

[0035] Furthermore, the distance prior can be modulated based on whether the ROIs are consistent, as shown in the following formula:

[0036] Where, r i The ROI label to which the i-th electrode belongs; ρ j The dominant ROI label for the j-th anatomical anchor point; [·] represents the indicator function, which takes the value 1 if the condition in parentheses is true, and 0 otherwise; β is the ROI consistency reward coefficient (scalar hyperparameter, β>0), and δ is the ROI incompatibility penalty coefficient (scalar hyperparameter, δ<0).

[0037] The gate matrix is ​​obtained by softmax normalization and used for modulation adapter projection:

[0038] in, The prior logarithmic matrix (dimension C) of subject s is calculated from the above formula on an electrode-anchor basis. in ×C shared ); softmax(·, dim=-1) represents normalization along the anchor point (shared channel) dimension; G s The resulting gate matrix (dimension C) in ×C shared ), It is transposed; W s The channel projection matrix of subject s (dimension C) shared ×C in ); γ is the learnable scaling factor, ⊙ represents element-wise multiplication, X s For the input tensor, X′ s This serves as the input for the shared channel after projection. This structure retains the data-driven learning capability while utilizing the consistency between anatomical distance and ROI to provide prior constraints for projection.

[0039] In the adapter forward propagation, the gating matrix and the channel projection matrix jointly determine the channel projection, enabling the model to utilize anatomical priors while also learning individualized corrections based on target subject data. This implementation is particularly suitable for scenarios with relatively complete electrode coordinates and a small number of target training trials.

[0040] S13. Input the fixed-shape shared input data corresponding to each source subject into the multi-scale temporal-global spatial shared core for feature extraction to obtain reusable temporal-spatial features across subjects.

[0041] Shared core receives uniform shape This includes multi-scale temporal branches, global spatial aggregation convolutions, and flattening regularization layers. The multi-scale temporal branches can employ K parallel temporal convolutional branches (e.g., K=3, with kernel widths of 128, 64, and 32 sampling points respectively, each branch having 8 output channels and a pooling factor of 8); the outputs of each branch are concatenated along the channel dimension and then processed by a kernel of size... A global spatial convolution of ×1 is used to aggregate the shared channel dimensions in one step, resulting in cross-channel temporal-spatial features f. This shared core is used to learn reusable neural representations across subjects, avoiding the need for each subject to learn the complete model individually, thereby improving transfer efficiency and generalization ability.

[0042] S14. The temporal-spatial features are decoded using a multi-task decoding head to obtain the prediction result.

[0043] The temporal-spatial features f shared by the core output are fed into the multi-task decoding head. This multi-task decoding head includes a classification head and a circumferential regression head. The classification head outputs Ncls-way prediction scores (logits) for discrete category prediction (e.g., outputting 7-way or other number of category logits in the embodiment); the circumferential regression head outputs a two-dimensional prediction vector and performs L2 normalization to represent circular visual attributes such as hue and orientation. ,

[0044] Where, p xy The θ is the unit vector obtained by L2 normalizing the two-dimensional vector output by the circumferential regression head; pred The predicted angle (hue / orientation) represented by this unit vector; cosθ pred sinθ pred For p xy Two components; ||·|2 is the L2 norm, ||p xy ||2=1 indicates that it lies on the unit circle.

[0045] Representing angles using a two-dimensional vector on the unit circle avoids the discontinuity error caused by directly regressing angle values ​​at the 0° / 360° boundary, while preserving the circular adjacency relationship.

[0046] S15. Based on the heterogeneous channel EEG data of each source subject, the task labels and the prediction results, jointly train the channel projection adapter, the shared core and the multi-task decoder to obtain pre-trained shared core parameters.

[0047] Mini-batches are sampled alternately or in combination from multiple source subjects to jointly optimize the source subject adapter, shared core, and task head. The joint training loss can be written as:

[0048] Among them, Ltotal For the total loss, For classification cross-entropy loss, For circular unit vector regression loss, For optional cross-subject manifold alignment loss, logits is the unnormalized class score output by the classification head; y is the ground truth of the discrete class label; xy target λ represents the truth value of the circular label (a two-dimensional unit vector). hue λ is the weighting coefficient for the circular regression loss (scalar hyperparameter, ≥0); align Here are the manifold alignment loss weights (scalar hyperparameters, ≥0). Manifold alignment encourages similar samples from different participants to be close together in the shared space and dissimilar samples to be far apart, thereby improving the robustness of the shared core to participant identity.

[0049] Among them, f i a Let f be the temporal-spatial feature vector obtained from the i-th sample of source subject a through the shared core. j b The corresponding feature of the j-th sample of the source subject b; "same category / different category" refers to the sample pair having the same / different category labels; λ represents the Euclidean distance, or L2 distance, between two samples that share a representation vector, where mean is the average of the corresponding sample pairs; neg is the weight coefficient of the outlier (negative sample pair) term (scalar hyperparameter, ≥0); m is the interval threshold (scalar hyperparameter, >0), min(·,m) cuts off the distance of negative sample pairs at m.

[0050] During training, the shared core parameters with the best verification performance are saved as the pre-trained shared core parameters.

[0051] S16. Based on the pre-trained shared core parameters, construct a target channel projection adapter for the target subject, and reconfigure the task head in the multi-task decoding head according to the label space of the target task. Using the intracranial EEG data of the target subject, perform rapid fine-tuning on the target channel projection adapter, the task head, and the parameters in the shared core determined according to the fine-tuning strategy, to obtain the adapted target decoding model.

[0052] Load pre-trained shared core parameters to build a new target adapter for the target subjects. (dimension is) × ), and configure or rebuild the task header according to the target task. Select fine-tuning strategies based on the amount of data from the target participants and the differences from the task, including: head_only: Only trains the task head, suitable for scenarios where there is very little target data and the differences between tasks are mainly reflected in the output layer; adapter_only: Only trains the target adapter, suitable for scenarios where the electrode layout of the target subjects is very different but the task is the same; adapter_head: Trains both the target adapter and the task head simultaneously, serving as the default strategy for few-sample cross-subject transfer. adapter_full: All or some of the parameters of the training target adapter, task header and shared core, suitable for scenarios with sufficient target data or large task differences; progressive: Unfreezes the layers in a hierarchical manner, balancing target adaptation with prevention of catastrophic forgetting. In the initial stage, only the target adapter and task head are trained. Once the validation loss reaches a plateau, the spatial aggregation layer and temporal branch layer near the output are unfrozen sequentially, with smaller learning rates set for layers closer to the input. , Where k is the stage number of the gradual thawing (k=1,2,…); Θ k Θ k-1 These represent the sets of trainable parameters for the k-th and (k-1)-th stages, respectively; L is the total number of layers in the network that can be unfrozen. L-k This represents counting the k-th layer from the output to the input; params(·) indicates taking the parameters of that layer, ∪ is the union of sets; lr k Let lr be the learning rate for the k-th stage. base η is the baseline learning rate. decay The learning rate decay coefficient (0 < η) decay ≤1).

[0053] full: Trains all parameters, suitable for scenarios with sufficient data and allowing for complete fine-tuning.

[0054] S17. Input the intracranial EEG data of the target subject into the target decoding model for decoding to obtain the intracranial EEG decoding result of the target subject.

[0055] The evaluation metrics were calculated on the target subject test set, and the optimal model checkpoint was derived. The classification performance metrics included classification accuracy, balanced accuracy, confusion matrix, and class-by-class accuracy. For the circular regression task, the circumferential mean absolute error was defined as: Where N is the total number of samples (trials) participating in the evaluation; Let be the predicted angle for the i-th sample. ,in , The circular regression head outputs two components of the unit vector; θ i Let θ be the target angle. i = atan2(y i , x i ), where x i y i is the true value component of the circumferential label; atan2 is the two-parameter arctangent; ×180 / π is the radian rotation angle.

[0056] In another implementation, during the fine-tuning of the Phase B objective, the sample loss can be weighted according to the model prediction entropy, so that samples with high uncertainty receive higher training weights. ,

[0057] Among them, w i H represents the loss weight for the i-th sample; i Let α be the predicted entropy of the i-th sample; ent N is the entropy weight amplification factor (scalar hyperparameter, ≥0); cls Total number of categories; Predict the probability that the i-th sample belongs to the c-th class for the model; Σ c To sum over all categories; log(N) cls ) is the normalization factor (maximum entropy).

[0058] The above enhancements can be used independently or in combination with dissection prior gating and progressive thawing to adapt to different data scales and task difficulties.

[0059] The present invention provides a cross-subject intracranial EEG decoding method based on transfer learning. This method acquires intracranial EEG data and corresponding task labels from multiple source subjects, where each source subject has a different number of electrode channels, resulting in heterogeneous channel EEG data for each source subject. A channel projection adapter is constructed for each source subject. Using the heterogeneous channel EEG data of each source subject, the electrode channel dimension of that subject is projected onto a preset unified shared channel dimension through the corresponding channel projection adapter, resulting in fixed-shape shared input data for each source subject. This fixed-shape shared input data is then input into a multi-scale temporal-global spatial shared core for feature extraction, yielding reusable temporal-spatial features across subjects. The temporal-spatial features are decoded using a multi-task decoding head to obtain prediction results. Based on the heterogeneous channel EEG data and the task for each source subject, the method achieves the desired prediction. The labels and prediction results are used to jointly train the channel projection adapter, the shared core, and the multi-task decoding head to obtain pre-trained shared core parameters. Based on the pre-trained shared core parameters, a target channel projection adapter is constructed for the target subject, and the task head in the multi-task decoding head is reconfigured according to the label space of the target task. The reconfiguration includes determining the output dimension and type of the task head and initializing the task head parameters. The task head includes a classification head and a circumgression head. Using the intracranial EEG data of the target subject, and according to the selected fine-tuning strategy, the parameters in the target channel projection adapter, the task head, and the shared core determined according to the fine-tuning strategy are rapidly fine-tuned to obtain the adapted target decoding model. The intracranial EEG data of the target subject is input into the target decoding model for decoding to obtain the intracranial EEG decoding result of the target subject. Compared to existing technologies, which suffer from drawbacks such as the heterogeneity of intracranial EEG electrode channels among different subjects, making it difficult to reuse the model across subjects, requiring large amounts of data for new subjects with slow convergence, insufficient cross-task reuse capability, and boundary discontinuity errors in the decoding of ring visual attributes, this method achieves explicit alignment of heterogeneous electrode channels, rapid transfer of small samples from new subjects, flexible cross-task reuse, and robust decoding of ring visual attributes.

[0060] Figure 2 This is a schematic diagram of the overall data flow (corresponding to the overall system structure block diagram) of the cross-subject intracranial EEG decoding method based on transfer learning provided by the present invention. Figure 2 As shown, the overall data flow includes: intracranial EEG data and electrode element information (MNI coordinates, ROI labels) from multiple source subjects are input to the multi-subject data management module; data from each source subject are projected to a unified shared channel dimension via the corresponding channel projection adapter. Fixed-shape shared input data enters the multi-scale temporal-global spatial shared core to extract reusable temporal-spatial features across subjects. The feature vectors enter the multi-task decoding head, where the classification head outputs discrete category prediction results and the circular regression head outputs circular unit vector regression prediction results. In stage A (stage A joint pre-training), the above modules are jointly trained and the optimal shared core parameters are saved. In stage B (stage B target fine-tuning), the pre-trained shared core parameters are loaded, a new target channel projection adapter is constructed for the target subjects, and the task head is reconstructed. After rapid fine-tuning, the adapted target decoding model is obtained, and finally, the decoding results are output by the evaluation and export module.

[0061] Figure 3 This is a schematic diagram of the channel projection adapter and anatomical prior gating provided by the present invention. (See diagram below.) Figure 3 As shown, the left side represents the heterogeneous input channels of subject s. via channel projection matrix W s (Dimensions are 30×) Mapped to the right-hand unified shared channel dimension With MNI coordinates and ROI labels available, the system aggregates the source test electrode coordinates and performs hierarchical clustering according to ROI. There are anatomical anchor points; Gaussian distance priors are calculated based on the Euclidean distance between each electrode and the anatomical anchor point, and a reward term β or a penalty term δ is added based on whether the electrode ROI label and the anchor point dominant ROI label are consistent, to obtain the ROI-modulated prior logits; after softmax normalization, a gating matrix G is generated. s The gating matrix and the channel projection matrix modulate the channel projection together, enabling the model to retain individualized learning capabilities while utilizing anatomical priors.

[0062] Figure 4 This is a flowchart of the joint pre-training in stage A and the target fine-tuning in stage B provided by the present invention. Figure 4 As shown, in stage A, the system alternately or mixedly samples mini-batches from multiple source subject sets, jointly optimizes the channel projection adapter, shared core, and multi-task head for each source subject, and saves the shared core parameters that validate the best performance; in stage B, the system loads the pre-trained shared core parameters and constructs a new target channel projection adapter (dimension: ...) for the target subject. × The system reconstructs the task head based on the target task. Then, based on the difference between the target data volume and the task, it selects a fine-tuning strategy from head_only, adapter_only, adapter_head, adapter_full, progressive, and full strategies for rapid fine-tuning. Finally, the target subject evaluation and export module calculates indicators such as classification accuracy, balanced accuracy, and CircularMAE, and exports the best model checkpoint.

[0063] Figure 5 This is a schematic diagram of cross-task migration and shared representation alignment provided by the present invention. For example... Figure 5 As shown, the system comprises two parts: a cross-task transfer mechanism and shared representation alignment. The first part demonstrates the cross-task transfer mechanism: based on the shared core parameters obtained from joint pre-training in stage A, these parameters are transferred to the target task. The target task can have different output dimensions than the source task (e.g., transferring the 7-way color classification of the source task to 24-way fine-grained color classification) or different task types (e.g., transferring to 2-way visual imagination judgment or 5-way object category recognition). During the transfer process, the shared core parameters are loaded and used as a reusable representation basis across subjects. The system reconstructs the classification head and circumferential regression head according to the label space of the target task, enabling flexible replacement and cross-task reuse of the task head. The second part demonstrates the shared representation alignment effect: in the multi-subject joint pre-training in stage A, the temporal-spatial features extracted by the shared core are constrained by the cross-subject manifold alignment loss. In the shared representation space, feature vectors of samples from different subjects but belonging to the same category are close to each other (illustration of clustering of similar samples), while feature vectors of samples from different categories are far apart (illustration of dispersion of dissimilar samples). This manifold alignment mechanism enhances the subject invariance of shared representations, enabling the pre-trained shared cores to generalize better to new subjects, providing a robust representational basis for rapid fine-tuning of target subjects in Phase B.

[0064] Compared to existing technologies, which suffer from drawbacks such as the heterogeneity of intracranial EEG electrode channels among different subjects, making it difficult to reuse models across subjects, the large demand for transfer data from new subjects and slow convergence, insufficient cross-task reuse capability, and boundary discontinuity errors in ring visual attribute decoding, the cross-subject intracranial EEG decoding method and system based on transfer learning provided in this invention have the following advantages: (1) Achieve explicit alignment of channel dimensions. This is done by using an input-level channel projection adapter to align any... Map to fixed This ensures a fixed shared core structure, strict parameter reuse, and reduces the complexity of handling variable-length electrode sequences during the inference phase.

[0065] (2) Improve the transfer efficiency of new subjects. The pre-trained shared core can serve as a reusable representation base across subjects. In the target phase, only a lightweight adapter and task head need to be trained, which is suitable for rapid calibration with a small number of samples.

[0066] (3) Supports flexible migration across tasks. The task header can be reconstructed based on the target label space, and the fine-tuning strategy can be selected according to the data volume and task differences, realizing the migration from color classification to fine-grained color, object category or other visual attribute tasks.

[0067] (4) Improve the robustness of ring visual attribute decoding. The circumferential regression head represents hue or orientation with a two-dimensional unit vector, avoiding discontinuities at angle boundaries, and can share representations with the classification head to form complementary supervision.

[0068] (5) Introduce anatomical priors and manifold alignment. Anatomical prior gating reduces the search space of the adapter, and cross-subject manifold alignment enhances the subject invariance of shared representations, which is beneficial to improving generalization ability.

[0069] The following describes the cross-subject intracranial EEG decoding system based on transfer learning provided by the present invention. The cross-subject intracranial EEG decoding system based on transfer learning described below can be referred to in correspondence with the cross-subject intracranial EEG decoding method based on transfer learning described above.

[0070] Figure 6 This is a schematic diagram of the structure of the cross-subject intracranial EEG decoding system based on transfer learning provided by the present invention, specifically including: The multi-subject data management module 601 is used to acquire intracranial electroencephalogram (EEG) data and corresponding task tags from multiple source subjects. Each source subject has a different number of electrode channels, resulting in heterogeneous channel EEG data for each source subject. For detailed explanations, please refer to the relevant descriptions in the above method embodiments; they will not be repeated here.

[0071] The channel projection adapter module 602 is used to construct a channel projection adapter for each source subject. Utilizing the heterogeneous channel EEG data of each source subject, the corresponding channel projection adapter projects the electrode channel dimension of that subject onto a preset unified shared channel dimension, obtaining fixed-shape shared input data corresponding to each source subject. For detailed explanations, please refer to the relevant descriptions in the above method embodiments; they will not be repeated here.

[0072] The shared core module 603 is used to input the fixed-shape shared input data corresponding to each source subject into the multi-scale temporal-global spatial shared core for feature extraction, thereby obtaining reusable temporal-spatial features across subjects. For detailed explanations, please refer to the relevant descriptions in the above method embodiments; they will not be repeated here.

[0073] The multi-task decoding head module 604 is used to decode the temporal-spatial features through the multi-task decoding head to obtain the prediction result. For detailed explanations, please refer to the relevant descriptions in the above method embodiments; they will not be repeated here.

[0074] The training and transfer control module 605 is used to jointly train the channel projection adapter, the shared core, and the multi-task decoder based on the heterogeneous channel EEG data, the task labels, and the prediction results of each source subject, to obtain pre-trained shared core parameters. For detailed explanations, please refer to the relevant descriptions in the above method embodiments; they will not be repeated here.

[0075] The training and transfer control module 605 is further configured to construct a target channel projection adapter for the target subject based on the pre-trained shared core parameters, and reconfigure the task head in the multi-task decoding head according to the label space of the target task. The reconfiguration includes determining the output dimension and type of the task head and initializing the task head parameters. The task head includes a classification head and a circumgression head. Using the intracranial EEG data of the target subject, and according to the selected fine-tuning strategy, the module performs rapid fine-tuning on the target channel projection adapter, the task head, and the parameters determined according to the fine-tuning strategy in the shared core, to obtain the adapted target decoding model. For detailed explanation, please refer to the relevant descriptions in the above method embodiments, which will not be repeated here.

[0076] The decoding output module 606 is used to input the intracranial EEG data of the target subject into the target decoding model for decoding, and obtain the intracranial EEG decoding result of the target subject. For detailed explanation, please refer to the relevant descriptions in the above method embodiments, which will not be repeated here.

[0077] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7As shown, the electronic device may include: a processor 710, a communications interface 720, a memory 730, and a communications bus 740, wherein the processor 710, the communications interface 720, and the memory 730 communicate with each other through the communications bus 740. The processor 710 can call logic instructions in the memory 730 to execute a cross-subject intracranial EEG decoding method based on transfer learning. This method includes: acquiring intracranial EEG data and corresponding task labels from multiple source subjects, wherein each source subject has a different number of electrode channels, resulting in heterogeneous channel EEG data for each source subject; constructing a channel projection adapter for each source subject, and using the heterogeneous channel EEG data of each source subject, projecting the electrode channel dimension of that subject onto a preset unified shared channel dimension through the corresponding channel projection adapter, resulting in fixed-shape shared input data corresponding to each source subject; inputting the fixed-shape shared input data corresponding to each source subject into a multi-scale temporal-global spatial shared core for feature extraction, obtaining reusable temporal-spatial features across subjects; decoding the temporal-spatial features through a multi-task decoding head to obtain prediction results; and based on the heterogeneous channel EEG data of each source subject... Using the target channel EEG data, the task labels, and the prediction results, the channel projection adapter, the shared core, and the multi-task decoding head are jointly trained to obtain pre-trained shared core parameters. Based on the pre-trained shared core parameters, a target channel projection adapter is constructed for the target subject, and the task head in the multi-task decoding head is reconfigured according to the label space of the target task. The reconfiguration includes determining the output dimension and type of the task head and initializing the task head parameters. The task head includes a classification head and a circumgression head. Using the target subject's intracranial EEG data, and according to the selected fine-tuning strategy, rapid fine-tuning is performed on the parameters of the target channel projection adapter, the task head, and the shared core determined according to the fine-tuning strategy to obtain the adapted target decoding model. The target subject's intracranial EEG data is input into the target decoding model for decoding to obtain the target subject's intracranial EEG decoding result.

[0078] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0079] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the cross-subject intracranial EEG decoding method based on transfer learning provided by the above methods. The method includes: acquiring intracranial EEG data and corresponding task labels from multiple source subjects, wherein each source subject has a different number of electrode channels, resulting in heterogeneous channel EEG data for each source subject; constructing a channel projection adapter for each source subject, and using the heterogeneous channel EEG data of each source subject, projecting the electrode channel dimension of the subject to a preset unified shared channel dimension through the corresponding channel projection adapter, resulting in fixed-shape shared input data corresponding to each source subject; inputting the fixed-shape shared input data corresponding to each source subject into a multi-scale temporal-global spatial shared core for feature extraction, resulting in reusable temporal-spatial features across subjects; and using a multi-task decoding head. The temporal-spatial features are decoded to obtain prediction results. Based on the heterogeneous channel EEG data of each source subject, the task labels, and the prediction results, the channel projection adapter, the shared core, and the multi-task decoding head are jointly trained to obtain pre-trained shared core parameters. Based on the pre-trained shared core parameters, a target channel projection adapter is constructed for the target subject, and the task head in the multi-task decoding head is reconfigured according to the label space of the target task. The reconfiguration includes determining the output dimension and type of the task head and initializing the task head parameters. The task head includes a classification head and a circumgression head. Using the intracranial EEG data of the target subject, and according to the selected fine-tuning strategy, the parameters in the target channel projection adapter, the task head, and the shared core determined according to the fine-tuning strategy are rapidly fine-tuned to obtain the adapted target decoding model. The intracranial EEG data of the target subject is input into the target decoding model for decoding to obtain the intracranial EEG decoding result of the target subject.

[0080] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the cross-subject intracranial EEG decoding method based on transfer learning provided by the above methods. This method includes: acquiring intracranial EEG data and corresponding task labels from multiple source subjects, wherein each source subject has a different number of electrode channels, resulting in heterogeneous channel EEG data for each source subject; constructing a channel projection adapter for each source subject, and using the heterogeneous channel EEG data of each source subject, projecting the electrode channel dimension of that subject onto a preset unified shared channel dimension through the corresponding channel projection adapter, resulting in fixed-shape shared input data corresponding to each source subject; inputting the fixed-shape shared input data corresponding to each source subject into a multi-scale temporal-global spatial shared core for feature extraction, resulting in reusable temporal-spatial features across subjects; and decoding the temporal-spatial features through a multi-task decoding head to obtain... The prediction results are obtained; based on the heterogeneous channel EEG data of each source subject, the task labels, and the prediction results, the channel projection adapter, the shared core, and the multi-task decoding head are jointly trained to obtain pre-trained shared core parameters; based on the pre-trained shared core parameters, a target channel projection adapter is constructed for the target subject, and the task head in the multi-task decoding head is reconfigured according to the label space of the target task. The reconfiguration includes determining the output dimension and type of the task head and initializing the task head parameters. The task head includes a classification head and a circumferential regression head. Using the intracranial EEG data of the target subject, according to the selected fine-tuning strategy, the parameters in the target channel projection adapter, the task head, and the shared core determined according to the fine-tuning strategy are rapidly fine-tuned to obtain the adapted target decoding model; the intracranial EEG data of the target subject is input into the target decoding model for decoding to obtain the intracranial EEG decoding result of the target subject.

[0081] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0082] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0083] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for cross-subject intracranial EEG decoding based on transfer learning, characterized in that, include: Intracranial EEG data and corresponding task labels were obtained from multiple source subjects, with each source subject having a different number of electrode channels, resulting in heterogeneous channel EEG data for each source subject. For each source subject, a channel projection adapter is constructed. Using the heterogeneous channel EEG data of each source subject, the electrode channel dimension of the subject is projected to the preset unified shared channel dimension through the corresponding channel projection adapter to obtain the fixed-shape shared input data corresponding to each source subject. The fixed-shape shared input data corresponding to each source subject is input into the multi-scale temporal-global spatial shared core for feature extraction, resulting in reusable temporal-spatial features across subjects; The temporal-spatial features are decoded using a multi-task decoding head to obtain the prediction results; Based on the heterogeneous channel EEG data, task labels and prediction results of each source subject, the channel projection adapter, the shared core and the multi-task decoder are jointly trained to obtain pre-trained shared core parameters. Based on the pre-trained shared core parameters, a target channel projection adapter is constructed for the target subject, and the task head in the multi-task decoding head is reconfigured according to the label space of the target task. The reconfiguration includes determining the output dimension and type of the task head and initializing the task head parameters. The task head includes a classification head and a circumferential regression head. Using the intracranial EEG data of the target subject, and according to the selected fine-tuning strategy, the parameters in the target channel projection adapter, the task head, and the shared core determined according to the fine-tuning strategy are rapidly fine-tuned to obtain the adapted target decoding model. The intracranial EEG data of the target subject is input into the target decoding model for decoding to obtain the intracranial EEG decoding result of the target subject.

2. The method according to claim 1, characterized in that, The channel projection adapter is an anatomical prior gating adapter; The construction of a channel projection adapter for each source subject includes: Obtain the electrode MNI coordinates and ROI labels for each source subject; The electrode MNI coordinates of each source subject are hierarchically clustered according to the ROI label to obtain an anatomical anchor point and its corresponding dominant ROI label, which are equal in number to the dimension of the unified shared channel. The Gaussian distance prior is calculated based on the Euclidean distance between each source test electrode and the anatomical anchor point, and a preset reward coefficient or penalty coefficient is applied to the Gaussian distance prior based on the consistency between the electrode ROI label and the dominant ROI label to obtain the ROI modulation term. A gating matrix is ​​generated based on the distance prior and the ROI modulation term. The gating matrix is ​​then used to constrain the projection weights of the channel projection adapter to obtain the anatomical prior gating adapter. The formula for calculating the Gaussian distance prior is as follows: ; in, The prior is Gaussian distance, σ is the Gaussian bandwidth parameter, and e i For the electrode and a j For anchor points; The ROI modulation formula is as follows: ; Where, r i The ROI label to which the i-th electrode belongs; ρ j The dominant ROI label for the j-th anatomical anchor point; [·] is an indicator function, which takes the value 1 if the condition in parentheses is true, and 0 otherwise; β is the ROI consistency reward coefficient, and δ is the ROI incompatibility penalty coefficient.

3. The method according to claim 1, characterized in that, The multi-scale temporal-global spatial sharing core includes a multi-scale temporal branch and a global spatial aggregation layer; The step involves inputting the fixed-shape shared input data corresponding to each source subject into a multi-scale temporal-global spatial shared core for feature extraction, resulting in reusable temporal-spatial features across subjects, including: The fixed-shape shared input data is processed in parallel by performing multiple temporal convolutions at different scales through the multi-scale temporal branches to obtain multi-scale temporal features; The multi-scale temporal features are concatenated along the channel dimension by the global spatial aggregation layer, and then global spatial convolution is performed to aggregate cross-channel information to obtain the temporal-spatial features.

4. The method according to any one of claims 1-3, characterized in that, The prediction results include discrete classification prediction results and / or circumferential unit vector regression prediction results; The multi-task decoding head includes a classification head and a circumferential regression head; The step of decoding the temporal-spatial features using a multi-task decoding head to obtain the prediction result includes: The classification head outputs prediction scores for each category based on the temporal-spatial features, thus obtaining the discrete classification prediction results. The circular regression head outputs a two-dimensional prediction vector based on the temporal-spatial features, and the two-dimensional prediction vector is normalized to obtain a circular unit vector as the circular unit vector regression prediction result.

5. The method according to claim 4, characterized in that, The method involves jointly training the channel projection adapter, the shared core, and the multi-task decoder based on the heterogeneous channel EEG data, task labels, and prediction results of each source subject to obtain pre-trained shared core parameters, including: Based on the heterogeneous channel EEG data, the task labels, and the prediction results of each source subject, training batches are sampled alternately or in combination on each source subject; Based on the heterogeneous channel EEG data and task labels corresponding to the training batch, calculate the classification cross-entropy loss and / or the circumferential unit vector regression loss. The parameters of the channel projection adapter, the shared core, and the multi-task decoder are updated based on the classification cross-entropy loss and / or circular unit vector regression loss, and the shared core parameters with the best verification performance are saved as the pre-trained shared core parameters.

6. The method according to claim 5, characterized in that, The method further includes: Based on the temporal-spatial features and corresponding task labels extracted by the shared core for each source subject, the cross-subject manifold alignment loss is calculated. The cross-subject manifold alignment loss is used to constrain the temporal-spatial features of similar samples in different subjects to be close to each other in the shared representation space, while the temporal-spatial features of dissimilar samples are far apart from each other.

7. The method according to claim 1, characterized in that, The process involves using the intracranial EEG data of the target subject and, based on a selected fine-tuning strategy, performing rapid fine-tuning on the parameters determined according to the fine-tuning strategy in the target channel projection adapter, the task head, and the shared core to obtain an adapted target decoding model, including: Based on the amount of intracranial EEG data of the target subjects and the differences between the source task and the target task in output dimension and / or task type, a target fine-tuning strategy is selected from multiple preset fine-tuning strategies. Rapid fine-tuning is then performed on the parameters of the target channel projection adapter, the task head, and the shared core, determined according to the target fine-tuning strategy, to obtain the adapted target decoding model. The difference in output dimension refers to the difference in the number of output paths required by the task head for the target task compared to the number of output paths required by the task head for the source task. The difference in task type refers to the target task and the source task belonging to different task types within discrete classification and circular regression tasks, respectively. The multiple preset fine-tuning strategies include training only the task head, training only the target channel projection adapter, training both the target channel projection adapter and the task head simultaneously, training some or all parameters of the target channel projection adapter, the task head, and the shared core, or progressively unfreezing network parameters from the output end to the input end in a hierarchical manner, setting smaller learning rates for layers closer to the input end.

8. The method according to claim 1, characterized in that, The task labels include discrete category labels and / or continuous circular labels represented as two-dimensional unit vectors, which are used to characterize the annular visual attributes of hue and / or orientation.

9. A cross-subject intracranial EEG decoding system based on transfer learning, characterized in that, include: The multi-subject data management module is used to acquire intracranial EEG data and corresponding task tags from multiple source subjects. Each source subject has a different number of electrode channels, resulting in heterogeneous channel EEG data for each source subject. The channel projection adapter module is used to build a channel projection adapter for each source subject. Using the heterogeneous channel EEG data of each source subject, the electrode channel dimension of the subject is projected to the preset unified shared channel dimension through the corresponding channel projection adapter to obtain the fixed-shape shared input data corresponding to each source subject. The shared core module is used to input the fixed-shape shared input data corresponding to each source subject into the multi-scale temporal-global spatial shared core for feature extraction, so as to obtain reusable temporal-spatial features across subjects. The multi-task decoding head module is used to decode the temporal-spatial features through the multi-task decoding head to obtain the prediction result; The training and transfer control module is used to jointly train the channel projection adapter, the shared core, and the multi-task decoder based on the heterogeneous channel EEG data, the task labels, and the prediction results of each source subject, so as to obtain pre-trained shared core parameters. The training and transfer control module is also used to construct a target channel projection adapter for the target subject based on the pre-trained shared core parameters, and to reconfigure the task head in the multi-task decoding head according to the label space of the target task. The reconfiguration includes determining the output dimension and type of the task head and initializing the task head parameters. The task head includes a classification head and a circumferential regression head. Using the intracranial EEG data of the target subject, and according to the selected fine-tuning strategy, the module performs rapid fine-tuning on the target channel projection adapter, the task head, and the parameters in the shared core determined according to the fine-tuning strategy to obtain the adapted target decoding model. The decoding output module is used to input the intracranial EEG data of the target subject into the target decoding model for decoding, and obtain the intracranial EEG decoding result of the target subject.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the cross-subject intracranial EEG decoding method based on transfer learning as described in any one of claims 1 to 8.

11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the cross-subject intracranial EEG decoding method based on transfer learning as described in any one of claims 1 to 8.

12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the cross-subject intracranial EEG decoding method based on transfer learning as described in any one of claims 1 to 8.