-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EEG noise reduction with ASR #7479
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 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: |
@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.
|
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 ***@***.***> 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). |
For anyone who's interested in integrating the ASR method into MNE-Python, please give us a sign by commenting/reacting to this thread. This will help me and the devs to judge whether including and maintaining ASR in MNE is worth the effort. |
I really would like to have ASR included in MNE-Python. I am trying to translate from EEGLAB to Python, but since I do not know MATLAB is almost impossible to me. |
I am a bit ambivalent. As stated in #9302, I feel it's mostly an online method, for which MNE-python is not necessarily well equipped. Also, I have yet to see a proper comparison between ASR and other denoising techniques in terms of SNR or decoding performance. In my experience ASR looks great upon visual inspection, but I am not 100% convinced. I would be happy to be proven wrong though. @doctorgt Just out of curiosity, do you use ASR offline? Have you made any quantitative comparison with/without ASR and found a clear benefit? |
@nbara yes I have used it offline. i am a neurofeedback practitioner and QEEG experte and i compared an ASR artifacted EEG with a manual artifacted EEG (done by me). It was shocking to see QEEG results (processed with Neuroguide software) were almost 100% between in both manual artifacted and ASR artifacted. I need it on Python!! |
Completely agree. I created a more or less systematic (but not exhaustive) notebook that compares ASR performance with other cleaning/preprocessing techniques on three EEG datasets. Looks like ASR doesn't exceedingly improve ERPs / SNR assumed from the average signal, but it seems to have some edge over other cleaning techniques when it comes to different decoding tasks... I will share the notebook here after it's cleaned and commented... |
Soo, here is a link to my comparison of a few automated cleaning methods. https://digyt.github.io/automated_EEG_cleaning_comparison/ It's far from exhaustive and perfectly valid, as this would imply more variable data and more computing power (definitely going beyond an online Google Colab Script). Other limitations are named in the notebook. However, as far as this allows me to draw conclusions, I would say the following about Artifact Subspace Reconstruction:
So, in brief I would say that ASR is no "superhuman" cleaning algorithm, but from my point of view it definitely has its use cases, and could fill some gaps especially in the Python cleaning landscape. |
Note for people who want to use ASR with MNE-Python: Integration of ASR into the MNE incubator is under discussion in #9302. Until then, a MATLAB-like and MNE-Python-compatible version of vanilla ASR can be found here: ASR, rASR, and other denoising algorithms can be found in @nbara's beautiful Python-MEEGkit: |
Closing for #9302 |
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
The text was updated successfully, but these errors were encountered: