Shrinkage-Controlled Re-Centering for Few-Sample EEG Domain Adaptation

EEG models break when they move to a new hospital, a new headset, or a new patient. A widely used fix works on the matrices that describe how electrode signals co-vary. These covariance matrices live on a curved space, the manifold of symmetric positive definite (SPD) matrices. The fix computes the average covariance matrix of the new domain and moves every recording so that this average sits at a common reference point, which is called re-centering. The fix has two weaknesses, and both get worse when the new domain is small. With only three patients, or ten minutes of a night's recording, the domain average is mostly noise, so re-centering moves the data by a random amount. Even when the average is accurate, part of it is real signal rather than nuisance. Older cohorts have different covariance structure because they are older, and early-night recordings differ because they contain more deep sleep. Re-centering erases that signal.

We propose deciding how far to move a new domain by treating its offset as an unknown to be estimated, and doing that estimation with empirical Bayes. Many source domains tell us how much domains typically differ for nuisance reasons, and they also tell us how covariances depend on the label. A new domain with few samples is then only partly re-centered. The step size shrinks toward zero when its average is unreliable, and the step removes only the part of the offset that the label does not explain. No target labels or target label statistics are required.

Core Claim

The closest prior work is Geodesic Optimization for Predictive Shift Adaptation on EEG data (GOPSA). It showed that full re-centering destroys age-related variance across EEG sites. It learns how far to move each site along the shortest curved path (the geodesic) between the site mean and the identity matrix. Its weakness is that it needs the true mean target value $\mathbb{E}[y]$ of the new site at test time. It was also evaluated only on large sites and only for regression. On the statistics side, An Empirical Bayes Approach to Shrinkage Estimation on the Manifold of Symmetric Positive-Definite Matrices supplies James–Stein-style shrinkage for SPD means when samples are scarce. It never uses that shrinkage for domain adaptation.

We claim that combining the two answers a question neither paper addresses: how far to re-center a domain from which only a handful of samples are available. The amount of re-centering should be a posterior quantity that depends on three things. These are the number of samples, the spread of nuisance offsets across source domains, and an estimate of the label-driven offset obtained without labels. We expect this method to match GOPSA's label-informed performance without $\mathbb{E}[y]$. We also expect it to beat full re-centering and no re-centering by a margin that grows as target sample size shrinks.

Model

We work in the log-Euclidean tangent space, where a covariance $C$ is represented by its matrix logarithm $\log C$. This lets averages and shrinkage be computed in closed form. We still interpret the final movement as a step along a geodesic.

For domain $d$ with $n_d$ recordings, let $\hat m_d$ be the mean of $\log C_i$. We model

$$\hat m_d = \mu + B\,\bar z_d + u_d + \varepsilon_d,\qquad u_d\sim\mathcal N(0,\tau^2 I),\quad \varepsilon_d\sim\mathcal N(0,\sigma^2 I/n_d).$$

The symbols are defined as follows. $\mu$ is the population reference. $\bar z_d$ is the domain's label summary, meaning mean age for regression or the vector of sleep-stage proportions for classification. $B$ maps label summaries to tangent-space shifts. $u_d$ is the nuisance offset, coming from the site, amplifier, or individual skull, and it is what we want removed. $\varepsilon_d$ is the sampling noise of the average.

We estimate $\mu$, $B$, $\tau^2$, and $\sigma^2$ from the source domains. $B$ comes from subject-level or epoch-level regression of $\log C$ on labels, pooled across sources. This matters because 14 sites are too few to fit $B$ from site means alone. The posterior mean of the nuisance offset is then a shrunken residual:

$$\hat u_d = \frac{\tau^2}{\tau^2+\sigma^2/n_d}\,\big(\hat m_d-\mu-B\,\hat{\bar z}_d\big).$$

We subtract $\hat u_d$ from every target recording. With many samples this reduces to "remove only the unexplained offset," which is GOPSA's behavior. With very few samples the correction vanishes smoothly instead of injecting noise.

The unknown label summary $\hat{\bar z}_d$ is estimated by alternating two steps. First, the source-trained predictor is applied to the currently aligned target data. Second, the predicted label summary is plugged back into the equation above. In classification this is the standard expectation-maximization update for class proportions, which we initialize at the source proportions.

When single recordings are short, the individual covariances themselves get standard Ledoit–Wolf shrinkage before taking logarithms. We treat that step as a fixed preprocessing choice, not a contribution.

Research Program

The work has three parts.

Estimator and diagnostics. We will implement the estimator above for both regression and sleep-stage classification. We will measure how well $\hat m_d - \hat u_d$, computed from a small subsample, approximates the full-data reference. We will also check whether the learned shrinkage factor tracks the empirically best step size along the geodesic, found by oracle sweep.

Stability of the alternation. We will study when the label-estimation loop converges and when it drifts. The specific failure mode is predictions confirming their own bias. To detect it, we will compare against oracle $\bar z_d$ and against $\bar z_d$ estimated from a labeled support set of 1 to 5 examples per class.

Model capacity and curvature. We will test whether the scalar-$\tau^2$ assumption is too crude by comparing it with a diagonal $\tau^2$ estimated by Stein's unbiased risk estimate, following the JASA paper. We will also test whether moving from log-Euclidean to affine-invariant geometry changes conclusions, at the cost of iterative mean computation.

We deliberately use a lightweight downstream model, either tangent-space ridge or logistic regression, or a frozen SPDTransNet. This way any gain is attributable to the alignment step rather than to model capacity.

Baselines

No re-centering. The source-trained model is applied to raw target covariances. This is the do-nothing reference. If our method cannot beat it at the smallest target sizes, the shrinkage is too weak to matter.

Full re-centering. Each target domain's own mean is moved to the identity matrix, as in the Riemannian whitening used by Automatic Classification of Sleep Stages from EEG Signals Using Riemannian Metrics and Transformer Networks. This is the standard practice the proposal argues against. It is computed on exactly the same subsampled target data.

GOPSA with oracle $\mathbb{E}[y]$. This is the strongest existing method and an upper reference, because it is given information we withhold. On HarMNqEEG it reports mean $R^2$ of 0.59 and MAE of 8.37 years. Its "DO intercept" baseline reports $R^2$ 0.57 and MAE 8.64 years (GOPSA). We will rerun GOPSA in our leave-one-site-out protocol, at each subsampled target size, with the same tangent-space ridge and the same hyperparameter search budget. Beating it is not required. We count it a success if our label-free method stays within 0.02 $R^2$ of oracle GOPSA at full site size. We count it a clear win if, at target sizes of 10 or fewer subjects, our method exceeds GOPSA given $\mathbb{E}[y]$ estimated from the same few subjects' labels.

Sleep staging comparisons. For the classification setting there are two baselines. The first is SPDTransNet direct transfer, which reports 78.23% macro F1 on MASS-SS3→MASS-SS1 without retraining (SPDTransNet). The second is TPON, a Euclidean transductive prototype method, which reports 87.1% accuracy and 81.7 macro F1 for 5-way 10-shot on SleepEDF-2013 (Few-shot EEG sleep staging based on transductive prototype optimization network). TPON will be retrained under our splits rather than compared on reported numbers.

Ablations. Two ablations isolate the key ingredients. The first keeps shrinkage but removes the label term (set $B=0$). The second keeps the label term but removes shrinkage (factor fixed at 1). If either ablation alone matches the full method, the corresponding half of the claim fails.

Why not just…?

Why not just re-center and accept the noise? At large target sizes, full re-centering may well be fine for nuisance removal. Its error from sampling noise falls roughly as $1/\sqrt{n_d}$, because it is a sample mean. GOPSA's results show it still removes label signal at any size. The target-size sweep below measures directly where full re-centering crosses below no re-centering. If it never does, the shrinkage half of our proposal is unnecessary, and we will say so.

Why not just apply Ledoit–Wolf or a fixed shrinkage weight to the target mean? This is the most serious threat. In the tangent space, our estimator is a form of linear shrinkage, so a hand-tuned weight could match it. The difference is that our weight comes from source-domain variance and adapts per target size, with no tuning on target data. Our weight also shrinks toward a label-adjusted point rather than toward $\mu$. We will include a baseline that uses the best single fixed weight, chosen by cross-validation over source sites. If that baseline matches the full method, the honest conclusion is that the label decomposition, not the Bayesian machinery, is the contribution.

Why not just run GOPSA with $\mathbb{E}[y]$ estimated from a few labeled support subjects? This is natural when a few labels exist, and we include it as a baseline. With 3 to 5 subjects, though, the label mean has large variance. GOPSA has no mechanism to shorten its step when the estimate is unreliable. Our method uses support labels, when available, to improve $\hat{\bar z}_d$ while still shrinking the step.

Why not just fine-tune a pretrained model or use Euclidean prototypes? Small clinical cohorts make fine-tuned networks memorize site artifacts (Chest X-ray investigation). Transfer of single-channel deep models from MASS-SS3 to MASS-SS1 drops by over 15 points (SPDTransNet). TPON confuses N1 with REM. These approaches are also complementary to alignment, so we will additionally report TPON trained on our aligned covariance features.

Why not just augment the target data? Generative augmentation adds no new information about the domain's offset. MEMD recombination plateaus beyond roughly doubling the data and hurts temporal models (Assessing the Potential of Data Augmentation in EEG Functional Connectivity for Early Detection of Alzheimer's Disease). For this reason we do not treat augmentation as a primary competitor.

Proposed Experiments

Regression on HarMNqEEG. We use the 14-site, 1,564-participant age-regression benchmark with leave-one-site-out evaluation. The held-out site is subsampled to 3, 5, 10, 20 subjects, or the full site, with 50 random draws per size. We report $R^2$ and MAE. The decisive check is the curve of performance against target size. Our method should never fall below no re-centering. It should approach oracle GOPSA as size grows. It should beat full re-centering by the largest margin at 3 to 5 subjects.

Cold-start sleep staging on MASS. Source domains are the 62 MASS-SS3 subjects, which give a well-estimated $\tau^2$. The target subjects come from MASS-SS1, the older cohort with mild cognitive impairment. Each target subject's reference is estimated from only the first 30, 60, or 120 thirty-second epochs of the night.

This setting stresses the label term. Early-night epochs are rich in deep sleep, and older subjects have less of it, so naive re-centering on an early window should shift every epoch toward the wrong stages. We report macro F1 and per-stage F1, with N1 singled out. The decisive check compares three conditions: with the label term, with $B=0$, and with oracle stage proportions. If the label term does not reduce the gap between oracle and naive re-centering on early windows, the label-decomposition half of the claim is falsified.

Few-shot classification on SleepEDF-2013. As a secondary check against TPON, we run its 5-way 10-shot protocol and use the support set to sharpen $\hat{\bar z}_d$.

Diagnostics. Across all settings, we report the distance between subsample-based and full-data references, and the learned versus oracle step size. These diagnostics show whether the posterior step is calibrated, not just whether accuracy improved.