Real-Time ICA on raw EEG data

Hello, quite new in the world of MNE. I was wondering if it was possible to implement real-time preprocessing (specially ICA) on EEG data?

I think the other preprocessing steps, for example bandpass-filtering, are easy to apply in real-time. Can we also do the same with ICA, where eye/muscle/heart artefacts will be discarded in real-time?

The goal:

  • collect RAW eeg data in real time (no problem),
  • pre-process in real-time
  • use classifier on the preprocessed data to show output in real-time (should be no problem too)

Any help is appreciated :folded_hands:

In principle, ICA can be run online with some adaptations. For that, please have a look at GitHub - goodshawn12/orica: Online Recursive Independent Component Analysis

I have tried the REST Toolbox and ORICA before. But is it not for EEGLAB? Can I use something similar for MNE Python?

A Python implementation of ORICA is available in the SpyICA toolbox. The toolbox focuses on spike sorting, but I think the ICA algorithms are still compatible with any time-series data.

There are some example scripts showing how ORICA can be used, but overall the documentation isn’t extensive.

It’s not MNE, but this is the most I found when I was searching for these tools in Python before.

For real-time or offline EEG the Minds AI Filter is simpler and works better than ICA on dynamic artifacts, but can also be used in conjunction: https://www.minds-applied.com/minds-ai