Any iEEG users want to help develop a HFO python repository (mne, sklearn and BIDS friendly)?

Hi,

iEEG epilepsy researcher here. I’ve been developing methods for EZ localization in epilepsy patients, and the primary “benchmark” is high-frequency oscillations. These are definitely debatable in terms of what they mean, and there are a lot of algorithms proposed to “automatically detect” these epochs.

However, they are all in matlab and they are all imo hard to debug and use. Furthermore, a lot of these algorithms are not even open source.

I’ve been working on setting up a repository Python3.6+, mne-python Raw object friendly, sklearn API, and BIDS friendly. Have implemented LineLength and RMS detectors, but am looking for co-developers/maintainers to help with documentation, implementation of more detectors, etc.

Anyone interested?

3 Likes

I am interested! I don’t have a lot of spare bandwidth but had a similar idea on my list of future projects along with collecting other “feature” datasets.

-Chris

1 Like

Hey Chris!

Awesome. What’s your github, perhaps we can set up a meet time?

Btw repo started here: GitHub - adam2392/mne-hfo: Estimate/compute high-frequency oscillations (HFOs) from iEEG data that are BIDS and MNE compatible using a scikit-learn compatible API.

Hi Adam,
My github personal code starts here: cleemesser (Chris Lee-Messer) · GitHub
Our lab uses eegml · GitHub
-C

Hey @cleemesser a colleague and I have done some work to make an initial API solution regarding this at: GitHub - adam2392/mne-hfo: Estimate/compute high-frequency oscillations (HFOs) from iEEG data that are BIDS and MNE compatible using a scikit-learn compatible API.

feel free to take a look and see if it might be useful for you and your research?? We are currently using it to benchmark some epileptogenic zone localization algorithms.

Some features:

  1. can use GridSearchCV and RandomSearchCV functions from scikit learn from optimizing hyperparameters. We provide a utility function to map input data to sklearn data structures.
  2. inputs take mne.io.Raw
  3. input/outputs assume BIDS *_events.tsv, or *_annotations.tsv (BIDS-Derivative BEP021 not merged in yet) structure.
  4. benchmarking against an open-access dataset with annotated HFOs

In the works:

  1. implementation of CSDetector and MorphologyDetector
  2. inclusion of mne.Annotations for v0.23+, since channel annotations have been added.
1 Like

@adam2392 --I’m interested. I now have a script for determining HFOs using the method of Burnos, et. al, as discussed in " Human Intracranial High Frequency Oscillations (HFOs) Detected by Automatic Time-Frequency Analysis," PLOS ONE, April 2014. This method is a two-stage process: Events of interested are detected using the Hilbert transform, after which a time-frequency analysis based upon the Stockwell transform determines those events that qualify as HFOs. I’m planning to combine this tool with tkinter, py2app, and pyinstaller so as to create software for use on both Mac and Windows platforms.

1 Like

@adam2392, would you be willing to share the open-access benchmarking data set or point me to where I can find it? Thanks

We have everything documented in our open-source v0.1 package here:

mne-hfo/detect.py at master · adam2392/mne-hfo · GitHub also is in the works for the Hilbert detector you referred to, which we’ll implement in v0.2.

If you’re interested in leveraging the sklearn/mne/bids framework we have for the Hilbert detector you’re speaking of, you’re more than welcome to file an issue there and make a PR! Things are open-source, and pypi installable, so you can just do pip install mne-hfo. We’ve tested it on Mac and Windows and Ubuntu in our CI.

@adam2392 Thanks much. It the Hilbert detector to which you refer the one described by Crépon B, et al. “Mapping interictal oscillations greater than 200 Hz recorded with intracranial macroelectrodes in human epilepsy”. Brain. 2010;133(1):33–45? My understanding is that their detector only considers the Hilbert envelope and when the signal exceeds the envelope by a certain number of standard deviations. Burnos’ method also has a second stage utilizing the Stockwell transform and a time-frequency analysis. It’s the Burnos’ method that we’ve implemented.

Ah yes, sorry should’ve clarified. We’ll probably add that one too under the same abstraction of “Hilbert related detectors”.

Our goal is to have a simple API source for any common HFO algos (I would definitely say the class of Hilbert detectors seem popular among the community) that leverage existing platforms (e.g. mne, sklearn, BIDS) to basically make running these very easy.

Are you trying to implement these for research purposes?

Really more clinical. I have an upcoming sabbatical project whose goal is to create Mac and Windows packages for HFO detection and other tasks, such as finding connectivity measures. The user interface would be based upon tkinter. The py2app and pyinstaller modules would facilitate the conversion to a Mac .app and Windows .exe., respectively. At this stage I have lots of bits and pieces to perform specific tasks. You can email me at fishbacp@gvsu.edu if you’d like to discuss further. I’m a mathematician who is somewhat new to this field.

how much data do you have available for learning?
is it public data?
would organizing an ML challenge on such data be an option?

Alex

2 Likes

For posterity, @adam2392 has started work on this here:

1 Like