Problem
My thesis, for my biomedical engineering degree, used EEG data from a Chilean FONDECYT research project. EEG records brain activity through scalp electrodes, but recordings routinely contain channels or time segments with no biological information: loose electrodes, impedance changes, muscle and eye artifacts, line noise. Labs often clean these by hand, which is slow and hard to reproduce.
The goal was one automated protocol that takes raw recordings in and returns usable data out, with every step evaluated by a quantitative metric instead of visual inspection.
Method
The protocol builds on EEGLAB (MATLAB) and published state-of-the-art techniques, chained into one parameterized script:
- Load and decimate. Recordings above 500 Hz are halved to 250 Hz to cut compute without losing the band of interest.
- High-pass filter at 1 Hz to remove slow drifts from eye movement and impedance changes.
- Line-noise removal at 50 Hz and harmonics with CleanLine.
- Bad channel and artifact rejection with
clean_rawdataand Artifact Subspace Reconstruction (ASR), controlled by a burst criterion k. - Channel reconstruction by spherical spline interpolation (SSI), compared against a geodesic-distance method.
- Average re-referencing.
- Spectral trial rejection using the 30–100 Hz band to flag muscle contamination.
- ICA decomposition and automatic labeling with ICLabel; non-brain components (eye, muscle) are removed.
- Dipole fitting with DIPFIT. A component counts as dipolar when its residual variance is below 0.15, the plausibility threshold used in the literature.
Every threshold is a parameter (filter cutoffs, ASR k, label and residual-variance thresholds, epoching window), so the same code runs on different experiments.
Results
The protocol was run on 64-channel recordings (10-10 montage) from 10 subjects. The headline metric is the number of dipolar independent components, a proxy for how much physiologically plausible brain signal survives cleaning.
| Subject | Dipolar ICs, raw | Dipolar ICs, after protocol |
|---|---|---|
| C11 | 0 | 9 |
| C12 | 0 | 2 |
| C13 | 0 | 0 |
| C14 | 0 | 7 |
| C15 | 0 | 11 |
| C16 | 0 | 9 |
| C17 | 0 | 20 |
| C18 | 0 | 5 |
| C19 | 0 | 4 |
| C21 | 0 | 12 |
One subject (C13) did not improve. With 10 subjects and 64 channels, I treat this as evidence that the protocol works, not as a general benchmark.
The key tuning knob: ASR burst criterion
EEGLAB's default k is 5 to 7. In this dataset lower values removed more artifacts but also discarded more neural signal. A value between 20 and 30 retained far more usable signal while still producing dipolar components, so I recommend it as the default for exploratory analysis. Where signal purity matters more than data volume, such as connectivity or ERP studies, lower values (5 to 12) remain appropriate.
Channel reconstruction
Removed channels were rebuilt by spherical spline interpolation and scored against the original signal with MAE and MSE per subject, then compared with a geodesic-distance approach.
Limits
Ten subjects and 64 channels bound how far the conclusions extend, and runtime is limited by available RAM. The thesis discussion also notes that artifact reduction was smaller than expected and many components remained artifactual, which held back the number of dipolar components.