The Neurophysiological Biomarker Toolbox (NBT)

Compute Independent Component Analysis

An EEG signal is a mixture of signals from many sources. Some of these sources are not from the brain and produce so-called artifacts. Typical sources of artifacts are eye-blinks, breathing, heartbeat, or 50 Hz line noise. We want to clean our EEG signal from artifacts and, therefore, need a way of filtering these signals away. Independent component analysis (ICA) is a method which can extract signals from an EEG signal.

ICA will find, as the name indicates, independent components (i.e., signals) in the EEG signal. We can then select which of these components we want to reject and remove them from the EEG signal using a mathematical procedure called “projection”.

The ICA components are signals that have been combined from several EEG channels, this means that they act as spatial filters on the data. What the ICA algorithm does is to put different weights on each EEG channel such that each component is “independent” from all other components.

Click here for a more technical explanation

Here we describe how to extract ICA components from our demo dataset.

  1. Load and Clean your data
  2. Run ICA
  3. Filter ICA components
  4. Mark ICA components as bad
  5. Repeat steps 2,3
  6. Reject filtered ICA components
  7. Re-reference data to common average electrode
  8. Save ICA Processing

1. Load and Clean your data

Load and Clean your data from bad channels and noisy transient artifacts following the previous sections.

If you have already cleaned your data and saved as CleanSignal, you can load directly the cleaned signal:

  1. if you are in the NBT GUI: go to File|Load NBT Signal; if you are in the EEGlab window: go to NBT|File|Load NBT Signal. Then select the file you want to load (i.e. NBT.S0006.081215.EOR1.mat)
  2. a window will appear asking which signal you want to load (the original or the cleaned), select CleanSignalInfo from the list (see figure below)

2. Run ICA

If you are using NBT from the EEGlab window:

  1. go to NBT|Pre-processing tools|ICA|Run ICA on good channels only. ICA only gives good results if the signal is relatively stationary. We, therefore, apply a 0.5 Hz high-pass filter, this happens automatically (and is only done for the ICA, your signal will not be filtered).
  2. a window will ask you how many components you want. Answer 15. Wait for the ICA algorithm to run; it usually takes around 300 steps.

Please note, that we here decided only to find 15 components. We decided on 15 components, because this number has given us good results with the demo dataset. The number of components you should select for your own data, depends on the signal length (you need at least time points for x number of components, where k is factor around ~30 or more), and how many components you want to evaluate. However, if you are looking for low signal to noise sources, you should probably take the maximum number of components possible.

You will get different components and numbers from the ones in this guide, because ICA is not an analytical process. The components also depend on which channels you have marked as bad, and which transient artifacts you have removed.

3. Filter ICA components

To start rejecting ICA components we need to filter the components, i.e., we remove the frequencies below 0.5 Hz.

We need to filter the components, because the ICA components were calculated on the filtered signal.

  1. go to the menu NBT|Pre-processing tools|ICA|Filter ICA components, wait for the filtering to complete.
  2. We will use different methods to identify brain component and artifacts.
  • First, we inspect component activations, i.e., how the components change over time. Go to the menu Plot|Component activations (scroll) (if no clear components exist, it might help to remove more transient artifacts). If the component activation traces are crossing a lot, you may want to change the scaling of the y-axis using the + and - signs in the lower right corner of the scroll window. Try to identify which components you think are artifact? And which are brain components? Artifact components are characterized by sharp changes, or huge variations in voltage. Brain components would, e.g., have a clear alpha rhythm (~ 10 Hz). Which components would you reject? By scrolling the activation plot it is possible to identify Components 7 and 11 as candidates to reject.

  • To have more descriptive information on the components go to the menu Tools|Reject data using ICA|Reject components by map, click ok. Single component properties can be observed by clicking on the button indicating the number of the component (see figures below). Component 1 clearly comes from the brain, because of the strong ~10 Hz peak in the power spectrum. While Component 7 can be classified as an artifact component, because of the sharp changes in the component activations, and the typical eye-region topographic map.

  • To strengthen our confidence that a component is an artifact component we can also study the component statistics. Go to Plot|Data statistics|Component statistics; write the number of the component you want to study, and click Ok. Most often brain components will have a gaussian distribution, as seen below for component 1, whereas component 7, which we assume to be an artifact component, has a non-gaussian distribution (see Figure below). The figure shows you a histogram of component activity (left) and a QQ plot (right) (see QQ plot on wikipedia. The QQ plot is a straight line if the distribution is normal, if not it has a bend like as seen in the second Figure below.

  • We get a better understanding of our components if we plot their power spectrum and distribution on the scalp. A power spectrum shows you how much power the signal has at each frequency; you will, therefore, see a peak in the alpha frequency range (8-13 Hz) if your signal contains alpha oscillations. Go to the menu Plot|Component spectra and maps in the EEGlab window, click on OK in the popup window. We see that components 1, 2, 3 have a clear alpha peak, whereas other components have a flat power spectrum. It seems that components 1, 2, 3, come from the brain. Which components did you select above?

4. Mark ICA components as bad

  1. To improve the ICA result, we need to remove components identified as bad (7, 11, 13, 14). Go to NBT|Pre-processing tools|ICA|Mark ICA components as bad.
  2. Insert the numbers of the bad components (use space between numbers, without parenthesis), click OK.

With low-density EEG (~60 channels), our experience is that this step should not be done. Instead the components identified as bad channels should be rejected as artifacts. Afterwards the signal should be transformed to average reference. We would be happy to hear your experiences? (Give us feedback)

5. Repeat steps 2,3

  1. Re-run ICA NBT|Pre-processing tools|ICA|Run ICA on good channels only, this time only asking for 11 components because we marked 4 as bad.

We only ask for 11 components because we marked 4 as bad. If, e.g., you only mark 2 components as bad, then you should ask for 15-2 = 13 components.

  1. Filter the components NBT|Pre-processing tool|ICA|Filter ICA components
  2. Let's plot the components again:
    1. go to Plot|Component activations(scroll)
    2. go to Plot|Component spectra and maps
    3. A final step, before we remove artifact components, is to look at the power spectrum and topographic plots again. Go to the menu Tools|Reject data using ICA|Reject components by map. You will be asked Components to plot, click Ok. Click on the buttons for each of the artifact components you have selected, a power spectrum with a map pops up (as seen before). If you still think this component is an artifact click accept (see Figures below), and click Ok (else just click Ok). It often helps to view component activations, power spectrum and topographic plots together.

6. Reject filtered ICA components

  1. Finally, go to the menu NBT|Pre-processing tools|ICA|Reject filtered ICA components, click Ok, then accept.

The components you selected are now removed. Which components did you select? [The most prominent artifacts are components 5,9,10,11]

Only remove maximal 4 components! And only remove components that are clear artifacts.

When you are done rejecting artifacts, you need to re-reference the data and then save the cleaned data!

7. Re-reference data to common average electrode

The signal value for each electrode is calculated as the potential difference between the electrode and a reference electrode. Your data will have been created using Cz as a reference which is located in the center of the scalp, because it is the place with the least artifacts (far from neck and facial muscles). The Cz, however, is not convenient as a reference electrode, e.g., when plotting topographies of oscillation power plots, because it will appear as if there is almost no activity at Cz. Therefore, you should re-reference your data to a so-called “average reference”. After re-referencing, the potential at a given electrode is given relative to the mean across all channels.

  1. To re-reference your data, click NBT|Pre-processing tools|Re-reference (exclude bad channels)

8. Save ICA Processing

  1. Go to NBT|File|Save as NBT Signal
  2. When asked for NBT Signal name write ICASignal
  3. Select the folder where you want to store your signal. We recommend to use the folder where the original data file is, then the ICA signal will be appended (added) to this file and you will have the three signals in one file (original, cleaned, ICA). Wait for confirmation that the signal has been saved.

Common ICA components

Common ICA components (Find more example of artifactual components in this document)

  • Alpha oscillations

Alpha oscillations: The ICA components have a clear 8-13 Hz frequency, which is also seen in the power spectrum.

Alpha oscillations: The ICA components have a clear 8-13 Hz frequency

Power spectrum. A clear alpha peak is seen

The component statistics show that the activity has an almost normal distribution, as we would expect for a signal from the brain.

The topography also shows a dominance in the parietal region as expected for alpha oscillations.

Typical topography of alpha wave activity

  • Eye Artifacts

Eye artifacts are characterized by slow, but strong changes in component activity.

The power spectrum has no alpha peak.

The component statistics show that the activity does not have normal distribution.

The topography has a dominance in the eye region.

  • Heart Beat

The component activity of a heart beat (signal nr 4) has ~ 1 Hz frequency.

The component activity has a broad power spectrum.

The component activity does not have a normal distribution.

The topography is not localized but covers the whole scalp.

ICA analysis can also be computed in NBT GUI:

  1. go to Pre-processing|ICA|Run ICA on good channels only
  2. go to Pre-processing|ICA|Filter ICA components
  3. use the visualization tools for detecting the first round of bad components
    1. go to Visualization|ICA|Plot component activations
    2. go to Visualization|ICA|Plot spectra and maps
    3. go to Visualization|ICA|Components statistics
    4. go to Visualization|ICA|Reject component by map
  4. once you selected the first bad components go to Pre-processing|ICA|Mark ICA components as bad
  5. repeat points 1,2,3
  6. go to Pre-processing|ICA|Reject filtered ICA components

Finally to re-reference your data click Pre-processing|Re-reference to average reference (exclude bad channels), and to save your data click File|Save NBT Signal. When asked for NBT Signal name write ICASignal and select the folder where you want to store your signal (we recommend to use the folder where the original data file is).

NBT also implements automatic and semi-supervised methods for Independent Components Rejection, visit the page Automatic and Semi-Automatic methods for EEG pre-processing to learn more about this subject.

Next step: Compute Biomarkers

Go back to the Tutorials

tutorial/compute_independent_component_analysis.txt · Last modified: 2014/09/11 00:18 by Simon-Shlomo Poil
The NBTwiki platform - version 2.8 - 9 May 2013
Copyright (C) 2008-2015