# preprocessing/ICA: movement artifacts vs blinks

**URL:** <https://mne.discourse.group/t/preprocessing-ica-movement-artifacts-vs-blinks/1193>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [March 14, 2017, 12:44am UTC](https://mne.discourse.group/t/preprocessing-ica-movement-artifacts-vs-blinks/1193 "2017-03-14T00:44:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 14, 2017, 12:44am UTC](https://mne.discourse.group/t/preprocessing-ica-movement-artifacts-vs-blinks/1193/1 "2017-03-14T00:44:11Z")

</div>

I have EEG data where the recording was continuous during breaks between  
blocks, so there are lots of movement artifacts during temporal spans that  
I ultimately don't care about. If I just epoch the data, those temporal  
spans go away, but I want to do blink rejection. Doing blink rejection on  
an Epochs object doesn't seem to work out of the box, and doing it on each  
epoch individually seems inefficient and possibly dodgy.

Question 1: is there a sensible way to run blink rejection on an Epochs  
object that I haven't thought of?

Assuming I need to reject blinks using the Raw object, here are more  
details: I don't have a separate EOG channel, so I'm using a forehead  
electrode (Fp1) that seems to reflect the blinks quite well (based on  
visual inspection of raw.plot()). But the movement artifacts are much  
bigger than the blinks, so ICA is not working very well at catching the  
actual blinks; in a ~70 minute recording it is detecting as few as 12  
"blinks" for some subjects, and those events are localized around what are  
clearly movement artifacts or other large between-block drifts.

Question 2: Other than manually zeroing out values in raw.\_data, is there a  
way to mask or delete time spans of the Raw object that you want ICA to  
ignore? I know about raw.crop() but that only works for beginning/end  
times.

Question 3: is there some other approach I'm not thinking of that might get  
around this problem?  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20170313/535e5e0a/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20170313/535e5e0a/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 14, 2017, 1:57am UTC](https://mne.discourse.group/t/preprocessing-ica-movement-artifacts-vs-blinks/1193/2 "2017-03-14T01:57:00Z")

</div>

Hi Dan

It might be helpful if you were a little more clear/specific about what  
you're currently doing, so we can help suggest things you haven't thought  
of 🙂

That said, I'm guessing you're using ica.find\_bads\_eog and ica.plot\_scores?  
I've been working on adapting my lab's EEGLAB workflows to MNE over the  
past few months and my experience is that this routine works a lot better  
for MEG than EEG data. For EEG (using various systems and channel counts),  
this approach is pretty unreliable. In my experience ica.find\_bads\_eog at  
the default threshold (3.0) often misses finding any blinks, and if you  
drop the threshold down you tend to get false positives. I haven't found a  
threshold that works reliably across subjects/datasets. If anyone has had  
better success I'd love to hear about it though!

My approach is to fit ICA on the epochs as I want to analyze them, and  
use ica.plot\_properties to inspect every component and manually identify  
the EOG-related components. This is usually very easy to do based on scalp  
distribution, variance, and the epochs raster plots (and easy to teach  
undergrads to reliably identify as well).

I've heard many people say they like to fit ICA on longer epochs than they  
ultimately plan on analyzing. In principle, more data = more opportunities  
to train ICA well. However, I've never done this as I've always been  
satisfied with the results I get using a "normal" epoch length and manual  
inspection. Fitting ICA on raw, continuous data - especially when there are  
lots of very noisy periods such as breaks - is unlikely to work well  
because ICA will just be trying to fit all the huge variance in your data  
and so will - as you seem to be seeing - will tend to miss the blinks.  
There's also a danger that real (brain) data will be lost.

Best regards,  
Aaron

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 14, 2017, 6:25am UTC](https://mne.discourse.group/t/preprocessing-ica-movement-artifacts-vs-blinks/1193/3 "2017-03-14T06:25:12Z")

</div>

Hi Dan,  
in the dev-version of MNE-python it is possible to use annotations  
\<[https://mne-tools.github.io/dev/generated/mne.Annotations.html](https://mne-tools.github.io/dev/generated/mne.Annotations.html)\> to omit  
bad segments of data when fitting ICA  
\<[https://mne-tools.github.io/dev/generated/mne.preprocessing.ICA.html?mne.preprocessing.ICA.fit#mne.preprocessing.ICA.fit](https://mne-tools.github.io/dev/generated/mne.preprocessing.ICA.html?mne.preprocessing.ICA.fit#mne.preprocessing.ICA.fit)\>  
by  
using reject\_by\_annotation and annotation descriptions starting with the  
keyword 'bad'.

It is also possible to annotate the data interactively with raw.plot by  
pressing 'a'. Would be nice to hear if this works for you.

-Jaakko

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 14, 2017, 2:18pm UTC](https://mne.discourse.group/t/preprocessing-ica-movement-artifacts-vs-blinks/1193/4 "2017-03-14T14:18:15Z")

</div>

> My approach is to fit ICA on the epochs as I want to analyze them, and  
> use ica.plot\_properties to inspect every component and manually identify  
> the EOG-related components. This is usually very easy to do based on scalp  
> distribution, variance, and the epochs raster plots (and easy to teach  
> undergrads to reliably identify as well).

Assuming the movement artifacts are much bigger than the blinks, I wonder  
if this suggestion be adapted to this use case with something like:

1. Use `make_fixed_length_events` to make regularly-spaced events of some  
duration (not sure if e.g., 1 sec or 10 sec would work better)  
2. Create Epochs using a rejection threshold that throws away epochs based  
on movement artifacts, but not the blink artifacts.  
3. Run ICA on the Epochs.

Eric  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20170314/f7b3e669/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20170314/f7b3e669/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 15, 2017, 7:58am UTC](https://mne.discourse.group/t/preprocessing-ica-movement-artifacts-vs-blinks/1193/5 "2017-03-15T07:58:40Z")

</div>

one more thing. If the movement artifacts can get mapped to strong peak-to-peak  
amplitudes the reject param in ICA can certainly help automatically  
excluding these  
segments from the ICA fit.

Alex

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 16, 2017, 1:10am UTC](https://mne.discourse.group/t/preprocessing-ica-movement-artifacts-vs-blinks/1193/6 "2017-03-16T01:10:08Z")

</div>

Thanks all, for the suggestions.? Annotations seemed like the right way to go, since I know the block start/end times already.? [Jaakko, I can report that annotations are working for me (both adding programmatically via `raw.annotations = mne.Annotations(...)` and also interactively.]? After annotating the between-block times as "bad-between-blocks", `ica.plot_components` looks good: 3 components that make sense for my experiment, and one on the forehead/face (the blinks).? Unfortunately neither `find_eog_events` nor `create_eog_epochs` seems to respect annotations (yet?).? So although I can ignore the between-blocks times when fitting the ICA, it doesn't seem to help with the next step of `ica.find_bads_eog`.? Please let me know if I'm misunderstanding something about this process; otherwise I'll report back after I've had a chance to try some of the other suggestions.
