A Segmentation Federated Learning Method for EEG Decoding Across Data Silos
By using a segmented federated learning method to exchange intermediate lexical units and gradients between the client and server, a training architecture for EEG decoding models that crosses data silos is constructed. This solves the problems of heterogeneity across data silos and limited calibration data for new users, achieving efficient improvement in EEG decoding accuracy and lightweight adaptation.
Patent Information
- Application Number
- CN202611249612.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-18
- Publication Date
- 2026-11-17
AI Technical Summary
EEG data from data silos is difficult to centralize directly, exhibits significant heterogeneity, and has limited calibration data for new users, making it difficult to improve the accuracy of EEG decoding.
By employing a segmented federated learning approach, an EEG decoding model training architecture is constructed across data silos by exchanging intermediate lexical units and gradients between the client and server. This architecture leverages multiple heterogeneous EEG data silos to jointly learn transferable knowledge, and only updates the target-side embedding module during the downstream adaptation phase.
Without centralized raw EEG data, collaborative pre-training of heterogeneous EEG data across institutions and data silos is achieved, improving the EEG decoding accuracy in collaborative scenarios with multiple data silos and reducing the computational and communication burden on the client side.
Smart Images

Figure CN123115253A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of brain-computer interface signal decoding technology, and more specifically, relates to a segmented federated learning method for EEG decoding across data silos. Background Technology
[0002] Brain-computer interfaces (BCIs) establish a direct communication channel between the brain and external devices. Electroencephalography (EEG) is a widely used method for acquiring neural signals in BCIs due to its non-invasiveness, portability, low cost, and high temporal resolution. Motor imagery (MI) and event-related potentials (ERPs) are two typical EEG-based BCI paradigms.
[0003] Electroencephalogram (EEG) signals are typically characterized by low signal-to-noise ratios, non-stationarity, and significant individual variability. To obtain EEG decoding models with strong generalization and transferability capabilities, pre-training with larger-scale datasets is necessary. However, the amount of EEG data available from a single laboratory or hospital is usually limited. Data collected from different institutions can provide complementary information for learning transferable representations. Therefore, jointly utilizing data resources from multiple institutions is of great significance for large-scale EEG model training.
[0004] In practical cross-institutional collaborations, directly aggregating multiple EEG datasets for model pre-training typically presents the following difficulties: 1. EEG data is sensitive. EEG signals contain physiological and neural activity information and may also reflect cognitive state, health status, or identity-related characteristics. Raw EEG data usually cannot flow freely between institutions.
[0005] 2. EEG data is scattered across different data silos. EEG data collection is costly, and the data is naturally distributed among different laboratories, hospitals, or other data holders. Institutions are usually unwilling to share these valuable data resources, forming isolated data silos that are difficult to merge into a unified training set.
[0006] 3. Significant heterogeneity exists among different EEG datasets. Data from different institutions may differ in sampling rate, electrode configuration, trial length, acquisition protocol, and subject population, making it difficult to process them directly using a unified input module.
[0007] 4. Downstream users have limited calibration data and computing resources. During testing, new users can typically only provide a small number of labeled calibration samples, making it difficult for them to undertake the retraining of the complete model or fine-tuning of all parameters.
[0008] It is evident that existing technologies suffer from technical problems such as the difficulty in directly centralizing EEG data from multiple institutions, significant heterogeneity across datasets, and limited calibration data for new users, ultimately leading to difficulties in improving the accuracy of EEG decoding in collaborative scenarios involving multiple data silos. Summary of the Invention
[0009] To address the aforementioned deficiencies or improvement needs of existing technologies, this invention provides a segmentation federated learning method for EEG decoding across data silos. This solves the technical problems of existing technologies, such as the difficulty in directly centralizing EEG data from multiple institutions, significant heterogeneity across datasets, and limited calibration data from new users, which ultimately lead to difficulties in improving the accuracy of EEG decoding in collaborative scenarios involving multiple data silos.
[0010] To achieve the above objectives, according to a first aspect of the present invention, a segmentation federated learning method for EEG decoding across data silos is provided, including a pre-training phase and a downstream adaptation phase. The pre-training phase includes: The EEG decoding model was trained using K source EEG datasets, K 2. The training architecture of the EEG decoding model includes K clients and a central server; each client corresponds to a source EEG dataset and includes a client embedding module, and the central server includes a server encoder and a server classification module shared by the K clients; During training, each client embedding module maps EEG trials from its corresponding source EEG dataset to intermediate tokens with a uniform number and dimension, and sends the intermediate tokens and their corresponding ground truth class labels to the central server. The central server concatenates the intermediate tokens from different client embedding modules along the batch dimension to obtain concatenated tokens. The server encoder extracts global features from the concatenated tokens, and the shared server classification module performs classification prediction on the global features to obtain the classification results. The classification results of each client are divided from the classification results, and the error between the classification results of each client and its ground truth class label is used as the classification loss of each client. The classification losses of each client are then weighted according to the batch size of each client to obtain the total loss. Backpropagation is used to update the server encoder and server classification module. The gradient of the total loss relative to the concatenated tokens is calculated, the gradient is split according to the batch size of each client, and the split gradients are sent to the corresponding clients. Each client continues to backpropagate based on the received gradients to update its own client embedding module. Training is completed until convergence, resulting in a pre-trained server encoder, server classification module, and K client embedding modules. The downstream adaptation stage includes: for target users who have not participated in pre-training, creating and initializing a target-end embedding module, loading and freezing the pre-trained server-end encoder and server-end classification module, forming an EEG decoding model to be adapted with the target-end embedding module, training the EEG decoding model to be adapted using the target user's calibration data, updating only the target-end embedding module, training until convergence, and obtaining a trained EEG decoding model.
[0011] Furthermore, the client-side embedded module includes a time-domain branch and a frequency-domain branch; The temporal branch extracts local spatiotemporal patterns from EEG trials using temporal and spatial convolutions to obtain temporal lexical units. The frequency branch extracts local spectral information from EEG trials through time window segmentation, real-valued fast Fourier transform, amplitude calculation, logarithmic scaling, and channel averaging to obtain frequency lexical units. The temporal and frequency lexical units are fused using learnable coefficients to obtain intermediate lexical units.
[0012] Furthermore, the server-side encoder is composed of multiple local-global fusion blocks stacked together, each local-global fusion block including a local lexical mixing module and a Transformer encoding module; The central server concatenates intermediate lexical units from different client embedding modules along the batch dimension to obtain concatenated lexical units. The local lexical unit mixing module applies depthwise separable one-dimensional convolution to the concatenated lexical units along the lexical dimension to extract local relationships between adjacent lexical units, resulting in a locally mixed lexical unit sequence. The Transformer encoding module includes a multi-head self-attention layer and a feedforward network. The multi-head self-attention layer models long-range dependencies on the locally mixed lexical unit sequence, and the feedforward network transforms the output of the multi-head self-attention layer to obtain global features.
[0013] Furthermore, the server-side classification module adopts a dual-pooling structure that combines attention pooling and mean pooling. After performing attention pooling and mean pooling on the global features respectively, two branches of features are obtained. The features of the two branches are concatenated and then classified by layer normalization and multilayer perceptron.
[0014] According to a second aspect of the present invention, a method for decoding electroencephalograms (EEGs) across data silos is provided, comprising: The target user's EEG test is input into a trained EEG decoding model for decoding to obtain the decoding result; The trained EEG decoding model was trained using a segmented federated learning method for EEG decoding across data silos.
[0015] According to a third aspect of the present invention, a segmentation federated learning system for cross-data silo EEG decoding is provided, comprising: The pre-training module uses K source EEG datasets to train the EEG decoding model, K 2. The training architecture of the EEG decoding model includes K clients and a central server. Each client corresponds to a source EEG dataset and includes a client embedding module. The central server includes a server encoder and a server classification module shared by the K clients. During training, each client embedding module maps the EEG trials in its corresponding source EEG dataset to intermediate lexical units with a uniform number of lexical units and lexical unit dimensions, and sends the intermediate lexical units and their corresponding ground truth class labels to the central server. The central server concatenates the intermediate lexical units from different client embedding modules along the batch dimension to obtain concatenated lexical units. The server encoder extracts global features from the concatenated lexical units, and the shared server classification module processes the global features. The system performs classification prediction to obtain classification results. From these results, it separates the classification results for each client, using the error between each client's classification result and its true class label as the classification loss for each client. The classification losses for each client are then weighted according to their batch size to obtain the total loss. Backpropagation is then used to update the server-side encoder and server-side classification module. The gradient of the total loss relative to the concatenated words is calculated, and the gradient is split according to the batch size of each client. The split gradients are then sent to their respective clients, which continue backpropagation based on the received gradients to update their respective client embedding modules. Training continues until convergence, resulting in a pre-trained server-side encoder, server-side classification module, and K client embedding modules. The downstream adaptation module creates and initializes a target-end embedding module for target users who have not participated in pre-training, loads and freezes the pre-trained server-side encoder and server-side classification module, and forms an EEG decoding model to be adapted together with the target-end embedding module. The EEG decoding model to be adapted is trained using the calibration data of the target user, and only the target-end embedding module is updated. The training continues until convergence, and a trained EEG decoding model is obtained.
[0016] Furthermore, the client-side embedded module includes a time-domain branch and a frequency-domain branch; The temporal branch extracts local spatiotemporal patterns from EEG trials using temporal and spatial convolutions to obtain temporal lexical units. The frequency branch extracts local spectral information from EEG trials through time window segmentation, real-valued fast Fourier transform, amplitude calculation, logarithmic scaling, and channel averaging to obtain frequency lexical units. The temporal and frequency lexical units are fused using learnable coefficients to obtain intermediate lexical units.
[0017] Furthermore, the server-side encoder is composed of multiple local-global fusion blocks stacked together, each local-global fusion block including a local lexical mixing module and a Transformer encoding module; The central server concatenates intermediate lexical units from different client embedding modules along the batch dimension to obtain concatenated lexical units. The local lexical unit mixing module applies depthwise separable one-dimensional convolution to the concatenated lexical units along the lexical dimension to extract local relationships between adjacent lexical units, resulting in a locally mixed lexical unit sequence. The Transformer encoding module includes a multi-head self-attention layer and a feedforward network. The multi-head self-attention layer models long-range dependencies on the locally mixed lexical unit sequence, and the feedforward network transforms the output of the multi-head self-attention layer to obtain global features.
[0018] Furthermore, the server-side classification module adopts a dual-pooling structure that combines attention pooling and mean pooling. After performing attention pooling and mean pooling on the global features respectively, two branches of features are obtained. The features of the two branches are concatenated and then classified by layer normalization and multilayer perceptron.
[0019] According to a fourth aspect of the invention, a computer program product is provided that, when run, causes a computer to execute a segmented federated learning method for EEG decoding across data silos or an EEG decoding method for cross-data silos.
[0020] In summary, compared with the prior art, the above-described technical solutions conceived by this invention can achieve the following beneficial effects: (1) This invention innovatively constructs an EEG decoding model training architecture consisting of heterogeneous clients and a central server. The training architecture includes K clients, each client configured with an embedding module and corresponding to a source EEG dataset, used to represent a data silo in the real world. The central server includes a shared server encoder and a shared server classification module, responsible for learning cross-dataset transferable knowledge from unified intermediate lexical units uploaded by each client. Under the condition that the original EEG data is retained locally on the corresponding client, cross-dataset transferable knowledge is jointly learned by exchanging intermediate lexical units, labels and gradients, using multiple heterogeneous EEG data silos. In the downstream adaptation stage, only the target embedding module is updated, realizing lightweight and fast adaptation for new targets. At the same time, the client retains its own embedding module, and the server completes the shared model training through intermediate lexical units and layer gradients, avoiding direct transmission of original EEG data and complete model parameters across institutions; the client only performs the computation of the lightweight embedding module, structurally reducing the client's computation and communication burden. This demonstrates that the method of the present invention can achieve collaborative pre-training of heterogeneous EEG data across institutions and data silos without centralized raw EEG data, and supports lightweight downstream adaptation for new targets, thereby obtaining a well-trained EEG decoding model to improve the EEG decoding accuracy in collaborative scenarios with multiple data silos.
[0021] (2) The client-side embedded module in this invention includes a time-domain branch and a frequency-domain branch. The time-domain branch uses temporal convolution and spatial convolution to extract local spatiotemporal patterns from EEG trials. Temporal convolution is good at extracting short-term signal dynamics, while spatial convolution can effectively aggregate electrode information. The combination of the two accurately extracts the local spatiotemporal patterns of EEG. The core mechanism of EEG is often reflected in the energy changes in specific frequency bands. The frequency-domain branch can directly and efficiently extract these local spectral information through real-valued fast Fourier transform and logarithmic scaling, which is crucial for tasks such as motor imagery or event-related potentials. By using learnable coefficients to complete time-frequency lexical fusion, the resulting "intermediate lexical" contains more discriminative feature information, thereby significantly improving the accuracy of the final decoding.
[0022] (3) The server-side encoder of this invention is composed of multiple local-global fusion blocks stacked together. Each local-global fusion block includes a local lexical mixing module and a Transformer encoding module. The server concatenates intermediate lexical units from different client embedding modules along the batch dimension to obtain concatenated lexical units. The local lexical mixing module performs depthwise separable one-dimensional convolution on the concatenated lexical units along the lexical dimension to extract the local relationships between adjacent lexical units. Under the premise of protecting privacy (without uploading the original data), it realizes the joint modeling of intermediate representations from different clients. The multi-head self-attention mechanism of the Transformer encoding module can directly establish the association between any two lexical units, overcome the problem of limited receptive fields in traditional convolutional neural networks, and can capture the implicit, long-distance global patterns in EEG, significantly improving the discriminative power of features.
[0023] (4) The server-side classification module of this invention adopts a dual-pooling structure combining attention pooling and mean pooling. Mean pooling is equivalent to "averaging" the global features, which can preserve the overall statistical regularity and background information of the EEG signal, and has strong noise resistance and robustness. Attention pooling weights different words, highlighting features related to the classification task, while suppressing irrelevant redundant information. After the two are concatenated, the final classification features retain both overall statistical information and local discriminative information, avoiding information loss that may be caused by a single pooling method. Layer normalization is performed after concatenation, which can effectively eliminate the feature scale differences caused by different pooling branches, accelerate the convergence of the model, and prevent overfitting. The multilayer perceptron further performs nonlinear transformation on the fused features, enhancing the model's ability to fit complex decision boundaries. Attached Figure Description
[0024] Figure 1 This is a schematic diagram of a segmentation federated learning method for EEG decoding across data silos provided in an embodiment of the present invention; Figure 2 (a) is a structural diagram of the time-frequency embedding module provided in an embodiment of the present invention; Figure 2 Figure (b) is a structural diagram of the global fusion encoder provided in an embodiment of the present invention; Figure 2 (c) is a structural diagram of the dual-pooling classification head provided in an embodiment of the present invention; Figure 3 This is a flowchart illustrating a single communication round during the pre-training phase provided in an embodiment of the present invention. The flowchart uses the example of two clients participating in this communication round for illustration. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0026] A segmentation federated learning method for decoding EEG data across data silos, including a pre-training phase and a downstream adaptation phase; The pre-training phase includes: The EEG decoding model was trained using K source EEG datasets, K 2. The training architecture of the EEG decoding model includes K clients and a central server; each client corresponds to a source EEG dataset and includes a client embedding module, and the central server includes a server encoder and a server classification module shared by the K clients; During training, each client embedding module maps EEG trials from its corresponding source EEG dataset to intermediate tokens with a uniform number and dimension, and sends the intermediate tokens and their corresponding ground truth class labels to the central server. The central server concatenates the intermediate tokens from different client embedding modules along the batch dimension to obtain concatenated tokens. The server encoder extracts global features from the concatenated tokens, and the shared server classification module performs classification prediction on the global features to obtain the classification results. The classification results of each client are divided from the classification results, and the error between the classification results of each client and its ground truth class label is used as the classification loss of each client. The classification losses of each client are then weighted according to the batch size of each client to obtain the total loss. Backpropagation is used to update the server encoder and server classification module. The gradient of the total loss relative to the concatenated tokens is calculated, the gradient is split according to the batch size of each client, and the split gradients are sent to the corresponding clients. Each client continues to backpropagate based on the received gradients to update its own client embedding module. Training is completed until convergence, resulting in a pre-trained server encoder, server classification module, and K client embedding modules. The downstream adaptation stage includes: for target users who have not participated in pre-training, creating and initializing a target-end embedding module, loading and freezing the pre-trained server-end encoder and server-end classification module, forming an EEG decoding model to be adapted with the target-end embedding module, training the EEG decoding model to be adapted using the target user's calibration data, updating only the target-end embedding module, training until convergence, and obtaining a trained EEG decoding model.
[0027] Federated learning (FL) offers a solution for distributed training by retaining the original data locally on the client and exchanging model parameters between the client and the server. However, traditional federated learning typically requires each client to train the complete model and transmit the complete model parameters over multiple rounds of communication. As the model size increases, the burden of local training on the client and the burden of communicating the complete model parameters increase accordingly. Furthermore, a fully shared model struggles to flexibly adapt to differences in channel count, temporal sampling points, and signal distribution across various EEG datasets.
[0028] Split learning (SL) divides the model into client and server parts. By deploying lightweight embedding modules on the client and deploying the computationally intensive model backbone on the server, it reduces the computational burden on the client and avoids repeatedly transmitting complete model parameters.
[0029] Example 1 This invention proposes a general split-federated learning (SplitFL) method. This method divides the EEG decoding model into a client-side embedding module, a server-side encoder, and a server-side classification module. Different clients use their respective dataset-specific embedding modules to process heterogeneous EEG inputs, while the server-side encoder and classification module are shared by all clients. As a model example of this general method, this invention further proposes a split representation-fusion Transformer (SplitFormer) model. The client-side embedding module is instantiated as a time-frequency embedding (TFE) module, the server-side encoder is instantiated as a global fusion encoder (GFE), and the server-side classification module is instantiated as a dual-pooling classification head (Head). Therefore, this invention enables collaborative pre-training of heterogeneous EEG data across institutions and data silos without centralized raw EEG data, and supports lightweight downstream adaptation for new datasets or new users.
[0030] It should be noted that SplitFormer is only one model instance of SplitFL. Other models that can be divided into client embedding modules, shared server encoders, and shared classification modules can also adopt the above SplitFL pre-training and downstream adaptation process.
[0031] A segmentation federated learning method for decoding EEG data across data silos, including a pre-training phase and a downstream adaptation phase; The pre-training phase includes the following steps: 1. Establish a cross-institutional training system consisting of multiple source clients and a central server. Each source client corresponds to a source EEG dataset, which is used to represent a data silo in the real world.
[0032] 2. Each client participating in the current communication round samples EEG batches from its local dataset and uses its dedicated TFE to map the original EEG trials into intermediate lexical units with a uniform number of lexical units and lexical unit dimensions.
[0033] 3. Each participating client uploads the intermediate lexical units and their corresponding tags to the central server, while the raw EEG data is stored locally on the client.
[0034] 4. The central server concatenates intermediate terms and tags from different clients along the batch dimension, extracts global features using shared GFE, and generates classification output using shared Head.
[0035] 5. The central server weights the loss of each client according to the size of the EEG batch of each client actually participating in this communication round, and obtains the total loss of this communication round. The shared GFE and Head are then updated through backpropagation.
[0036] 6. The central server calculates the gradient of the total loss relative to the concatenated words, splits the gradient according to the batch size of each client, and returns the corresponding split gradient to each client.
[0037] 7. Each client continues to perform local backpropagation using the returned layer gradient, updating only the client's TFE.
[0038] 8. Repeat the above communication rounds to finally obtain the pre-trained shared GFE, shared Head, and TFE of each source client.
[0039] In the downstream adaptation phase, for new datasets or new users who did not participate in pre-training, a new target-side TFE is initialized, the pre-trained GFE and Head are loaded and frozen, and the target-side TFE is updated only using a small amount of calibration data from the target side. After adaptation, the target-side TFE, pre-trained GFE, and pre-trained Head work together to complete personalized EEG decoding.
[0040] Consider by A cross-data silo learning scenario consisting of an EEG data holder and a central server. The data holder is the first Each source client has a locally labeled EEG dataset represented as follows:
[0041] in, For the first Number of EEG samples per client; For the first One EEG test; For the corresponding tags; , and These represent the number of channels, the number of time sampling points, and the number of categories, respectively. Within the same EEG paradigm, all clients have the same label space, but different clients... , The subject population and data distribution can be different.
[0042] The goal of SplitFL is to obtain raw EEG data from various clients without centralizing the data from each client. Each heterogeneous source client learns transferable shared knowledge and transfers that knowledge to a target dataset or target user that did not participate in pre-training. The target end only provides a small calibration set. For downstream adaptation. SplitFL is a general framework that can be instantiated using different EEG decoding models that can be divided into client-side embedding modules, shared server-side encoders, and shared classification modules. This invention further proposes SplitFormer as a model instance, which includes a client-side TFE and a server-side shared GFE and Head.
[0043] As shown in Figure 1, with the first Taking a client as an example, it saves local datasets and dataset-specific TFE The central server stores the GFE shared by all clients. and Head .
[0044] No. The client first uses TFE to map different EEG samples to a unified lexical space; the central server then uses GFE to extract global features from the uploaded lexical space and uses the Head to generate classification output. This model partitioning allows the client TFE to handle low-level dataset-specific adaptation, while the shared GFE and Head are responsible for learning high-level decoding knowledge that can be transferred across datasets.
[0045] For the EEG test for each client Client-side TFE output:
[0046] in, To output the number of lexical units, This is the lexical dimension. Although the number of input channels differs between clients... and number of time sampling points They can be different, but the outputs after processing by each client's TFE have the same characteristics. Dimensions are provided for processing by the shared server-side module.
[0047] As shown in Figure 2(a), the TFE includes a time-domain branch and a frequency-domain branch: I. Temporal branching is used to extract local spatiotemporal patterns from EEG tests, and performs the following operations in sequence: A. Temporal convolution is used to extract short-time signal dynamics; B. Employing cross-channel spatial convolution to aggregate electrode information; C. Perform group normalization (GN), exponential linear unit (ELU) activation, and average pooling on the obtained features; D. Using 1×1 convolutional projection to generate temporal lexical units .
[0048] II. The frequency domain branch is used to supplement the time domain representation with spectral information, and performs the following operations in sequence: A. Divide the input EEG signal into local time windows; B. Perform a real-valued fast Fourier transform (rFFT) on each local window to obtain the spectral amplitude; C. Perform logarithmic scaling on the spectral amplitude; D. Averaging along the channel dimension; E. Generating frequency domain terms through linear projection .
[0049] Temporal and frequency domain lexical units are fused in the following way:
[0050] in, The learnable fusion coefficients are initialized to... ; Representation layer normalization. Merged It is uploaded to the central server as an intermediate word element.
[0051] Central server receives the first fusion metawords generated by a client First, global features are obtained through GFE:
[0052] The classification output is then obtained through the Head:
[0053] As shown in Figure 2(b), GFE is composed of It consists of stacked local-global fusion blocks, each of which includes a local lexical mixing module and a Transformer encoding module.
[0054] The local lexical mixing module employs depthwise separable one-dimensional convolutions along the lexical dimension. These one-dimensional convolutions aggregate the local context of adjacent lexical units, and pointwise one-dimensional convolutions further transform the features. The Transformer encoding module includes a multi-head self-attention layer and a feedforward network. The multi-head self-attention layer models the long-range dependencies of the entire lexical sequence, and the feedforward network further transforms the attention output.
[0055] make , No. The calculation of each local-global fusion block is as follows:
[0056]
[0057]
[0058] in, , and These represent local word-based mixed operations, multi-head self-attention operations, and feedforward network operations, respectively. After... After merging local and global blocks, we get .
[0059] As shown in Figure 2(c), the Head uses a dual-pooling fusion structure that combines attention pooling and mean pooling: 1. The attention pooling branch uses a linear layer to generate word-level attention scores. After Tanh activation, linear mapping, and Softmax normalization, attention weights are obtained. Then, the word features are weighted and summed to obtain the attention features:
[0060] 2. The mean pooling branch calculates the average along the word dimension to obtain the mean feature:
[0061] The two pooling features are concatenated and then normalized:
[0062] Then input the data into a multi-layer perceptron (MLP), which consists of two linear layers and Gaussian error linear units (GELUs) activated in between, to obtain the classification output:
[0063] The SplitFL pre-training process is shown in Figure 3. The client-side TFE, server-side GFE, and server-side Header are jointly optimized during the pre-training phase. Each pre-training round is divided into multiple communication rounds, allowing... Indicates the first The set of clients selected in each communication round.
[0064] For participating clients From local dataset Sampled EEG batches and labels:
[0065] in, This is the current local batch size for this client. The client calculates this using a dedicated TFE:
[0066] The client will and Uploaded to the central server, raw EEG batch Keep it locally.
[0067] The central server concatenates the terms and tags uploaded by each participating client along the batch dimension:
[0068]
[0069] in, This indicates that the data is spliced along the batch dimension. The central server calculates sequentially:
[0070] in, This represents the batch global characteristics output by the central server. This indicates the corresponding batch classification output.
[0071] The central server weights the losses of each client based on the batch size of their respective EEG data in this communication round, thus obtaining the total loss for that round:
[0072] No. The average cross-entropy loss for each batch of clients is:
[0073] in, Represents cross-entropy loss, Indicates the first The first client The classification output for each sample. This represents the corresponding real label.
[0074] Central server to Perform backpropagation, update the shared Head and shared GFE, and further calculate the loss relative to the concatenated tokens. gradient .
[0075] because It is obtained by concatenating the lexical units of each client along the batch dimension, and the central server follows the... Will Decomposed into gradients corresponding to each client and return to the client. The client continues to use the received gradients. Perform local backpropagation, updating only the TFE parameters of this client.
[0076] Each communication round sequentially executes client-side forward propagation, server-side forward propagation, server-side loss calculation and backpropagation, layered gradient return, and client-side TFE update, until all pre-training rounds are completed.
[0077] In downstream tasks, given a small amount of calibration data for the target dataset or target user:
[0078] in, This indicates the number of calibration samples at the target end.
[0079] Initialize a new target TFE Load pre-trained and And keep both parameters frozen. The prediction result for the target sample is:
[0080] The target adaptation loss is:
[0081] During the adaptation process, only based on renew No updates and After adaptation, the target-side TFE, pre-trained GFE, and pre-trained Head are used to decode the test EEG trials on the target side.
[0082] Example 2 This experiment employs the split-federated learning (SplitFL) method and uses the split representation-fusion Transformer (SplitFormer) model as a model instance to simulate EEG decoding across data silos. Each pre-training dataset serves as a source client, with each client storing the original EEG data locally and processing the local EEG signals using a dataset-specific time-frequency embedding (TFE) module. The server runs a shared global fusion encoder (GFE) and classification module across all clients. During pre-training, the client transmits intermediate lexical representations and corresponding labels generated by the TFE to the server. The server completes the shared representation learning and returns the split-level gradients to the client; the original EEG data is not transmitted to the server. During downstream adaptation, the pre-trained GFE and classification module are frozen, and the TFE is created and fine-tuned only on the target user side.
[0083] Experimental tasks were conducted on two brain-computer interface paradigms: motor imagery (MI) and event-related potential (ERP). Each paradigm was pre-trained using seven source datasets and downstream adapted and tested using three target datasets not involved in pre-training, to evaluate the model's transfer decoding capabilities across datasets and subjects. Pre-training used the AdamW optimizer for 300 epochs, and downstream adaptation for 50 epochs, with a OneCycle learning rate ranging from 2.5 × 10⁻⁶. -4 Up to 5×10 -4 The experimental results are the mean and standard deviation of five runs with different random seeds.
[0084] Motor imagery refers to the mental imagery of a subject's left or right hand, or other predetermined movements, without actually moving their limbs. Motor imagery induces event-related desynchronization and synchronization changes in the sensorimotor cortex's related rhythms, thus forming spatiotemporal patterns in the EEG signal that can be used to distinguish different motor intentions. This experiment uses left-hand and right-hand motor imagery as binary classification tasks. Motor imagery brain-computer interfaces can convert motor intentions into control commands for external devices, assisting in rehabilitation training, controlling robotic arms or wheelchairs, driving prostheses, and providing assistive interaction for individuals with limited motor function.
[0085] Event-related potentials (ERPs) are EEG responses that are temporally locked to external stimuli. This experiment used an ERP task, exemplified by P300 target detection, to binary classify the EEG trials corresponding to target stimuli and non-target stimuli that the subjects were interested in. This type of task can be applied to scenarios such as brain-computer interface spellers, visual target selection, assisted communication, and attentional state detection.
[0086] This embodiment uses publicly available EEG datasets to conduct simulation experiments, and all data used can be obtained through publicly available channels of the corresponding datasets.
[0087] The MI pre-training datasets include Cho2017, PhysionetMI, Dreyer2023, Schirrmeister2017, Zhou2016, Weibo2014, and M3CV, while the downstream target datasets include BNCI2014001, BNCI2014004, and Lee2019MI. The number of subjects, sessions, channels, number of trials, trial duration, and classification tasks for each dataset are shown in Table 1. MI data were uniformly resampled to 250 Hz and bandpass filtered from 8 to 32 Hz; each trial was pruned or padded for 4 seconds.
[0088] Table 1 Overview of the MI dataset
[0089] The ERP pre-training datasets include BI2012, BI2014a, BI2014b, BI2015a, BI2015b, BNCI2014008, and BNCI2015003, while the downstream target datasets include BI2013a, BNCI2014009, and EPFLP300. Basic information for each dataset is shown in Table 2. The ratio of target to non-target trials in the ERP data is approximately 1:5. Data is uniformly resampled to 250 Hz and bandpass filtered from 1 to 30 Hz; each trial is pruned or padded for 1 second.
[0090] Table 2 Overview of ERP Datasets
[0091] SplitFL (using SplitFormer as a model instance) is compared with 15 representative EEG decoding methods. Non-baseline model methods include EEGNet, DeepCNN, ShallowCNN, ADFCNN, IFNet, Conformer, Deformer, MSCFormer, and DBConformer; baseline model methods include BENDR, BIOT, LaBraM, EEGPT, CBraMod, and REVE. Non-baseline models are trained directly on calibration data from the target dataset, while baseline models use pre-trained weights and are fine-tuned with all parameters on calibration data. All comparison methods use the same target calibration and test set partitioning.
[0092] The MI task reports balanced accuracy (BCA), area under the receiver operating characteristic curve (AUROC), and Cohen's Kappa; the ERP task reports BCA, area under the precision-recall curve (AUC-PR), and Cohen's Kappa. BCA is the average recall for each class, AUROC measures discriminative ability at different decision thresholds, AUC-PR is suitable for imbalanced tasks, and Cohen's Kappa evaluates the consistency between predictions and labels after removing randomness consistency.
[0093] The model was evaluated on three unseen downstream target datasets. In MI, the first session for each target subject was used for calibration, and the remaining sessions were used for testing. In ERP, 150 trials were taken from the first session for each target subject for calibration, and the remaining sessions were used for testing, while maintaining the original class imbalance. During SplitFL downstream adaptation, only the target-side TFE was updated, and all trainable parameters of each baseline were updated.
[0094] The main results for the MI dataset are shown in Table 3. SplitFL achieved the highest mean values across all three evaluation metrics for the three MI target datasets. Compared to the suboptimal methods for each metric, the average BCA, AUROC, and Cohen's Kappa scores for the three datasets improved by 0.0499, 0.0283, and 0.0966, respectively. This indicates that, without centralized raw EEG data, the server-side shared encoder and classification module can learn transferable representations from multiple source clients and effectively improve cross-dataset MI decoding performance.
[0095] Table 3 shows the results of different methods on the downstream dataset of MI. Pre represents the pre-training method, and Priv represents the privacy-preserving distributed pre-training. The best and second-best results in each column are marked with bold and underline, respectively.
[0096]
[0097] The main results for the ERP dataset are shown in Table 4. In the ERP task, SplitFL achieved the highest mean values on all three target datasets and on the three metrics: BCA, AUC-PR, and Cohen's Kappa. Compared with the suboptimal methods for each metric, the average BCA, AUC-PR, and Cohen's Kappa values for the three datasets were improved by 0.0501, 0.0392, and 0.0251, respectively, indicating that the proposed method can adapt to the ERP decoding task with an imbalance between target and non-target trials.
[0098] Table 4 shows the results of different methods on the downstream dataset of ERP. Pre indicates the pre-training method, and Priv indicates privacy-preserving distributed pre-training. The best and second-best results in each column are marked with bold and underline, respectively.
[0099]
[0100] Based on the above experimental results, the segmented federated learning method proposed in this invention can achieve collaborative pre-training, privacy protection, and lightweight downstream adaptation of EEG decoding models under cross-data silo conditions. The technical effects of this embodiment are summarized as follows: 1. Expand the scale of pre-training data: Use datasets from multiple institutions or laboratories as independent source clients to participate in collaborative pre-training, thereby expanding the scale of effective pre-training data without centralizing the original EEG data and improving the final decoding performance.
[0101] 2. Protect data resources and reduce client burden: The client retains the original EEG data and dataset-specific embedding modules, while the server completes the training of the shared model through intermediate representations and layered gradients, avoiding direct transmission of original EEG data and complete model parameters across institutions; the client only performs computations on lightweight embedding modules, structurally reducing the client's computational and communication burden.
[0102] 3. Rapid Adaptation to Target Users: In the downstream stage, the pre-trained knowledge on the server side is frozen, and only the TFE on the target side is fine-tuned. Taking the BNCI2014001 dataset as an example, the TFE accounts for only 4.54% of the parameters of the complete SplitFormer model. Adaptation to the target dataset can be achieved with limited calibration data, and decoding metrics that are superior to the compared baseline are obtained in the MI and ERP main experiments.
[0103] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A segmentation federated learning method for decoding EEG data across data silos, characterized in that, This includes the pre-training phase and the downstream adaptation phase; The pre-training phase includes: The EEG decoding model was trained using K source EEG datasets, K 2. The training architecture of the EEG decoding model includes K clients and a central server; each client corresponds to a source EEG dataset and includes a client embedding module, and the central server includes a server encoder and a server classification module shared by the K clients; During training, each client embedding module maps EEG trials from its corresponding source EEG dataset to intermediate tokens with a uniform number and dimension, and sends the intermediate tokens and their corresponding ground truth class labels to the central server. The central server concatenates the intermediate tokens from different client embedding modules along the batch dimension to obtain concatenated tokens. The server encoder extracts global features from the concatenated tokens, and the shared server classification module performs classification prediction on the global features to obtain the classification results. The classification results of each client are divided from the classification results, and the error between the classification results of each client and its ground truth class label is used as the classification loss of each client. The classification losses of each client are then weighted according to the batch size of each client to obtain the total loss. Backpropagation is used to update the server encoder and server classification module. The gradient of the total loss relative to the concatenated tokens is calculated, the gradient is split according to the batch size of each client, and the split gradients are sent to the corresponding clients. Each client continues to backpropagate based on the received gradients to update its own client embedding module. Training is completed until convergence, resulting in a pre-trained server encoder, server classification module, and K client embedding modules. The downstream adaptation stage includes: for target users who have not participated in pre-training, creating and initializing a target-end embedding module, loading and freezing the pre-trained server-end encoder and server-end classification module, forming an EEG decoding model to be adapted with the target-end embedding module, training the EEG decoding model to be adapted using the target user's calibration data, updating only the target-end embedding module, training until convergence, and obtaining a trained EEG decoding model.
2. The segmentation federated learning method for EEG decoding across data silos as described in claim 1, characterized in that, The client-side embedded module includes a time-domain branch and a frequency-domain branch; The temporal branch extracts local spatiotemporal patterns from EEG trials using temporal and spatial convolutions to obtain temporal lexical units. The frequency branch extracts local spectral information from EEG trials through time window segmentation, real-valued fast Fourier transform, amplitude calculation, logarithmic scaling, and channel averaging to obtain frequency lexical units. The temporal and frequency lexical units are fused using learnable coefficients to obtain intermediate lexical units.
3. A segmentation federated learning method for EEG decoding across data silos as described in claim 1 or 2, characterized in that, The server encoder is composed of multiple local-global fusion blocks stacked together, and each local-global fusion block includes a local lexical mixing module and a Transformer encoding module; The central server concatenates intermediate lexical units from different client embedding modules along the batch dimension to obtain concatenated lexical units. The local lexical unit mixing module applies depthwise separable one-dimensional convolution to the concatenated lexical units along the lexical dimension to extract local relationships between adjacent lexical units, resulting in a locally mixed lexical unit sequence. The Transformer encoding module includes a multi-head self-attention layer and a feedforward network. The multi-head self-attention layer models long-range dependencies on the locally mixed lexical unit sequence, and the feedforward network transforms the output of the multi-head self-attention layer to obtain global features.
4. A segmentation federated learning method for EEG decoding across data silos as described in claim 1 or 2, characterized in that, The shared server classification module adopts a dual-pooling structure that combines attention pooling and mean pooling. After performing attention pooling and mean pooling on the global features respectively, two branches of features are obtained. The features of the two branches are concatenated and then classified by layer normalization and multilayer perceptron.
5. A method for decoding electroencephalograms (EEGs) across data silos, characterized in that, include: The target user's EEG test is input into a trained EEG decoding model for decoding to obtain the decoding result; The trained EEG decoding model is obtained by a segmentation federated learning method for cross-data silo EEG decoding as described in any one of claims 1 to 4.
6. A segmentation federated learning system for decoding EEG data across data silos, characterized in that, include: The pre-training module uses K source EEG datasets to train the EEG decoding model, K 2. The training architecture of the EEG decoding model includes K clients and a central server; each client corresponds to a source EEG dataset and includes a client embedding module, and the central server includes a server encoder and a server classification module shared by the K clients; During training, each client embedding module maps EEG trials from its corresponding source EEG dataset into intermediate tokens with a uniform number and dimension of tokens, and sends the intermediate tokens and their corresponding ground truth class labels to the central server. The central server concatenates the intermediate tokens from different client embedding modules along the batch dimension to obtain concatenated tokens. The server encoder extracts global features from the concatenated tokens, and the shared server classification module performs classification prediction on the global features to obtain the classification results. The classification results of each client are divided from the classification results, and the error between the classification results of each client and their ground truth class labels is used as the classification loss of each client. The classification losses of each client are then weighted according to the batch size of each client to obtain the total loss. Backpropagation is used to update the server encoder and the server classification module. The gradient of the total loss relative to the concatenated tokens is calculated, the gradient is split according to the batch size of each client, and the split gradients are sent to the corresponding clients. Each client continues to backpropagate based on the received gradients to update its own client embedding module. Training continues until convergence, yielding a pre-trained server-side encoder, a server-side classification module, and K client-side embedding modules; The downstream adaptation module creates and initializes a target-end embedding module for target users who have not participated in pre-training, loads and freezes the pre-trained server-side encoder and server-side classification module, and forms an EEG decoding model to be adapted together with the target-end embedding module. The EEG decoding model to be adapted is trained using the calibration data of the target user, and only the target-end embedding module is updated. The training continues until convergence, and a trained EEG decoding model is obtained.
7. A segmentation federated learning system for cross-data silo EEG decoding as described in claim 6, characterized in that, The client-side embedded module includes a time-domain branch and a frequency-domain branch; The temporal branch extracts local spatiotemporal patterns from EEG trials using temporal and spatial convolutions to obtain temporal lexical units. The frequency branch extracts local spectral information from EEG trials through time window segmentation, real-valued fast Fourier transform, amplitude calculation, logarithmic scaling, and channel averaging to obtain frequency lexical units. The temporal and frequency lexical units are fused using learnable coefficients to obtain intermediate lexical units.
8. A segmentation federated learning system for EEG decoding across data silos as described in claim 6 or 7, characterized in that, The shared server encoder is composed of multiple local-global fusion blocks stacked together, and each local-global fusion block includes a local lexical mixing module and a Transformer encoding module; The central server concatenates intermediate lexical units from different client embedding modules along the batch dimension to obtain concatenated lexical units. The local lexical unit mixing module applies depthwise separable one-dimensional convolution to the concatenated lexical units along the lexical dimension to extract local relationships between adjacent lexical units, resulting in a locally mixed lexical unit sequence. The Transformer encoding module includes a multi-head self-attention layer and a feedforward network. The multi-head self-attention layer models long-range dependencies on the locally mixed lexical unit sequence, and the feedforward network transforms the output of the multi-head self-attention layer to obtain global features.
9. A segmentation federated learning system for EEG decoding across data silos as described in claim 6 or 7, characterized in that, The shared server classification module adopts a dual-pooling structure that combines attention pooling and mean pooling. After performing attention pooling and mean pooling on the global features respectively, two branches of features are obtained. The features of the two branches are concatenated and then classified by layer normalization and multilayer perceptron.
10. A computer program product, characterized in that, When the product is running, it enables the computer to execute the segmentation federated learning method for EEG decoding across data silos as described in any one of claims 1 to 4, or the EEG decoding method for cross-data silos as described in claim 5.
