Federated EEG Pretraining in a Shared Cortical Source Space

Hospitals and consumer headset makers record brain activity with very different electrode layouts. A clinical cap may have 19 or 22 scalp channels, a research cap 62 or 64, and a consumer headband 14 placed mostly over the forehead. The signals are also very noisy: scalp electroencephalography (EEG, voltages recorded on the scalp) is blurred by the skull and swamped by blinks and muscle activity. Privacy rules keep these recordings inside each institution, so collaborative training has to be federated, meaning each site trains locally and only model updates are averaged. Every federated EEG system we found assumes all sites share one electrode layout. Every layout-agnostic EEG model we found is trained on pooled data.

We propose to make sites with different layouts speak the same language by fixing the model's internal "channels" to a common set of cortical source regions. The physics of how brain sources project onto scalp electrodes, known as volume conduction, is the same for every site and can be computed from a template head without touching private data. That physics also tells the server, for each site, which brain regions its electrodes can actually see and how badly its noise obscures them. Updates are then averaged region by region, weighted by that visibility. A 14-channel forehead headband should improve the model's frontal regions and leave its occipital regions mostly alone.

Core Claim

Under federation, a layout-agnostic encoder runs into a failure that does not occur when it is trained on pooled data. Methods such as CHARM's learned canonical queries (Learning From Heterogeneous Eeg Signals with Differentiable Channel Reordering) map arbitrary input channels into a fixed set of internal slots. In centralized training, all layouts appear in the same batches, so the meaning of each slot is bound jointly. In federated training, each site's gradients come only from its own layout. Plain averaging then mixes slot parameters that may have drifted toward different meanings at different sites. Sites with few electrodes or low signal-to-noise ratio (SNR) contribute what amounts to noise for slots they cannot observe.

Our claim is that two things restore a consistent shared representation. The first is anchoring each slot to a fixed cortical source patch through a template forward model. The second is weighting each site's update to each slot by how well that site observes that source. The prediction is concrete: the gain over plain federated averaging should grow as layouts become more different and per-site noise becomes more uneven, and it should vanish when all sites share one layout.

Research Program

The encoder has three parts. First, a source-space front end maps a site's $C_k$ electrodes onto $S$ fixed cortical patches (on the order of a few hundred). Its weights are initialized from, and regularized toward, a regularized inverse of the template forward matrix for that site's montage. Electrode positions in standard 10-20 naming are public metadata, not patient data. Second, a shared temporal transformer runs over the source tokens. Third, a light task head is kept local. The forward-model matrix $L_k \in \mathbb{R}^{C_k \times S}$ gives the scalp voltage that unit activity in each patch produces at each electrode of site $k$.

Each site estimates its own noise covariance $N_k$ from baseline or artifact-labeled segments and forms an inverse and its resolution matrix:

$$W_k = L_k^\top (L_k L_k^\top + N_k)^{-1}, \qquad R_k = W_k L_k .$$

The diagonal entry $R_k[s,s]$ lies between 0 and 1. It measures how much of patch $s$'s true activity survives site $k$'s electrode coverage and noise. Few electrodes near $s$ or a large $N_k$ both push it toward zero. Sites send these $S$ scalars once, not their data or noise covariance.

The server aggregates parameters attached to slot $s$ (its embedding and per-source projection) as

$$\theta_s \leftarrow \frac{\sum_k n_k\, R_k[s,s]\, \theta_{k,s}}{\sum_k n_k\, R_k[s,s]},$$

where $n_k$ is the site's sample count and $\theta_{k,s}$ the site's local update for slot $s$. The shared trunk is aggregated with standard FedAvg, or with SCAFFOLD's drift-correcting control variates, which Federated GNNs for EEG-Based Stroke Assessment found helpful across hospitals.

Local pretraining uses latent-space masked prediction in the style of EEG2Rep. That method predicts the hidden representations of masked contiguous time blocks rather than raw voltages, which avoids spending capacity reproducing artifacts. We apply it over source tokens, and we add a modest amount of CHARM-style channel masking so that sites see their own partial-coverage regimes.

The related work plays three roles here. CHARM and UniArray supply the method idea of mapping arbitrary sensor sets to a canonical shape. UniArray does this with virtual microphones and a learned spatial dictionary for airborne sound. Our canonical shape is instead dictated by the physics of volume conduction, and both papers train centrally. Federated Transfer Learning for EEG Signal Classification federates spatial covariance features and mixEEG federates EEG with tailored mixup. Both motivate the work by showing federation helps EEG, and both constrain it by requiring identical montages. MVPFormer handles per-patient intracranial layouts with relative channel attention, but it is centralized. Its reported plateau from 75M to 1.2B parameters, attributed to data starvation (MVPFormer, full version), is the larger reason to want cross-site training.

We restrict this proposal to scalp EEG. Intracranial electrode positions are patient-specific and arguably identifying, and a template head model is a poor fit for them.

Baselines

The naive reference points are local-only training at each site and a common-subset model. Local-only training is the same encoder trained on each site's data alone; the stroke study reports that isolated hospital models were clearly worse than federated ones. The common-subset model uses only the electrodes every site shares, aggregated with FedAvg. It is the simplest way to make federation type-check.

The strongest existing competitor is federated CHARM-CQ. This is the CHARM canonical-query encoder with CMSAugment channel masking, trained with FedAvg and with SCAFFOLD. It is the only cited layout-agnostic EEG model with strong missing-channel robustness: on TUH Seizure with 75% of channels missing it reports accuracy 0.704 against 0.171 for a standard CNN (CHARM). We found no reported result on Lacuna for any federated, heterogeneous-montage EEG model, so we will establish this baseline ourselves.

A second strong competitor is the interpolation route. Every site interpolates its electrodes onto a common 10-20 montage with spherical splines. A fixed-montage model is then trained with mixEEG augmentation and FedAvg. mixEEG reports cross-subject accuracy on SEED improving from 77.0% to 86.3% under domain generalization, and on CHB-MIT four-class epilepsy detection from 43.6% to 47.6% (mixEEG).

The upper bound is the same model trained centrally on pooled data. In the stroke study, federation matched centralized training (MAE 3.22–3.23 versus 3.22 ± 0.12), and we expect a similar gap to close only under homogeneous layouts.

All methods share the encoder size, the pretraining objective, the number of communication rounds, the local epochs per round, and the hyperparameter search budget, with 20 configurations per method tuned on held-out validation sites. Three ablations isolate the key ingredients. The first keeps source anchoring but uses uniform weights, which tests whether the weighting matters. The second uses visibility weights with the inverse computed without $N_k$, which tests whether accounting for noise matters. The third keeps the source-space front end but replaces latent masked prediction with supervised training, which tests the low-SNR objective.

Beating the field means two things on held-out sites with unseen montages. Downstream accuracy must exceed federated CHARM-CQ and the interpolation route by a margin larger than seed variance across five seeds. The gap must also widen as layout heterogeneity and noise imbalance increase.

Why not just…?

Why not just interpolate everyone onto a standard montage? This is the real threat. Spline interpolation is itself a crude linear volume-conduction model. The two approaches differ in what they claim to know. Interpolation fabricates channels over unobserved scalp, and averaging then treats those fabricated channels as if they were measured. Our method instead down-weights unobserved regions explicitly. If interpolation plus mixEEG matches us in the controlled sweep, the visibility weighting is not earning its keep, and we would report the simpler method.

Why not just federate CHARM as is? It may work when layouts overlap heavily. Our hypothesis is that its learned slots lose cross-site consistency when layouts barely overlap. We test this directly with the slot-consistency measure described below; if CHARM's slots stay aligned, the anchoring argument is wrong.

Why not just use the channels everyone shares? With a 14-channel frontal headband in the federation, the shared subset can shrink to a handful of electrodes. UniArray's drop from 13.76 to 9.87 dB SI-SDRi when falling back to a single channel (UniArray) illustrates how much spatial information is discarded. Our common-subset baseline measures this cost on EEG directly.

Proposed Experiments

The controlled study starts from PhysioNet Motor Imagery (64 channels, 109 subjects), split into simulated sites. Each site is assigned a subsampled montage of 14 frontal, 19 standard 10-20, 32, or 64 channels, and a controlled level of added artifact-like noise, so that ground truth is known. We sweep two axes: montage overlap and noise imbalance between sites.

The decisive check is a region-specific failure. Motor imagery depends on sensorimotor sources, and the 14-channel noisy sites barely observe them. Under uniform averaging, adding these sites should hurt held-out accuracy; under visibility weighting, it should not. We also measure slot consistency: for held-out subjects, we compare centered-kernel-alignment similarity of each slot's representation across site-specific models after local updates. Anchoring should keep this similarity high where federated CHARM's degrades.

The realistic study treats each dataset as an institution with its native layout. TUH Abnormal and TUH Seizure supply 17–22 heterogeneous clinical channels, CHB-MIT supplies pediatric clinical recordings, SEED supplies 62 research channels, and DREAMER supplies 14 consumer channels. Federated pretraining runs across all five. Evaluation is leave-one-site-out, using linear probing and fine-tuning on the held-out site, alongside the per-dataset tasks the cited papers use. This allows direct comparison with CHARM's reported 0.963 on CHB-MIT after TUH pretraining (against 0.891 without) and with mixEEG's SEED and CHB-MIT numbers, while noting that those were obtained centrally or with homogeneous montages respectively.

A negative control reruns the method with all sites on one identical montage. There it should match FedAvg; if it beats FedAvg, the gain is coming from something other than visibility.

The main risk is that the template forward model is too inaccurate for individual heads. Initializing from the template while allowing learned deviations, together with the noise-free inverse ablation, will show whether the physics prior helps or merely constrains.