Git Product home page Git Product logo

spikes_detection_fcbg's Introduction

spikes_detection_fcbg

Three pipelines for automatic epileptic spikes detection

Pipelines description

All pipelines imply simple preprocessing, such as resampling to 250 Hz and filtering from 2 to 35 Hz.

Naive pipeline (naive): Operates only on the channel with the highest variance. Applies standardization to this channel and make classification by variance thresholding. Yields the highest rate of false positives.

RECOMMENDED: Simple SVM (var1_svm): Operates only on the channel with the highest variance. Applies standardization to this channel. Computes 44 features for each epoch and uses Support Vector Machines for classification.

Simple AdaBoost (var1_abdt): Operates only on the channel with the highest variance. Applies standardization to this channel. Computes 44 features for each epoch and uses AdaBoost for classification. Yields the best detection of spikes within seizures, however, can lead to increased false positives.

Requirements

Python libraries:

To satisfy all the requirements:

  1. Install conda
  2. Open a Conda Terminal and clone the following repository using command:
git clone https://github.com/NataliiaMolch/spikes_detection_fcbg.git
  1. Finally, go to spikes_detection/ directory and make a setup with one of two options:

Automatic setup (Linux):

cd spikes_detection_fcbg/
python setup.py

OR

Manual setup (Linux):

cd spikes_detection_fcbg/
conda env create -f environment.yml
echo 'export PATH=$(pwd):$PATH' >>  ~/.bashrc
source ~/.bashrc
chmod u+x spikes_detection

Usage

First, make sure that all the requirements are satisfied (use the instructions above).

Before running program for spikes detection add configurations to config.ini file (can be opened with any text editor). Make sure that MAIN and DATA configurations are up to date.

Linear interpolation of bad channels

If there are bad channels they need to interpolated for correct work of the algorithms. One can use a build-in interpolation of bad channels performed via linear splines. To indicate for each recording what channels should be interpolated create a "<recording_name>_bads.txt" file where in the first line all the bad channels are listed, separated by a comma and a space.

For example, for a recording "M9_epi2_LH.sef" with 1st and 13th channels broken create a file "M9_epi2_LH_bads.txt" with content:

e1, e13

Note that, "<recording_name>_bads.txt" file should be at the same location as "<recording_name>.sef" file.

Excluding artifacts and/or seizures

Presence of movement artefacts can negatively affect the quality of predictions. Detection of spikes during seizures is not perfect with presented algorithms, however, presence of seizures should not affect the quality of predictions.

To exclude seizures and artefacts, create a separate .mrk file at the same location as "<recording_name>.sef" and name it: "<recording_name>_exclude.mrk". Mark artefacts/seizures beginning and ending with "Art"/"Sz" and "Art.end"/"Sz.end" correspondingly.

For example, for a recording "M9_epi2_LH.sef" create a "M9_epi2_LH_exclude.mrk" file with possible content:

TL02
2020000	2020000	Art
2056000	2056000	Art.end
2104000	2104000	Art
2112000	2112000	Art.end
2184000	2184000	Sz
2496000	2496000	Sz.end
...

Program execution

Use terminal to run the program by either ways (prior modification of configuration file is needed):

Easy run:

 cd spikes_detection_fcbg/
 spikes_detection

Note spikes_detection cmd has two optional options: [-p] [-e] Option -p: full path to configuration file with .ini extension. If -p option is not given, then searches for config.ini file in current working directory. Option -e: the name of the conda environment. If -e option is not given, then uses spikes_detection conda environment by default.

OR

The other way

cd spikes_detection_fcbg/
conda activate spikes_detection
python make_predictions.py

Note make_predictions.py has one argument [--config_file] - path to configuration file. If not given, searches for config.ini file in current working directory.

spikes_detection_fcbg's People

Contributors

nataliiamolch 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.