Station 4 · Lesson 6

Reading artifact components

Core15 minBefore this lesson: ICLabel & removing componentsPrint the card
Starts from: eeglab_data.set (D1) · Already applied: High-pass & low-pass filtering, Removing line noise (50/60 Hz), Bad channels, Channel interpolation, Re-referencing, Running ICA, 1-Hz filtering for ICA & copying weightsDownload the data (opens in a new tab)
Script to reach this state
MATLAB
% Shortcut: if you saved D1_main_ica.set in the 1-Hz filtering lesson, keep
% the first line and the last two lines, and replace every line between them with:
% EEG = pop_loadset('D1_main_ica.set', pwd);
[ALLEEG, EEG, CURRENTSET, ALLCOM] = eeglab;
eeglabRoot = fileparts(which('eeglab'));
EEG = pop_loadset('eeglab_data.set', fullfile(eeglabRoot, 'sample_data'));
fullLocs = EEG.chanlocs;

% Main dataset: high-pass at 0.1 Hz, then 60 Hz line-noise removal
EEG = pop_eegfiltnew(EEG, 'locutoff', 0.1);
EEG = pop_eegfiltnew(EEG, 'locutoff', 58, 'hicutoff', 62, 'revfilt', 1);

% Bad channels you removed earlier, e.g. {'T7'}; leave empty if none
badChans = {};
if ~isempty(badChans)
    EEG = pop_select(EEG, 'rmchannel', badChans);
    EEG = pop_interp(EEG, fullLocs, 'spherical');
end

% Average reference, EOG channels excluded
eogIdx = find(ismember({EEG.chanlocs.labels}, {'EOG1', 'EOG2'}));
EEG = pop_reref(EEG, [], 'exclude', eogIdx);

% ICA on a 1-Hz copy, then copy the weights back
EEG_ica = pop_eegfiltnew(EEG, 'locutoff', 1);
EEG_ica = pop_runica(EEG_ica, 'icatype', 'runica', 'extended', 1);
EEG.icaweights  = EEG_ica.icaweights;
EEG.icasphere   = EEG_ica.icasphere;
EEG.icachansind = EEG_ica.icachansind;
EEG.icawinv     = [];
EEG.icaact      = [];
EEG = eeg_checkset(EEG);
EEG.filename = ''; EEG.filepath = ''; EEG.datfile = ''; EEG.saved = 'no';
[ALLEEG, EEG, CURRENTSET] = pop_newset(ALLEEG, EEG, 0, 'setname', 'D1 main', 'gui', 'off');
eeglab redraw;

The idea in brief

ICLabelA tool that classifies each ICA component into seven classes with a probability for each. gives each ICAA method that separates the recording into independent sources, some brain and some artifact. component a probability for seven classes. But it can be wrong, and the decision to remove a component is yours. In the ICLabel lesson you read three classes: eye, muscleHigh-frequency electrical activity from muscles, often jaw and neck., and brain. This lesson covers all seven, with the sign that tells each one apart.

Before and after

This lesson reads components without changing the data. The example below is solved, and its link opens the full ICA game: each example there shows the three panels, and after you answer it shows ICLabel’s probabilities and why.

Your next questions, each answered in its own section:

Why do I need this step?

The reasons in detail, and the terms you need

The official tutorial gives the order in which to look at a component:

  1. The scalp mapA top-down picture showing how a value is spread over the head..
  2. The time course of the component.
  3. The powerThe squared amplitude; how strong a signal is at a given frequency. spectrumHow a signal's strength is distributed across frequencies. of the component’s activity.
  4. For epoched data, the ERP imageA plot showing every trial as a colored row, stacked in order..

No single panel is enough. A component is an artifactA non-brain signal mixed into the recording, such as blinks or muscle activity. when the panels agree.

Colour and sign do not matter.

In ICA the sign of a component is arbitrary: red and blue on the map can swap, and the time course can flip, without any change in meaning. Look at the shape, not the colour.

How do I do it in EEGLAB?

5 steps in the menus

Start with the main datasetOne EEG data file loaded in EEGLAB together with its information. loaded and holding ICA weights, as in the Starting point. If you continue from the ICLabel lesson, select D1 main from the Datasets menuA list of commands that opens from its name at the top of the window., not D1 main clean, because the artifact components are still in it.

  1. Open Tools then Classify components using ICLabel then Label components, keep Default (recommended), and press OK. The maps appear with the most likely class above each one.
  2. Open Tools then Classify components using ICLabel then View extended component properties and choose a component. Its window shows the scalp map, the activity spectrum, the time course, and the probability of each class.
  3. To see time courses side by side, open Plot then Component activations (scroll). Blinks and heartbeats are easiest to spot here.
  4. For each component, read the panels in the order above and compare them with the table in the next section.
  5. Write down the components you would remove and why. Do not remove anything in this lesson; removal is in the ICLabel lesson.

How do I write it as code?

The same steps in 16 lines of MATLAB
MATLAB
% Classify the components, then find the clearest example of each class
EEG = pop_iclabel(EEG, 'default');
classes = EEG.etc.ic_classification.ICLabel.classes;
probs   = EEG.etc.ic_classification.ICLabel.classifications;
[~, bestClass] = max(probs, [], 2);   % most likely class of each component

for c = 1:numel(classes)
    [p, comp] = max(probs(:, c));
    fprintf('%-14s components: %2d | clearest: %2d (%.0f%%)\n', ...
        classes{c}, sum(bestClass == c), comp, 100 * p);
end

% Panels of the clearest Eye, Muscle, and Brain components
% Column order: Brain, Muscle, Eye, Heart, Line Noise, Channel Noise, Other
[~, examples] = max(probs(:, [3 2 1]));
% pop_viewprops is in the ICLabel plugin folder; the menu adds it to the path, a script must add it
addpath(fullfile(fileparts(which('iclabel')), 'viewprops'));
pop_viewprops(EEG, 0, examples);

The loop prints, for each class, how many components have it as their most likely class, and the component with the highest probability for it. The last line opens the panels of the clearest eye, muscle, and brain components. If the highest probability for a class is below 50%, D1 most likely has no clear component of that class.

In D1 expect several brain components and at least one eye component among the first. Heart and channel noiseNoise on a single channel, usually from a poorly connected electrode. may be missing: not every dataset contains every class.

Which value should I choose?

Suitable values for your analysis goal

The signs of the seven ICLabel classes:

ClassScalp mapSpectrumTime course
BrainSmooth and broad, like one source in the brainFalls as frequencyThe number of cycles per second, measured in hertz (Hz). rises, often with a peak near 10 HzOngoing oscillation without sharp peaks
EyeFar frontal. A blink: symmetric at the front. A sideways movement: opposite colours on the left and right frontsHighest at low frequencies, then falls smoothlyLarge isolated peaks for blinks, or steps for sideways movements
MuscleA small, focal spot at the edge, near the temples or neckRises or stays high from about 20 Hz upwardFast, rough activity, often in bursts
HeartBroad, often a gradient across the whole headNo distinctive peakSharp, regular spikes, about one per second
Line NoiseAny shapeA narrow, tall peak at 50 or 60 Hz, depending on the country of recordingContinuous fast oscillation
Channel NoiseConcentrated on a single electrodeOften irregularJumps or drifts, like one bad channel
OtherMixed or scatteredMixedNo clear pattern

Which classes to remove: on our path, components above 0.9 for Eye or Muscle, after review (the ICLabel lesson). Heart, line noise, and channel noise are removed only after a clear review. Do not remove Other or Brain.

How do I check it worked?

4 quick checks
  1. You can name the sign of each of the seven classes: map, spectrum, and time course.
  2. In D1 you found the clearest eye component and confirmed it with all three panels.
  3. Your list is written down: the components you would remove, with a reason for each, and no Brain or Other component on it.
  4. In the ICA game, you classified the examples and read the explanation after each answer.

What mistakes do people make?

5 mistakes and how to avoid them
  • Judging by colour. The sign is arbitrary in ICA. A blue blink map is the same as a red one.
  • Judging from one panel. A frontal map alone is not enough: a frontal brain component exists too. Its spectrum has a peak, not a smooth fall from the lowest frequencies.
  • Treating ICLabel’s probability as the truth. It is an estimate from a trained classifier. A component at 55% Eye and 40% Brain needs your review before any decision.
  • Expecting every class in every dataset. Heart components often need an ECG artifact strong enough to reach the EEG, and line noise is often weak after a notch filter.
  • Removing Other components. Other means ICLabel could not decide. Removing it may remove brain activity with it.

Where can I read more?

4 sources, official docs first

Written for EEGLAB 2026.1 · 2026-10-28

Need help?

Ask, share feedback, or report an error