ICA and line noise can be unstable?
See original GitHub issueI have been trying to remove the line noise of some ECoG data using ICA (I am trying to avoid bandstop filter here).
However, the results I get are pretty unstable, and I am not quite sure why. That is, fitting the ICA several times of the same data can give radically different results (very good or very bad).
- I think I checked that this was not a copy/memory problem.
- Setting the
ICA(random_state)
stabilizes the results (but is arbitrary, since differentrandom_state
give very different results).
Here is a summary of what I do [complete notebook here]:
sources
= 1/F random source signal- mix these source signals together with a line noise (
raw = dot(cov, vstack(sources, linenoise)
) filtered_raw = raw.copy().filter(55, 65)
to filter around line noise (because of this ref)- ICA().fit(filtered_raw)`
- compute PSD of the data in component space
dot(ica.components, original_raw)
- find the component carying the line noise:
bad
- remove it from the data:
ica.apply(original_raw, exclude=[bad])
- check the PSD of this cleaned data
This works ~ well for low sampling frequency with or without decim>1
, but gets unstable for high sampling frequency when we use a decim>1
.
This could be due to aliasing, so I tried to shuffle the data just prior to fitting the ICA
times = np.arange(raw.n_times)
np.random.shuffle(times)
raw._data = raw._data[:, times]
the results are a bit better, but still pretty unstable. In the notebook, you can see that it works 50% of the time
Any idea what I do wrong?
Issue Analytics
- State:
- Created 7 years ago
- Comments:32 (32 by maintainers)
Top Results From Across the Web
Independent Component Analysis for artifact removal
The noise above is most likely due to instability in the ICA decomposition algorithm, which here forced to create two components compensating for...
Read more >Powerline noise elimination in biomedical signals via blind ...
Usually, powerline noise in biomedical recordings are extinguished via band-stop filters. However, due to the instability of biomedical signals ...
Read more >How To Reduce Noise In EEG Recordings [11 Solutions]
If you are working with bio-data, you have probably come across noisy data. Here is how to remove the noise from the signal...
Read more >Beyond Noise: Using Temporal ICA to Extract Meaningful ...
Thus, the BOLD signal can be seen as temporally smoothed in comparison with the neuronal activity, motivating the neglect of signal fluctuations ...
Read more >Identifying key factors for improving ICA‐based ...
It can be achieved by applying spatial filter methods to the data, ... then interpolated (e.g. channels heavily contaminated by line noise, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
And just by the way: do you think implementing eeglab’s cleanline in mne would be a worthwhile investment?
I’m closing it for now. Thank you all for your comments and help.