How excluding rejected epochs by Autoreject before ICA do not effect EOG?

Hi,
I am working around with AutoReject and ICA for cleaning data. I know that the suggested practice is applying AutoReject before and after ICA and I have checked this example.

However, I don’t understand how applying AutoReject before ICA do not badly effect our preprocessing. In fact, Autoreject will find some epochs with EOG artifact as bad epochs. By excluding them from ICA, how should the ICA find the EOG component?

ica.fit(epochs[~reject_log.bad_epochs])

Here EOG epochs are among bad_epochs, am I right? and the question is if yes, how ICA can properly understand the EOG component by not seeing them?

1 Like

I’m no expert in using Autoreject, but I had the same thoughts. I try to give ICA as much data as possible, and I think it is essential to include eye activity. I usually only exclude inter-trial segments as well as extremely huge artifacts (which I manually annotate). This results in pretty decent ocular components most of the time. In my opinion, it would make sense to use Autoreject after the ICA cleaning step.

2 Likes

Thanks for the answer @cbrnr. I have also checked here and here and found them very useful but still have the same issue with AutoReject before ICA and I guess maybe I miss something. Maybe @richard can help because he has some useful advises there.

The threads you mentioned recommend applying Autoreject after ICA. I think the Autoreject step prior to ICA is to only learn a global threshold which can be used by ICA to automatically ignore certain segments of data. This first Autoreject step does not reject any data.

So IMO the goal is to provide ICA with sensible data. Whether you manually exclude segments (e.g. inter-trial segments and large artifacts) or you use Autoreject to define a threshold that finds large artifacts (and thus removes them prior to ICA) is up to you. The “real” Autoreject step is always after ICA.

3 Likes

I totally agree with your idea on applying global autoreject before ICA or simply applying PTP and excluding large artifacts. However, the autoreject example and both of the threads that I mentioned suggest local autoreject before ICA and I don’t know why, so I get confused.

In the example we have:

We recommend that you first highpass filter the data, then run autoreject (local) and supply the bad epochs detected by it to the ICA algorithm for a robust fit, and finally run autoreject (local) again.

Also take a look at the followings:

These comments talk about local vs global Autoreject before ICA, but they do not say that you absolutely should use Autoreject before ICA. To be honest, I find the first statement (which is in the Autoreject documentation) confusing too. I don’t even know what “global” and “local” means in this context.

Yes it is confusing. Global means one threshold for all channels and local means one threshold per each channel. The way this threshold is computed is like this:

Divide epochs to train and test (k-fold cross validation will be used) and choose the threshold with the minimum error. Error is the difference between train mean and test median after rejecting epochs for a specific threshold.

Using this definitions applying global AutoReject seems more reasonable to me, because in this way we may found e.g. 200e-6 volts as the global PTP and just reject the epochs with large artifacts and then apply ICA.

Local autoreject before ICA has never worked for me. Even global is sometimes difficult. I tend to set rejection thresholds manually and then run ICA :woman_shrugging: In MNE-BIDS-Pipeline, we currently only use AR global (to reject bad epochs before ICA or SSP).

Best wishes,
Richard

2 Likes

Hi,

As Clemens said, the first autoreject step (local or global) is only to provide ICA with sensible data. If there are large artifacts in the data, it will confuse ICA … my sense is that it is worse than rejecting some eyeblinks, particularly if there is a preceding PCA step which reduces dimensionality based on variance explained. The eyeblinks are pretty stereotypical, so in my experience you don’t need to provide too many examples for the ICA algorithm to learn a good eyeblink component. Of course, your mileage may vary depending on your data. So always test the pipeline on your data and use mne-report for post-processing visualization and checks.

In terms of local autoreject vs global autoreject, it doesn’t matter so much as long as they get rid of high-amplitude artifacts without rejecting too many eyeblink artifacts. But global autoreject is faster. The “real” autoreject should indeed be after the ICA step as hinted in the thread. The reason is that you don’t want to falsely drop ocular artifacts and lose precious data.

Hope that helps!
Mainak

4 Likes