GithubHelp home page GithubHelp logo

saman-rahbar / dynamic-spatial-filtering Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hubertjb/dynamic-spatial-filtering

0.0 1.0 0.0 610 KB

Code for "Robust EEG processing with dynamic spatial filtering", Banville et al. 2021

License: BSD 3-Clause "New" or "Revised" License

Python 92.97% Shell 7.03%

dynamic-spatial-filtering's Introduction

Dynamic spatial filtering

Code for Banville et al., "Robust learning from corrupted EEG with dynamic spatial filtering", arXiv, 2021.

https://arxiv.org/abs/2105.12916

tl;dr We introduce a spatial attention block that dynamically handles corrupted EEG channels by predicting spatial filters on a window-by-window level. This dynamic spatial filtering (DSF) block is trained end-to-end on the predictive task with data augmentation, and its attention values can be visualized to understand which channels are important.

Architecture of the dynamic spatial filtering (DSF) block

Running the experiments

Once this repository has been cloned locally, the denoising experiments on neural architectures can be run with the following:

โš ๏ธ This will download the training split of the PC18 dataset (~135 GB), preprocess and cache the preprocessed data, then train 9 models and test their performance under 5 corruption levels. For a quick test, run the experiments/pc18_debug.sh version which downloads and works on only 3 recordings.

cd dynamic-spatial-filtering
pip install -r requirements.txt
bash experiments/pc18.sh

Outputs will be found under runs/.

If the PC18 dataset is already available locally, first set the following environment variable to the directory containing PC18's training directory to avoid re-downloading the data:

export PC18_DATASET_PATH=<path to the directory, e.g. /pc18/1.0.0/>

By default, the training script will cache the preprocessed data in the working directory to speed up future experiments. To change the directory into which the data should be cached, set the following environment variable:

export JOBLIB_CACHE_DIR=<path to the directory>

To disable caching, set the environment variable to 'none':

export JOBLIB_CACHE_DIR=none

Citation

@article{banville2021robust,
  title={Robust learning from corrupted EEG with dynamic spatial filtering},
  author={Banville, Hubert and Wood, Sean U. N. and Aimone, Chris and Engemann, Denis-Alexander and Gramfort, Alexandre},
  journal={arXiv},
  year={2021}
}

dynamic-spatial-filtering's People

Contributors

hubertjb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.