Projections and ICA

  • MNE version: e.g. 1.0.3
  • operating system: Windows 10
    Hi all,
    I have been trying to preprocess some recently collected data but keep running into an issue when I try to take the ECG and EOG artifacts out with Projections or ICA (so essentially 2 different problems but only one needs to work reliably). I will give good and bad examples so the problem is clear. I have one participant that gives great projectors. Below is just the epoched ecg projector for my good participant:

However, all my other participants have at least one projector that looks bad (But not always the same one). Here is an example of one that had a bad ECG:

I am unsure why this happens, it appears different channels spread the projection out in time. I do have separate channels being recorded for ecg veog and heog. I do a projection for each one, and everyone is different for what projector is bad. I use the following code to make these:
“”“”"
ecg_evoked = mne.preprocessing.create_ecg_epochs(raw,ch_name=‘ECG’).average()
ecg_evoked.apply_baseline((None, None))
ecg_evoked.plot_joint(title=‘ECG’)

veog_evoked = mne.preprocessing.create_eog_epochs(raw, ch_name =‘VEOG’).average()
veog_evoked.apply_baseline((None, None))
veog_evoked.plot_joint(title=‘VEOG’)

heog_evoked = mne.preprocessing.create_eog_epochs(raw, ch_name =‘HEOG’).average()
heog_evoked.apply_baseline((None, None))
heog_evoked.plot_joint(title=‘HEOG’)
“”“”"
Because every other participant has at least one of these messy projectors I do not apply them. Instead I tried using ICA instead. The issue that arises there is that for my participants that gave good projectors, I get a read out of a clearly selected ICA component for the ecg, but when I actually look at the components I do not see anything that looks like ecg. You can see that ICA001 is automatically selected:


The opposite happens with my participant that gave me a bad ecg projection, where no clear ecg component is recognized but I do at least see some ecg like behavior in one of the components, however, it is never not separated out enough and using more or less components does not end up working. More components splits the ecg into more components instead of splitting non-ecg noise out of it.

Any suggestions on how to overcome this step would be greatly appreciated. Additionally, I am not sure why the ECG, VEOG, and HEOG show up in the ICA readout. It does appear I can use them, but with no ICA head models matching them, I am guessing they are just a duplicate of the originally recorded raw channels and thus not a real option to use to clean the data.
I am not sure if the messy looking projectors are options, or if this will come down to both options being not great but which is the clearest one of the two. I would use both to use the pros and cons of each method, but at the moment, most participants that have a bad projection for a particular artifact also have bad ICA components for that same artifact. When trying to apply those messy projections to the data sometimes they clear out the artifact fairly well, and sometimes they barely touch it. Either way, I am worried about using the messy projections because they could possibly take out too much good eeg data.

Please let me know if any of this is something any of you have seen before and what is that best way to overcome it.

Thank you,
Matt

Is this EEG data? And how many channels do you have?
For the ICA, on EEG data, I would go for n_components=n_channels (or n_channels - 1 if the reference channel has been added and the data referenced to a common average). Alternatively, you can use n_components=0.999 and it will automatically determine the number of components based on the cumulative variance explained. 10 components as you show in your screenshot looks too low IMO.
Also, ECG does not always show up on EEG signals.

And yes, when you plot the IC sources, the auxiliary EOG/ECG channels are picked from the provided instance and plotted alongside (at the bottom) to make identification easier.

The better alternative is to simply use n_components=None (i.e. the default), which will do exactly that.

1 Like

Thank you so much! I have 64 eeg channels and 3 aux channels of 2 eog and 1 ecg. I wasn’t sure if that many components would degrade all the ICs too much. I tried what you have both said and got this for the two participants.
the one with the good projectors:


the one with the bad ecg projector:

curiously this second person’s reconstructed ICs look similar to their bad projectors:
Figure_2

I was hoping to use the projector method over ICA because for the non-messy projector epochs, the code:
‘’‘’‘’’
#%% ECG projector
ecg_projs, ecg_event_proj = mne.preprocessing.compute_proj_ecg(raw, ch_name =‘ECG’, n_eeg=1, reject=None, no_proj=True)
mne.viz.plot_projs_topomap(ecg_projs, info=raw.info)
raw.add_proj(ecg_projs)
‘’‘’‘’‘’
seems to work much better than ICA. As you can see above in both participants, the best ecg IC is not even identified and the IC that does look good, such as 20 in the first participant, may have too much neural data to comfortably remove. And that is the participant with the really clean projector. I was hoping to avoid individualizing the cleaning process too much. Are there any guidelines that are commonly used that would make what to do in this type of case clear?

I think you need to take one step back and look at the automatically detected ECG events. It appears something isn’t working well when detecting ECG, as shown in your ECG evoked plot in the initial posting. So then any downstream processing won’t yield good results either — good old “garbage in, garbage out”.

For the ICA, you shared the second figure for the first participant with ICs 20+
Please share the ICs time-series and topographic map from the 20 first ICs as you did for the second participant.

Thank you both for taking the time to help out. below is the subjects in the c=same order as before:

I have been concerned about the hardware/software of the new system we are using in my lab, it has been riddled with bugs I have been working out. So, I am considering that something is wrong at recording too. I have stopped recording participants for now until I can get a solid grasp of what is happening or at least a standard way of cleaning that works for everyone.
One person had pointed out all my participants that have odd looking epoched ECG artifacts all have biphasic ecg recordings. From what I am aware, this is uncommon, so it is odd that I have several. But this point was raised as a possible explanation why the projection method is not as functional for those individuals since it essentially splits the peak of the R wave into two separate peaks and troughs. We are using a 3 electrode lead I ECG configuration. Let me know if that makes sense to you as some of this is above my head. Though, using this many components, as both of you had suggested, does seem to pull out reasonable ECG components that seem more usable than what I have been doing, so now I am just trying to confirm that the data is good since this method seems to work.