GSoC Proposal
In M/EEG decoding in simple terms means, to predict what the samples of brain signals corresponds to. Machine learning approaches are used for predictions. In MNE decoding module currently is quite disorganized needs refactoring, usability improvements and other enhancements. This will particularly involve making it more compatible with Scikit-Learn API.
There are various functions, classes in decoding that needs work. The main aim is to make it compatible with Scikit-Learn API. Other than that there are other improvements needed as well, described as follows
-
Enhance decoding objects to follow sklearn API. As mentioned above this will be the primary objective of GSoC. There are several sub- tasks that needs to be taken care of:
-
GAT and EMS should work with
cross validation
andgrid-search
method of Scikit-Searn. One should be able to successfully executecross_val_score(GAT, X, y)
. This refactor could become challenging as decoding objects are fitted in multivariate way. Related issue: https://github.com/mne-tools/mne-python/issues/2188 -
Using
EpochsVectorizer
across various functions in decoding. Scikit-learn object requires data to be 2-D. Therefore as an usability improvement,EpochsVectorizer
should be called internally. -
Make all decoding functions compatible with Scikit-Learn.
EMS
doesn't follow Scikit-Learn API, therefore this would require total refactoring. This falls in line with the first goal.
-
-
Implementation of a systematic i/o for decoding objects. Currently there is no uniform mechanism to store the classifiers and the predicted values.
pickle
provides a nice way to store python objects, although is extremely slow fortime-gen
module and an API change would make it tough to unpickle. Related issue:https://github.com/mne-tools/mne-python/issues/2189 -
The visualization of several decoding classes also needs to be enhanced. This will involve writing various plot functions. Aside from decoding,
viz
also requires work in general and also writing its documentation. -
Scikit-Learn provides a nice interface to chain various steps of preprocessing by using
Pipeline
. This also makes easier to perform grid-search over parameters. Here the aim would be to make it possible for various transformers, using decoding module to be compatible withsklearn.pipeline
. Therefore it should be possible to preprocess using:make_pipeline(Filter(10, 30), Covariances(method='shrunk'), Xdawn(n_components=4), TangentSpace(), SVM(kernel='linear'))
Refactoring would require a good deal of knowledge about the current code base therefore I believe it would be of best interest to go for i/o and visualization improvement first. This will help me learn about the decoding module which will in turn help in refactoring later.
Read documentation of MNE and Scikit-Learn. Study about related topics of EEG and machine learning algorithms. Make future goals clear, update or change schedule after discussing various strategies with mentor. Also a good time to solve related bugs.
First phase of project. I plan to use this time to implement a systematic i/o operations for decoding objects. Prior to this, a healthy discussion is needed with the mentor, on how the estimators and predicted values should be stored. Desired outcome could be:
gat = GAT(..)
gat.fit(..).score()
gat.save(fname)
gat = GeneralizationAcrossTime(fname)
This will be accompanied by tests and initial documentation.
Begin working on visualization of decoding methods. This will be an initial work which should be followed later once refactoring is done.
I plan to use this period to work on EpochsVectorizer
. This should not be
a lengthy task as, if I am assuming correctly, the function needs to be
called in various functions to transform the data.
Start working on refactor of GAT
and EMS
and make it compatible with
Scikit-Learn API. This will be challenging and would require a good
deal of discussion before proceeding. The aim should be to do something like:
cross_val_score(GAT)
Make all decoding objects compatible with Scikit-Learn API. For example
EMS
doesn't currently inherit sklearn.base
classes.
Make sure everything is working as expected. Ensure tests cases pass and each function is covered. Also a good time for writing detailed documentation.
Work on rest of MNE transformers, to use decoding module to pipe various steps. As I am quite unsure how much time above tasks might take, this could be completed during or after GSoC.