GithubHelp home page GithubHelp logo

brianhill11 / ppg_qi Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 2.53 MB

Repo for PPG Quality Index algorithm

Python 100.00%
physionet physiological-signals machine-learning cnn signal-processing ppg photoplethysmogram

ppg_qi's Introduction

PPG-QI

PPG Quality Index (QI) models for predicting the presence of PPG waveform artifacts

This repo contains code for generating image/array pairs for waveform windows, and then training CNN models to predict whether or not a window is valid/invalid. The probability of a window being valid can be interpreted as a quality index.

3 steps are required for creating the quality index models: (1) generating waveform images to label, (2) labeling the waveform images as valid/invalid, and (3) training a CNN model to generate the quality index.

For additional details, please see Imputation of the continuous arterial line blood pressure waveform from non-invasive measurements using deep learning.

Applying the trained model to new data

For an example of how to load the model weights and generate predictions on new PPG waveform data, see filter_existing_files.py.

Generating input data

Loading data into Label Studio

  1. Clone Label Studio from the Github repo
  2. Change directories into the cloned label-studio directory and install dependencies
# Install all package dependencies
pip install -e .
  1. Create a soft link to the directory containing the image files, so they can be served locally (see this issue for details)
ln -s /path/to/ppg_images label-studio/static/ppg_images
  1. Initialize the label-studio project, supplying the path to save the label-studio project files
python label_studio/server.py init ../wave_qi/wave_qi
  1. Start the label-studio server, supplying the path to save label-studio project files
python label_studio/server.py start ../wave_qi/wave_qi
  1. Click the "Setup" tab to configure the project settings

Set up the project as an "Image classification" ask, and set the Labeling Config like this:

<View>
  <Image name="image" value="$image"/>
  <Choices name="ppg" toName="image" showInLine="true">
    <Choice value="invalid" background="red"/>
    <Choice value="neutral" background="blue" />
    <Choice value="valid" background="green" />
  </Choices>
</View>

And click Save at the bottom of the page. This will give you three classification options per image: (1) invalid, (2) neutral (not sure), and (3) valid.

  1. To to the Import tab to load the [signal]_image_file_paths.csv file that contains locations of the waveform images for labeling
  2. Go to the Labeling tab and start labeling images. Note that the number keys can be used as keyboard shortcuts for labels.
  3. Once windows are labeled, go to the Export tab and choose CSV as the export format to save the labeling results as a .csv file

Training the QI models

Citation

If you use the PPG QI model in your work, please cite:

Hill, B.L., Rakocz, N., Rudas, ร. et al. Imputation of the continuous arterial line 
blood pressure waveform from non-invasive measurements using deep learning. 
Sci Rep 11, 15755 (2021). https://doi.org/10.1038/s41598-021-94913-y

ppg_qi's People

Contributors

brianhill11 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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