Cross-subject BCI decoding, with the adaptation methods as blocks

CORAL, MMD alignment, Transfer Component Analysis, a DANN discriminator, feature alignment and subject adaptation — assembled on the same canvas as the model they feed.

A decoder trained on one subject rarely survives contact with the next. Electrode impedance, montage placement, anatomy, alertness and session-to-session drift all shift the feature distribution, and a model with no mechanism to account for that shift transfers badly — which is why cross-subject accuracies in the literature sit so far below within-subject ones.

Domain adaptation is the family of methods that addresses the shift directly, by aligning source and target distributions rather than hoping the model generalises. In BCILattice they are blocks on the ML Suite canvas, and they are free on every plan.

The adaptation blocks

Alongside them sits a Domain Incremental Learning family for the continual-learning case, where new subjects or sessions arrive over time rather than all at once.

BlockWhat it does
CORAL AdapterAligns the second-order statistics — the covariance — of the source and target feature distributions.
MMD AlignerMinimises maximum mean discrepancy between source and target, a kernel-based distribution distance.
Transfer Component AnalysisLearns a shared subspace in which the marginal distributions of the two domains are close.
DANN DiscriminatorAdversarial domain-adversarial training: a discriminator tries to tell the domains apart, the encoder learns features it cannot.
Feature AlignmentDirect alignment of feature-space statistics between domains.
Subject AdaptationSubject-specific adaptation of a model trained across a cohort.

Not an upsell

One hundred and eighteen of the 119 blocks in the catalogue are free on every plan, and the domain adaptation family is among them. So are continual learning, federated averaging, conformal prediction, neural architecture search and the reinforcement learning trainers.

The single gated block is Custom Code, which executes arbitrary Python you supply.

Adaptation makes the evaluation harder, not easier

A cross-subject claim requires a grouped split: the target subject must be wholly absent from training. Any leakage of target trials into the training fold turns a transfer result into a within-subject one wearing the wrong label.

The Results validation tab infers the grouping from the run and states which comparisons the design supports. If the split does not license a cross-subject claim, the result is still listed with its real number and a flag rather than being quietly presented as transfer.

When to reach for it

  • Cross-subject decoding

    A model that must work on a subject who contributed no training data.

  • Cross-session

    The same subject on a different day, with a re-mounted cap and different impedances.

  • Cross-device

    Recordings from two acquisition systems in one cohort, where the shift is instrumental as well as physiological.

  • fNIRS especially

    Between-subject variability in optode coupling and placement is large, which is why fNIRS models transfer worse than EEG ones by default.

Questions

Which domain adaptation method should I try first?

CORAL, usually. It aligns covariance, needs no adversarial training, is cheap to run, and gives you a baseline transfer number before you invest in a DANN setup that is harder to tune.

Do I need labelled target data?

It depends on the method. CORAL, MMD and TCA align distributions and can work with unlabelled target data; subject adaptation and supervised fine-tuning need labels from the target. The block you choose determines the answer.

Does domain adaptation work for fNIRS as well as EEG?

Yes, and it matters more there. fNIRS between-subject variability from optode placement and coupling is substantial, so a within-subject model transfers poorly without alignment.

How do I report a cross-subject result honestly?

Use a grouped split with the target subject wholly held out, evaluate with nested cross-validation if you tuned anything, and report the per-fold scores rather than only the mean. The validation tab checks all three against the run design.

Read the reference

Related

Run a study end to end, on your own machine

The free plan covers two studies, the full analysis suite, and 118 of the 119 ML blocks.