# Autoreject Falsely Rejecting High Amplitude Periodic Discharges

**URL:** <https://mne.discourse.group/t/autoreject-falsely-rejecting-high-amplitude-periodic-discharges/4896>\
**Category:** Support & Discussions\
**Tags:** preprocessing, eeg, epochs, autoreject\
**Created:** [May 17, 2022, 3:29pm UTC](https://mne.discourse.group/t/autoreject-falsely-rejecting-high-amplitude-periodic-discharges/4896 "2022-05-17T15:29:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lmctx13](https://avatars.discourse-cdn.com/v4/letter/l/dbc845/32.png) [@lmctx13](https://mne.discourse.group/u/lmctx13)\
**Post date:** [May 17, 2022, 3:29pm UTC](https://mne.discourse.group/t/autoreject-falsely-rejecting-high-amplitude-periodic-discharges/4896/1 "2022-05-17T15:29:44Z")

</div>

Hi everyone! I have been working on a preprocessing pipeline that will be used to remove muscle artifacts. I have been using Autoreject in order to do this.

However, I have run into an issue. The pipeline is falsely rejecting high amplitude periodic activity (which is not considered artifact). I have attempted to change the autoreject parameters to remedy this, but that strategy did not work.

Here is an example of high amplitude periodic activity:

 ![Screenshot (748)](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/1/1107c3f5794c1da4f0efb8a07606f555956e590b.jpeg)

Do you have any ideas for addressing this issue? I am happy to provide further details, and I appreciate your help!

---

<div class="post-metadata">

**Author:** ![mainakjas](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mainakjas/32/34_2.png) [@mainakjas](https://mne.discourse.group/u/mainakjas)\
**Post date:** [May 18, 2022, 12:36am UTC](https://mne.discourse.group/t/autoreject-falsely-rejecting-high-amplitude-periodic-discharges/4896/2 "2022-05-18T00:36:04Z")

</div>

Hi Leah,

Could you provide some more details about what you tried? Did you apply autoreject (local) or autoreject (global)? Autoreject is a bit crude in this sense because it cannot distinguish between true high amplitude artifact signals vs high brain amplitude signals. One suggestion is to filter out your periodic signal and use autoreject to get the annotations of bad segments. You might also find more information or discussion here:

[https://github.com/autoreject/autoreject/issues/99](https://github.com/autoreject/autoreject/issues/99)

Mainak

---

<div class="post-metadata">

**Author:** ![lmctx13](https://avatars.discourse-cdn.com/v4/letter/l/dbc845/32.png) [@lmctx13](https://mne.discourse.group/u/lmctx13)\
**Post date:** [May 18, 2022, 4:10pm UTC](https://mne.discourse.group/t/autoreject-falsely-rejecting-high-amplitude-periodic-discharges/4896/3 "2022-05-18T16:10:19Z")

</div>

Hi Mainak,

I believe I applied local autoreject since the thresholds for each channel are calculated. I can look into the resource you provided and attempt to filter out the periodic signal.

Thank you,  
Leah

---

<div class="post-metadata">

**Author:** ![eort](https://avatars.discourse-cdn.com/v4/letter/e/e56c9b/32.png) [@eort](https://mne.discourse.group/u/eort)\
**Post date:** [October 19, 2022, 3:08pm UTC](https://mne.discourse.group/t/autoreject-falsely-rejecting-high-amplitude-periodic-discharges/4896/4 "2022-10-19T15:08:45Z")

</div>

Hi,

@lmctx13, I was wondering whether you got anywhere with this problem, as I face a similar situation where autoreject picks up a lot of alpha activity and rejects decent trials.

@mainakjas, if I go the route of running autoreject on epochs that have the periodic signal filtered out, can I apply the solution to unfiltered data? Specifically, I have following procedure in mind:

1. notch filter raw data to get rid of alpha (on a copy of the raw)
2. make epochs from the filtered raw data (two copies)
3. run autoreject on epochs on first copy
4. run ICA data epochs on first copy
5. apply ICA solution to second copy of epochs
6. run autoreject again, this time on the second copy of epochs
7. **And now critically, create new epochs from unfiltered raw data, apply ICA solution and autoreject solution to those epochs**

Would that make sense?

Thanks,  
Eduard

---

<div class="post-metadata">

**Author:** ![lmctx13](https://avatars.discourse-cdn.com/v4/letter/l/dbc845/32.png) [@lmctx13](https://mne.discourse.group/u/lmctx13)\
**Post date:** [October 25, 2022, 11:17pm UTC](https://mne.discourse.group/t/autoreject-falsely-rejecting-high-amplitude-periodic-discharges/4896/5 "2022-10-25T23:17:06Z")

</div>

Hi Eduard, I ultimately did not use Autoreject due to this issue. I am currently looking into other MNE functions that could be used to reject muscle movements, such as the annotate muscle z-score function and the ICA.find\_bads\_muscle function.

---

<div class="post-metadata">

**Author:** ![mainakjas](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mainakjas/32/34_2.png) [@mainakjas](https://mne.discourse.group/u/mainakjas)\
**Post date:** [October 31, 2022, 1:07pm UTC](https://mne.discourse.group/t/autoreject-falsely-rejecting-high-amplitude-periodic-discharges/4896/6 "2022-10-31T13:07:05Z")

</div>

Hi Eduard,

Apologies for the slow response as I’m on vacation.

> > ![](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/6/624e249495afb372513c7f974dceeb9eb28245bc.png "eort") | [eort](https://mne.discourse.group/u/eort)  
> > October 19 |
> > 
> > - | - |
> 
> Hi,
> 
> [@lmctx13](https://mne.discourse.group/u/lmctx13), I was wondering whether you got anywhere with this problem, as I face a similar situation where autoreject picks up a lot of alpha activity and rejects decent trials.
> 
> [@mainakjas](https://mne.discourse.group/u/mainakjas), if I go the route of running autoreject on epochs that have the periodic signal filtered out, can I apply the solution to unfiltered data?

Absolutely, I think you should fit on filtered data and transform on unfiltered data … that is precisely the reason we have a fit-transform API

> Specifically, I have following procedure in mind:
> 
> 1. notch filter raw data to get rid of alpha (on a copy of the raw)
> 2. make epochs from the filtered raw data (two copies)
> 3. run autoreject on epochs on first copy
> 4. run ICA data epochs on first copy
> 5. apply ICA solution to second copy of epochs
> 6. run autoreject again, this time on the second copy of epochs
> 7. **And now critically, create new epochs from unfiltered raw data, apply ICA solution and autoreject solution to those epochs**
> 
> Would that make sense?

This sounds exactly like how I would have used autoreject for the data you mention. Hope it works for you!

Mainak
