Coder Social home page Coder Social logo

leoota / mstgcn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ziyujia/mstgcn

0.0 0.0 0.0 176 KB

Multi-View Spatial-Temporal Graph Convolutional Networks with Domain Generalization for Sleep Stage Classification.

Python 98.97% Shell 1.03%

mstgcn's Introduction

MSTGCN

Multi-View Spatial-Temporal Graph Convolutional Networks with Domain Generalization for Sleep Stage Classification. [paper]

This work is an extension of previous work: GraphSleepNet: Adaptive Spatial-Temporal Graph Convolutional Networks for Sleep Stage Classification (IJCAI 2020) [paper].

model_architecture

These are source code and experimental setup for the ISRUC-S3 dataset.

Citation

If you find this useful, please cite our work as follows:

@ARTICLE{9530406,
  author={Jia, Ziyu and Lin, Youfang and Wang, Jing and Ning, Xiaojun and He, Yuanlai and Zhou, Ronghao and Zhou, Yuhan and Lehman, Li-wei H.},
  journal={IEEE Transactions on Neural Systems and Rehabilitation Engineering}, 
  title={Multi-View Spatial-Temporal Graph Convolutional Networks With Domain Generalization for Sleep Stage Classification}, 
  year={2021},
  volume={29},
  number={},
  pages={1977-1986},
  doi={10.1109/TNSRE.2021.3110665}}

Datasets

We evaluate our model on the ISRUC-Sleep-S3 dataset and the Montreal Archive of Sleep Studies (MASS)-SS3 dataset.

  • The ISRUC-Sleep-S3 dataset is available here, and we provide the pipeline to run MSTGCN on it.
  • The MASS-SS3 dataset is an open-access and collaborative database of laboratory-based polysomnography (PSG) recordings. Information on how to obtain it can be found here.

Requirements

  • Python 3.6
  • CUDA 10.1
  • cuDNN 7.6.5
  • Tensorflow-gpu 1.15.0
  • Keras 2.3.1
  • numpy 1.15.4
  • scipy 1.1.0
  • scikit-learn 0.21.3

How to run

  • 1. Get Dataset:

    You can download ISRUC-Sleep-S3 dataset by the following command, which will automatically download the raw data and extracted data to ./data/ISRUC_S3/:

    ./get_ISRUC_S3.sh

    For MASS-SS3 dataset, you need to you need to visit the link and contact their administrator.

  • 2. Data preparation:

    To facilitate reading, we preprocess the dataset into a single .npz file:

    python preprocess.py

    In addition, distance based adjacency matrix is provided at ./data/ISRUC_S3/DistanceMatrix.npy.

  • 3. Configuration:

    Write the config file in the format of the example.

    We provide a config file at /config/ISRUC.config

  • 4. Feature extraction:

    Run python train_FeatureNet.py with -c and -g parameters. After this step, the features learned by a feature net will be stored.

    • -c: The configuration file.
    • -g: The number of the GPU to use. E.g.,0,1,3. Set this to-1 if only CPU is used.
    python train_FeatureNet.py -c ./config/ISRUC.config -g 0
  • 5. Train MSTGCN:

    Run python train_MSTGCN.py with -c and -g parameters. This step uses the extracted features directly.

    python train_MSTGCN.py -c ./config/ISRUC.config -g 0
  • 6. Evaluate MSTGCN:

    Run python evaluate_MSTGCN.py with -c and -g parameters.

    python evaluate_MSTGCN.py -c ./config/ISRUC.config -g 0

Summary of commands to run:

./get_ISRUC_S3.sh
python preprocess.py
python train_FeatureNet.py -c ./config/ISRUC.config -g 0
python train_MSTGCN.py -c ./config/ISRUC.config -g 0
python evaluate_MSTGCN.py -c ./config/ISRUC.config -g 0

mstgcn's People

Contributors

ningxj1999 avatar ziyujia 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.