Source-linked AI summary
Memory-Augmented Online Test-Time Adaptation for EEG Motor Imagery via Perturbation Consistency and Confidence Calibration
Kunkun Zhang, Kehao Wu, Zhitao Chen, Haigen Hu, Qianwei Zhou
TL;DR
Cross-subject EEG decoding faces distribution shifts, while many adaptation methods rely on offline data access or repeated passes. MOPC uses memory-augmented, source-free single-pass adaptation; it outperforms comparison methods on two MI-BCI datasets, with reported gains including 2.22% over T-Time on BCI IV IIb.
Problem
Cross-subject signal differences degrade EEG decoding reliability, and many existing adaptation methods require offline target-set passes or source access that do not fit continuous, trial-by-trial BCI use.
Source: §I · pp. 1–2Method
MOPC adapts a source-trained ensemble in a single pass using recent-trial memory, perturbation consistency, joint entropy minimization, and confidence-calibrated reweighting.
Source: §I · p. 2Results
MOPC consistently outperforms DT, DA, and state-of-the-art TTA baselines on both datasets; it reaches 81.23% average accuracy on BCI IV IIb and improves 2.22% over T-Time there.
Source: 1) Class-Balanced Accuracy Evaluation · p. 7, §V · p. 11Takeaways & Limitations
The authors conclude that MOPC provides source-free, single-pass cross-subject decoding with stable measurement reliability and fewer than 60 ms of update latency.
Source: §V · p. 11
Abstract
from arXiv · showhide
Recently, electroencephalography (EEG)-based brain--computer interfaces (BCIs) have gained traction as portable neural measurement systems. However, the practical deployment of these instruments is often hindered by nonstationarity and cross-subject distribution shifts, which lead to significant intersubject inconsistency. Existing adaptation methods remain impractical for real-time measurement scenarios, as they typically require offline access to source or aggregated target data. To address these challenges, this article proposes memory-augmented online test-time adaptation (OTTA) with perturbation consistency and confidence calibration (MOPC), a source-free framework designed to enhance the reliability of BCI instrumentation. MOPC enables the measurement system to update its decoding parameters on the fly during the inference stage, facilitating single-pass adaptation without accessing sensitive source data. We introduce random-mask perturbations to enforce prediction consistency against inherent EEG signal noise and acquisition artifacts. Furthermore, a confidence-calibrated reweighting loss is designed to integrate feature-space similarity, effectively mitigating unreliable pseudolabels and class imbalance during continuous signal acquisition. To ensure system stability and prevent the catastrophic forgetting of established neural patterns, a lightweight memory module is incorporated to regularize parameter updates within a tight latency budget. Evaluated on the BCI IV IIb and OpenBMI datasets, MOPC achieves state-of-the-art performance, outperforming prior methods by 2.22~\% and 3.67~\%, respectively, while keeping the per-trial adaptation latency to approximately 40--60 ms. This study provides a robust, recalibration-free solution for real-time EEG decoding, marking a significant advancement in the precision and usability of practical BCI measurement instruments.
I. INTRODUCTION
Cross-subject EEG motor-imagery decoding is vulnerable to signal drift, while many adaptation approaches require offline data access or repeated passes. MOPC adapts in a source-free, single-pass stream using memory and EEG-oriented objectives.
I. INTRODUCTION
- Signal differences between subjects can sharply reduce decoding reliability, while per-subject recalibration lengthens setup and undermines repeatability.The paper frames cross-subject variability as instrument drift.Source: §I · p. 1
- Existing adaptation methods often require offline target-set passes, and UDA additionally requires source recordings at deployment, unlike single-pass OTTA.The introduction also notes that common OTTA methods overlook EEG trial noise and class-balance drift.Source: §I · pp. 1–2
- MOPC combines a FIFO memory for adaptive Euclidean alignment with perturbation consistency, joint entropy minimization, and confidence-calibrated reweighting.The reweighting uses same-class feature similarity and effective-number class weights to address unreliable pseudolabels and class drift.Source: §I · p. 2
- Each arriving trial updates only one member’s batch-normalization parameters in a round-robin schedule, keeping adaptation lightweight and class-count independent.MOPC starts from a cross-subject source ensemble and adapts from unlabeled trials without retraining.Source: §I · p. 2
II. METHODOLOGY
The methodology treats cross-subject motor-imagery decoding as prediction on an unlabeled target stream, using a source-trained model to map EEG trials into features and class probabilities.
A. Preliminaries
- The source model is trained end-to-end on pooled labeled trials from multiple source subjects, with a feature extractor followed by a classifier.The model maps each trial to a latent feature vector and then to a probability vector over classes.Source: A. Preliminaries · p. 3
- An EEG trial is represented as a C × T signal, and the feature extractor maps it to a D-dimensional latent vector before class scoring.The supplied passage specifies D = 32 and Y class scores.Source: A. Preliminaries · p. 3
- At deployment, an unlabeled stream comes from a subject outside the source domains, and OTTA predicts each arriving trial while adapting the pretrained model.The stream is presented sequentially, one target signal at a time.Source: A. Preliminaries · p. 3
B. Domain Prealignment
The methodology prealigns domains, trains an ensemble of source models, and combines their outputs for sequential predictions.
B. Domain Prealignment
- Target alignment is re-estimated from the most recent B trials, making alignment evolve as the stream changes.Euclidean alignment is used to reduce source–target shift by aligning trial covariances.Source: B. Domain Prealignment · pp. 3–4
C. Source Model Training
- EEGNet is used as the efficient backbone, and leave-one-subject-out cross-validation trains five source models for the ensemble.The best model from each fold is retained after cross-entropy training.Source: C. Source Model Training · p. 4
1) Soft Voting Ensemble Learning:
- The ensemble produces its final prediction by integrating the models’ softmax probability distributions, while updating one model at a time.The models are updated in rounds as test samples arrive sequentially.Source: 1) Soft Voting Ensemble Learning · p. 4
2) Dynamic Memory Bank:
MOPC keeps a FIFO memory of recent prealigned trials and their predictions to support streaming adaptation. It also enforces prediction consistency between original and randomly masked EEG signals.
2) Dynamic Memory Bank:
- The FIFO memory stores recent prealigned trials and output distributions, providing context for streaming adaptation to temporally dependent EEG.New trials replace the oldest entry; the capacity is B = 24.Source: 2) Dynamic Memory Bank · p. 4
- Memory capacity empirically balances tracking recent distribution drift against retaining sufficient statistics for stable updates.The balance is assessed in Fig. 3.Source: 2) Dynamic Memory Bank · p. 4
3) Perturbation Consistency Regularization:
- Random time masking simulates signal information loss, and perturbation consistency regularization aligns predictions for original and augmented trials.The default mask length is W = 200 time samples.Source: 3) Perturbation Consistency… · p. 4
- KL-divergence consistency loss performs better than cross-entropy consistency loss in the reported experiments.Source: 3) Perturbation Consistency… · p. 4
4) Joint Entropy Minimization:
Joint entropy minimization applies entropy reduction to both original and perturbed signals. Confidence-calibrated reweighting uses feature similarity and class balance to address noisy pseudolabels and shifting class proportions.
4) Joint Entropy Minimization:
- Joint entropy minimization reduces Shannon entropy for both the original signal and its perturbed version.Source: 4) Joint Entropy Minimization · p. 4
5) Confidence-Calibrated Reweighting:
- Confidence-calibrated reweighting addresses target-stream class drift and pseudolabel noise by emphasizing reliable and minority samples.Source: 5) Confidence-Calibrated Reweighting · p. 4
- Per-sample confidence weights aggregate feature similarities among same-class neighbors stored in the memory bank.Latent features are recalculated dynamically using the current sample and historical data.Source: 5) Confidence-Calibrated Reweighting · pp. 4–5
- Combining confidence, class-balance weighting, and focal modulation downweights unreliable pseudolabels while upweighting informative minority and hard samples.The formulation is intended to stabilize adaptation under class-imbalanced, nonstationary test streams.Source: 5) Confidence-Calibrated Reweighting · p. 5
E. Optimization of MOPC
MOPC combines three losses in a streaming optimization schedule. Each incoming trial is predicted before it triggers one adaptation step, with network weights fixed except for batch-normalization parameters.
- MOPC jointly optimizes perturbation consistency, joint entropy minimization, and confidence-calibrated reweighting in a hybrid objective.Source: E. Optimization of MOPC · p. 5
- After prediction, one gradient update uses the combined loss on the memory bank and updates only batch-normalization parameters of the selected ensemble member.The implementation selects ensemble members in turn.Source: E. Optimization of MOPC · p. 5
- Offline training builds a five-model source ensemble by training on four folds and retaining each model’s best-performing checkpoint.The algorithm describes training on N − 1 folds for each ensemble member.Source: E. Optimization of MOPC · p. 5
- Online inference maintains a dynamic memory bank, appends each incoming trial, and removes the oldest entry when capacity is exceeded.Source: E. Optimization of MOPC · p. 5
A. Datasets
The evaluation uses cross-subject protocols on BCI IV IIb and OpenBMI for binary experiments, with BCI IV 2a reserved for preliminary multiclass validation. Preprocessing and online settings define the acquisition windows and adaptation conditions.
A. Datasets
- The main binary evaluation uses BCI IV IIb and OpenBMI, while BCI IV 2a is used only for preliminary multiclass validation.Source: A. Datasets · p. 5, 3) BCI IV 2a · p. 6
1) BCI IV IIb:
- BCI IV IIb includes nine subjects, three EEG channels, two motor-imagery classes, and 4-second trials sampled at 250 Hz.The cross-subject protocol pools about 5,760 source trials and tests 320 trials per subject.Source: 1) BCI IV IIb · pp. 5–6
2) OpenBMI:
- OpenBMI includes 54 subjects and uses 20 selected channels for motor-imagery trials sampled at 1,000 Hz before downsampling.Its pooled source set contains 21,200 trials, with 200 test trials per subject.Source: 2) OpenBMI · p. 6
3) BCI IV 2a:
- BCI IV 2a provides four motor-imagery classes from nine subjects and is excluded from the main binary experiments.It has 22 EEG channels and 288 trials in each of two sessions.Source: 3) BCI IV 2a · p. 6
B. Data Preprocessing
- Preprocessing applies 4–40 Hz filtering to BCI IV IIb and 8–30 Hz filtering plus downsampling to 250 Hz for OpenBMI.Source: B. Data Preprocessing · p. 6
C. Experiment Settings
- LOSO evaluation treats one subject as the unlabeled target and the remaining subjects as source; online CPU adaptation uses one BN-only update per trial.The same configuration is used across subjects and datasets, with a 4-second, 1,000-sample trial window.Source: C. Experiment Settings · p. 6
D. Baseline Methods
The evaluation compares MOPC with direct-transfer, domain-adaptation, and test-time-adaptation methods under a shared leave-one-subject-out protocol. MOPC leads on both datasets, with gains across most subject-level comparisons and the lowest reported cross-subject variability.
D. Baseline Methods
- Baselines were evaluated with the same LOSO protocol and balanced classes; transfer-learning methods used EEGNet and the same domain prealignment, isolating adaptation-mechanism differences in DA and TTA rows.Reported metrics included accuracy, F1-score, Cohen’s kappa, and standard deviation; absolute values are not intended for comparison with the original papers’ results.Source: D. Baseline Methods · p. 7
1) Class-Balanced Accuracy Evaluation:
- 81.23% accuracy on BCI IV IIb exceeded EEGNet by 4.95%, SHOT by 2.91%, and T-Time by 2.22%; OpenBMI's 78.94% exceeded T-Time's 75.27% by 3.67%.The OpenBMI improvements were significant by paired Wilcoxon signed-rank tests (p-value < 0.05).Source: 1) Class-Balanced Accuracy Evaluation · p. 7, Table II · p. 8, Table III · p. 8
- MOPC won 77 of 81 paired subject-level comparisons against nine baselines, with two ties and two losses of at most 1.25 points.Its margins were smallest on near-chance B02 and B03 and largest on B04, B06, and B08; T-Time led on B03.Source: 1) Class-Balanced Accuracy Evaluation · p. 7
- MOPC had the lowest cross-subject standard deviation among ten methods (11.59) while raising the mean; removing its memory bank reproduced much of the drop from using current-trial-only context.The authors identify memory-driven context as the primary source of the gain.Source: 1) Class-Balanced Accuracy Evaluation · p. 7
2) Class-Imbalanced Accuracy Evaluation:
Under test-time class imbalance, MOPC outperforms T-Time on both datasets, while ablations indicate that its losses, dynamic alignment, and memory bank contribute to adaptation performance.
2) Class-Imbalanced Accuracy Evaluation:
- Under 2:1 test-time imbalance, MOPC beats T-Time by 1.09% on BCI IV IIb and 3.05% on OpenBMI.The margin over the strongest baseline is 1.09 versus 2.22 points on BCI IV IIb and 3.05 versus 3.67 points on OpenBMI in imbalanced versus balanced tests.Source: 2) Class-Imbalanced Accuracy Evaluation · p. 8
1) Component Ablation Study:
- Removing Lpcr, Ljem, or Lccr lowers BCI IV IIb accuracy from 81.23% to 80.32%, 79.67%, or 79.58%, respectively.On OpenBMI, omitting any term reduces accuracy by approximately 0.8%–1.4%; removing Lccr causes the largest single-term drop on both datasets.Source: 1) Component Ablation Study · p. 8, 2) Class-Imbalanced Accuracy Evaluation · p. 8, Table V · p. 9
- Disabling DPA lowers accuracy and kappa, while removing the memory bank produces an even larger decline in both metrics.The authors interpret these omissions as evidence that real-time alignment and memory-augmented context retention support stable online adaptation.Source: 1) Component Ablation Study · pp. 8–9, Table VI · p. 9
2) Impact of Memory Bank Size:
Memory-bank size affects accuracy, while MOPC gains extend across backbones and adapted features become more separated. The CPU pipeline runs in approximately 40–60 ms per trial.
2) Impact of Memory Bank Size:
- Accuracy peaks at 81.23% with B=24 on BCI IV IIb and 79.10% with B=16 on OpenBMI, then declines as banks grow.The authors selected B=24 for all experiments as near-optimal across datasets while limiting memory and computation overhead.Source: 2) Impact of Memory Bank Size · p. 9, Figure 3 · p. 9
3) Model-Agnostic Generalization:
- MOPC improves accuracy over source-only transfer across EEGNet, ConvNet, LMDA, and Conformer backbones.The original model ranking is largely preserved, while performance gaps narrow with MOPC.Source: Table VII · p. 9, 3) Model-Agnostic Generalization · p. 9
A. Feature Visualization
- For subjects B04 and B06, adapted t-SNE embeddings show more clearly separated LH and RH clusters than direct-transfer embeddings.The passage attributes this to dynamically updated batch-normalization statistics under the unsupervised hybrid loss.Source: A. Feature Visualization · p. 9, Figure 4 · p. 10
B. Computational Efficiency and Real-Time Suitability
- The CPU pipeline takes 40–60 ms per trial; MOPC and TENT restrict updates to BN affine parameters, but MOPC reports higher cross-subject accuracy at the same update cost.The reported pipeline time includes preprocessing, inference, and online adaptation.Source: B. Computational Efficiency and… · p. 10
C. Extension to Multiclass MI
MOPC’s update design extends to K-class MI without changing the architecture, and a preliminary four-class evaluation reports improvement over source transfer. The conclusion identifies broader multiclass validation and initial pseudolabel quality as boundaries for the current evidence and design.
C. Extension to Multiclass MI
- MOPC extends to K-class MI without architectural changes; only the classifier head width changes, and adaptation remains O(1) in class count.The memory bank, dynamic EA, and three loss terms operate unchanged across class counts.Source: C. Extension to Multiclass MI · p. 10
- In preliminary four-class BCI Competition IV 2a tests, dynamic alignment adds +12.59 points for all nine subjects, while online adaptation adds +2.49 points and improves six.Online adaptation slightly regresses the other three subjects; the single-seed evaluation compares only source-only and alignment-only conditions, not competing OTTA methods.Source: Table IX · p. 10, C. Extension to Multiclass MI · pp. 10–11
V. CONCLUSION
- The conclusion centers empirical validation on binary classification, with preliminary four-class results; broader multiclass benchmarking remains future work, and reweighting relies on initial pseudolabel quality.The paper also states that the design extends to multiclass decoding at O(1) adaptation cost.Source: §V · p. 11