Riemannian geometry for BCI: classify the covariance itself

Instead of filtering channels and computing features, Riemannian methods treat each trial's covariance matrix as a point on a curved space and classify it there. They are simple, fast and hard to beat.

Updated

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.

BlockUse
CovariancesSpatial covariance per trial, the input to everything else
ERP covariancesCovariances augmented with class-average ERPs, for P300 and other evoked paradigms
MDMMinimum distance to Riemannian class means
FgMDMMDM after geodesic filtering in the tangent space
Tangent space + TSClassifierProject to the tangent space, then a linear classifier
Euclidean AlignmentRe-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

Run a study end to end, on your own machine

The free plan covers two studies, the full analysis suite, and 118 of the 119 ML blocks.