Error-Related Potentials for Brain-Computer Interfaces
An ErrP is the brain's automatic response to perceiving a mistake — its own or a machine's. This project decodes that signal from EEG and turns it into a reward, so a brain-computer interface can learn what a user actually wants instead of being told explicitly. Built with NeuroTech@USC; the team's real-time cursor-control BCI earned runner-up at the 2026 BCI Competition at UC Berkeley — an intercollegiate contest among university neurotech labs.
My focus was the machine-learning side: the ErrP detection pipeline, the RL formulation, and the analysis behind the results — from training the models to interpreting the EEG data.
ML pipeline
- Two detectors — universal and personalized. ErrP classifiers are trained both across participants (a subject-agnostic model) and within a single participant (a calibrated, personal model), trading generality against per-user accuracy.
- EEG → features → decision. Raw EEG is preprocessed and reduced to ErrP-discriminative features, then classified for the presence of an error potential — fast enough to serve as an online learning signal rather than an offline label.
- Results. Best accuracy is ~76% within participant and ~65% across participants — and that cross-subject gap is exactly what motivates per-user calibration.
Reinforcement learning
- ErrP as the reward. The detected error potential is designed to drive an RL agent that maps neural data onto intended actions — moving a cursor via motor imagery, for instance — so the interface improves from the user's own error responses instead of hand-labeled targets.
- Why RL fits. EEG is highly non-stationary: signals drift within a session and across sessions and subjects. RL is built for exactly that moving target, which makes it a natural way to close the loop between brain and interface.
Data collection
- Paradigm. An error-observation task built in PsychoPy elicits ErrPs on demand, with stimulus events time-locked to the EEG stream.
- Live acquisition. EEG is polled in real time over Lab Streaming Layer (LSL), so detection can run online rather than only on recorded sessions.
Stack
Python, scikit-learn, PsychoPy, Lab Streaming Layer (LSL), Jupyter.