OTD ACADEMY
Sign up free
Library

LIBRARYTurning EEG Into a Command: CSP & EEGNet

How a noisy EEG window becomes one of a few commands: the classic Common Spatial Patterns + LDA pipeline, and the deep-learning alternative, EEGNet.

The last stage of a EEG BCI turns a window of signal into a decision, one of a small set of commands. The standard pipeline is a chain: cut the signal into epochs, bandpass to the task's frequencies, extract features (or spatially filter), then hand those to a classifier that outputs a class. Two eras of this exist side by side: the classic hand-engineered approach, and end-to-end deep learning.

Common Spatial Patterns (CSP), plainly

CSP is a supervised, two-class spatial filter (e.g. left vs right motor imagery). It learns combinations of electrodes that MAXIMIZE the band-power for one class while MINIMIZING it for the other, turning a spatial difference into an easily separated number. The usual feature is the log-variance of the CSP-filtered signals, fed to a simple linear classifier (LDA). It fits motor imagery beautifully, because the signal there IS a spatial band-power difference (Ramoser et al., 2000).

CSP's main limit is that it works on one chosen frequency band, so the popular Filter-Bank CSP (FBCSP) splits the EEG into sub-bands and automatically picks the discriminative ones per person. CSP is also supervised (it needs labeled calibration data), sensitive to noise and small sample sizes, and natively two-class; multi-class needs extensions.

EEGNet: the deep-learning route

The deep-learning route replaces the hand-built features with a network that learns them. EEGNet (Lawhern et al., 2018) is a deliberately compact convolutional neural net for EEG: a temporal convolution learns frequency filters, a depthwise convolution learns spatial filters per frequency (the network's own analog of CSP), a separable convolution summarizes, and a small layer classifies. It was shown to generalize across several BCI paradigms (P300, error-related negativity, movement-related potentials, and motor imagery) with few parameters.

CSP + LDA vs EEGNet

CSP + LDAEEGNet
Feature engineeringHand-designed (bandpass + spatial filter)Learned end-to-end
Data appetiteLow, works with little dataHigher (but EEGNet is designed to be data-efficient)
InterpretabilityHigh (you can read the filters)Lower (though it ships visualization tools)
Best for2-class motor imagery, a strong baselineCross-paradigm, more data available
Maker reality

EEG datasets are small, brains differ, and the signal drifts between sessions, so expect a per-subject calibration step (often 15–30 minutes of recording) and some retraining over time. Start with CSP + LDA: it's fast, low-data, interpretable, and a strong baseline that EEGNet itself is measured against. Reach for EEGNet or FBCSP when you have more data or need more than two classes.

References

Keep going

A classifier is only as good as the signal underneath it. Build the clean front-end that feeds it in the OTD Academy EEG front-end project.

One Thousand Drones Academy · reviewed June 2026

Coming soon

8-Channel EEG Front-End on ESP32

Design the analog board that reads real brainwaves: the BCI.