Dual-Paradigm BCI Speller — P300 + SSVEP
Two paradigms, one interface
A systems exercise: take two published BCI decoding methods (P300 and SSVEP) from research paper to a working pipeline with a hardware abstraction layer, a real-time calibration workflow, and an honest account of exactly where "working on public research data" stops and "working for a real person on real hardware" would need to start.
- P300
- SSVEP
- EEG
- xDAWN
- CCA
- FBCCA
- LSL
- GPT-2
Question
Why It Matters
System
Data
Method
Preprocessing
Hardware abstraction layer handles LSL auto-discovery, per-device channel mapping with fallback substitution, polyphase resampling to target sample rate, and online artifact rejection (amplitude / peak-to-peak / sliding-window variance).
Feature Extraction
P300: xDAWN spatial filtering to enhance evoked potentials. SSVEP: canonical correlation analysis (CCA) and filter-bank CCA (FBCCA) for frequency detection — zero-shot by design, no training data needed.
Model
P300: xDAWN + shrinkage-LDA classifier. SSVEP: CCA, FBCCA, and a supervised CNN baseline, compared head-to-head on the same dataset.
Training
P300: offline cross-validated training on BNCI2014009 (5-fold CV). SSVEP: CCA/FBCCA are zero-shot — no training. CNN baseline trained with up to 10 examples/class. Warm-start blending combines a public-data prior model with the user's personal model.
Evaluation
P300: 5-fold CV accuracy, balanced accuracy, ROC-AUC on BNCI2014009 subject 1. SSVEP: zero-shot accuracy on Nakanishi2015 subject 1 (12-class). Offline replay: accuracy and ITR (Wolpaw formula) on pre-recorded epochs. Calibration marker-EEG sync verified via mock stream.
Experiment
Results
| System | Result |
|---|---|
| P300 (xDAWN+LDA), BNCI2014009 subj. 1 | 88.4% ± 1.8% acc (0.783 balanced acc, baseline 83.3%), 0.918 ± 0.013 ROC-AUC |
| SSVEP FBCCA, Nakanishi2015 subj. 1 (12-class) | 77.8% zero-shot (vs. CCA 70.4%; CNN near chance at all calibration budgets) |
| Offline replay → OS keypress (FBCCA, pre-recorded) | 86.67% accuracy, 38.36 bits/min ITR, 15 selections |
| Calibration marker-EEG sync (mock stream) | 119 epochs extracted, counts matched flash schedule exactly |
Full methodology and per-fold breakdowns in docs/BENCHMARKS.md.
P300 achieved 88.4% accuracy but with a majority-class baseline of 83.3% — the balanced accuracy of 0.783 is the more honest number. SSVEP FBCCA at 77.8% zero-shot outperformed standard CCA (70.4%); the supervised CNN baseline stayed near chance at every calibration budget tested (up to 10 examples/class), suggesting that on this dataset, CCA/FBCCA's signal-modeling approach is more sample-efficient than a small CNN. The offline replay demo achieved 86.67% accuracy and 38.36 bits/min ITR — but this is an online decoder running on offline data, not a live EEG closed loop.
What Changed
The warm-start scheme was designed to blend a public-data prior model with the user's personal model while they still have little data. However, the public P300 prior model only overlaps the personal calibration montage on 3 of 5 channels (Oz, Cz, Pz — BNCI2014009 doesn't have O1/O2), capping its usefulness. SSVEP "calibration" isn't training at all — CCA/FBCCA are zero-shot by design, so that wizard is a detectability check, not a model-fitting step.
Limitations
- No real headset has touched this code — everything is verified against public datasets or synthetic noise.
- Warm-start channel overlap is thin (3 of 5 channels shared between prior and personal montage).
- SSVEP calibration validates, it doesn't train — CCA/FBCCA don't use training data.
- Single-subject numbers throughout — none of this has been checked for how much it varies across subjects.
- Not reviewed for clinical or assistive use — no consent process, no usability testing, no safety review.
Next Experiment
Validate character-level decode on real signal (the row/column vote aggregation is built but only exercised on synthetic noise). Then build a genuine real-time closed loop with a live LSL headset feeding a causal, sample-by-sample decoder.