Noisy components not being removed from EEG

  • MNE version: 0.24.0
  • operating system: Windows 10

Hi,

I’ve recently been playing with MNE code to preprocess EEG data obtained from a 21-channel NeXus-32F setup.

I am able to run the code well, and get the packages working. However, I notice that the noisy components aren’t being excluded despite using and applying ICA. As a result, my plot on the preprocessed data has a y-axis of (-20 - 40 microVolts) which is very large for EEG signal!

Can anyone please suggest how I could better clean my data?

Thank you in advance! :slight_smile:

Cheers,
Thapa

1st image: pre ICA

2nd image: post ICA

Hello,

Could you share the code snippet where you run the ICA, mark components for exclusion (and print ica.exclude) and then apply the ICA?

Mathieu

Hi @mscheltienne,

Thank you for your reply.

Below is a snippet of the code where ica.exclude is applied.

I’ve also printed ica.exclude which == [0]. Perhaps, this is why ICA was not being applied because there was nothing index to be excluded. Alternatively, I also read somewhere on this forum that having a <32 channel EEG dataset is not ideal to run ICA. I’m still reading into this atm but open to any suggestions.

Thank you.

Cheers,
Thapa.

First, after fitting you plot the components and then the properties individually. This will open as many property windows as fitted components. Instead, you can do ica.plot_components(inst=segment_ica) and now the topographic maps are interactive. If you click on one, it will open the property figure.

You can also look at the time series, especially if you are interested in eye-movement-related components, they are usually very easy to spot and label on the time series: ica.plot_sources(inst=segment_ica). Again, this plot is interactive. If you click on the name of an IC, it will open the property figure.

ica.exclude = [0] means that the first component has been labeled as “noise” and will be excluded when the ICA is applied. This is the step missing from your screenshot ica.apply(segment_ica). Only after this last step.

21 channels is definitely low, but if you limit your exclusion of components to eye-movement and heartbeat-related components, you should be fine because those components are usually very well captured by an ICA and will not capture small brain activities.

Also, could you share the output of print (segment_ica), print (segment_ica.info), and print (reject)?

Mathieu

P.S: Please post code snippets as formatted code (Ctrl + E, or the appropriate button in the edit bar) instead of screenshots.

2 Likes

Hi @mscheltienne,

Thank you for the detailed explanation. Yes, completely misinterpreted the ica.exclude[0] output.

Below are the outputs you requested.

Thank you, once again!

Cheers,
Thapa

Below is segment_ica
<Epochs |  4255 events (all good), 0 - 1 sec, baseline off, ~175.2 MB, data loaded,
 '1': 4255>

Below is segment_ica.info
<Info | 8 non-empty values
 bads: []
 ch_names: FP1, FP2, F7, F3, Fz, F4, F8, T3, C3, Cz, C4, T4, T5, P3, PZ, ...
 chs: 21 EEG
 custom_ref_applied: False
 dig: 24 items (3 Cardinal, 21 EEG)
 highpass: 0.1 Hz
 lowpass: 30.0 Hz
 meas_date: 2022-07-26 08:30:53 UTC
 nchan: 21
 projs: []
 sfreq: 256.0 Hz
>

Below is reject
{'eeg': 0.00019115241970408655}