Transfer learning for EEG-based BCIs: a comparative evaluation and optimization of data alignment methods

Abstract

Background:

This paper addresses a critical challenge in developing practical EEG-based brain-computer interfaces (BCIs): enhancing cross-subject generalization by mitigating individual differences in brain signals. How can we effectively leverage data from existing subjects to improve performance for a new user with minimal subject-specific calibration?

Methods:

We systematically compare and optimize three prominent data alignment techniques, Riemannian Procrustes Analysis (RPA), Euclidean Alignment (EA), and Correlation Alignment (CORAL), designed to transform EEG data from multiple source subjects and a target subject into a common representation space, mitigating variability.

Evaluation:

We employed leave-one-subject-out cross-validation (LOSO-CV) framework on EEG-based attention decoding data to empirically evaluate the effectiveness of each alignment method compared to a baseline condition with no alignment. Key parameters, specifically the regularization parameter α for EA, were optimized to maximize cross-subject transfer performance.

Results:

The study demonstrates that alignment methods improve classification accuracy compared to the baseline. Notably, EA evaluated at α = 100 the scaling value at which the largest fraction of subjects attained their best accuracy in our parameter sweep yielded the largest mean improvement, increasing classification accuracy by 3.44% over the no alignment baseline (paired t(17)≈2.48, p≈0.024; Cohen's dz≈0.59; 95% confidence interval for the mean improvement [0.52%, 6.36%]). Because this α value was identified from the same sweep that produced the per-subject accuracies, this estimate together with the per-subject “best-parameter” results should be interpreted as an oracle sensitivity-analysis upper bound on subject-specific tuning rather than as a leakage-free LOSO estimate. While optimized EA showed the best mean performance, the analysis also demonstrated subject-specific differences in the most ideal alignment strategy.

Conclusion:

This comparison framework quantifies the benefits of different alignment approaches and highlights the valuable contribution of parameter optimization, particularly for EA.

Significance:

These results indicate the potential of optimized alignment techniques, EA in particular, to significantly enhance cross-subject transfer learning in EEG-based BCIs. This has practical ramifications for methodology selection and tuning, and maps a path toward more robust and generalizable BCI systems requiring less subject-specific calibration for real-world applications.

1 Introduction

A brain-computer interface (BCI) provides an immediate interface between the human brain and an external machine, mapping brain signals reflecting user intentions or cognitive states (Lotte et al., 2015). Electroencephalography (EEG) remains the most popular input modality for non-invasive BCIs due to the fact that it is portable, harmless, and provides high temporal resolution. These systems have great promise for applications in neurorehabilitation, assistive technologies for individuals with disabilities, and cognitive monitoring tasks such as attention tracking and emotion detection (Belkacem et al., 2020; Jamil et al., 2021). Standard BCI paradigms utilize unique neural signatures, e.g., sensorimotor rhythms modulated by motor imagery (MI) (Kang et al., 2009; Tu and Sun, 2012) or event-related potentials (ERPs) evoked by particular stimuli (Reichert et al., 2020). This article considers attention decoding with EEG signals.

One of the biggest challenges to making BCIs practical in daily life is high inter-subject variability in brain signals across individuals. This variability makes it difficult to develop models that can perform well for any individual without requiring time-consuming and lengthy calibration sessions for each individual (Jeng et al., 2020). Inter-subject variability occurs since individuals' brains vary in anatomy, neural adaptability, and personal styles of cognition (Lebreton et al., 2019). Even if two people perform the same task, the EEG traces might look completely different. Traditional approaches try to tackle this by creating personalized models for each user. However, this method has limitations, it takes hours of calibration and isn't feasible in situations where BCIs need to work right out of the box (Lebreton et al., 2019; Belkacem et al., 2023).

To overcome these limitations and reduce the calibration burden, transfer learning (TL) has emerged as a powerful paradigm. TL aims at leveraging knowledge gained from existing 'source' subjects to improve learning performance on a new 'target' subject, thereby minimizing the need for extensive target-specific data (Lotte et al., 2018). TL encompasses various strategies applicable to BCIs, broadly categorized into approaches that adapt models across sessions for the same subject (intra-subject) or adapt models across different subjects (inter-subject), as illustrated in the taxonomy shown in Figure 1.

Flowchart illustrating types of transfer learning in brain-computer interface (BCI), divided into intra-subject and inter-subject transfer. Subcategories include feature representation learning, parameter transfer, feature transformation, and instance transfer, with further subdivisions into baseline-aligning, distribution matching, and combined approaches.

Taxonomy of transfer learning in BCI: This framework categorizes intra-subject and inter-subject transfer approaches.

A key strategy within inter-subject TL for EEG-BCIs is data alignment. The core idea is to mathematically transform the EEG data from different subjects into a shared feature space, thereby reducing the distributional discrepancies caused by inter-subject variability and making the data more comparable for model training (Sun et al., 2016). Several alignment techniques have been proposed, often operating in different mathematical domains. For instance, methods like Riemannian Alignment (RA) operate on covariance matrices within the Riemannian manifold (Zanini et al., 2017). Alternatively, He and Wu (2019) proposed an effective Euclidean Alignment (EA) approach that directly aligns and transforms raw EEG trials in the Euclidean space, with promising use cases for transfer learning in MI and ERP tasks. Other approaches, like Correlation Alignment (CORAL) (Sun et al., 2016), focus specifically on aligning the second-order statistics (covariances) of the source and target data features.

While individual alignment methods like the EA approach proposed by He and Wu (2019) have demonstrated potential, there is a need for a systematic comparison of different alignment philosophies, such as those based on Riemannian geometry (like Riemannian Procrustes Analysis, RPA), direct Euclidean transformation, and statistical feature alignment (CORAL), to understand their relative strengths, weaknesses, and optimal application within the context of EEG-BCIs, particularly for tasks like attention decoding (Reichert et al., 2020; Chugh and Aggarwal, 2024). Furthermore, methods like EA and CORAL often involve hyperparameters (e.g., regularization terms) whose optimal settings for maximizing cross-subject transfer performance warrant specific investigation.

This study tests three hypotheses. First, data alignment improves leave-one-subject-out (LOSO) transfer performance over no alignment. Second, parameter choice materially affects alignment performance, especially for EA and CORAL. Third, the best alignment strategy is subject-dependent rather than universal. Accordingly, the contribution of this work is not a new alignment algorithm, but a controlled comparative evaluation and parameter sensitivity study of lightweight alignment methods for covert spatial attention decoding.

This paper undertakes such a comparative study and optimization of three distinct data alignment methods: RPA, EA, and CORAL. Contributions from this study are:

We implement and apply these three alignment methods within a unified transfer learning framework for EEG-BCI decoding.

We systematically evaluate their effectiveness in improving cross-subject generalization using a leave-one-subject-out cross-validation (LOSO-CV) scheme.

We optimize key parameters for EA and CORAL to maximize their transfer performance.

We analyze subject-specific results to provide insights into which methods might be preferable under different circumstances.

By comparing these diverse approaches, we aim to provide a clearer understanding of their impact on transfer learning for EEG-BCIs and offer practical guidance for method selection and tuning in real-world scenarios.

The remainder of this paper is organized as follows: Section II introduces the alignment methods (RPA, EA, CORAL). Section III describes the dataset and experimental setup. Section IV presents the comparative results and parameter optimization findings. Finally, Section V discusses the implications and concludes the paper.

2 Related works

This section reviews previous work on transfer learning techniques used in EEG-based brain-computer interfaces (BCIs).

While some studies focused on transferring knowledge across sessions for the same user, this work concentrates on transfer learning between different subjects. Table 1 summarizes prior transfer learning approaches in EEG-based BCIs and situates the present comparative evaluation within the literature.

PaperTarget domainCalibration dataTransfer learning approach(Kang et al. 2009)Existing subjectN/AFeature-representation(Tu and Sun 2012)Existing subjectWhole dataFeature-representation(Özdenizci et al. 2020)Existing subjectWhole dataFeature-representation(Alamgir et al. 2010)Existing subjectWhole dataParameter(Jayaram et al. 2016)Existing subjectWhole dataParameter(Zhang et al. 2015)Existing subjectWhole dataDistribution-matching(Reuderink et al. 2011)New subjectTask-relevant dataBaseline-aligning(Zanini et al. 2017)New subjectTask-relevant dataBaseline-aligning(He and Wu 2019)New subjectTask-relevant dataBaseline-aligning(Rodrigues et al. 2018)New subjectTask-relevant dataDistribution-matching(Dai et al. 2019)New subjectTask-relevant dataDistribution-matching(Zhang and Wu 2020)New subjectTask-relevant dataBaseline-aligning & Distribution-matching(Li et al. 2019b)New subjectTask-relevant dataDistribution-matching(Dagois et al. 2018)New subjectTask-relevant dataInstance(Zhang et al. 2019b)New subjectTask-relevant dataInstance(Zhang et al. 2019a)New subjectTask-relevant dataFeature-representation(Jeon et al. 2021)New subjectTask-relevant dataFeature-representation(Li et al. 2019a)New subjectTask-relevant dataDistribution-matching(Bolagh and Clifford 2017)New subjectPre-trial/resting dataInstance(Wei et al. 2018)New subjectPre-trial/resting dataParameter

Transfer learning approaches for EEG-based studies.

Early research in this area focused on learning features that remain stable across subjects. This is known as feature representation learning. For example, Kang et al.(Kang et al., 2009) proposed a weighted common spatial filter (CSF) that worked across subjects. Tu and Sun (2012) later extended this by creating both shared CSFs for all users and personalized filters for each individual. Özdenizci et al. (2020) applied convolutional neural networks and adversarial training to learn subject-invariant features. Similarly, Zhang et al. (2019a) and Jeon et al. (2021) used deep learning to extract consistent patterns across users.

As research evolved, a new direction called parameter-transfer learning was introduced. This approach trains models on data from multiple users and then adjusts some parameters to handle individual differences. For instance, Alamgir et al. (2010) proposed a method that learns shared model parameters while fine-tuning for each subject. Jayaram et al. (2016) showed that pre-trained models can be adapted to new users using calibration data.

More recently, feature-transformation methods have gained attention. These methods reduce subject-specific differences by transforming the features. There are two main types: baseline-aligning and distribution-matching. Baseline-aligning removes individual-specific baselines to make the data more uniform (Reuderink et al., 2011; Zanini et al., 2017; He and Wu, 2019). Distribution-matching transforms features so that the distributions across users become more similar (Li et al., 2019b; Zhang et al., 2015; Rodrigues et al., 2018; Dai et al., 2019; Li et al., 2019a). Some studies combine both strategies for better results (Zhang and Wu, 2020).

Another strategy is instance-transfer, where more weight is given to labeled data from source subjects that are more similar to the target subject. This weighting is often based on the distance between their data distributions (Dagois et al., 2018; Zhang et al., 2019b).

Although these methods have shown good performance in controlled lab settings, most assume that labeled data is available for all classes. This assumption doesn't hold in real-world scenarios, like drowsiness or seizure detection, where collecting enough labeled data for every new user may not be possible.

Recent EEG transfer learning research has increasingly shifted toward deep representation learning, including domain-adversarial networks, self-supervised and contrastive learning, transformer-based models, and foundation model paradigms. While these approaches can capture non-linear subject variability and benefit from large-scale pretraining, they typically require substantially larger datasets, greater computational resources, and more complex training pipelines. In contrast, alignment-based methods remain attractive in small-sample EEG settings due to their simplicity, interpretability, and low calibration cost.

Recent work has also extended alignment methods beyond inter-subject transfer. Transfer EA (Vishwanath et al., 2025) enables inter-dataset and cross-species transfer, demonstrating improved classification between human and mouse EEG. Covariance-based harmonization frameworks (Mellot et al., 2023) decompose alignment into re-centering, re-scaling, and rotation, highlighting re-centering as critical for cross-population generalization. A recent review (Wu, 2025) further consolidates these developments and expands the scope of alignment to MEG, intracranial EEG, and cross-modality applications.

Together, these advances show that alignment remains an active and evolving area, increasingly used as a component within broader transfer pipelines. Accordingly, the present study focuses on a controlled comparison of classical alignment operators in the inter-subject setting, while providing insights relevant to emerging inter-dataset and cross-species applications.

We also went through the studies that used or cited the dataset by Reichert et al. (2020), as shown in Table 2. Some of these studies applied classifiers such as decision trees, SVMs, LSTMs, and CNNs to decode cognitive states from EEG, reporting performance that ranged from moderate to high accuracy. Others used the dataset primarily to support claims related to stimulus design, eye movement artifacts (EOG), or covert attention mechanisms. A few papers focused more on theoretical exploration or methodology validation rather than model performance. These prior works highlight the dataset's utility in both applied machine learning and cognitive neuroscience contexts.

YearAuthor(s) and referenceResults/notes2021(Gutierrez-Martinez et al., 2021)Review paper2021(Shahbakhti et al., 2021)TPR: 98.52% for EOG2022(Fernández-Rodŕıguez et al., 2022)Cited for stimulus impact discussion2022(Wang et al., 2022)Cited for stimulus features study2023(Abdel-Samei et al., 2023)Cited for EOG2022(Xu et al., 2022)2024(Reichert et al., 2024)2024(Ron-Angevin et al., 2024)Cited for covert attention2024(Zhou et al., 2024)2021(Altan et al., 2021)Decision Tree: 89.24%, k-NN: 70.10%, MLP: 64.86%, SVM: 62.92%2024(Chugh and Aggarwal, 2024)LSTM: 92.79%, CCA: 88.8%, SVM: 61.76%2024(Yao et al., 2024)2024(Paul et al., 2024)2023(Van de Wauw et al., 2023)2022(An et al., 2022)MSSA-TN: 33.33%, CCN: 22.92%, SVM: 25.00%, KNN: 27.08%, RF: 37.50%, LDA: 12.50%2022(Reichert et al., 2022)Cited. Same authors' paper2023(Kæseler, 2023)2022(Aggarwal et al., 2022)SVM: 66.6%, Gradient boosting: 67.9%, CNN: 70.0%2021(Honźık, 2021)CNN with two conv layers: 52.31%

Studies that used or cited the dataset.

We selected this dataset for our study because it targets covert spatial attention shifts, a task relevant to many real-world BCI applications. Moreover, it contains rich time-resolved EEG data recorded across multiple subjects, making it ideal for evaluating and comparing alignment-based transfer learning strategies. The dataset also provides enough subject diversity and trials to meaningfully assess cross-subject generalization performance, which is the central aim of our work.

3 Methodology

The current study focuses on evaluating feature-transformation techniques and their optimization strategies for addressing inter-subject variability in EEG-based BCIs. The methodology comprises several key components, including dataset preparation, pre-processing, alignment methods, parameter optimization, and evaluation metrics. The methodological pipeline overview of the work is shown in Figure 2.

Flowchart illustrating EEG data processing: starting from raw EEG data, followed by preprocessing, label data preparation, selection among four alignment methods—no alignment, Riemannian Procrustes analysis, Euclidean alignment, correlation alignment—then CCA-based spatial filtering, classifier application to target data, and performance evaluation using LOSO.

Methodological pipeline of the study: the stepwise process of the study, including EEG pre-processing, label preparation, alignment methods, spatial filtering, classification, and performance evaluation using LOSO validation.

3.1 Dataset

This research used the data set from a study by Reichert et al. (2020) with a group of participants in Germany. The study involved 18 healthy individuals who participated in a series of visual attention experiments. The researchers recorded brain signals while participants looked at visual cues, specifically focusing on how people shift their attention without moving their eyes. This type of attention shift, where someone focuses on different areas in their field of vision while keeping their eyes still, helps us understand how the brain processes visual information.

The brain activity recording focused on specific areas of interest. Electrode placements are shown in Figure 3.

Electrode placement diagram for EEG using the international ten–twenty system, shown as a top view of a head, with specific electrodes highlighted in green, blue, yellow, and magenta, indicating distinct scalp regions.

Electrode placements based on the 10–20 system, highlighting the 14 parieto-occipital channels selected for attention decoding in this study.

Although the original set-up used 30 electrodes, the study focused on 14 key channels in the back of the head, an area that is particularly important for processing visual information. These channels included O9, O10, CP1, CP2, Pz, P3, P4, P7, P8, PO3, PO4, PO7, PO8, and Oz as shown in Figure 3. The researchers chose these specific locations because they're known to be most active when people are processing visual information and shifting their attention. During the experiment, participants went through seven different experimental runs. They started with simple tasks where they had to focus their attention on either a green cross, which represented “yes,” or a red cross, which meant “no.” As they progressed through the experiment, the tasks became more complex. In later runs, participants had to answer actual questions by focusing on either the green or red cross, and in the final run, they even shared their personal opinions using the same method.

Each person completed 24 trials in every run, which means they did 168 trials in total. Within each trial, the researchers collected data from 10 different time points, giving them 1,680 separate pieces of data from each participant. Figure 4 provides a thorough description of the experimental steps used by the authors to create the dataset.

Flowchart depicting an experiment protocol for one subject with seven runs. Runs 1 and 2 involve focusing on green plus or red cross for 24 trials without questions, with EEG recorded and no feedback, producing ground truth for classifier training. Runs 3 to 6 present objective questions; attention directed according to the answer, EEG recorded with feedback, and results used to retrain a classifier. Run 7 presents subjective questions, directs attention based on personal answer, EEG recorded with feedback, and produces ground truth from responses.

Experiment procedure.

The researchers presented the visual cues, a red “x” cross and a green “+” cross, on opposite sides of a screen. While recording brain signals at 250 Hz, they saved all this information in MATLAB files. For every trial, they kept track of many different aspects: exactly when and where they showed the crosses, which cross the participant was supposed to pay attention to, how the participant responded, and even details like how far the crosses were from the center of the screen and how big they were.

We selected this dataset because it is well-annotated and trial-dense for a controlled covert spatial attention benchmark, although its cohort size is modest at 18 subjects. This makes it suitable for LOSO evaluation of alignment methods, but conclusions should be interpreted as specific to this paradigm until validated on larger and more diverse datasets.

3.2 EEG pre-processing

The raw EEG data was also undergone a sequence of pre-processing steps to enhance signal quality and prepare it for decoding. The EEG signals were initially re-referenced to the left and right mastoid average to eliminate hemispheric biases caused by asymmetric placements of the electrodes. Second, channel selection was done through retaining the 14 parieto-occipital channels, which are of most crucial importance to visual attention tasks.

Following channel selection, the signals were filtered using a 4th-order zero-phase IIR Butterworth band-pass filter with a frequency range of

1.0–12.5 Hz. This filtered out high-frequency noise and retained the EEG frequency bands of interest for cognitive and attentional processing. The EEG data was then resampled to 50 Hz for reducing the computational complexity and increasing efficiency in processing. During the epoching step, EEG data were separated into epochs of 750 ms, which is equivalent to 38 time points at a sampling rate of 50 Hz. Epoching was initiated at the onset of the stimulus so that EEG data would be synchronized with experimental triggers. Then, 10 epochs for 10 individual stimuli were concatenated to result in a single labeled trial dataset. Trials were divided by the target direction (e.g., left vs. right visual cue) to produce the final dataset used for model building and decoding.

The pre-processing pipeline follows the original Reichert et al. analysis on the same dataset (Reichert et al., 2020), including 1.0–12.5 Hz bandpass filtering and resampling to 50 Hz, to ensure that any performance differences are attributable to alignment rather than pre-processing. This pass-band is appropriate for the neural targets of the task: lateralized covert spatial attention is primarily reflected in low-frequency activity, notably the N2pc component (200–300 ms) and posterior alpha-band dynamics (8–12 Hz), both largely contained below ~12 Hz. The upper cutoff was chosen to capture the full alpha range while minimizing leakage into higher frequencies.

Restricting the analysis to this band also reduces contamination from electromyographic activity and microsaccades, which disproportionately affect higher frequencies and are particularly relevant in a gaze-independent paradigm. We therefore treat this pre-processing as a task-specific design choice aligned with the benchmark, rather than a universally optimal setting. While higher-frequency activity may be informative in other attention paradigms, evaluating broader spectral ranges remains an important direction for future work.

3.3 Alignment methods

To address inter-subject variability, we experimented with the following setups: No Alignment (baseline) and three alignment methods: RPA, EA, and CORAL. These methods align EEG signals between subjects by transforming features into a shared representation space. The No alignment strategy was the control, in which the EEG data was used without converting them. This provided a benchmark to measure the efficacy of the alignment strategies. RPA equates the covariance matrices of EEG data between subjects to a common manifold. The method involves computing the covariance matrices of both source and target data, followed by whitening and alignment transformations. The whitening matrix ensures that the source data has an identity covariance, and the alignment matrix maps the whitened source data to the target space. EA transforms EEG data by centering it around a common mean. First, the mean of the EEG data for each subject is computed. Then, the data is aligned by subtracting the subject-specific mean and adding the grand mean of all subjects. This transformation ensures that the data from different subjects is centered around a uniform meanwhile retaining the variance structure. CORAL matches the covariance structures of the source and target EEG data. The target covariance matrix is regularized, and a transformation is derived to align the covariance of the source data to that of the target data. CORAL minimizes the differences in second-order statistics (covariance) between domains. Specifically, the source features are whitened using the inverse square root of the source covariance matrix and then recolored using the square root of the target covariance matrix, thereby aligning the covariance structure of the source domain to that of the target domain.

3.4 Optimization algorithms

To optimize the performance of each baseline alignment method, we introduced a regularization variable for each method.

3.4.1 regularized RPA (rRPA)

To improve the performance of the RPA alignment method, we introduced regularized RPA (rRPA) with a tunable parameter α that balances the contribution of the sample covariance matrix S and a scaled identity matrix I. The regularized covariance matrix is defined as:

where α∈[0, 1] controls the shrinkage intensity. For α = 1, the formula simplifies to:

This setting completely regularizes the covariance matrix by disregarding the sample covariance S, resulting in an isotropic covariance matrix. Such a matrix assumes that all channels are uncorrelated with equal variance across channels.

3.4.2 Role of λ and α par and EA Alignment Methods3.4.2.1 λ in CORAL (regularization parameter)

The λ parameter in CORAL controls the regularization of the target domain covariance matrix. Regularization is crucial to balance the use of the actual target covariance matrix and a scaled identity matrix, which helps to stabilize the alignment when the covariance matrix is ill-conditioned. The regularized target covariance matrix is computed as:

where:

Ctarget: Target covariance matrix.

I: Identity matrix.

λ∈[0, 1]: Regularization parameter.

The transformation matrix for CORAL is then derived based on the regularized covariance matrix, enabling alignment of source and target data.

3.4.2.2 α in EA (scaling parameter)

The α parameter in EA scales the adjustment of source and target data means to a grand mean. This parameter controls how much the data is centered around the grand mean. The alignment formula for EA is given by:

where:

X: Data matrix.

M: Mean of the data.

G: Grand mean of all data.

α>0: Scaling parameter controlling the degree of mean adjustment. Small values preserve the original data distribution, while larger values (e.g., α = 100) more aggressively center data around the grand mean.

3.5 Canonical Correlation Analysis (CCA)

Canonical Correlation Analysis (CCA) was used as the decoding method to extract task-related features from the EEG signals. CCA identifies linear combinations of two datasets, in this case, the EEG signals (X) and the corresponding label-based model functions (Y), such that the correlation between the resulting canonical variables is maximized. The objective of CCA is to determine weight vectors a and b that solve the following optimization problem:

where X represents the EEG data matrix and Y represents the model functions constructed using task-specific labels.

For each epoch i, the EEG data matrix Xi has dimensions 38 × 14 (time points × channels), and the model functions Yi are generated based on stimulus labels. Specifically, Yi is defined as:

where yi is the epoch-specific label (+1 for left targets and −1 for right targets), and I38 is a 38 × 38 identity matrix. The concatenated matrices X and Y are constructed across all training epochs:

Once the weight vectors a and b are computed, the canonical variables U and V are obtained as:

The canonical correlation between

Comments (0)

No login
gif