A spatial covariance matrix summarises a trial's band power and the relationships between channels at once. Covariance matrices are symmetric positive definite (SPD), and the set of SPD matrices is not flat, so averaging or comparing them with ordinary Euclidean arithmetic distorts them. Riemannian geometry provides the correct distance and mean.
Minimum Distance to Mean (MDM) computes a Riemannian mean covariance per class and assigns a new trial to the nearest one. Tangent-space methods project covariances onto a flat space at a reference point, after which any standard classifier applies. These approaches have won several BCI competitions and are a standard part of modern BCI toolkits.
The family in BCILattice
pyRiemann itself ships with the app, so the rest of its API is available as blocks under the MNE palette.
| Block | Use |
|---|---|
| Covariances | Spatial covariance per trial, the input to everything else |
| ERP covariances | Covariances augmented with class-average ERPs, for P300 and other evoked paradigms |
| MDM | Minimum distance to Riemannian class means |
| FgMDM | MDM after geodesic filtering in the tangent space |
| Tangent space + TSClassifier | Project to the tangent space, then a linear classifier |
| Euclidean Alignment | Re-centres each subject's data on a common reference, a strong first step for cross-subject work |
Why they work well on EEG
Few parameters
MDM has almost nothing to tune, which matters with tens of trials per class.
Robust to scaling
Affine-invariant distances are unaffected by some of the gain and mixing changes that hurt other features.
Transfer friendly
Re-centring each session or subject on its own mean covariance removes much of the between-session shift.
Paradigm neutral
The same machinery handles motor imagery, P300 (with ERP covariances) and SSVEP (with band-filtered covariances).
Caveats
Covariance estimation needs more samples than channels. On dense montages with short trials, use shrinkage or reduce channels first. Recentering and reference means are fitted quantities, so they belong inside the training folds like any other fitted step.
Questions
What is Riemannian geometry in BCI?
It is an approach that represents each EEG trial by its spatial covariance matrix and classifies these matrices using distances and means defined on the curved space of symmetric positive definite matrices.
What is the MDM classifier?
Minimum Distance to Mean computes the Riemannian mean covariance matrix of each class and assigns a new trial to the class whose mean is closest in Riemannian distance.
What is tangent space mapping?
It projects covariance matrices from the curved manifold onto a flat vector space at a reference point, usually the overall mean, so standard classifiers such as logistic regression or SVM can be used.
Do I need pyRiemann to use Riemannian methods?
Not in BCILattice: covariances, MDM, FgMDM and tangent-space classifiers are built-in blocks. pyRiemann itself ships with the app for anything else.
Read the reference
Related
Common Spatial Patterns (CSP) for EEG
CSP finds channel combinations whose variance differs most between two classes. Log-variance of those few filtered signals is often all a linear classifier needs.
BCI Domain Adaptation
CORAL, MMD alignment, Transfer Component Analysis, a DANN discriminator, feature alignment and subject adaptation — assembled on the same canvas as the model they feed.
P300 BCI and the P300 Speller Explained
When a rare target appears among frequent non-targets, the brain produces a positive deflection about 300 ms later. A P300 BCI flashes options and finds the one that evokes it.
EEG Machine Learning
A node canvas of 119 blocks covers the pipeline from design matrix to evaluation — and the evaluation half is built to make an inflated score hard to produce by accident.