Rectifying Geometric Misalignment: Online Source-Free Adaptation for Class-Imbalanced EEG

arXiv cs.LG Papers

Summary

This paper proposes OSPDIM, a source-free online unsupervised domain adaptation framework for EEG-based BCIs that corrects geometric misalignment caused by class-imbalanced label shifts on the Riemannian manifold, outperforming standard alignment methods in online scenarios.

arXiv:2608.05315v1 Announce Type: new Abstract: Electroencephalography (EEG) based Brain-Computer Interfaces (BCIs) often require unsupervised domain adaptation (UDA) to generalize across subjects and sessions. While Riemannian alignment methods like the Riemannian Centering Transformation (RCT) are effective for handling covariate shifts, they implicitly assume balanced class priors. However, in realistic online BCI scenarios, the label distributions vary dynamically (label shift), causing standard alignment techniques to geometrically misalign the target data distributions. In this work, we propose OSPDIM (Online SPD manifold information maximization), a source-free online UDA framework designed to address label shifts on the Riemannian manifold. OSPDIM introduces a manifold-constrained bias parameter into the tangent space mapping, which is optimized via information maximization to correct the geometric skew caused by imbalanced data streams. Unlike offline methods relying on global batch statistics, OSPDIM estimates and corrects geometric bias on-the-fly. Simulations on 2D SPD matrices visually demonstrate that OSPDIM successfully rectifies the misalignment where standard centering fails. Extensive experiments on multiple motor imagery datasets show that OSPDIM significantly outperforms standard Riemannian baselines, particularly in challenging online adaptation scenarios with severe class imbalance, offering a robust solution for practical, plug-and-play BCI systems.
Original Article
View Cached Full Text

Cached at: 08/07/26, 07:49 AM

# Rectifying Geometric Misalignment: Online Source-Free Adaptation for Class-Imbalanced EEG
Source: [https://arxiv.org/html/2608.05315](https://arxiv.org/html/2608.05315)
###### Abstract

Electroencephalography \(EEG\) based Brain\-Computer Interfaces \(BCIs\) often require unsupervised domain adaptation \(UDA\) to generalize across subjects and sessions\. While Riemannian alignment methods like the Riemannian Centering Transformation \(RCT\) are effective for handling covariate shifts, they implicitly assume balanced class priors\. However, in realistic online BCI scenarios, the label distributions vary dynamically \(label shift\), causing standard alignment techniques to geometrically misalign the target data distributions\. In this work, we proposeOSPDIM\(Online SPD manifold information maximization\), a source\-free online UDA framework designed to address label shifts on the Riemannian manifold\. OSPDIM introduces a manifold\-constrained bias parameter into the tangent space mapping, which is optimized via information maximization to correct the geometric skew caused by imbalanced data streams\. Unlike offline methods relying on global batch statistics, OSPDIM estimates and corrects geometric bias on\-the\-fly\. Simulations on2×22\\times 2SPD matrices visually demonstrate that OSPDIM successfully rectifies the misalignment where standard centering fails\. Extensive experiments on multiple motor imagery datasets show that OSPDIM significantly outperforms standard Riemannian baselines, particularly in challenging online adaptation scenarios with severe class imbalance, offering a robust solution for practical, plug\-and\-play BCI systems\.

## IIntroduction

EEG\-based Brain\-Computer Interfaces \(BCIs\) are promising for rehabilitation but suffer from severe domain shifts due to non\-stationarity and subject variability\[[27](https://arxiv.org/html/2608.05315#bib.bib29)\]\. To mitigate these shifts without resource\-intensive calibration\[[17](https://arxiv.org/html/2608.05315#bib.bib1)\], Unsupervised Domain Adaptation \(UDA\) has emerged as a standard solution to transfer knowledge from labeled source domains to unlabeled targets\[[29](https://arxiv.org/html/2608.05315#bib.bib2),[5](https://arxiv.org/html/2608.05315#bib.bib30)\]\.

Developing BCIs that generalize across domains without labeled calibration data remains a grand challenge\[[4](https://arxiv.org/html/2608.05315#bib.bib3),[28](https://arxiv.org/html/2608.05315#bib.bib4)\], corresponding to source\-free unsupervised domain adaptation \(SFUDA\) when target data are unavailable during training\[[16](https://arxiv.org/html/2608.05315#bib.bib5),[30](https://arxiv.org/html/2608.05315#bib.bib6)\]\. Riemannian geometry\-aware alignment methods for SPD matrix\-valued EEG features are strong candidates for this setting\[[7](https://arxiv.org/html/2608.05315#bib.bib31),[2](https://arxiv.org/html/2608.05315#bib.bib7),[21](https://arxiv.org/html/2608.05315#bib.bib8),[19](https://arxiv.org/html/2608.05315#bib.bib9)\], as they provide interpretable and robust covariance\-based representations\[[3](https://arxiv.org/html/2608.05315#bib.bib10),[22](https://arxiv.org/html/2608.05315#bib.bib11),[9](https://arxiv.org/html/2608.05315#bib.bib12)\]\. These methods mainly align Riemannian moments, such as the Fréchet mean and variance, so that a source\-trained model can generalize to related target domains\[[31](https://arxiv.org/html/2608.05315#bib.bib14),[20](https://arxiv.org/html/2608.05315#bib.bib16),[10](https://arxiv.org/html/2608.05315#bib.bib32),[8](https://arxiv.org/html/2608.05315#bib.bib17),[26](https://arxiv.org/html/2608.05315#bib.bib18),[6](https://arxiv.org/html/2608.05315#bib.bib19),[18](https://arxiv.org/html/2608.05315#bib.bib20),[12](https://arxiv.org/html/2608.05315#bib.bib33)\]\.

Despite the progress in alignment techniques, a critical but frequently overlooked issue is label shift, which appears in many real\-world applications such as EEG\-based sleep staging\[[25](https://arxiv.org/html/2608.05315#bib.bib21)\]\. In online BCI use, such shifts can arise because user intentions and mental states are not sampled uniformly over time: some commands may be issued more frequently, and fatigue, attention fluctuations, or task interruptions may produce stream segments dominated by only a subset of classes\. Under conditions of label shift, aligning the moments of marginal feature distributions can be detrimental\[[1](https://arxiv.org/html/2608.05315#bib.bib22)\]\. Consequently, addressing the diverse sources of distribution shifts in EEG requires an SFUDA approach capable of explicitly handling label shifts\. Although the broader machine learning literature offers several frameworks for SFUDA under label shift conditions\[[14](https://arxiv.org/html/2608.05315#bib.bib23),[15](https://arxiv.org/html/2608.05315#bib.bib24)\], few have been rigorously applied to EEG data\. For example, Li et al\.\[[13](https://arxiv.org/html/2608.05315#bib.bib25)\]employed the objective of information maximization\[[23](https://arxiv.org/html/2608.05315#bib.bib26)\]for cross\-domain generalization\. Within the realm of Riemannian geometry methods, Mellot et al\.\[[18](https://arxiv.org/html/2608.05315#bib.bib20)\]studied an EEG\-based age regression problem and proposed a framework to facilitate generalization between populations with different prior distributions\.

Here, we address the critical challenge of online label shift in EEG\-based BCIs, where standard Riemannian alignment fails catastrophically due to the geometric misalignment of streaming statistics\. We extend the SPDIM framework\[[11](https://arxiv.org/html/2608.05315#bib.bib28)\]to the challenging online source\-free setting\. Unlike the original offline formulation that relies on global batch statistics, we propose a novel sequential adaptation protocol designed to estimate and correct the geometric bias on\-the\-fly\. This mechanism employs a sliding buffer and iterative manifold optimization to dynamically rectify the alignment as data streams in\. Furthermore, we provide a comprehensive analysis of adaptation speed and stability, demonstrating that Online SPDIM significantly outperforms standard baselines even under severe label shift\.

## IIPreliminaries

### II\-ARiemannian geometry

The smooth manifold of realD×DD\\times Dsymmetric positive definite \(SPD\) matrices, denoted as𝒮D\+=\{Z∈ℝD×D:ZT=Z,Z≻0\}\\mathcal\{S\}\_\{D\}^\{\+\}=\\\{Z\\in\\mathbb\{R\}^\{D\\times D\}:Z^\{T\}=Z,Z\\succ 0\\\}, forms a Riemannian manifold when equipped with an inner product on the tangent space𝒯Z​𝒮D\+\\mathcal\{T\}\_\{Z\}\\mathcal\{S\}\_\{D\}^\{\+\}at each pointZZ\. In this work, we employ the Affine Invariant Riemannian Metric \(AIRM\) as the inner product\. The tangent spaces possess a Euclidean structure with computationally efficient distances, locally approximating the Riemannian distances on𝒮D\+\\mathcal\{S\}\_\{D\}^\{\+\}\. The Riemannian distance between two SPD matricesA,B∈𝒮D\+A,B\\in\\mathcal\{S\}\_\{D\}^\{\+\}is defined asδR​\(A,B\)=‖log⁡\(A−1/2​B​A−1/2\)‖F\\delta\_\{R\}\(A,B\)=\\\|\\log\(A^\{\-1/2\}BA^\{\-1/2\}\)\\\|\_\{F\}\. For a set of SPD points𝒵=\{Zi\}i=1n⊂𝒮D\+\\mathcal\{Z\}=\\\{Z\_\{i\}\\\}\_\{i=1\}^\{n\}\\subset\\mathcal\{S\}\_\{D\}^\{\+\}, the Fréchet mean is defined as the unique point that minimizes the sum of squared Riemannian distances:

G𝒵=arg⁡minM∈𝒮D\+​∑i=1nδR2​\(M,Zi\)\.G\_\{\\mathcal\{Z\}\}=\\arg\\min\_\{M\\in\\mathcal\{S\}\_\{D\}^\{\+\}\}\\sum\_\{i=1\}^\{n\}\\delta\_\{R\}^\{2\}\(M,Z\_\{i\}\)\.\(1\)

### II\-BClass\-imbalanced online unsupervised domain adaptation

Problem Setup\.Letxxdenote the input data andyythe corresponding output labels\. We consider a set ofNNsource domains\{𝒟si\}i=1N\\\{\\mathcal\{D\}\_\{s\_\{i\}\}\\\}\_\{i=1\}^\{N\}andMMtarget domains\{𝒟tj\}j=1M\\\{\\mathcal\{D\}\_\{t\_\{j\}\}\\\}\_\{j=1\}^\{M\}, with marginal probability distributionspsi​\(x\)p\_\{s\_\{i\}\}\(x\)andqtj​\(x\)q\_\{t\_\{j\}\}\(x\), respectively\. Each source domain𝒟si=\{\(xsi\(k\),ysi\(k\)\)\}k=1lsi\\mathcal\{D\}\_\{s\_\{i\}\}=\\\{\(x\_\{s\_\{i\}\}^\{\(k\)\},y\_\{s\_\{i\}\}^\{\(k\)\}\)\\\}\_\{k=1\}^\{l\_\{s\_\{i\}\}\}consists oflsil\_\{s\_\{i\}\}labeled examples, while each target domain𝒟tj=\{xtj\(k\)\}k=1ltj\\mathcal\{D\}\_\{t\_\{j\}\}=\\\{x\_\{t\_\{j\}\}^\{\(k\)\}\\\}\_\{k=1\}^\{l\_\{t\_\{j\}\}\}containsltjl\_\{t\_\{j\}\}unlabeled examples\.

We operate under specific distributional assumptions to model the domain shift\. First, we assumecovariate shiftwith the input marginal distributions differing between domains \(i\.e\.,psi​\(x\)≠qtj​\(x\)p\_\{s\_\{i\}\}\(x\)\\neq q\_\{t\_\{j\}\}\(x\)\)\. Second, we model theclass\-imbalanceproblem by assuminglabel shiftbetween the source and target domains \(i\.e\.,psi​\(y\)≠qtj​\(y\)p\_\{s\_\{i\}\}\(y\)\\neq q\_\{t\_\{j\}\}\(y\)\), while the source label distributions are consistent \(i\.e\.,psi​\(y\)=psk​\(y\)p\_\{s\_\{i\}\}\(y\)=p\_\{s\_\{k\}\}\(y\)\)\. Furthermore, consistent with the Riemannian alignment framework, we assume that the distribution shifts manifest primarily as geometric displacements of the Riemannian Fréchet mean, which can be corrected via geometric re\-centering\.

The primary objective is to transfer knowledge from the source domains\{𝒟si\}i=1N\\\{\\mathcal\{D\}\_\{s\_\{i\}\}\\\}\_\{i=1\}^\{N\}to the target domains\{𝒟tj\}j=1M\\\{\\mathcal\{D\}\_\{t\_\{j\}\}\\\}\_\{j=1\}^\{M\}and learn a robust target prediction functionht:xt→yth\_\{t\}:x\_\{t\}\\to y\_\{t\}, utilizing only the labeled source data and the unlabeled target data\.

Online setting\.In contrast to traditional offline adaptation where the entire target dataset𝒟tj\\mathcal\{D\}\_\{t\_\{j\}\}is accessible simultaneously, we consider a strictlyonlineunsupervised domain adaptation scenario\. Here, the target data is revealed sequentially in a stream or as mini\-batches\. At any time stepkk, the model has only access to the current observation \(or batch\)xtj\(k\)x\_\{t\_\{j\}\}^\{\(k\)\}to update its parameters and predict the label\. Crucially, the model cannot access future data and does not retain a large buffer of historical data due to memory limitations and computational efficiency requirements\. This setting necessitates an alignment and prediction mechanism capable of adapting efficiently on\-the\-fly to the shifting target distribution\.

## IIIMethods

### III\-ATSMNet and Geometric Misalignment

Standard Tangent Space Mapping \(TSM\) frameworks\[[2](https://arxiv.org/html/2608.05315#bib.bib7)\]project SPD covariances into a Euclidean tangent space centered at the Riemannian Fréchet mean\. TSMNet\[[8](https://arxiv.org/html/2608.05315#bib.bib17)\]extends this by integrating domain\-specific batch normalization into an end\-to\-end architecture, which aligns marginal distributions via geometric re\-centering and whitening\. While this mechanism effectively handles covariate shift, it is highly susceptible to label shift\. Specifically, aligning the biased empirical mean of an imbalanced target stream to the identity matrix \(the balanced source center\) introduces severe geometric distortion, thereby misaligning class clusters and degrading performance\.

### III\-BOnline SPD Manifold Information Maximization \(OSPDIM\)

Standard Riemannian alignment methods, such as the Riemannian Centering Transformation \(RCT\)\[[31](https://arxiv.org/html/2608.05315#bib.bib14)\]incorporated in TSMNet, operate on the assumption that label distributions remain consistent across domains\. However, in the presence of label shift, aligning the Fréchet means of marginal distributions leads to geometric over\-correction\. To address this in real\-time scenarios, we proposeOSPDIM, which extends the offline SPDIM framework\[[11](https://arxiv.org/html/2608.05315#bib.bib28)\]to the challenging online setting\.

Manifold\-constrained Bias Parameter\.OSPDIM operates in a source\-free setting, keeping the pre\-trained source feature extractorfθf\_\{\\theta\}and classifiergψg\_\{\\psi\}frozen\. To counteract the geometric misalignment during test\-time adaptation, we introduce a time\-varying domain\-specific bias parameterΦt∈𝒮D\+\\Phi\_\{t\}\\in\\mathcal\{S\}\_\{D\}^\{\+\}into the tangent space mapping\. The modified mapping function for an incoming target sampleCiC\_\{i\}at timettis defined as:

mϕ​\(Ci\)=upper∘log⁡\(Φt12​\(C¯t−12​Ci​C¯t−12\)​Φt12\)m\_\{\\phi\}\(C\_\{i\}\)=\\text\{upper\}\\circ\\log\\left\(\\Phi\_\{t\}^\{\\frac\{1\}\{2\}\}\\left\(\\overline\{C\}\_\{t\}^\{\-\\frac\{1\}\{2\}\}C\_\{i\}\\overline\{C\}\_\{t\}^\{\-\\frac\{1\}\{2\}\}\\right\)\\Phi\_\{t\}^\{\\frac\{1\}\{2\}\}\\right\)\(2\)whereC¯t\\overline\{C\}\_\{t\}represents the reference center for tangent space mapping at timett\. Intuitively, the inner term performs standard Riemannian centering \(whitening\) relative to the empirical target mean\. The outer multiplication applies a learnable geometric translation on the SPD manifold\. In standard TSMNet,C¯t\\overline\{C\}\_\{t\}is a fixed batch statistic and no bias is applied \(Φt=I\\Phi\_\{t\}=I\)\. In OSPDIM, we initializeΦt\\Phi\_\{t\}as the identity but dynamically optimize it to minimize the information maximization loss \(see Eq\.[4](https://arxiv.org/html/2608.05315#S3.E4)\), thereby actively recovering the true class\-balanced geometric center\.

Online Adaptation Protocol\.The core contribution of OSPDIM is the sequential adaptation mechanism\. Unlike the offline setting where bias is optimized globally, OSPDIM employs a sliding window approach:

- •Sliding Buffer:We maintain a First\-In\-First\-Out \(FIFO\) bufferℬt\\mathcal\{B\}\_\{t\}of capacityNNto store the most recent target features\. This buffer stabilizes the gradient estimation against single\-sample noise\.
- •Iterative Manifold Update:At each time steptt, we update the biasΦt\\Phi\_\{t\}to minimize the loss calculated on the target bufferℬt\\mathcal\{B\}\_\{t\}\. SinceΦt\\Phi\_\{t\}resides on the Riemannian manifold𝒮D\+\\mathcal\{S\}\_\{D\}^\{\+\}, standard Euclidean updates are invalid\. We employ approximated Riemannian gradient descent via Euclidean optimization followed by a retraction: Φt←Proj𝒮D\+​\(Φt−1−η⋅∇ΦℒI​M​\(ℬt;Φt−1\)\)\\Phi\_\{t\}\\leftarrow\\text\{Proj\}\_\{\\mathcal\{S\}\_\{D\}^\{\+\}\}\\left\(\\Phi\_\{t\-1\}\-\\eta\\cdot\\nabla\_\{\\Phi\}\\mathcal\{L\}\_\{IM\}\(\\mathcal\{B\}\_\{t\};\\Phi\_\{t\-1\}\)\\right\)\(3\)where∇Φ\\nabla\_\{\\Phi\}is the Euclidean gradient computed by Adam, andProj𝒮D\+\\text\{Proj\}\_\{\\mathcal\{S\}\_\{D\}^\{\+\}\}acts as a retraction mapping the updated parameter back onto the SPD manifold to ensure validity\. This allows OSPDIM to track and correct non\-stationary label shifts in real\-time\.

Optimization via Information Maximization\.To estimateΦt\\Phi\_\{t\}without target labels, we optimize the information maximization \(IM\) objective on the buffer data\. Letp^i=gψ​\(mϕt​\(Ci\)\)\\hat\{p\}\_\{i\}=g\_\{\\psi\}\(m\_\{\\phi\_\{t\}\}\(C\_\{i\}\)\)denote theKK\-dimensional softmax probability predicted by the frozen source model for an unlabeled target sampleCi∈ℬtC\_\{i\}\\in\\mathcal\{B\}\_\{t\}\. The loss functionℒI​M\\mathcal\{L\}\_\{IM\}is defined as:

ℒI​M=−1\|ℬt\|​∑Ci∈ℬt∑c=1Kp^i,c​log⁡p^i,c⏟ℒC​E​M\+∑c=1Kp¯c​log⁡p¯c⏟ℒM​E​M\\mathcal\{L\}\_\{IM\}=\\underbrace\{\-\\frac\{1\}\{\|\\mathcal\{B\}\_\{t\}\|\}\\sum\_\{C\_\{i\}\\in\\mathcal\{B\}\_\{t\}\}\\sum\_\{c=1\}^\{K\}\\hat\{p\}\_\{i,c\}\\log\\hat\{p\}\_\{i,c\}\}\_\{\\mathcal\{L\}\_\{CEM\}\}\+\\underbrace\{\\sum\_\{c=1\}^\{K\}\\bar\{p\}\_\{c\}\\log\\bar\{p\}\_\{c\}\}\_\{\\mathcal\{L\}\_\{MEM\}\}\(4\)wherep¯c=1\|ℬt\|​∑Ci∈ℬtp^i,c\\bar\{p\}\_\{c\}=\\frac\{1\}\{\|\\mathcal\{B\}\_\{t\}\|\}\\sum\_\{C\_\{i\}\\in\\mathcal\{B\}\_\{t\}\}\\hat\{p\}\_\{i,c\}is the mean prediction probability for classccacross the buffer\. The Conditional Entropy Minimization \(ℒC​E​M\\mathcal\{L\}\_\{CEM\}\) acts on individual target predictions to encourage confidence, pushing decision boundaries away from high\-density regions\. The Marginal Entropy Maximization \(ℒM​E​M\\mathcal\{L\}\_\{MEM\}\) acts on the buffer\-level label distribution to prevent trivial solutions \(e\.g\., assigning all samples to a single class\) by encouraging diverse predictions\.

## IVExperiments

### IV\-ASimulations

To validate our approach, we visualized the adaptation process on the2×22\\times 2SPD manifold\. We generated latent features and mapped them to SPD matrices using domain\-specific mixing matrices, resulting in ill\-conditioned, ”needle\-like” distributions characteristic of EEG signals \(Figure[1](https://arxiv.org/html/2608.05315#S4.F1), Left\)\. To simulate severe label shift, the target domain was subsampled to a minority\-to\-majority ratio of 0\.1\.

As shown in Figure[1](https://arxiv.org/html/2608.05315#S4.F1)\(Middle\), standard RCT effectively centers the global distribution around the Identity matrix\. However, due to the severe class imbalance, the global mean is dominated by the majority class\. Consequently, simply aligning the global means results insemantic misalignment: the centroid of the target majority class \(Orange ‘\+’\) is pulled away from the source majority class \(Blue ‘\+’\), as indicated by the distinct black connecting line\.

In contrast,OSPDIM\(Right\) optimizes a manifold\-constrained bias parameter via information maximization\. This effectively corrects the geometric skew caused by the label shift\. As observed, the centroids of the corresponding classes between the source and target domains \(e\.g\., Source Class 0 and Target Class 0\) become nearly overlapping, effectively realigning the target distribution \(Green\) with the source\. This visual confirmation demonstrates that OSPDIM successfully recovers the true class distribution structure without requiring target labels\.

![Refer to caption](https://arxiv.org/html/2608.05315v1/ospdim__viz_v3.png)Figure 1:Visualization of domain adaptation on the2×22\\times 2SPD manifold\.The gray curved structure represents the SPD manifold\.Left \(Raw Data\):Blue dots represent Source, Red dots represent Target\. Class centroids are marked by ‘\+’\. The dashed line connects the majority class centroids, highlighting the initial shift\. Note: markers \(circles/triangles\) distinguish class labels\.Middle \(RCT\):Standard alignment fails under label shift\. Target data \(Orange\) is centered to the identity matrixII, but the class clusters remain misaligned with the source, as shown by the distinct black gap between class centroids\.Right \(OSPDIM\):Our method \(Green dots\) effectively reduces the gap between source and target centroids by optimizing the manifold\-constrained bias, accurately recovering the decision boundary structure\.
### IV\-BMotor imagery

To validate the proposed framework in realistic BCI scenarios, we evaluated our method on public motor imagery datasets\. While standard benchmarks are typically balanced, real\-world online BCI applications often encounter varying class priors over time\. To bridge this gap, we artificially introduced label shifts in the target domains to simulate challenging online adaptation scenarios\.

Datasets and Preprocessing\.We utilized two widely used motor imagery datasets from the MOABB framework and BCI competition IV\[[24](https://arxiv.org/html/2608.05315#bib.bib27)\]: BNCI2014001 \(9 subjects, 2 classes, 144 trials per class\) and BNCI2015001 \(12 subjects, 2 classes, 200 trials per class\)\. The preprocessing pipeline included resampling EEG signals to 256 Hz and applying temporal band\-pass filters \(4–36 Hz\) to capture sensorimotor rhythms\. To ensure data quality, we performed outlier rejection by removing trials with peak\-to\-peak amplitude exceeding 200μ\\muV\. We extracted task\-related epochs associated with specific class labels for classification, using a time window of \[0\.5, 3\.5\] seconds post\-cue to capture the event\-related desynchronization effects\. Regarding the problem formulation, we assume that while the source domains \(different subjects\) exhibit covariate shift, their label distributionsPS​\(y\)P\_\{S\}\(y\)remain balanced and consistent, as is standard in controlled BCI calibration protocols\.

Experimental Setup\.We adopted a strict source\-free unsupervised domain adaptation \(SFUDA\) protocol\. For each dataset, we employed a leave\-one\-subject\-out cross\-validation scheme\. The source model \(TSMNet\) was trained on labeled source subjects and then frozen\. Source data is used only during pre\-training; during online adaptation, only the frozen source model and incoming unlabeled target samples are available\. For the target subject, we simulated varying degrees of label shift by subsampling the data to achieve minority\-to\-majority class ratios \(Imbalance Ratio\) of\{0\.1,0\.2,0\.3,0\.4\}\\\{0\.1,0\.2,0\.3,0\.4\\\}\. We focus on this range because the goal is to stress\-test online adaptation under severe\-to\-moderate imbalance, where biased Riemannian centering is expected to be most harmful\. Higher ratios such asρ=0\.9\\rho=0\.9are close to the balanced case and therefore induce only a weak geometric bias, making them less central to the failure mode studied here\. To increase statistical power and mitigate the noise introduced by the random subsampling process, we run each experiment across 10 different random seeds for every subject and imbalance ratio, and we report the average gain per subject\.

We compared five settings:OSPDIM \(Proposed\), our online method using a sliding buffer \(N=32N=32\) andK=5K=5update steps per sample;SPDIM \(Offline Reference\)\[[11](https://arxiv.org/html/2608.05315#bib.bib28)\], an offline upper bound using the full target batch;Deep Learning, an EEGConformer trained on source domains without adaptation, serving as a non\-geometric reference baseline;Online RCT, which updates the target mean sequentially via a Riemannian exponential moving average, serving as a standard geometric baseline for streaming data; andOffline RCT, which computes the target Fréchet mean from the entire target set\.

Results\.The quantitative results are summarized in Figure[2](https://arxiv.org/html/2608.05315#S4.F2), which reports the balanced accuracy gain relative to the deep learning baseline\. We observed distinct performance patterns across the datasets:

Sensitivity of RCT to Label ShiftConsistent with the simulations, RCT baselines show substantial performance losses under label shift\. The degradation remains relatively stable acrossρ∈\[0\.1,0\.4\]\\rho\\in\[0\.1,0\.4\], suggesting that even mild imbalance can move the target mean enough to distort the source decision boundary; stronger imbalance further increases centroid bias but does not necessarily cause a proportional accuracy drop\.

Effectiveness of OSPDIM\.OSPDIM consistently achieves positive gains across both datasets and all imbalance ratios\. Subject\-level averages and bootstrap\-based 95% confidence intervals \(n=2000n=2000\) indicate consistent improvements across subjects, and it retained stable performance when label shift is absent, showing that the learned manifold\-constrained bias recovers performance lost to domain shift\.

Performance Gap and LimitationsOSPDIM remains below the offline SPDIM upper bound because it relies only on a small causal buffer rather than full target\-batch statistics\. Nevertheless, it bridges much of the gap between failing Online RCT and the offline reference, supporting the effectiveness of information\-maximization\-based bias correction in imbalanced streams\.

![Refer to caption](https://arxiv.org/html/2608.05315v1/gain_vs_dl_ci95_final-0213.png)Figure 2:Performance Gain Analysis\.Comparison of balanced accuracy gains relative to the deep learning baseline \(EEGConformer, zero line\)\. Each dot represents the average gain of a single subject across multiple random seeds\. Bars indicate the group\-level mean gain with 95% confidence intervals\. OSPDIM consistently achieves positive gains across all imbalance ratios on both datasets, demonstrating robust correction of geometric misalignment\.
### IV\-CAblation Study: Adaptation Speed

We further investigated the impact of the adaptation speed, controlled by the learning rateη\\etain the iterative update step\. Figure[3](https://arxiv.org/html/2608.05315#S4.F3)illustrates the performance on BNCI2014001 \(Ratio 0\.1\) under varyingη\\eta\. Small learning rates \(η<0\.003\\eta<0\.003\) update the bias too slowly, whereas large rates \(η\>0\.03\\eta\>0\.03\) make the bias unstable under small\-buffer noise\. OSPDIM reaches its best performance aroundη≈0\.005\\eta\\approx 0\.005\(∼\\sim66%\), suggesting a trade\-off between stability and responsiveness\. This confirms that tuning the adaptation speed is crucial for handling dynamic label shifts in online BCIs\.

Peak: 0\.66310−310^\{\-3\}10−210^\{\-2\}10−110^\{\-1\}0\.50\.50\.60\.60\.70\.7Adaptation Speed \(Learning Rateη\\eta\)Balanced AccuracyFigure 3:Sensitivity Analysis of Adaptation Speed\.The solid blue line represents the mean balanced accuracy of OSPDIM, while the shaded area indicates the standard error \(SE\)\.

## VConclusion

In this work, we presented OSPDIM, an online source\-free domain adaptation framework designed for EEG decoding under non\-stationary label shifts\. Our simulations on the SPD manifold elucidated the geometric failure of standard Riemannian alignment \(RCT\): under severe class imbalance, the empirical target mean becomes biased, causing RCT to inadvertently force class clusters away from the optimal decision boundaries\. OSPDIM addresses this by introducing a sequential, manifold\-constrained bias correction optimized via information maximization\. This approach decouples geometric centering from distribution alignment, effectively recovering the true class structure on\-the\-fly\.

Empirical results demonstrate that OSPDIM significantly outperforms standard online baselines \(e\.g\.,\>15%\>15\\%improvement on BNCI2014001\), showing strong resilience to extreme imbalance without requiring target labels\. While the strict online constraint introduces a performance gap compared to the offline oracle, OSPDIM provides a robust foundation for plug\-and\-play BCI systems\. Future work will focus on integrating this geometric bias correction directly into end\-to\-end deep learning architectures to further enhance representation learning from raw EEG signals\.

## References

- \[1\]S\. Bakas, S\. Ludwig, D\. A\. Adamos,et al\.\(2023\)Latent alignment with deep set EEG decoders\.arXiv preprint arXiv:2311\.17968\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p3.1)\.
- \[2\]A\. Barachant, S\. Bonnet, M\. Congedo, and C\. Jutten\(2011\)Multiclass brain–computer interface classification by Riemannian geometry\.IEEE Transactions on Biomedical Engineering\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p2.1),[§III\-A](https://arxiv.org/html/2608.05315#S3.SS1.p1.1)\.
- \[3\]M\. Congedo, A\. Barachant, and R\. Bhatia\(2017\)Riemannian geometry for EEG\-based brain\-computer interfaces; a primer and a review\.Brain\-Computer Interfaces\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p2.1)\.
- \[4\]S\. H\. Fairclough and F\. Lotte\(2020\)Grand challenges in neurotechnology and system neuroergonomics\.Frontiers in Neuroergonomics\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p2.1)\.
- \[5\]V\. Jayaram, M\. Alamgir, Y\. Altun,et al\.\(2016\)Transfer learning in brain\-computer interfaces\.IEEE Computational Intelligence Magazine\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p1.1)\.
- \[6\]C\. Ju and C\. Guan\(2022\)Deep optimal transport on SPD manifolds for domain adaptation\.arXiv preprint arXiv:2201\.05745\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p2.1)\.
- \[7\]C\. Ju, R\. Kobler, A\. Collas, M\. Kawanabe,et al\.\(2026\)SPD matrix learning for neuroimaging analysis: perspectives, methods, and challenges\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p2.1)\.
- \[8\]R\. Kobler, J\. Hirayama, Q\. Zhao, and M\. Kawanabe\(2022\)SPD domain\-specific batch normalization to crack interpretable unsupervised domain adaptation in EEG\.InNeurIPS,Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p2.1),[§III\-A](https://arxiv.org/html/2608.05315#S3.SS1.p1.1)\.
- \[9\]R\. J\. Kobler, J\. Hirayama, L\. Hehenberger, C\. Lopes\-Dias, G\. R\. Müller\-Putz, and M\. Kawanabe\(2021\)On the interpretation of linear Riemannian tangent space model parameters in M/EEG\.InEMBC,Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p2.1)\.
- \[10\]S\. Li, S\. Chu, O\. Koç, Y\. Ding, Q\. Zhao, M\. Kawanabe, and Z\. Chen\(2026\)HEEGNet: hyperbolic embeddings for eeg\.arXiv preprint arXiv:2601\.03322\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p2.1)\.
- \[11\]S\. Li, M\. Kawanabe, and R\. J\. Kobler\(2024\)SPDIM: source\-free unsupervised conditional and label shift adaptation in EEG\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p4.1),[§III\-B](https://arxiv.org/html/2608.05315#S3.SS2.p1.1),[§IV\-B](https://arxiv.org/html/2608.05315#S4.SS2.p4.2)\.
- \[12\]S\. Li, M\. Kawanabe, and R\. J\. Kobler\(2024\)Geometric deep learning to enhance imbalanced domain adaptation in eeg\.\.InESANN,Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p2.1)\.
- \[13\]S\. Li, Z\. Wang, H\. Luo, L\. Ding, and D\. Wu\(2023\)T\-time: test\-time information maximization ensemble for plug\-and\-play BCIs\.IEEE Transactions on Biomedical Engineering\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p3.1)\.
- \[14\]X\. Li, J\. Li, L\. Zhu, G\. Wang, and Z\. Huang\(2021\)Imbalanced source\-free domain adaptation\.InACMMM,Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p3.1)\.
- \[15\]J\. Liang, R\. He, and T\. Tan\(2024\)A comprehensive survey on test\-time adaptation under distribution shifts\.International Journal of Computer Vision\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p3.1)\.
- \[16\]Y\. Liu, W\. Zhang, and J\. Wang\(2021\)Source\-free domain adaptation for semantic segmentation\.InCVPR,Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p2.1)\.
- \[17\]F\. Lotte, L\. Bougrain, A\. Cichocki,et al\.\(2018\)A review of classification algorithms for EEG\-based brain–computer interfaces: a 10 year update\.Journal of Neural Engineering\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p1.1)\.
- \[18\]A\. Mellot, A\. Collas, S\. Chevallier,et al\.\(2024\)Geodesic optimization for predictive shift adaptation on EEG data\.arXiv preprint arXiv:2407\.03878\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p2.1),[§I](https://arxiv.org/html/2608.05315#S1.p3.1)\.
- \[19\]A\. Mellot, A\. Collas, P\. L\. C\. Rodrigues,et al\.\(2023\)Harmonizing and aligning M/EEG datasets with covariance\-based techniques to enhance predictive regression modeling\.Imaging Neuroscience\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p2.1)\.
- \[20\]P\. L\. C\. Rodrigues, C\. Jutten, and M\. Congedo\(2019\)Riemannian Procrustes analysis: transfer learning for brain–computer interfaces\.IEEE Transactions on Biomedical Engineering\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p2.1)\.
- \[21\]R\. N\. Roy, M\. F\. Hinss, L\. Darmet,et al\.\(2022\)Retrospective on the first passive brain\-computer interface competition on cross\-session workload estimation\.Frontiers in Neuroergonomics\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p2.1)\.
- \[22\]D\. Sabbagh, P\. Ablin, G\. Varoquaux,et al\.\(2020\)Predictive regression modeling with MEG/EEG: from source power to signals and cognitive states\.NeuroImage\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p2.1)\.
- \[23\]Y\. Shi and F\. Sha\(2012\)Information\-theoretical learning of discriminative clusters for unsupervised domain adaptation\.InICML,pp\. 1275–1282\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p3.1)\.
- \[24\]M\. Tangermann, K\. Müller, A\. Aertsen,et al\.\(2012\)Review of the BCI competition IV\.Frontiers in NeuroscienceVolume 6 \- 2012\.Cited by:[§IV\-B](https://arxiv.org/html/2608.05315#S4.SS2.p2.2)\.
- \[25\]P\. Tholke, Y\. Mantilla\-Ramos, H\. Abdelhedi,et al\.\(2023\)Class imbalance should not throw you off balance: choosing the right classifiers and performance metrics for brain decoding with imbalanced data\.NeuroImage\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p3.1)\.
- \[26\]X\. Wei, A\. A\. Faisal, M\. Grosse\-Wentrup,et al\.\(2022\)2021 BEETL competition: advancing transfer learning for subject independence and heterogenous EEG data sets\.InNeurIPS,Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p2.1)\.
- \[27\]J\. R\. Wolpaw, N\. Birbaumer, D\. J\. McFarland,et al\.\(2002\)Brain–computer interfaces for communication and control\.Clinical Neurophysiology\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p1.1)\.
- \[28\]J\. R\. Wolpaw, N\. Birbaumer, D\. J\. McFarland,et al\.\(2002\)Brain–computer interfaces for communication and control\.Clinical Neurophysiology\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p2.1)\.
- \[29\]D\. Wu, Y\. Xu, and B\. Lu\(2020\)Transfer learning for EEG\-based brain–computer interfaces: a review of progress made since 2016\.IEEE Transactions on Cognitive and Developmental Systems\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p1.1)\.
- \[30\]S\. Yang, Y\. Wang, J\. V\. D\. Weijer,et al\.\(2021\)Generalized source\-free domain adaptation\.InICCV,Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p2.1)\.
- \[31\]P\. Zanini, M\. Congedo, C\. Jutten,et al\.\(2017\)Transfer learning: a Riemannian geometry framework with applications to brain–computer interfaces\.IEEE Transactions on Biomedical Engineering\.Cited by:[§I](https://arxiv.org/html/2608.05315#S1.p2.1),[§III\-B](https://arxiv.org/html/2608.05315#S3.SS2.p1.1)\.

Similar Articles