Mne-python: EEG noise reduction with ASR

Created on 19 Mar 2020  Â·  8Comments  Â·  Source: mne-tools/mne-python

I'm using Python for signal processing and would like to use the Artifact Subspace Reconstruction (ASR) algorithm ([https://sccn.ucsd.edu/wiki/Artifact_Subspace_Reconstruction_(ASR)]) to detect and remove EEG noise.
Is there a Python implementation of the ASR algorithm?
Thanks

Most helpful comment

There is a WIP implementation here:
https://github.com/bertrandlalo/timeflux_rasr

All 8 comments

@BCIstorm this is not available per se in MNE but we have bits and pieces.

we have OTP https://mne.tools/stable/auto_examples/preprocessing/plot_otp.html
there is autoreject https://autoreject.github.io/
etc.

if you absolutely want this feature you'll need to give a try to implementing it. I am not closing this issue as It can be seen as a feature request

There is a WIP implementation here:
https://github.com/bertrandlalo/timeflux_rasr

@jonathanjfshaw I wasn't aware of this one.

I also have a working (AFAICT), but poorly documented version on my computer. It does both ASR and the riemannian variant (in my experience they give very similar results). I will try to clean it up and upload it to github in the next couple weeks.

EDIT: I had a closer look and those guys seem to be doing it well! Code looks neat. I just don't know how dependent it is to the timeflux ecosystem or whether it can be used independently? I will post my code anyway since it doesn't depend on any third party library, and if, anything, it'll give them a point of comparison.

As promised, I uploaded my code to my github page (see here).

It's still a bit rough around the edges and the riemannian variant is experimental*. To be honest I haven't found ASR super helpful. It sure does look compelling visually, but at least in my case it didn't make a big difference in my decoding results. Still I'm happy if it helps anyone.

  • because I had to fiddle around with pymanopt to create a non-linear eigenspace decomposition, which is not 100% tested.

@nbara can you share a self contained example using a fetched mne dataset ?

>

Sure, do you have any idea which dataset I should use? The ASR paper recommends at least 30s of clean data to calibrate. But ideally it should also contain high amplitude artifacts to get a nice before/after effect.

Sent from my phone

On 1 May 2020, at 22:01, Alexandre Gramfort notifications@github.com wrote:


@nbara can you share a self contained example using a fetched mne dataset ?

>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

none I can suggest like that but maybe some eegbci subject? unless it's
public hence quite clean data

>

Hi nbara,

your implementation of ASR is really interesting. However, I still do not understand the documentation you wrote for it in the MEEGKIT, even when I saw the example of its use. Could you help me a little? I want to learn how to use it like in EEGLAB, input the raw eeg I want to clean and get the raw cleaned from artifacts (deleted from the data, no substituting it).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Sirabhop picture Sirabhop  Â·  6Comments

sappelhoff picture sappelhoff  Â·  6Comments

hoechenberger picture hoechenberger  Â·  6Comments

mirgee picture mirgee  Â·  3Comments

seankmartin picture seankmartin  Â·  4Comments