Classification done honestly
Features, LDA, CSP, and Riemannian classifiers, then the part that matters more than the algorithm, which is how you split the data. Leakage, chance levels, calibration drift, and information transfer rate.
On this page18 min
A classifierClassifier An algorithm that assigns each trial a label, such as left hand or right hand, after being trained on labelled examples. Related: Linear discriminant analysis (LDA)Linear discriminant analysis (LDA) A simple, robust classifier that draws a straight boundary between classes; the workhorse of EEG decoding for two decades., Support vector machine (SVM)Support vector machine (SVM) A classifier that finds the boundary with the widest margin between classes; strong on small datasets., Cross-validationCross-validation Testing a model on data it never saw during training, repeatedly, so the reported accuracy means something.. Glossary entry learns a rule from labelled examples and applies it to new ones. Every BCIBrain-computer interface (BCI) A system that turns measured brain activity into control of something outside the body, from a cursor to a wheelchair to a speech synthesizer. Related: DecoderDecoder The algorithm that maps neural signals to intended actions, such as a classifier or a Kalman filter. , Closed loopClosed loop A system in which the output feeds back to influence the input, such as a user adjusting their brain activity while watching the cursor it controls. . Glossary entry is one. The algorithms are the easy part and this page covers them in a few paragraphs. The hard part, the part where most student projects and a distressing number of papers go wrong, is evaluation: making sure the number you report is the number a new person on a new day would get. That takes most of the page, because it deserves it.
Features
A classifierClassifier An algorithm that assigns each trial a label, such as left hand or right hand, after being trained on labelled examples. Related: Linear discriminant analysis (LDA)Linear discriminant analysis (LDA) A simple, robust classifier that draws a straight boundary between classes; the workhorse of EEG decoding for two decades. , Support vector machine (SVM)Support vector machine (SVM) A classifier that finds the boundary with the widest margin between classes; strong on small datasets. , Cross-validationCross-validation Testing a model on data it never saw during training, repeatedly, so the reported accuracy means something. . Glossary entry wants a short vector of numbers per trial. For EMGElectromyography (EMG) Recording the electrical activity of muscles, hundreds of microvolts to millivolts, much larger than EEG. Related: Myoelectric prosthesisMyoelectric prosthesis An artificial limb controlled by EMG from the remaining muscles. , Electroencephalography (EEG)Electroencephalography (EEG) Recording the brain's electrical activity from electrodes on the scalp, a few tens of microvolts of blurred, summed cortical activity. . Glossary entry and oscillatory EEGElectroencephalography (EEG) Recording the brain's electrical activity from electrodes on the scalp, a few tens of microvolts of blurred, summed cortical activity. Related: Electrocorticography (ECoG)Electrocorticography (ECoG) Recording from electrodes placed on the surface of the brain under the skull, usually during epilepsy surgery evaluation; cleaner and sharper than EEG. , Magnetoencephalography (MEG)Magnetoencephalography (MEG) Recording the tiny magnetic fields produced by cortical currents with superconducting sensors in a shielded room; less blurred by the skull than EEG, and far more expensive. , Volume conductionVolume conduction The spreading of currents from a source through the conductive tissues of the head, which is why one source shows up on many electrodes and why scalp EEG is blurry. , Microvolt (µV)Microvolt (µV) One millionth of a volt. Scalp EEG is tens of microvolts; a AA battery is 1.5 million of them. . Glossary entry: band powers or log-variances per channel, sometimes after a spatial filterFilter An operation that passes some frequencies and attenuates others; every filter also delays or distorts the timing of what it passes. Related: High-pass filterHigh-pass filter Removes slow drifts and DC offsets, passing everything above a cutoff; set it too high and you erase slow brain activity. , Low-pass filterLow-pass filter Removes fast content above a cutoff; the anti-alias filter is one, and so is the smoothing you apply to a noisy trace. , Notch filterNotch filter A very narrow filter that removes one frequency, usually 60 Hz mains hum; it also rings and distorts nearby content, so fix the hum at the source first. , Phase distortionPhase distortion Different frequencies being delayed by different amounts, which smears and shifts waveforms such as an ERP peak. . Glossary entry. For ERPsEvent-related potential (ERP) The small, stereotyped voltage waveform the brain produces in response to an event, invisible in a single trial and revealed by averaging many. Related: P300P300 A positive bump about 300 milliseconds after a rare or meaningful stimulus, the basis of the classic BCI speller. , N170N170 A negative deflection about 170 milliseconds after seeing a face, over the back of the head on the right. , Error-related negativity (ERN)Error-related negativity (ERN) A sharp negative wave about 50 to 100 milliseconds after you make a mistake, before you consciously notice. , Trial averagingTrial averaging Adding many time-locked epochs together so the consistent response grows and the random noise shrinks by the square root of the number of trials. . Glossary entry: the downsampled voltage waveform, channels concatenated. For SSVEPSteady-state visual evoked potential (SSVEP) When you stare at something flickering at a fixed rate, visual cortex oscillates at that rate, and the frequency can be read straight out of the EEG spectrum. Related: Canonical correlation analysis (CCA)Canonical correlation analysis (CCA) Finding the combination of channels that correlates best with reference sinusoids at each candidate frequency; the standard SSVEP decoder. , Brain-computer interface (BCI)Brain-computer interface (BCI) A system that turns measured brain activity into control of something outside the body, from a cursor to a wheelchair to a speech synthesizer. . Glossary entry: correlations with reference frequencies. Good features make simple classifiersClassifier An algorithm that assigns each trial a label, such as left hand or right hand, after being trained on labelled examples. Related: Linear discriminant analysis (LDA)Linear discriminant analysis (LDA) A simple, robust classifier that draws a straight boundary between classes; the workhorse of EEG decoding for two decades. , Support vector machine (SVM)Support vector machine (SVM) A classifier that finds the boundary with the widest margin between classes; strong on small datasets. , Cross-validationCross-validation Testing a model on data it never saw during training, repeatedly, so the reported accuracy means something. . Glossary entry work; no classifierClassifier An algorithm that assigns each trial a label, such as left hand or right hand, after being trained on labelled examples. Related: Linear discriminant analysis (LDA)Linear discriminant analysis (LDA) A simple, robust classifier that draws a straight boundary between classes; the workhorse of EEG decoding for two decades. , Support vector machine (SVM)Support vector machine (SVM) A classifier that finds the boundary with the widest margin between classes; strong on small datasets. , Cross-validationCross-validation Testing a model on data it never saw during training, repeatedly, so the reported accuracy means something. . Glossary entry rescues bad features. The most reliable way to improve a BCIBrain-computer interface (BCI) A system that turns measured brain activity into control of something outside the body, from a cursor to a wheelchair to a speech synthesizer. Related: DecoderDecoder The algorithm that maps neural signals to intended actions, such as a classifier or a Kalman filter. , Closed loopClosed loop A system in which the output feeds back to influence the input, such as a user adjusting their brain activity while watching the cursor it controls. . Glossary entry is still to improve the signal.
Three classifiers that cover the field
Linear discriminant analysisLinear discriminant analysis (LDA) A simple, robust classifier that draws a straight boundary between classes; the workhorse of EEG decoding for two decades. Related: ClassifierClassifier An algorithm that assigns each trial a label, such as left hand or right hand, after being trained on labelled examples.. Glossary entry fits a Gaussian to each class with a shared covariance and draws the boundary where they are equally likely. Few parameters, hard to overfit, fast, and the default in BCIBrain-computer interface (BCI) A system that turns measured brain activity into control of something outside the body, from a cursor to a wheelchair to a speech synthesizer. Related: DecoderDecoder The algorithm that maps neural signals to intended actions, such as a classifier or a Kalman filter. , Closed loopClosed loop A system in which the output feeds back to influence the input, such as a user adjusting their brain activity while watching the cursor it controls. . Glossary entry for two decades. With shrinkage regularization it handles more features than trials, which is the usual EEGElectroencephalography (EEG) Recording the brain's electrical activity from electrodes on the scalp, a few tens of microvolts of blurred, summed cortical activity. Related: Electrocorticography (ECoG)Electrocorticography (ECoG) Recording from electrodes placed on the surface of the brain under the skull, usually during epilepsy surgery evaluation; cleaner and sharper than EEG. , Magnetoencephalography (MEG)Magnetoencephalography (MEG) Recording the tiny magnetic fields produced by cortical currents with superconducting sensors in a shielded room; less blurred by the skull than EEG, and far more expensive. , Volume conductionVolume conduction The spreading of currents from a source through the conductive tissues of the head, which is why one source shows up on many electrodes and why scalp EEG is blurry. , Microvolt (µV)Microvolt (µV) One millionth of a volt. Scalp EEG is tens of microvolts; a AA battery is 1.5 million of them. . Glossary entry situation.
Each class gets a score from its mean, the shared covariance, and its prior:
Here is the mean feature vector of class , the covariance shared across classes, and the prior probability of class . A new trial goes to the class with the largest score, so the boundary sits where two scores tie.
Common spatial patternsCommon spatial patterns (CSP) Spatial filters that maximize the variance of one class while minimizing the other, the classic feature extractor for motor imagery. Related: Motor imageryMotor imagery Imagining a movement without making it, which changes rhythms over motor cortex in a way a classifier can sometimes detect., ClassifierClassifier An algorithm that assigns each trial a label, such as left hand or right hand, after being trained on labelled examples.. Glossary entry is a feature extractor for two-class oscillatory problems: it finds spatial filtersFilter An operation that passes some frequencies and attenuates others; every filter also delays or distorts the timing of what it passes. Related: High-pass filterHigh-pass filter Removes slow drifts and DC offsets, passing everything above a cutoff; set it too high and you erase slow brain activity. , Low-pass filterLow-pass filter Removes fast content above a cutoff; the anti-alias filter is one, and so is the smoothing you apply to a noisy trace. , Notch filterNotch filter A very narrow filter that removes one frequency, usually 60 Hz mains hum; it also rings and distorts nearby content, so fix the hum at the source first. , Phase distortionPhase distortion Different frequencies being delayed by different amounts, which smears and shifts waveforms such as an ERP peak. . Glossary entry whose output variance is large for one class and small for the other. The log-variance of a few CSPCommon spatial patterns (CSP) Spatial filters that maximize the variance of one class while minimizing the other, the classic feature extractor for motor imagery. Related: Motor imageryMotor imagery Imagining a movement without making it, which changes rhythms over motor cortex in a way a classifier can sometimes detect. , ClassifierClassifier An algorithm that assigns each trial a label, such as left hand or right hand, after being trained on labelled examples. . Glossary entry components, then LDALinear discriminant analysis (LDA) A simple, robust classifier that draws a straight boundary between classes; the workhorse of EEG decoding for two decades. Related: ClassifierClassifier An algorithm that assigns each trial a label, such as left hand or right hand, after being trained on labelled examples. . Glossary entry, is the classic motor imageryMotor imagery Imagining a movement without making it, which changes rhythms over motor cortex in a way a classifier can sometimes detect. Related: Sensorimotor rhythm (mu)Sensorimotor rhythm (mu) An 8 to 13 Hz rhythm over motor cortex that weakens when you move, or imagine moving, the corresponding body part. , Event-related desynchronization (ERD)Event-related desynchronization (ERD) The drop in rhythmic power over a cortical area when it becomes active, such as mu weakening when you imagine moving your hand. , BCI inefficiencyBCI inefficiency The finding that around one in five people cannot control a motor-imagery BCI even after training; once called "BCI illiteracy," a label the field is retiring. . Glossary entry pipeline.
The objective is the ratio of the two class variances along the filterFilter An operation that passes some frequencies and attenuates others; every filter also delays or distorts the timing of what it passes. Related: High-pass filterHigh-pass filter Removes slow drifts and DC offsets, passing everything above a cutoff; set it too high and you erase slow brain activity. , Low-pass filterLow-pass filter Removes fast content above a cutoff; the anti-alias filter is one, and so is the smoothing you apply to a noisy trace. , Notch filterNotch filter A very narrow filter that removes one frequency, usually 60 Hz mains hum; it also rings and distorts nearby content, so fix the hum at the source first. , Phase distortionPhase distortion Different frequencies being delayed by different amounts, which smears and shifts waveforms such as an ERP peak. . Glossary entry:
Here and are the two classes’ channel covariance matrices and is the spatial filterFilter An operation that passes some frequencies and attenuates others; every filter also delays or distorts the timing of what it passes. Related: High-pass filterHigh-pass filter Removes slow drifts and DC offsets, passing everything above a cutoff; set it too high and you erase slow brain activity. , Low-pass filterLow-pass filter Removes fast content above a cutoff; the anti-alias filter is one, and so is the smoothing you apply to a noisy trace. , Notch filterNotch filter A very narrow filter that removes one frequency, usually 60 Hz mains hum; it also rings and distorts nearby content, so fix the hum at the source first. , Phase distortionPhase distortion Different frequencies being delayed by different amounts, which smears and shifts waveforms such as an ERP peak. . Glossary entry. The optimum is a generalized eigenvector, computed in one call.
Riemannian geometryRiemannian geometry classifiers Methods that treat each trial's covariance matrix as a point on a curved space and classify by distance there; the strongest simple baseline for EEG today. Related: ClassifierClassifier An algorithm that assigns each trial a label, such as left hand or right hand, after being trained on labelled examples., Common spatial patterns (CSP)Common spatial patterns (CSP) Spatial filters that maximize the variance of one class while minimizing the other, the classic feature extractor for motor imagery.. Glossary entry classifiersClassifier An algorithm that assigns each trial a label, such as left hand or right hand, after being trained on labelled examples. Related: Linear discriminant analysis (LDA)Linear discriminant analysis (LDA) A simple, robust classifier that draws a straight boundary between classes; the workhorse of EEG decoding for two decades. , Support vector machine (SVM)Support vector machine (SVM) A classifier that finds the boundary with the widest margin between classes; strong on small datasets. , Cross-validationCross-validation Testing a model on data it never saw during training, repeatedly, so the reported accuracy means something. . Glossary entry skip feature engineering: each trial is represented by its channel covariance matrix, which lives on a curved space where the natural distance is not Euclidean. Map the matrices to the tangent space at their mean and run logistic regression. This is the strongest simple baseline on nearly every public EEGElectroencephalography (EEG) Recording the brain's electrical activity from electrodes on the scalp, a few tens of microvolts of blurred, summed cortical activity. Related: Electrocorticography (ECoG)Electrocorticography (ECoG) Recording from electrodes placed on the surface of the brain under the skull, usually during epilepsy surgery evaluation; cleaner and sharper than EEG. , Magnetoencephalography (MEG)Magnetoencephalography (MEG) Recording the tiny magnetic fields produced by cortical currents with superconducting sensors in a shielded room; less blurred by the skull than EEG, and far more expensive. , Volume conductionVolume conduction The spreading of currents from a source through the conductive tissues of the head, which is why one source shows up on many electrodes and why scalp EEG is blurry. , Microvolt (µV)Microvolt (µV) One millionth of a volt. Scalp EEG is tens of microvolts; a AA battery is 1.5 million of them. . Glossary entry dataset and it is three lines in pyRiemann. Learn it after LDALinear discriminant analysis (LDA) A simple, robust classifier that draws a straight boundary between classes; the workhorse of EEG decoding for two decades. Related: ClassifierClassifier An algorithm that assigns each trial a label, such as left hand or right hand, after being trained on labelled examples. . Glossary entry, and use it by default.
The distance between two trial covariance matrices on their curved space is:
Here and are the two trials’ covariance matrices, is the matrix logarithm, and is the Frobenius norm. Mapping every trial to the tangent space at the mean turns these distances into ordinary vectors for logistic regression.
from pyriemann.estimation import Covariances
from pyriemann.tangentspace import TangentSpace
from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import make_pipeline
clf = make_pipeline(Covariances('oas'), TangentSpace(), LogisticRegression())
Support vector machines, random forests, and neural networks exist too. On EEG-sized datasets they rarely beat the three above by more than noise, and they overfit more. The deep learning page is about when they do and do not help.
Now the part that matters
You have 200 trials from one session. You shuffle them, train on 160, test on 40, and get 88 percent. Tomorrow, with the same classifier, what do you expect?
Substantially lower, and today’s data cannot tell you how much. Shuffled trials from one session share everything that drifts slowly: electrode impedancesElectrode impedance How hard it is to push current through the skin-electrode contact, typically 5 to 50 kilohms with gel and megohms dry, higher at low frequencies. Related: Dry electrodeDry electrode An electrode used without gel, faster to apply but with higher, less stable impedance and more motion noise; the consumer-headset compromise. , Conductive gel or pasteConductive gel or paste Salty gel between electrode and skin that lowers impedance, stabilizes the chemistry, and is the reason research EEG takes half an hour to set up. , Electrochemical impedance spectroscopy (EIS)Electrochemical impedance spectroscopy (EIS) Measuring an electrode's impedance across many frequencies to characterize its interface, standard in electrode development. . Glossary entry, the participant’s state, the exact cap position. The test set is not a new day; it is the same day with a few trials hidden. Only a second session tells you the cross-session number, and it is typically five to twenty points lower.
Leakage. Any information from the test set that reaches training is leakageData leakage Information from the test set sneaking into training, for example by shuffling trials from one session across both; it inflates accuracy and is the most common flaw in student BCI papers. Related: Cross-validationCross-validation Testing a model on data it never saw during training, repeatedly, so the reported accuracy means something.. Glossary entry, and it inflates the number. Shuffling trials across sessions. Fitting the CSPCommon spatial patterns (CSP) Spatial filters that maximize the variance of one class while minimizing the other, the classic feature extractor for motor imagery. Related: Motor imageryMotor imagery Imagining a movement without making it, which changes rhythms over motor cortex in a way a classifier can sometimes detect. , ClassifierClassifier An algorithm that assigns each trial a label, such as left hand or right hand, after being trained on labelled examples. . Glossary entry filtersFilter An operation that passes some frequencies and attenuates others; every filter also delays or distorts the timing of what it passes. Related: High-pass filterHigh-pass filter Removes slow drifts and DC offsets, passing everything above a cutoff; set it too high and you erase slow brain activity. , Low-pass filterLow-pass filter Removes fast content above a cutoff; the anti-alias filter is one, and so is the smoothing you apply to a noisy trace. , Notch filterNotch filter A very narrow filter that removes one frequency, usually 60 Hz mains hum; it also rings and distorts nearby content, so fix the hum at the source first. , Phase distortionPhase distortion Different frequencies being delayed by different amounts, which smears and shifts waveforms such as an ERP peak. . Glossary entry, the normalization, or the ICAIndependent component analysis (ICA) A method that unmixes multichannel data into statistically independent sources, so blinks and heartbeat can be identified and removed. Related: ArtifactArtifact Anything in the recording that did not come from the brain: blinks, muscle, heartbeat, movement, sweat, mains hum, electrode pops. . Glossary entry on all the data before splitting. Choosing hyperparameters on the test set. Choosing which subjects to include after seeing results. Each of these is common, each is easy to do by accident, and scikit-learn’s pipelines exist to prevent the second one: put every fitted step inside the pipeline so cross-validationCross-validation Testing a model on data it never saw during training, repeatedly, so the reported accuracy means something. Related: Data leakageData leakage Information from the test set sneaking into training, for example by shuffling trials from one session across both; it inflates accuracy and is the most common flaw in student BCI papers. , OverfittingOverfitting A model that has memorized its training data, including its noise, and fails on anything new. . Glossary entry fits it on training folds only.
The right splits, in increasing honesty. Shuffled trials within a session: the wrong way, useful only to check the code runs. Grouped by run or block within a session: honest within-session. Train on session one, test on session two: the cross-session number, which is what a user experiences. Leave one subject out: the cross-subject number, which is what a calibrationCalibration The session at the start of BCI use in which the decoder is trained on this person, today, because brains and electrodes drift. Related: Transfer learningTransfer learning Using data from other people or other days to shorten calibration for a new user. . Glossary entry-free product would need. Report the one that matches the claim you are making, and say which.
Chance is not 50 percent. With two classes and forty trials, a coin-flip classifierClassifier An algorithm that assigns each trial a label, such as left hand or right hand, after being trained on labelled examples. Related: Linear discriminant analysis (LDA)Linear discriminant analysis (LDA) A simple, robust classifier that draws a straight boundary between classes; the workhorse of EEG decoding for two decades. , Support vector machine (SVM)Support vector machine (SVM) A classifier that finds the boundary with the widest margin between classes; strong on small datasets. , Cross-validationCross-validation Testing a model on data it never saw during training, repeatedly, so the reported accuracy means something. . Glossary entry scores above 62 percent one time in twenty. The binomial distribution gives the upper bound for any trial count; the statistics page has it. Always report the chance bound next to the accuracy. With unbalanced classes, use balanced accuracy or report the confusion matrix, because 80 percent on a task with 80 percent standards is chance.
Balanced accuracy averages the two per-class rates instead:
A majority-class guesser scores 50 percent on this measure no matter how unbalanced the task is.
CalibrationCalibration The session at the start of BCI use in which the decoder is trained on this person, today, because brains and electrodes drift. Related: Transfer learningTransfer learning Using data from other people or other days to shorten calibration for a new user. . Glossary entry and drift. Signals change within a session (electrodesElectrode The conductor that turns ion currents in tissue into electron currents in a wire; its chemistry and contact quality set the noise you live with. Related: Silver/silver-chloride (Ag/AgCl)Silver/silver-chloride (Ag/AgCl) The standard electrode material for biopotentials, because its chemistry produces a stable, low-noise, low-drift interface with salty gel. , Electrode impedanceElectrode impedance How hard it is to push current through the skin-electrode contact, typically 5 to 50 kilohms with gel and megohms dry, higher at low frequencies. , Half-cell potentialHalf-cell potential The DC voltage that appears wherever a metal meets an electrolyte; two electrodes with different half-cell potentials produce an offset that can swamp the signal. . Glossary entry settle, attention fades) and between sessions (cap position, mood, sleep). A deployed BCIBrain-computer interface (BCI) A system that turns measured brain activity into control of something outside the body, from a cursor to a wheelchair to a speech synthesizer. Related: DecoderDecoder The algorithm that maps neural signals to intended actions, such as a classifier or a Kalman filter. , Closed loopClosed loop A system in which the output feeds back to influence the input, such as a user adjusting their brain activity while watching the cursor it controls. . Glossary entry recalibrates at the start of each session and often adapts during it. If your evaluation does not include the cost of that, it is not evaluating the system.
Information transfer rate
Accuracy alone misleads: 90 percent on two targets in ten seconds is worse than 70 percent on eight targets in three. Wolpaw’s information transfer rateBrain-computer interfaces for communication and controlThe review that defined information transfer rate, the one number that compares spellers honestly. combines them. Bits per selection:
for N targets and accuracy P, and ITR is B times selections per minute. A good SSVEPSteady-state visual evoked potential (SSVEP) When you stare at something flickering at a fixed rate, visual cortex oscillates at that rate, and the frequency can be read straight out of the EEG spectrum. Related: Canonical correlation analysis (CCA)Canonical correlation analysis (CCA) Finding the combination of channels that correlates best with reference sinusoids at each candidate frequency; the standard SSVEP decoder. , Brain-computer interface (BCI)Brain-computer interface (BCI) A system that turns measured brain activity into control of something outside the body, from a cursor to a wheelchair to a speech synthesizer. . Glossary entry speller reaches 40 to 60 bits per minute; a P300P300 A positive bump about 300 milliseconds after a rare or meaningful stimulus, the basis of the classic BCI speller. Related: Event-related potential (ERP)Event-related potential (ERP) The small, stereotyped voltage waveform the brain produces in response to an event, invisible in a single trial and revealed by averaging many. , Oddball paradigmOddball paradigm An experiment in which a rare target is mixed in among frequent standards; the rare one produces a P300. . Glossary entry speller 10 to 25; motor imageryMotor imagery Imagining a movement without making it, which changes rhythms over motor cortex in a way a classifier can sometimes detect. Related: Sensorimotor rhythm (mu)Sensorimotor rhythm (mu) An 8 to 13 Hz rhythm over motor cortex that weakens when you move, or imagine moving, the corresponding body part. , Event-related desynchronization (ERD)Event-related desynchronization (ERD) The drop in rhythmic power over a cortical area when it becomes active, such as mu weakening when you imagine moving your hand. , BCI inefficiencyBCI inefficiency The finding that around one in five people cannot control a motor-imagery BCI even after training; once called "BCI illiteracy," a label the field is retiring. . Glossary entry under 10. Report it, and report the time per selection it assumes.
As a rate, with seconds per selection:
Deep dive Why LDA works so well on EEG 3 min
EEGElectroencephalography (EEG) Recording the brain's electrical activity from electrodes on the scalp, a few tens of microvolts of blurred, summed cortical activity. Related: Electrocorticography (ECoG)Electrocorticography (ECoG) Recording from electrodes placed on the surface of the brain under the skull, usually during epilepsy surgery evaluation; cleaner and sharper than EEG. , Magnetoencephalography (MEG)Magnetoencephalography (MEG) Recording the tiny magnetic fields produced by cortical currents with superconducting sensors in a shielded room; less blurred by the skull than EEG, and far more expensive. , Volume conductionVolume conduction The spreading of currents from a source through the conductive tissues of the head, which is why one source shows up on many electrodes and why scalp EEG is blurry. , Microvolt (µV)Microvolt (µV) One millionth of a volt. Scalp EEG is tens of microvolts; a AA battery is 1.5 million of them. . Glossary entry features are roughly Gaussian, classes differ mostly in their means, and trials are few. LDALinear discriminant analysis (LDA) A simple, robust classifier that draws a straight boundary between classes; the workhorse of EEG decoding for two decades. Related: ClassifierClassifier An algorithm that assigns each trial a label, such as left hand or right hand, after being trained on labelled examples. . Glossary entry’s assumptions match, and its parameter count is small (a mean per class and one shared covariance), so it does not overfit. Shrinkage LDALinear discriminant analysis (LDA) A simple, robust classifier that draws a straight boundary between classes; the workhorse of EEG decoding for two decades. Related: ClassifierClassifier An algorithm that assigns each trial a label, such as left hand or right hand, after being trained on labelled examples. . Glossary entry regularizes the covariance toward the identity, which is essential when features outnumber trials, and the shrinkage amount can be set analytically (Ledoit-Wolf) with no cross-validationCross-validation Testing a model on data it never saw during training, repeatedly, so the reported accuracy means something. Related: Data leakageData leakage Information from the test set sneaking into training, for example by shuffling trials from one session across both; it inflates accuracy and is the most common flaw in student BCI papers. , OverfittingOverfitting A model that has memorized its training data, including its noise, and fails on anything new. . Glossary entry. It is hard to beat, and any method that claims to should be compared against it with the same split.
Deep dive Nested cross-validation for hyperparameters 3 min
If you tune anything (the number of CSPCommon spatial patterns (CSP) Spatial filters that maximize the variance of one class while minimizing the other, the classic feature extractor for motor imagery. Related: Motor imageryMotor imagery Imagining a movement without making it, which changes rhythms over motor cortex in a way a classifier can sometimes detect. , ClassifierClassifier An algorithm that assigns each trial a label, such as left hand or right hand, after being trained on labelled examples. . Glossary entry components, the regularization strength) you must tune it inside each training fold, using an inner cross-validationCross-validation Testing a model on data it never saw during training, repeatedly, so the reported accuracy means something. Related: Data leakageData leakage Information from the test set sneaking into training, for example by shuffling trials from one session across both; it inflates accuracy and is the most common flaw in student BCI papers. , OverfittingOverfitting A model that has memorized its training data, including its noise, and fails on anything new. . Glossary entry, and evaluate on the outer test fold that never saw the tuning. Tuning on the same folds you report is leakage and adds several points. scikit-learn’s GridSearchCV inside cross_val_score does this correctly.
Deep dive Transfer learning and calibration-free BCIs 3 min
Aligning each session’s covariance to a common reference (Riemannian alignment) before classification lets data from other sessions and other people help, and cuts calibrationCalibration The session at the start of BCI use in which the decoder is trained on this person, today, because brains and electrodes drift. Related: Transfer learningTransfer learning Using data from other people or other days to shorten calibration for a new user. . Glossary entry time. It works better for SSVEPSteady-state visual evoked potential (SSVEP) When you stare at something flickering at a fixed rate, visual cortex oscillates at that rate, and the frequency can be read straight out of the EEG spectrum. Related: Canonical correlation analysis (CCA)Canonical correlation analysis (CCA) Finding the combination of channels that correlates best with reference sinusoids at each candidate frequency; the standard SSVEP decoder. , Brain-computer interface (BCI)Brain-computer interface (BCI) A system that turns measured brain activity into control of something outside the body, from a cursor to a wheelchair to a speech synthesizer. . Glossary entry and P300P300 A positive bump about 300 milliseconds after a rare or meaningful stimulus, the basis of the classic BCI speller. Related: Event-related potential (ERP)Event-related potential (ERP) The small, stereotyped voltage waveform the brain produces in response to an event, invisible in a single trial and revealed by averaging many. , Oddball paradigmOddball paradigm An experiment in which a rare target is mixed in among frequent standards; the rare one produces a P300. . Glossary entry than for motor imageryMotor imagery Imagining a movement without making it, which changes rhythms over motor cortex in a way a classifier can sometimes detect. Related: Sensorimotor rhythm (mu)Sensorimotor rhythm (mu) An 8 to 13 Hz rhythm over motor cortex that weakens when you move, or imagine moving, the corresponding body part. , Event-related desynchronization (ERD)Event-related desynchronization (ERD) The drop in rhythmic power over a cortical area when it becomes active, such as mu weakening when you imagine moving your hand. , BCI inefficiencyBCI inefficiency The finding that around one in five people cannot control a motor-imagery BCI even after training; once called "BCI illiteracy," a label the field is retiring. . Glossary entry. The dream of a BCIBrain-computer interface (BCI) A system that turns measured brain activity into control of something outside the body, from a cursor to a wheelchair to a speech synthesizer. Related: DecoderDecoder The algorithm that maps neural signals to intended actions, such as a classifier or a Kalman filter. , Closed loopClosed loop A system in which the output feeds back to influence the input, such as a user adjusting their brain activity while watching the cursor it controls. . Glossary entry that works for a new person with no calibrationCalibration The session at the start of BCI use in which the decoder is trained on this person, today, because brains and electrodes drift. Related: Transfer learningTransfer learning Using data from other people or other days to shorten calibration for a new user. . Glossary entry is the field’s current frontier, and it is measured by leave-one-subject-out accuracy, which is currently far below within-subject for everything but SSVEPSteady-state visual evoked potential (SSVEP) When you stare at something flickering at a fixed rate, visual cortex oscillates at that rate, and the frequency can be read straight out of the EEG spectrum. Related: Canonical correlation analysis (CCA)Canonical correlation analysis (CCA) Finding the combination of channels that correlates best with reference sinusoids at each candidate frequency; the standard SSVEP decoder. , Brain-computer interface (BCI)Brain-computer interface (BCI) A system that turns measured brain activity into control of something outside the body, from a cursor to a wheelchair to a speech synthesizer. . Glossary entry.
Explain what this page was about to your roommate in three sentences. No jargon they would not know.
We build features as band power or averaged voltage per trial and separate them with simple boundaries that need few examples, using pipelines that fit every step inside the training folds only. We test on a later session or a held out person rather than shuffled trials from the same hour, because same day numbers near 88 percent often fall 5 to 20 points the next day when caps and states shift. We compare accuracy against a coin flip bound near 62 percent for 40 trials and report speed as bits per minute, near 40 to 60 for flicker spellers and under 10 for imagined movement.
Yours does not have to match. Check that the three ideas are there.