Skip to content

BrainVision EEG data classification using the MNE, Keras and the scikit-learn libraries.

Notifications You must be signed in to change notification settings

fkupilik/MNE_ML

Repository files navigation

MNE_ML

This is the example of the experiment using preprocessing methods from the MNE library and classification methods from the Keras and the scikit-learn libraries for EEG data stored in the BrainVision format.

The used dataset in the BrainVision format, which is located in the PROJECT_DAYS_P3_NUMBERS folder, is described in this article

Used preprocessing methods:

  • low-pass and high-pass filtering
  • epoch extraction
  • baseline correction
  • artifact removal with the peak-to-peak amplitude rejection
  • windowed means feature extraction

Used classifiers:

  • Convolutional neural network
  • LSTM neural network
  • Linear discriminant analysis
  • Support vector machines

Detailed description of the whole experiment with an explanation of the code is located in the Wiki.

Run:

The program is executable from the command line using the main.py file with one argument represents the choice of classifier. The command has the following form:

python main.py <classifier>

The user can choose from 4 types of classifiers, so the possible variants of the command are:

  • python main.py lda
  • python main.py svm
  • python main.py cnn
  • python main.py rnn

All other parameters are configurable in the param.py file. The solution is implemented in Python in version 3.6.9 and the versions of the used libraries can be found in the requirements.txt file.