Peculiar EOG Events

I’m interested in automated eye blink correction with ICA, using EOG data. I’m following along with this guide (Repairing artifacts with ICA — MNE 1.3.1 documentation); however I’m running into some odd issues with my EOG data.

The data was collected with a 64-channel BioSemi; however the EOG channels are LO1, LO2, IO1, and IO2, above/below and left/right of the eyes. The raw data plotted in MNE is below.

I then attempt to extract the EOG events and plot them. The code to get to this point is below:

eeg = mne.io.read_raw_edf(f, eog=['LO1', 'LO2', 'IO1', 'IO2'], preload=True, stim_channel='Status')
standard = mne.channels.make_standard_montage(kind = 'biosemi64')
eeg.set_montage(standard, on_missing='ignore')
eeg.set_eeg_reference(['M1', 'M2']) #reference to mastoids
eog_evoked = mne.preprocessing.create_eog_epochs(eeg, baseline=(-0.5, -0.2))
eog_evoked.plot_image(combine='mean')

When I do this, the logging output says it found over 50 EOG events, but I don’t know what to make of the output image:
eog_epochs

It looks very different from the image in the tutorial. Thinking the issue might be the number of EOG channels (and I truly do not know either way, so if this is not correct please let me know), I merged each set of channels with:

eeg = mne.set_bipolar_reference(eeg, anode='IO1', cathode='IO2')
eeg = mne.set_bipolar_reference(eeg, anode='LO1', cathode='LO2')

…right before the “eog_evoked” line up above. The channel output with this change appears as in the image below:

This returned more EOG events - 120 - but the image looks almost identical, simply with different scale values, with 2000 instead of 5000 (I can only attach three images to this post, sorry).

In either case the EOG results look nothing like those on the web page, or shown in other tutorials. If I go further, by using the ICA “find_bads_eog” function:

file_tmp = eeg.copy().filter(l_freq=1., h_freq=None, verbose='ERROR')
ica = mne.preprocessing.ICA(n_components=5, max_iter='auto', random_state=1)
ica.fit(file_tmp)
ica.exclude = []
eog_indices, eog_scores = ica.find_bads_eog(eeg)
ica.exclude = eog_indices

…the output is simply an empty list.

I’m using MNE 1.3.1, Python 3.9.6, Windows 10. Can anyone suggest what might be going on, and how I might resolve the issue?

1 Like

@ScalarSelfSimilarity,

You can pass any EOG channel / all channels via ch_name parameter to use them for EOG peak detection.
An example code:

eog_evoked = mne.preprocessing.create_eog_epochs(eeg, ch_name=['LO1', 'LO2', 'IO1', 'IO2'] ).average()
eog_evoked.apply_baseline(baseline=(None, -0.2))
eog_evoked.plot_joint()

If you like to do the source reconstruction, you have to set the average - eeg reference, which is a standard for forward modelling.

Your ICA code at the very end, looks rather misleading to me. Please check it.

n_components=5

ICA components should be higher. I would not expect ICA decomposition to work with such a low no. of components.

One general comment: MNE’s tutorials are mainly for simple use cases i.e., to demonstrate different implementations in a quick and easy way. You should go through each API/function’s description to use (tune) it properly.

best,
Dip

Thanks for the response. I did set the reference to the mastoids (incidentally, to what channel type would you set the mastoids? EOG or something else?). The colleague I work with initially selected only 5 components, so I went with that at first.

I tried setting the channel names as you describe. For displaying the eog events they still look weird, with those few sharp spikes. However doing the same for the “find_bads_eog” function, along with using 15 components as you suggest, seems to work - the eyeblink component is being pulled out.

Thanks!