Giter Club home page Giter Club logo

eareeg_knowledgedistillation's Introduction

A KNOWLEDGE DISTILLATION FRAMEWORK FOR ENHANCING EAR-EEG BASED SLEEP STAGING WITH SCALP-EEG DATA

Citation

If you find our work or this repository useful, please consider giving a star โญ and citation.

@misc{KDforearEEG,
      title={A Knowledge Distillation Framework For Enhancing Ear-EEG Based Sleep Staging With Scalp-EEG Data}, 
      author={Mithunjha Anandakumar and Jathurshan Pradeepkumar and Simon L. Kappel and Chamira U. S. Edussooriya and Anjula C. De Silva},
      year={2022},
      eprint={2211.02638},
      archivePrefix={arXiv},
      primaryClass={eess.SP}
}

This repository contains implementation of cross-modal knowledge distillation approach combining response based distillation to enhance ear-EEG based sleep staging using the scalp-EEG.

cross modal distillation.png

Getting Started

Open In Colab

Installation

The algorithms were developed in Pytorch Environment : https://pytorch.org/

pip install torch==1.10.0+cu113 torchvision==0.11.1+cu113 torchaudio===0.10.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html

Run below code to install all other dependencies

pip install -r requirements.txt

Training

Training Phase 01 - Supervised Training

Initially models are trained in supervised manner on scalp-EEG recordings, this pretrained models are used as teacher models in knowledge distillation training.

python main.py --model USleep --data_path <data path> --train_data_list [0,1,2,3,5,6,7] --val_data_list [8] --signals ear-eeg --training_type supervised --is_neptune True --nep_project <neptune project name> --nep_api <neptune API>

Training Phase 02 - Knowledge Distillation

Offline Knowledge Distillation

In offline knowledge distillation, the pretrained supervised model is used as teacher model and student model is trained to learn the distribution of teacher model as well as the true targets.

python main.py --data_path <data path> --model_path <model path>

Online Knowledge Distillation

In online knowledge distillation, both teacher and student models are trained simultaneously.

python main.py --data_path <data path> --KD_type online

Transfer Learning

python main.py --data_path <data path> --is_retrain True --training_type supervised --model_path <model path>

Evaluation

Evaluation code script can be used to evaluate the saved models.

python evaluation.py --data_path <data path> --model_path <model path> --n_epochs 20

Reference

[1] Perslev M, Darkner S, Kempfner L, Nikolic M, Jennum PJ, Igel C.U-Sleep: resilient high-frequency sleep staging. npj Digit. Med. 4, 72 (2021).https://github.com/perslev/U-Time/blob/master/utime/models/usleep.py

[2] Pradeepkumar, J., Anandakumar, M., Kugathasan, V., Suntharalingham, D., Kappel, S. L., De Silva, A. C., & Edussooriya, C. U. Towards Interpretable Sleep Stage Classification Using Cross-Modal Transformers. arXiv preprint arXiv:2208.06991 (2022). https://github.com/Jathurshan0330/Cross-Modal-Transformer

eareeg_knowledgedistillation's People

Contributors

jathurshan0330 avatar mithunjha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

eareeg_knowledgedistillation's Issues

Questions about datasets

Hello author, how to download the dataset in this code of yours? Or can you share the dataset you used in this paper?

dataset

is:open label:question can you tell men how to download the data which is used in

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.