Station 4 · Lesson 6
Reading artifact components
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
% 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;Your browser's back button takes you to the exact place you were, so open anything you like.
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:
- The scalp mapA top-down picture showing how a value is spread over the head..
- The time course of the component.
- 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.
- 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.
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.
Why do I need this step?
The official tutorial gives the order in which to look at a component:
- The scalp map.
- The time course of the component.
- The power spectrum of the component’s activity.
- For epoched data, the ERP image.
No single panel is enough. A component is an artifact 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.
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 , not D1 main clean, because the artifact components are still in it.
- 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.
- 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.
- To see time courses side by side, open Plot then Component activations (scroll). Blinks and heartbeats are easiest to spot here.
- For each component, read the panels in the order above and compare them with the table in the next section.
- 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 do it in EEGLAB?
Start with the main dataset loaded and holding ICA weights, as in the Starting point. If you continue from the ICLabel lesson, select D1 main from the Datasets menu, not D1 main clean, because the artifact components are still in it.
- 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.
- 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.
- To see time courses side by side, open Plot then Component activations (scroll). Blinks and heartbeats are easiest to spot here.
- For each component, read the panels in the order above and compare them with the table in the next section.
- 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
% 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.
How do I write it as code?
% 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 noise 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:
| Class | Scalp map | Spectrum | Time course |
|---|---|---|---|
| Brain | Smooth and broad, like one source in the brain | Falls as frequencyThe number of cycles per second, measured in hertz (Hz). rises, often with a peak near 10 Hz | Ongoing oscillation without sharp peaks |
| Eye | Far frontal. A blink: symmetric at the front. A sideways movement: opposite colours on the left and right fronts | Highest at low frequencies, then falls smoothly | Large isolated peaks for blinks, or steps for sideways movements |
| Muscle | A small, focal spot at the edge, near the temples or neck | Rises or stays high from about 20 Hz upward | Fast, rough activity, often in bursts |
| Heart | Broad, often a gradient across the whole head | No distinctive peak | Sharp, regular spikes, about one per second |
| Line Noise | Any shape | A narrow, tall peak at 50 or 60 Hz, depending on the country of recording | Continuous fast oscillation |
| Channel Noise | Concentrated on a single electrode | Often irregular | Jumps or drifts, like one bad channel |
| Other | Mixed or scattered | Mixed | No 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.
Which value should I choose?
The signs of the seven ICLabel classes:
| Class | Scalp map | Spectrum | Time course |
|---|---|---|---|
| Brain | Smooth and broad, like one source in the brain | Falls as frequency rises, often with a peak near 10 Hz | Ongoing oscillation without sharp peaks |
| Eye | Far frontal. A blink: symmetric at the front. A sideways movement: opposite colours on the left and right fronts | Highest at low frequencies, then falls smoothly | Large isolated peaks for blinks, or steps for sideways movements |
| Muscle | A small, focal spot at the edge, near the temples or neck | Rises or stays high from about 20 Hz upward | Fast, rough activity, often in bursts |
| Heart | Broad, often a gradient across the whole head | No distinctive peak | Sharp, regular spikes, about one per second |
| Line Noise | Any shape | A narrow, tall peak at 50 or 60 Hz, depending on the country of recording | Continuous fast oscillation |
| Channel Noise | Concentrated on a single electrode | Often irregular | Jumps or drifts, like one bad channel |
| Other | Mixed or scattered | Mixed | No 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
- You can name the sign of each of the seven classes: map, spectrum, and time course.
- In D1 you found the clearest eye component and confirmed it with all three panels.
- Your list is written down: the components you would remove, with a reason for each, and no Brain or Other component on it.
- In the ICA game, you classified the examples and read the explanation after each answer.
How do I check it worked?
- You can name the sign of each of the seven classes: map, spectrum, and time course.
- In D1 you found the clearest eye component and confirmed it with all three panels.
- Your list is written down: the components you would remove, with a reason for each, and no Brain or Other component on it.
- 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.
What mistakes do people make?
- 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.
Your browser doesn't allow saving progress. All lessons are open, but completion marks won't be saved.
Done. Your progress is saved in this browser.UndoWhere can I read more?
4 sources, official docs first
- EEGLAB TutorialDocumentationStudying and flagging artifactual ICA components
- EEGLAB pluginDocumentationICLabel
- Luck, Applied Event-Related Potential Data Analysis (1st edition)Chapter 9: Artifact Correction with ICA
- Learning to recognize ICA components of EEG and mobile EEGVideoFull video · 26:13
Written for EEGLAB 2026.1 · 2026-10-28
Going further
- EEGLAB Tutorial: https://eeglab.org/tutorials/06_RejectArtifacts/RunICA.html (Studying and flagging artifactual ICA components)
- EEGLAB plugin: https://eeglab.org/plugins/ICLabel/ (ICLabel)
- Luck, Applied Event-Related Potential Data Analysis (1st edition): https://socialsci.libretexts.org/Bookshelves/Psychology/Biological_Psychology/Applied_Event-Related_Potential_Data_Analysis_(Luck) (Chapter 9: Artifact Correction with ICA)
- Learning to recognize ICA components of EEG and mobile EEG: https://www.youtube.com/watch?v=AXCxrDikpaM (Full video)
Need help?
Ask, share feedback, or report an error
- Report a scientific error · Needs a GitHub account. Don't have one? Use "Share your thoughts".