Skip to main content

Taking multi-channel PPG and Accelerometer signals as input, BeliefPPG predicts the instantaneous heart rate and provides an uncertainty estimate for the prediction.

Project description

BeliefPPG: Uncertainty-aware Heart Rate Estimation from PPG signals via Belief Propagation (UAI 2023, Official Code)

Valentin Bieri*2, Paul Streli*1, Berken Utku Demirel1, Christian Holz1

1 Sensing, Interaction & Perception Lab, Department of Computer Science, ETH Zürich, Switzerland
2 MSc Student, Department of Computer Science, ETH Zürich, Switzerland
* These authors contributed equally to this work



We present a novel learning-based method that achieves state-of-the-art performance on several heart rate estimation benchmarks extracted from photoplethysmography signals (PPG). We consider the evolution of the heart rate in the context of a discrete-time stochastic process that we represent as a hidden Markov model. We derive a distribution over possible heart rate values for a given PPG signal window through a trained neural network. Using belief propagation, we incorporate the statistical distribution of heart rate changes to refine these estimates in a temporal context. From this, we obtain a quantized probability distribution over the range of possible heart rate values that captures a meaningful and well-calibrated estimate of the inherent predictive uncertainty. We show the robustness of our method on eight public datasets with three different cross-validation experiments.

Contents

TL; DR
This repository contains code to run leave-one-session-out cross-validation experiments on multiple supported datasets. Taking multi-channel PPG and Accelerometer signals as input, BeliefPPG predicts the instantaneous heart rate and provides an uncertainty estimate for the prediction.

Datasets

We provide a shell script which downloads the datasets DaLiA, WESAD, BAMI-1 and BAMI-2 from their original hosts. Run the following line in your terminal:

sh download_data.sh
  • Note that WESAD does not natively include ground-truth HR. Labels can be generated from the provided ECG recordings instead.
  • Support for the IEEE datasets is implemented, but the original data format seems to be no longer available. You can download it in the new format under https://zenodo.org/record/3902710#.ZGM9l3ZBy3C and restructure/convert the files or implement your own file reader.

Training and Inference

Run the following in your terminal:

python train_eval.py --data_dir ${DATA_PATH} --dataset dalia 

This will run LoSo cross-validation on the DaLiA dataset. On a modern GPU, expect one full run to take roughly 10–14 hours. Results, that is the MAEs, predictions and models, are saved in the output directory, which can be specified with the --out_dir argument. Note that you may have to reinstall h5py in order for the models to be saved correctly.

We highly recommend that you use Weights&Biases to monitor model training. Make sure to log into W&B in the console and then simply add the argument --use_wandb to save additional plots and logging information.

Citation

If your find our paper or codes useful, please cite our work:

@InProceedings{uai2023-beliefppg,
    author={Bieri, Valentin and Streli, Paul and Demirel, Berken Utku and Holz, Christian},
    title = {BeliefPPG: Uncertainty-aware Heart Rate Estimation from PPG signals via Belief Propagation},
    year = {2023},
    organization={PMLR},
    booktitle = {Conference on Uncertainty in Artificial Intelligence (UAI)}
}

License and Acknowledgement

This project is released under the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

beliefppg-0.1.tar.gz (8.5 MB view details)

Uploaded Source

Built Distribution

beliefppg-0.1-py3-none-any.whl (8.5 MB view details)

Uploaded Python 3

File details

Details for the file beliefppg-0.1.tar.gz.

File metadata

  • Download URL: beliefppg-0.1.tar.gz
  • Upload date:
  • Size: 8.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for beliefppg-0.1.tar.gz
Algorithm Hash digest
SHA256 61b5bafa5447267f4e2f32cd9e6af15dcbf6e8064d4998f46f6d5778d235bd96
MD5 29d46bc808cbb11da8a0336b5398796f
BLAKE2b-256 fdbc8f98ef3b1db490346227624027b4452a1d39cec83429f22fb7b9c545f646

See more details on using hashes here.

File details

Details for the file beliefppg-0.1-py3-none-any.whl.

File metadata

  • Download URL: beliefppg-0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for beliefppg-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0a2d880828502c2c0f62c5fe0da485aef3fd93c556d7eddc635c01d1861f1f0f
MD5 ccc945d6859ee3fe7edae0290b3ab651
BLAKE2b-256 d8e3d2c61fd4a54516c8305bef578962376e9b7fb5a29d1eebff3c0ed91f5d69

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page