Local Geometric Consistency + Riemannian Centering Transformation for cross-subject EEG transfer learning
Project description
LGC-RCT — Local Geometric Consistency + Riemannian Centering Transformation
Calibration-free cross-subject EEG transfer learning for passive Brain-Computer Interfaces.
Licona Muñoz, R. et al. — "Local Geometric Consistency for Cross-Subject EEG Transfer Learning" NAT 2026, Berlin. (citation forthcoming)
What is LGC-RCT?
LGC-RCT is a calibration-free method for cross-subject EEG transfer learning designed for passive BCI applications. It combines two components:
-
RCT (Riemannian Centering Transformation) [1]: a transfer learning method that re-centers covariance representations across domains to the identity matrix. Domains are treated as independent prior to the re-centering and classification phases.
-
LGC (Local Geometric Consistency) (proposed): a local-geometry phase applied prior to RCT. For each covariance matrix, a neighborhood including its immediate temporal neighbors on both sides is defined. A local Riemannian mean is computed over this neighborhood, and the matrix is replaced by this local estimate. The parameter K controls the degree of local geometric consistency enforced between neighboring window-level covariance matrices.
In this work, we investigate whether enforcing local geometric consistency among neighboring covariance matrices prior to RCT improves cross-subject workload classification.
Pipeline
Raw EEG (N channels)
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Band-pass filter + Sliding windows │
│ (dataset-specific band · 4 s windows · 50% overlap) │
└─────────────────────────────────────────────────────────────┘
│ (N_epochs, C, T)
▼
┌─────────────────────────────────────────────────────────────┐
│ Covariance matrix estimation │
│ Ledoit-Wolf · pyriemann Covariances('lwf') │
└─────────────────────────────────────────────────────────────┘
│ (N_epochs, C, C) SPD matrices
▼
╔═════════════════════════════════════════════════════════════╗
║ LGC — Local Geometric Consistency [proposed] ║
║ Riemannian moving average over K temporal neighbors ║
║ Block-aware: smoothing does not cross class boundaries ║
╚═════════════════════════════════════════════════════════════╝
│ (N_epochs, C, C) smoothed SPD matrices
▼
┌─────────────────────────────────────────────────────────────┐
│ RCT — Riemannian Centering Transformation │
│ TLCenter: re-centers each domain to the identity matrix │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ MDM classifier (with geodesic filtering) │
│ Trained on source domains only · target labels never used │
└─────────────────────────────────────────────────────────────┘
│
▼
Decision rule — Class 0 or Class 1
Key properties
- Calibration-free: no labeled data from the target subject required
- Standard API: follows the
(X, y, domains)convention of pyriemann transfer learning - Paradigm-agnostic: validated on mental workload and affective state classification (preliminary)
Installation
pip install lgc-rct
For exact reproducibility of published results:
pip install -r requirements-freeze.txt
pip install lgc-rct
Quick Start
from lgcrct import LGCRCTPipeline, run_loso
# X : np.ndarray, shape (N, C, T) — bandpass-filtered EEG epochs
# y : np.ndarray, shape (N,) — class labels {0, 1}
# domains : np.ndarray, shape (N,) — subject IDs
# LGC-RCT (proposed method)
pipe = LGCRCTPipeline(half_window=10, cov_estimator="lwf")
pipe.fit(X, y, domains, target_domain="subject_01")
y_pred = pipe.predict(X_test, y_test, domains_test)
# Full LOSO evaluation
results = run_loso(X, y, domains, half_window=10, cov_estimator="lwf")
Input format
X : np.ndarray (N, C, T) bandpass-filtered EEG epochs
y : np.ndarray (N,) class labels {0, 1}
domains : np.ndarray (N,) subject IDs (str or int)
Recommendation: apply sliding-window segmentation before calling LGC-RCT. LGC smoothing relies on temporal neighbors within each class segment — more windows per segment means richer temporal structure and stronger smoothing effect. A 4-second window with 50% overlap (2-second step) at 128 Hz is a validated configuration.
Validated Results
Mental Workload — Team Metrics dataset (private, TNO)
34 pilots, UAV supervision task, binary workload classification, LOSO, 128 Hz.
| Method | Alpha ACC | Theta ACC | Calib-free? |
|---|---|---|---|
| MDM | 50.56 ± 1.63 | 51.34 ± 2.15 | — |
| RCT | 57.74 ± 2.56 | 57.94 ± 3.46 | YES |
| LGC-RCT K=1 | 63.11 ± 4.04 | 60.61 ± 3.42 | YES |
| LGC-RCT K=10 | 77.73 ± 6.39 | 73.91 ± 6.05 | YES |
As reported in NAT26 Berlin proceedings.
Affective State Classification — DEAP dataset (preliminary)
32 subjects, emotion recognition, binary classification, LOSO, 128 Hz, 15–36 Hz.
| Task | Method | ACC | Calib-free? | Status |
|---|---|---|---|---|
| Valence | LGC-RCT K=10 | 79.52 ± 5.87 | YES | preliminary |
| Arousal | LGC-RCT K=10 | 75.51 ± 5.68 | YES | preliminary |
These results are preliminary and obtained without any dataset-specific tuning. The method configuration (K=10, cov_estimator='lwf' (Ledoit-Wolf covariance estimator)) is identical to the one used for workload; only the frequency band differs (15–36 Hz for DEAP vs. alpha/theta for Team Metrics). They suggest that LGC-RCT generalizes across passive BCI paradigms. Full analysis forthcoming.
Repository Structure
lgc-rct/
├── lgcrct/ # Installable Python package
│ ├── smoothing.py # LGC: block-aware Riemannian moving average
│ ├── pipeline.py # LGCRCTPipeline: fit / predict / transform
│ └── evaluation.py # run_loso: LOSO cross-subject evaluation
├── demos/
│ └── 02_demo_deap.py # Demo on DEAP public dataset
├── experiments/ # Requires Team Metrics dataset (private, TNO)
│ └── lgc_rct_loso.py # Full LOSO experiment script
├── data/
│ └── FORMAT.md # Dataset format and download instructions
└── results/
├── loso_34pilots_published.csv # NAT26 Berlin — K ablation (alpha & theta)
├── LGC-RCT_K10_DEAP_VALENCE_15-36Hz_LOSO.csv # DEAP valence (preliminary)
└── LGC-RCT_K10_DEAP_AROUSAL_15-36Hz_LOSO.csv # DEAP arousal (preliminary)
Reproducibility
The LGC-RCT pipeline is fully deterministic: Ledoit-Wolf covariance estimation,
Riemannian mean computation, and RCT alignment all have unique, closed-form or
convergent solutions on the SPD manifold. LOSO partitioning is determined entirely
by subject IDs. No random seed is required — results are exactly reproducible
given the same data and dependency versions (see requirements-freeze.txt).
This property extends to third-party use: researchers who apply lgc-rct to their own datasets and publish results can guarantee exact replication by any laboratory, without dependence on random initialization, hardware, or number of runs.
Dataset availability
The Team Metrics dataset is proprietary (TNO, Netherlands) and cannot be shared. To access it for replication of the NAT26 Berlin results, contact Anne-Marie Brouwer (TNO).
The DEAP demo (demos/02_demo_deap.py) runs on the publicly available DEAP dataset.
See data/FORMAT.md for download instructions.
Dependencies
| Package | Version |
|---|---|
| Python | ≥ 3.9 |
| numpy | ≥ 1.26.4 |
| pyriemann | ≥ 0.9 |
| scikit-learn | ≥ 1.6.1 |
experiments/lgc_rct_loso.pyadditionally requires gumpy for EEG bandpass filtering. gumpy is not available on PyPI — install from: https://github.com/gumpy-bci/gumpy Always passfs=128explicitly (gumpy defaults to fs=256).
Citation
If you use this method, please cite the paper:
@inproceedings{licona2026lgcrct,
title = {Local Geometric Consistency for Cross-Subject {EEG} Transfer Learning},
author = {Licona Mu{\~n}oz, Ricardo and others},
booktitle = {Proceedings of NAT 2026},
year = {2026},
note = {Berlin, Germany}
}
Paper DOI will be added upon proceedings publication.
If you use this software specifically, please also cite the software release:
@software{licona2026lgcrct_software,
author = {Licona Mu{\~n}oz, Ricardo and others},
title = {lgc-rct: Local Geometric Consistency + Riemannian Centering Transformation},
year = {2026},
publisher = {Zenodo},
version = {v0.1.0},
doi = {10.5281/zenodo.XXXXXXX}
}
Zenodo DOI will be assigned upon v0.1.0 release. To generate it: create a GitHub release tagged v0.1.0 and link the repository to Zenodo (zenodo.org → GitHub integration).
References
[1] Zanini, P., Congedo, M., Jutten, C., Said, S., & Berthoumieu, Y. (2018). Transfer Learning: A Riemannian Geometry Framework With Applications to Brain–Computer Interfaces. IEEE Transactions on Biomedical Engineering, 65(5), 1107–1116. https://doi.org/10.1109/TBME.2017.2742541
License
MIT License — see LICENSE for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lgc_rct-0.1.0.tar.gz.
File metadata
- Download URL: lgc_rct-0.1.0.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0b89cc52561f70ea696f319d7118e0193cfffb316555a307d83608dc0d4e25f
|
|
| MD5 |
55b75b927a2f143a5b62e37859ed2037
|
|
| BLAKE2b-256 |
704bc69a66801932661b3ea4fc3e73a10aefabb79289e973b29854a3de869cde
|
File details
Details for the file lgc_rct-0.1.0-py3-none-any.whl.
File metadata
- Download URL: lgc_rct-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc9699c14fad8be5dd3667bff3bcac3b2a70127b5cb501687031b26e707e58c9
|
|
| MD5 |
d322752c2632fe5a08e4a0b88f8fb0c0
|
|
| BLAKE2b-256 |
8340afc6d0eadf5a44ac367e42e8c303393c5bb12bb4e2704eaec256949b700f
|