EEGLAB Series Tutorial 5: Data Preprocessing 2 (ICA to remove artifacts)

EEGLAB Series Tutorial 5: Data Preprocessing 2 (ICA to remove artifacts)

Today I will introduce the EEG data processing series tutorial 5. In the previous issues, the basic data processing process has been introduced. You can refer to the following link:

EEGLAB series tutorial 1: Install and start EEGLAB

EEGLAB Series Tutorial 2: Managing Datasets in EEGLAB

EEGLAB Series Tutorial 3: Establishing a location in EEGLAB

EEGLAB Series Tutorial 4: Preprocessing Data in EEGLAB 1

A long time ago, I also used the analyzer software to share the ICA denoising tutorial, you can refer to the link:

Independent Component Analysis (ICA)

Before running ICA, through the previous series of tutorials, bad channels and bad data segments visible to the naked eye can be eliminated. Then it is better to run ICA.

run ICA

To perform ICA on the continuous EEGLAB dataset, select Tools → Decompose data by ICA. The function pop_runica will be called. To run ICA with the default options, just press OK.

image-20221218090410757

If high leads (128 leads and above) are used, the selected commandline option parameters can be modified, and a part of the data can be selected for PCA extraction.

Normal operation process:

image-20221218090609351

ICA algorithm

EEGLAB allows trying different ICA algorithms. Infomax ICA uses runica, Jader algorithm uses jamer.m and SOBI algorithm uses sobi.m These are EEGLAB default algorithms. Algorithms can be selected by selecting from the drop-down.

In addition to using the FastICA algorithm, the FastICA toolbox must be installed and added to the MATLAB path.

View ICA ingredients

The order of components given by runica.m is in descending order of the EEG variance calculated for each component.

IC component activation (time course)

To view IC components according to the time course, select Plot → component activations (scroll). Scrolling through the ICA activations makes it easy to spot the components that account for the characteristic artifacts. For example, in the display below, component 3 might be the blink component.

image-20221218090826816

2-D compositional scalp mapping

To draw a 2-D scalp composition map, select Plot → Component maps → In 2-D. The interactive window is then generated by the function pop_topoplot (below). Just press OK to draw all ingredients.

image-20221218090945045

The following picture appears, showing the scalp display of the selected ingredient.

image-20221218091029624

Optimizing the quality of ICA decomposition

ICA is an algorithm that uses machine learning to decompose the components of EEG data. It takes all training data into account. When too many types of noise are left in the training data—complex motion artifacts, electrode bad sectors, etc., these bad data features will have an impact on ICA decomposition. Therefore, it is optimal to provide the ICA with as much clean EEG data as possible. (Remove large and obvious artifact data)

Issues related to automatic artifact removal prior to ICA

The automatic artifact removal before ICA may delete some data (such as: large blinks, etc.), of course, this can also be corrected by the ICA method. However, lowering the threshold for automatic artifact removal may preserve too many artifacts that ICA cannot remove. In this case, the following steps are recommended:

  1. Start with a dataset that has been minimally cleaned of artifacts (or only bad channels removed)
  2. Run ICA on this dataset
  3. Identify bad ICA components and remove from data
  4. Clean the post-ICA dataset again using stricter thresholding or artifact removal methods to remove remaining artifacts from the data

Apply ICA to segmented data instead of continuous data

In general, it is recommended to use ICA on continuous data rather than extracted segmented data. First, segmented data already reduces the sample size, and the quality of the ICA components is higher when more data exists. Second, removing the baseline of segmented data can have a significant impact on ICA, as it introduces random offsets in each channel, which ICA cannot model or compensate for. Although it is possible to extract segments without deleting the baseline, after running ICA, the baseline may be deleted.

It is also possible to apply ICA to segmented data. ICA expects the data to be stationary, i.e. the same statistical model is generating all data samples. If you have enough data after staging, staging the data may be preferable as it will be more stable. However, when segmenting different events to generate different datasets, we recommend using the same ICA decomposition for all conditions. In practice, this might mean creating a dataset containing all segment types before running ICA. Assuming all data are statistically similar, more data generally provides better ICA decomposition. Longer periods are preferable because they produce more data for ICA (assuming stationarity holds.)

Automatic detection of artifact ICA components

Currently, Luca Pion-Tonachini's ICLabel plugin is the default EEGLAB plugin installed with EEGLAB, which provides estimates for each individual component (brain, eye movement, muscle, line noise, etc.) type. The goal of ICLabel is to develop an EEG IC classifier sufficiently reliable and accurate to be useful in large-scale studies. Current classifier implementations are trained on thousands of manually labeled ICs and hundreds of thousands of unlabeled ICs. More information can be found in the ICLabel reference article .

After running ICA, select the menu item Tools → Classify components using ICLabel → Label components. Just select the default and press OK.

image-20221218091548007

The following window will pop up and ask to draw the ingredients. Just press OK.

image-20221218091640043

Clicking on a component will bring up a window with its component properties and estimated probability of belonging to each type. IC components will be plotted with the class they are most likely to belong to and the likelihood of belonging to that class.

image-20221218091715991

You can then select the menu item Tools → Classify components using ICLabel → Flag components as artifacts. The default setting is to flag those components that have a greater than 90% probability of falling into the category of muscle or eye movement artifacts (blinks and eye movements). When marking components with this feature, the button in the interface for manually rejecting components will be shown in red (Tools→Reject components by map), and it is possible to edit which components are marked as artifacts.

image-20221218091845169

image-20221218092256841

Eliminate ICA components

To remove components, use the menu bar Tools → Remove components from data.

The previously marked artifact component numbers are included by default in the results window (below).

image-20221218092414533

The ingredient list can be manually edited by clicking the "Yes" or "Manual reject" button, as shown below.

image-20221218092439877

Enter the component number to be removed, and click Ok. A dialog window will pop up, asking if you want to compare the data before and after removing components, as shown in the figure below.

image-20221218092502190

Click the Plot single trials button. Shown (bottom) is the data before (black) and after (red) component removal. We can clearly see how well ICA does in removing blink artifacts.

image-20221218092533202

If the ICA component is removed in the segmented data period, you can click the Plot ERPs button to obtain a similar figure below, plotting the data results before (blue) and after (red) the channel ERP is removed.

image-20221218092733787

Once satisfied with the results, click the Accept button. Another window will pop up asking if you want to rename the new dataset. Enter a new name, save the dataset, and press Ok again .

image-20221218092612464

Finally, attach the classic ingredient identification summarized on the Internet:

wink component

picture

Ingredient Judgment: Wink Ingredient

Judgments based:

  1. Distributed at the front of the scalp topography;
  2. There are small squares in the ERP image;
  3. random distribution;
  4. In the power spectrum diagram, low frequency energy is high;
  5. Components are sorted higher, like in this example, IC3

The shade of color is meaningful, but red or blue does not matter, big red and big blue are fine.

eye movement component

picture

Component Judgment: Eye Movement Components

Judgments based:

  1. Distributed on both sides of the front end of the scalp topographic map, red and blue are opposite;
  2. In the ERP image, long strips, red and blue;
  3. random distribution;
  4. Low frequency energy is high in the power spectrum
  5. The components are sorted first, but generally after the blink, IC5 in this example.

head motion component

picture

Ingredient judgment: head-moving ingredients

Judgments based:

  1. Distributed around in the scalp topography;
  2. It appears as a long strip in the ERP image;
  3. random distribution;
  4. There is a very noticeable (very long) drift within a single trial.

Component judgment: ECG component

picture

Component judgment: ECG component

Judgments based:

1. It is scattered like raindrops in the ERP image.

picture

Composition judgment: power frequency interference

Judgments based:

  1. Scalp topography shows distribution around the ground line;
  2. The distribution on a single trail in the ERP image is very regular;
  3. In the power spectrum graph, the energy is highest around 50Hz (with sharp peaks).

ICA judgment website, if you are not familiar with ICA components, you can take a look at the introduction of this website

URL: https://labeling.ucsd.edu/tutorial/labels

Reference URL:

https://github.com/sccn/ICLabel

https://labeling.ucsd.edu/tutorial/format

Groppe, D. M., Makeig, S., & Kutas, M. (2009). Identifying reliable independent components via split-half comparisons. NeuroImage, 45(4), 1199–1211. https://doi.org/10.1016/j.neuroimage.2008.12.038

Luca Pion-Tonachini, Ken Kreutz-Delgado, Scott Makeig,ICLabel: An automated electroencephalographic independent component classifier, dataset, and website,NeuroImage,Volume 198,2019,Pages 181-197,ISSN 1053-8119,https://doi.org/10.1016/j.neuroimage.2019.05.026.

Thank you for watching, if you find it helpful, please like or pay attention!
Author of this article: Chen Rui

This article is for learning reference only. If you have any questions or infringements, you can add WeChat communication: braintechnology

More learning content, only released on Knowledge Planet:

picture

Guess you like

Origin blog.csdn.net/craig_cc/article/details/128360650