Bench modeSteps, parts, and safety only. Big type for a phone at the bench.

Artifact removal, three ways

Prevent, reject, or model. Regression against EOG, independent component analysis, and artifact subspace reconstruction, with the rule for when each is honest.

AssumesThe artifact bestiaryProject F: The software pipelineSpineDecoding / signal processing / ML

You are skimming: the title, the first figure, and the short version. Switch to Read in the header for the full page, or Deep to open every deep dive.

The bestiary taught you to recognize blinks, muscle, heartbeat, and pops. This page is what to do about them. There are three honest strategies, in order of preference: prevent them at the source, reject the stretches that contain them, or model them and subtract the model. And one dishonest one, which is to filter aggressively and hope. Let’s go through the three.

Prevent

Everything in the bestiary’s “at the source” notes. A fixation cross. Blink breaks between trials. A relaxed jaw. A cool room. Fresh paste and a settled electrode. A short recording. Every minute spent here saves an hour of processing and produces data that need no apology. The best labs are the ones whose raw data look clean.

Reject

For epoched experiments, discard trials whose amplitude exceeds a threshold (say, 100 µV peak-to-peak on any channel), or whose variance is many times the median, or that a human marked. Report how many were discarded and why. The rules must be fixed before you look at the results, or you will find yourself discarding the trials that disagree with your hypothesis. Rejection is honest exactly when it is blind.

For continuous data, mark bad segments and exclude them from analysis. MNE’s annotations do this.

Model and subtract

Regression. If you have an EOG channel recording the eyes directly, the blink’s contribution to each EEG channel is roughly a fixed fraction of the EOG signal. Estimate the fraction by regression and subtract. Simple, fast, and it also removes any real brain activity that correlates with the EOG channel, which is a small but real cost.

Independent component analysis. assumes the channels are mixtures of a set of independent sources and finds an unmixing that makes the outputs as statistically independent as possible. Blinks, heartbeat, and steady muscle come out as their own components with characteristic scalp maps: a blink component is frontal and symmetric; a heartbeat component is broad and its time course is a regular spike. You look at each component’s map and time course, decide which are artifact, zero them, and remix. Powerful, standard, and it requires judgment. Never exclude a component you have not looked at. Fit ICA on data high-passed at about 1 Hz; drift confuses it.

Artifact subspace reconstruction. learns what clean data look like from a calibration stretch, then slides a window through the recording, detects bursts whose variance is far above clean, and reconstructs those windows from the directions that were clean. It runs in real time, which ICA cannot, so it is common in BCI pipelines. Its parameter (how far above clean counts as a burst) is a dial between under- and over-cleaning.

Predict before you look

After ICA you remove three components: a blink, a heartbeat, and one whose scalp map looks like alpha over the back of the head. What have you done?

Removed the alpha rhythm. That third component was brain. ICA does not know what you want; it separates whatever is independent, and alpha, being a strong independent rhythm, gets its own component. This is why you look at every component’s map and time course before excluding it, and why the number of excluded components in a good analysis is small and reported.

The dishonest option

Band-pass hard, notch, and call it clean. Muscle overlaps beta and gamma; blinks overlap delta and theta; a notch rings. Filtering removes brain activity along with artifact and leaves whatever is in the passband, then hides the evidence. Filtering is for out-of-band noise. Artifacts are in-band, which is what makes them artifacts.

Which to use

Prevent, always. Then, for an ERP or an offline analysis: reject with fixed rules and use ICA for blinks and heart. For a real-time BCI: ASR or regression, because ICA cannot run online, plus rejection of windows that exceed a threshold. For a classifier in Phase 3: be careful that whatever you do to the training data you also do, identically and causally, to the test data, or you have leaked.

Deep dive How ICA finds the blink 4 min

Sixty-four channels, each a mixture of many sources. ICA looks for a linear unmixing whose outputs are as non-Gaussian and mutually independent as possible, on the reasoning that a mixture of independent things is more Gaussian than the things themselves. Blinks are very non-Gaussian (mostly zero, occasionally large), so they are found early and cleanly. The algorithms (Infomax, FastICA, Picard) differ in how they measure independence; the results for blinks and heartbeat are nearly the same. The number of components is at most the number of channels, and you need many samples (tens of thousands) for a stable solution, which is why ICA on a two-channel headband is not useful.

Deep dive Automatic labelling 2 min

Tools like ICLabel classify components as brain, eye, muscle, heart, line noise, or channel noise using a network trained on thousands of hand-labelled components. Use them to speed up review, not to replace it; check the ones it is uncertain about and any it labels brain that you plan to remove.

Recall
What are the three honest artifact strategies, in order of preference?
Prevent at the source; reject contaminated trials or segments using rules fixed in advance; model and subtract (regression, ICA, ASR).
Recall
Why is aggressive filtering not an artifact-removal strategy?
Artifacts overlap the brain signal's frequency bands (muscle with beta and gamma, blinks with delta and theta), so filtering removes brain activity too and hides the evidence.
Recall
Why can ICA not be used in a real-time BCI, and what is used instead?
ICA needs tens of thousands of samples and runs offline. Real-time pipelines use ASR, regression against an EOG channel, and threshold-based window rejection.
Explain it to your roommate

Explain what this page was about to your roommate in three sentences. No jargon they would not know.