Level 2 L2.7 pipeline thread

ASR, SSP and alternatives

Artifact subspace reconstruction, when it is preferable and what it risks, plus SSP and wavelet-based cleaning.

~45 min Notebook: nb-2-7-asr-vs-ica

Prerequisites: L2.6 · EOG regression and ICA

3 claims on this page are unverified. TODO(confirm) marks a specific statement the author has not yet checked against a primary source. Everything else on this page has been reviewed. Treat a marked claim as provisional and go to the cited source rather than quoting the sentence.

Objectives

  • Explain artifact subspace reconstruction
  • Apply ASR
  • State when ASR is preferable (mobile, real-time, low channel counts) and its risks
  • Recognize SSP and wavelet-based cleaning

Why this matters

ICA is the default artifact-correction method for offline, high-channel-count, well-behaved laboratory data. Outside those conditions — a mobile recording, a real-time loop, sixteen dry electrodes, a participant who cannot sit still — it is often unavailable or unaffordable, and a different family of methods takes over. Knowing what those methods do, and what they cost, is what lets you clean data you could not clean with ICA and still say honestly what you removed.

Concepts

Artifact subspace reconstruction

ASR is a statistical outlier-removal method that works on the covariance of short windows rather than on a decomposition of the whole recording (Mullen et al., 2015) . Its two stages:

Calibration. ASR first needs a stretch of relatively clean data from the same recording — found automatically, or supplied by you. From that reference data it computes the channel covariance and its principal components, and records how much variance each component normally carries.

Processing. It then slides a short window (on the order of half a second) over the whole recording. In each window it computes the covariance, takes its principal components, and compares each component’s variance with the calibration statistics. Any component whose variance exceeds the calibration value by more than a cutoff, expressed in standard deviations, is declared an artifact subspace. The data in that window is then reconstructed from the remaining components — the artifact subspace is replaced by its best linear estimate from the clean subspace, rather than simply zeroed — so the output is continuous and full-rank in appearance.

Three properties follow:

  • It is local in time. Unlike ICA, which finds one fixed set of spatial filters for the whole recording, ASR changes what it removes from window to window. That is what makes it suitable for non-stationary, mobile data, and it is also why what it removed is harder to describe.
  • It is causal-capable. The sliding window can run forward only, so ASR can be applied online with a bounded latency (L7.3). ICA cannot, unless the unmixing matrix was estimated in advance.
  • Its aggressiveness is one number, the cutoff in SDs. Lower is more aggressive. The literature’s recommended ranges vary and have been revised; TODO(confirm) the cutoff range recommended by the implementation you use, and report the value you chose either way.

The risks. A low cutoff removes real neural activity — in particular high-amplitude, transient, genuinely non-stationary brain activity, which is exactly what some analyses are about (bursts, L4.6; epileptiform transients). Because the removal is reconstruction rather than deletion, the output looks clean and full rank, which makes over-cleaning invisible: there is no list of removed components to inspect. And the calibration data matters: if the “clean” reference stretch was not clean, everything is judged against the wrong baseline. That is pf-overcleaning-ica in its ASR form.

SSP: fixed projections

Signal-space projection takes a different route. If an artifact has a fixed spatial pattern — blinks do, to a good approximation, and so does a particular mains-coupling geometry — you can estimate that pattern once (from blink-locked segments, or from an empty-room or rest recording) and then project the data onto the subspace orthogonal to it:

projs = mne.preprocessing.compute_proj_eog(raw, n_eeg=1)
raw.add_proj(projs); raw.apply_proj()

What it costs is explicit and countable: each projection removes exactly one dimension from the data. Two blink projectors on a 30-channel recording leave rank 28, and everything downstream — ICA, source analysis, any rank-sensitive estimator — must know. That explicitness is SSP’s main virtue over ASR: you can say precisely what was removed, and the topography of each projector can be plotted and argued about. Its main limitation is the same fixed-pattern assumption regression makes: one projector cannot follow an artifact whose field changes over the recording, and a projector that overlaps the field of your effect removes the effect.

Wavelet-based cleaning

A third family thresholds the data in a time–frequency representation: decompose each channel with a wavelet transform, identify coefficients that are outliers relative to the local distribution, shrink or zero them, and reconstruct. The appeal is that it is local in both time and frequency, so it can remove a transient without touching the rest of the epoch, and it needs neither many channels nor a spatial model — which is why it appears in single-channel and low-density contexts, and in hybrid pipelines that apply wavelet thresholding to ICA components rather than to channels.

The cost is the mirror image of the appeal: thresholding in time–frequency space is a non-linear operation on the signal, so it can alter the very quantities a time–frequency analysis measures (L4.2), and “outlier coefficient” is a statistical judgment with its own threshold. Report the wavelet family, the decomposition depth and the thresholding rule, or the method is not reproducible.

Cleaning for online use

A real-time or neurofeedback loop (L7.3) imposes constraints that reorganise the whole comparison:

  • Causality. No future samples. Zero-phase filtering is unavailable; ICA’s unmixing matrix must be estimated in a prior calibration block and then frozen; ASR runs naturally in this mode.
  • Latency budget. Every filter’s group delay and every window’s length is part of the time between the brain event and the feedback. A half-second ASR window is half a second of latency.
  • No second chances. Offline you can inspect what was removed and re-run. Online you cannot, so methods that fail gracefully (attenuating a bit too much) are preferred over methods that fail catastrophically.
  • Low channel counts. A 16-channel dry montage does not support a 16-component ICA with any stability, and covariance-based methods degrade more gracefully.

Choosing between them

ICAASRSSPWavelet
Fitsone spatial model for the whole recordingper-window subspaceone or more fixed projectorsper-coefficient threshold
Needsmany channels, lots of data, stationarityclean calibration dataa stable artifact topographya thresholding rule
Onlineonly with a pre-fitted matrixyesyesyes, with buffering
What was removedan inspectable list of componentshard to describeexactly N dimensionscoefficients
Main riskremoving brain componentsinvisible over-cleaningremoving effect-carrying dimensionsdistorting time–frequency estimates

They are also combinable, and often combined: ASR to remove gross non-stationary artifact, then ICA on what remains, is a common mobile-EEG pipeline. Each stage must still be reported with its parameters.

Judgment call

The question is not which method is best but which failure you can afford. ICA fails by removing a component you wanted, and leaves a list of what it removed. ASR fails by removing high-amplitude brain activity and leaves no list. If your effect is a transient, high-amplitude, non-stationary phenomenon, ASR’s failure mode is aimed straight at it — and the way to find out is to run the analysis both ways and report the difference.

The data behind this lesson

  • The notebook cleans one ds-erpcore P3 recording both ways — ICA (as fitted in L2.6) and ASR — and compares ERP signal-to-noise ratio and spectra on the same trials. ERP CORE is CC BY 4.0, open access and per-subject downloadable; TODO(confirm): the author mirrors the entry into the catalog registry and signs off the dataset page (§10.11 item 8).
  • ASR is not part of MNE; the notebook states which implementation and version it installs, and records the cutoff and the calibration segment in its run log (L2.8).

Explore

This lesson has no widget. Run the comparison yourself in the notebook and look at four things in this order:

  • the continuous traces before and after each method, at 10 s and at 60 s per page — what disappeared, and did anything that should have stayed disappear with it;
  • the ERP on identical trials under both methods, overlaid on the uncorrected ERP;
  • the spectra before and after: ASR and wavelet methods change broadband power in ways a waveform does not reveal;
  • the rank of the output under each method, which is the number SSP makes explicit and ASR hides.

Practice

ASR, SSP and ICA on one recording: ERP signal-to-noise ratio, spectra, rank, and the ASR cutoff sweep nb-2-7-asr-vs-ica

Level 2 ~4 min
notebooks/L2/nb-2-7-asr-vs-ica.ipynb

Downloads from ds-erpcore.

Open in Colab Download Read it here

The notebook cleans the same file both ways, holds the trial set fixed so that the comparison is not confounded by rejection, and prints ERP SNR and band power before and after each method. Its final cell prints the two SNR values this lesson’s exercise asks for.

Exercises

Exercise ex-2-7-snr-ica

Numeric

Report the ERP signal-to-noise ratio after ICA cleaning, as the notebook's final cell defines and prints it (same trials, same measurement window).

ratio

Accepted within ±0.15 ratio.

Exercise ex-2-7-snr-asr

Numeric

Report the ERP signal-to-noise ratio after ASR cleaning of the same file, on the same trials and with the same measurement.

ratio

Accepted within ±0.15 ratio.

Exercise ex-2-7-mobile-choice

Multiple choice

A collaborator will record 16 dry electrodes on participants walking outdoors, and needs cleaned data within 200 ms of acquisition to drive feedback. Which cleaning method do you recommend, and why?

Options

Pitfalls

Pitfall

Removing brain components that carry the effect

Symptom
Effect shrinks after "cleaning"; components with alpha or posterior topography removed.
Cause

Every component you remove is subtracted from the data. If it carried brain activity, so is your effect.

Detect
  • Compute the effect with and without the cleaning step. This is the decisive test, and it is cheap. A cleaning step that moves the effect is a step that needs justifying. - Count removed components per subject and look at the distribution. Large variance across subjects means the criterion is not the same criterion each time. - Review the removed set: any component with a smooth dipolar topograp…
Fix
  • Decide the removal policy before you look at the effect: which classes are removed, on what evidence, and what the upper limit on the number removed is. Apply it identically to every subject. - For each removed component, record the class, the evidence from each view, and the classifier probability if available, in the QC report (L2.8). If the justification needs “probably” more than once, keep…

Full entry with example →

In other tools

In other toolsEEGLAB — names only

The equivalents of what this lesson does, for a reader who works in another toolbox. Function names only: their own documentation is the place to learn how to call them.

EEGLAB

  • pop_clean_rawdataclean_rawdata plugin
  • clean_asrclean_rawdata plugin

Names checked 2026-09-18 against EEGLAB 2026.0.0 (plugins at the versions in EEGLAB’s own plugin list).

Reading

  1. Mullen et al. (2015). ASR. unverified