CRCC: Contrast-Based Robust Cross-Subject and Cross-Site Representation Learning for EEG
Authors: Xiaobin Wong, Zhonghua Zhao, Haoran Guo, Zhengyi Liu, Yu Wu, Feng Yan, Zhiren Wang, Sen Song
Organizations: Tsinghua Laboratory of Brain and Intelligence · Institute of Automation, Chinese Academy of Sciences · University of Chinese Academy of Sciences · Weixian College, Tsinghua University · School of Artificial Intelligence, Beijing University of Posts and Telecommunications · School of Computer Science and Technology, Northwestern Polytechnical University, Xi’an, China · Beijing Huilongguan Hospital, Capital Medical University · Peking University Huilongguan Clinical Medical School · School of Biomedical Engineering, Tsinghua University
EEG-based neural decoding models often fail to generalize across acquisition sites due to structured, site-dependent biases implicitly exploited during training. We reformulate cross-site clinical EEG learning as a bias-factorized generalization problem, in which domain shifts arise from multiple interacting sources. We identify three fundamental bias factors and propose a general training framework that mitigates their influence through data standardization and representation-level constraints. We construct a standardized multi-site EEG benchmark for Major Depressive Disorder and introduce CRCC, a two-stage training paradigm combining encoder-decoder pretraining with joint fine-tuning via cross-subject/site contrastive learning and site-adversarial optimization. CRCC consistently outperforms state-of-the-art baselines and achieves a 10.7 percentage-point improvement in balanced accuracy under strict zero-shot site transfer, demonstrating robust generalization to unseen environments.
Figures & tables
Figure 1: The CRCC Framework: our model comprises two primary stages: the pre-training phase (right) and the fine-tuning phase (left). During pre-training, the model takes 10-second EEG Differential Entropy (DE) features as input. These features are processed by an encoder, with gradients backpropagated through a joint objective involving a noise-reducing decoder and a domain discriminator, the latter of which facilitates robust representation learning across multiple open-source datasets. In the subsequent fine-tuning stage, the decoder and domain discriminator are detached. The core fine-tuning objective integrates a standard cross-entropy loss for classification with two specialized components: a contrastive learning module designed for cross-subject feature extraction and an adversarial loss aimed at mitigating inter-site variability.
Site Code
HC
MDD
Device
N
BDI
HAMD
N
BDI
HAMD
0
148
8.53 ± 7.57
/
0
/
/
32-channel EEG device
1 *
40
/
/
92
/
24.37 ± 5.33
2
186
/
/
0
/
/
3
2
/
/
70
24.45 ± 12.96
19.32 ± 7.37
4
3
5.33 ± 5.50
3.33 ± 3.06
216
18.08 ± 13.09
17.22 ± 8.74
Table 1: Demographic Information of the Multi-site Dataset.
Dataset
MDD (N)
HC (N)
Multi-site
Same Device
Same Evaluators
PREDICT
46
75
×
✓
✓
Tdbrain
426
47
×
✓
✓
EMBARC
309
40
✓
×
×
CANBIND
211
112
✓
×
×
Ours
411
416
✓
✓
✓
Table 2: Comparison Between Our Dataset and Existing EEG Databases for MDD.
Site & State
Method
B-Acc
ZS-BAcc
Precision
Recall
F1 Score
AUROC
site1-EO
DE+MLP
.819 ± .06
.570 ± .01
.815 ± .02
.819 ± .06
.810 ± .06
.874 ± .02
LaBraM
.783 ± .22
.504 ± .18
.594 ± .41
.676 ± .46
.631 ± .43
.791 ± .25
EEGPT
.815 ± .05
.491 ± .01
.755 ± .05
.716 ± .04
.709 ± .04
.766 ± .06
Ours
.832 ± .06
.645 ± .03
.799 ± .06
.838 ± .03
.815 ± .05
.870 ± .04
site1-EC
DE+MLP
.818 ± .05
.537 ± .01
.818 ± .04
.818 ± .05
.814 ± .05
.869 ± .05
LaBraM
.831 ± .18
.541 ± .16
.744 ± .39
.696 ± .37
.720 ± .38
.840 ± .22
Table 3: Performance Comparison on Independent Test Sites (Site 1 & Site 5). ”EO” and ”EC” denote Eyes-Open and Eyes-Closed states, respectively. B-Acc and ZS-BAcc represent Balanced Accuracy and Zero-shot Balanced Accuracy.
Figure 2: Scales values of the subjects The bars are color-coded, with blue representing HC and green representing MDD patients. For each group, the bars from left to right indicate: (i) the mean score for that category, (ii) the mean score of correctly classified subjects, and (iii) the mean score of misclassified subjects. The y-axis denotes the respective scale scores across four diagnostic dimensions: HAMD and BDI, and HAMA and SAS (Anxiety).
Figure 3: Zero-shot generalization performance across varying training site scales. The trend demonstrates a clear scaling law : the balanced accuracy on the unseen test set increases monotonically as the number of training sites grows from 2 to 6. The model achieves peak performance (69.75%) with 6 sites, underscoring the benefits of data diversity in enhancing cross-site robustness.
Configuration
B-Acc
ZS-BAcc
Precision
Recall
F1
AUROC
DE+MLP
.819 ± .06
.570 ± .02
.815 ± .06
.819 ± .06
.810 ± .06
.874 ± .07
I. Pre-training
w/o Pre-training
.545 ± .07
.471 ± .09
.500 ± .09
.597 ± .08
.540 ± .07
.524 ± .10
With Pre-training
.832 ± .03
.645 ± .04
.799 ± .07
.838 ± .07
.815 ± .04
.870 ± .04
II. Loss & CSCS Design
w/o L (Baseline)
.646 ± .04
.530 ± .06
.584 ± .10
.764 ± .10
.650 ± .04
.674 ± .05
Table 4: Ablation Studies on Site 1 (EO). We evaluate: (1) Generative Pre-training, (2) Cross subject and cross site Loss Design, and (3) site adv L . indicates the best performance in each category.
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
Category & Parameter
Pre-training
Fine-tuning (SFT)
Model Architecture
Projection Dimension
—
8
Drop Path Rate
—
0.1
Mask Ratio
0.5
—
Number of Classes
—
2
Optimization
Appendix
Table 5: Hyperparameter configurations for both Pre-training and Fine-tuning stages.
Figure 4: Comparative Interpretability Analysis of EEGPT: Intuitively, this explores the basis of the model’s classification decisions. Greater alignment between the focus of training data and generalization data indicates that their distributions are more similar from the model’s perspective, thereby leading to superior generalization performance.
Figure 5: Multi-level interpretability and consistency analysis of CRCC(ours) across various sites and generalization scenarios.
Site
Epoch
Balanced Accuracy
Zeroshot BA
HC Discriminator Acc
MDD Discriminator Acc
site1_eo
best_in_val
0.832 ± 0.034
0.645 ± 0.043
0.640 ± 0.106
0.669 ± 0.106
best_in_test
0.683 ± 0.025
0.775 ± 0.060
0.641 ± 0.109
0.669 ± 0.107
site1_ec
best_in_val
0.848 ± 0.044
0.659 ± 0.018
0.637 ± 0.101
0.660 ± 0.087
best_in_test
0.680 ± 0.020
0.820 ± 0.040
0.648 ± 0.096
0.658 ± 0.088
site5_eo
best_in_val
0.816 ± 0.040
0.563 ± 0.029
0.573 ± 0.063
0.493 ± 0.077
best_in_test
0.609 ± 0.045
0.761 ± 0.063
0.563 ± 0.089
0.484 ± 0.073
Appendix
Table 6: discriminators acc and generalization ability
Figure 6: Comparison of latent space embeddings between EEGPT and our model. Our model exhibits lower clustering across different sites (represented by distinct colors), implying that data from a new site is more likely to follow a similarly broad distribution. This characteristic facilitates the reduction of site-specific noise, thereby enhancing the extraction of effective biomarkers.
Figure 7: As illustrated in the figures, there is a clear self-clustering phenomenon within different sites, indicating that the model has learned shortcuts rather than features truly relevant to the disease. This is particularly evident on the zero-shot set: the MDD data from Site 1 significantly deviates from the distribution of the overall dataset, resulting in an inflated accuracy for the model.
Department of Computer Science, University of North Carolina at Charlotte, Charlotte, United States · Department of Computer Science, Dartmouth College, Hanover, United States · School of Computing, University of Georgia, Athens, United States +1
College of Computing and Data Science, Nanyang Technological University, Singapore · Southeast University, China · Centre for AI in Medicine, Nanyang Technological University, Singapore