Converting Mind Monitor CSV Data from Muse-S Headband to EDF via MNE-Python

Hi MNE-Python community,

I’m an intern working on a research project focusing on sleep. My team are using the Muse-S headband to collect EEG data for sleep analysis which is a consumer-grade EEG device with frontal electrodes that can record brainwave activity. The data is exported in CSV format via a 3rd party app called Mind Monitor, which includes data from EEG channels of muse-s headband (AF7, AF8, TP9, TP10), timestamps, and accelerometer data.

Our goal is to use YASA, a Python package designed for sleep staging and event detection (e.g., spindles, slow waves) from EEG data. However, YASA requires the data to be in European Data Format (EDF), and we currently have the data in CSV format. We understand that MNE-Python can be used for preprocessing and conversion tasks, but we are new to the technical aspects of how to properly integrate these tools and manage the required dependencies.

Context:

We are aiming to focus on single-channel EEG data from the AF7 or AF8 electrode for sleep staging with YASA.
The CSV data includes EEG signals, timestamps, and other auxiliary signals like accelerometer data.
We plan to use MNE-Python for preprocessing before converting the data to EDF.

Specific Questions:

  1. What is the correct process to convert the CSV data from Mind Monitor to EDF format using MNE-Python
  2. Are there any preprocessing steps (e.g., filtering, downsampling) that should be performed before converting the data to EDF format?

Since me and my team are new to this, we would appreciate any suggestions or links of information for using MNE-Python in this workflow for beginners would be greatly appreciated. Thanks in advance for your help!

To convert CSV data into EDF, you have to

  1. Import the CSV data (use whatever method works best for you) and create a RawArray (see Creating MNE-Python data structures from scratch — MNE 1.8.0 documentation).
  2. Install edfio and export your RawArray with the .export() method.

Regarding preprocessing, EDF does not require any specific preprocessing steps, so you can export your original data.

Hi Clemens,

Thank you for your response on converting CSV data to EDF using RawArray and edfio! This clarified some of the steps we need to take for the conversion process.

To give you some context, we are using SleepEEGpy, an open-source Python package for sleep EEG analysis that integrates MNE-Python and other tools.

Our workflow involves:

  1. Collecting data from the Muse-S headband (exported via Mind Monitor in CSV format),
  2. Preprocessing and converting the data to EDF using MNE-Python,
  3. Performing sleep staging and event detection with SleepEEGpy and YASA.

We’re working with single-channel EEG data from the AF7 or AF8 electrodes and are still relatively new to these tools.

Follow-up Questions:

1.For reference, we’ve checked SleepEEGpy’s dependencies, but want to ensure if we can use more up to date versions of MNE-Python without it affecting the procedures provided by SleepEEGpy’s documentation

2.Handling Consumer-Grade EEG Data: Given that we’re using consumer-grade EEG data from the Muse-S (which may have more noise or lower resolution compared to research-grade devices), do you have any recommendations on how to best handle or preprocess this type of data within MNE-Python? Are there specific limitations or adjustments we should be aware of when using SleepEEGpy for analysis?

We’d appreciate any advice on managing these dependencies and ensuring compatibility within our Python environment for sleep EEG analysis.

Regarding your first question, you should ask the developers of SleepEEGpy why they’ve pinned MNE to ~=1.6.0. At least I am not aware of any breaking changes that MNE might have introduced in versions newer than that.

I’m not sure if I can provide great advice regarding your second question (I’ve never used a Muse headband), but in my opinion, it’s mostly the use of dry electrodes on consumer-grade systems that negatively affect the recorded signals. In addition, these electrodes are usually placed around the perimeter of the 10-20 system locations, which means they are likely to pick up a lot of muscle activity. It totally depends on your research question, but if you have the option to pick a different location closer to the vertex, and maybe also use a gel-based electrode, I’d try that. If not, then you can still get nice EEG if you make sure your electrode has a good contact/connection. Probably even more important, instructing your participants to minimize any movements and muscle tension (e.g. they should be relaxed etc.) has a great influence on the quality of the recorded signals.

1 Like