Giter Site home page Giter Site logo

eden-kramer-lab / cnn_spectrogram_algorithm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jessicanada/cnn_spectrogram_algorithm

0.0 1.0 2.0 91.81 MB

A method to classify spectrograms from raw EEG data using a convolutional neural network

Jupyter Notebook 59.52% Python 16.16% Shell 0.01% HTML 24.31%

cnn_spectrogram_algorithm's Introduction

CNN_Spectrogram_Algorithm

The CNN spike ripple detector: a method to classify spectrograms from EEG data using a convolutional neural network (CNN).


Usage

See folder Demo-Application for an example applciation of the trained CNN spike ripple detector to simulated EEG data.

See folder Demo-Training for an example of how to train the CNN spike ripple detector using simulated spectrogram images.

Code in folder fastai comes from fastai version 0.7 by Jeremy Howard: https://www.fast.ai/

Data Structure

To run either demonstration, you must have a data folder of the following structure:

data/

├── train/

├── Yes

├── No

├── valid/

├── Yes

├── No

├── test/

For training, the Yes and No subfolders contain positive and negative case images on which we train the model. The test folder contains uncategorized images on which we test the model.

For application, the test folder contains new test data to be evaluated by the pretrained model (full_trained_model.pkl). For the code to run with this library, the Yes and No subfolders of train and valid cannot be empty: fill them with a few images from your test data -- this will not affect the output.

Environment

Below is a step-by-step method to prepare an environment capable of running the notebooks:

  1. Ensure you have both conda and pip installed

  2. In terminal, load in a virtual environment with conda, give it a name (environment_name):

conda env create -f new_enviro.yml -n environment_name

conda activate environment_name

  1. Open the jupyter console to run notebooks:

jupyter notebook

  1. When done, use conda deactivate to deactivate your virtual environment. To reload this environment in the future, use conda activate environment_name, skipping step 2.

cnn_spectrogram_algorithm's People

Contributors

jessicanada avatar mark-kramer 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.