Skip to content
bubble3jhPublic

About

Official PyTorch code for "Few-Shot PPG Signal Generation via Guided Diffusion Models" (IEEE Sensors Journal 2024)

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

Few-Shot PPG Signal Generation
via Guided Diffusion Models

IEEE Sensors Journal, 2024
Jinho Kang, Yongtaek Lim, KyuHyung Kim, Hyeonjeong Lee, KwangYong Kim, Minseong Kim, Jiyoung Jung, Kyungwoo Song

Paper IEEE Sensors Journal 2024 PyTorch

Overall framework of the Bi-Guided Diffusion Model

Official PyTorch implementation of BG-Diff, a Bi-Guided Diffusion Model that generates PPG signals with the blood pressure characteristics of a chosen group from only a few samples per group.

  • Few-shot generation for every blood pressure group. Guidance steers the diffusion model toward minority groups that an imbalanced dataset would otherwise leave out.
  • Bi-guidance. A discrete group condition and a continuous label condition guide the sampling together, so the generated signals are valid for the target group.
  • Post-processing that helps every training recipe. The generated data improve training from scratch, transfer learning, and linear probing on BCG, PPGBP, and SENSORS.

Overview

Guided generation toward minority groups

In an imbalanced dataset, guidance directs the diffusion model to generate for minority groups.

Generated data cover the distribution of unseen real data

Trained and sampled in a few-shot setting, the model still covers the distribution of unseen real data.

Getting started

Installation

conda env create -f environment.yml

Data

Datasets follow the layout of bp-benchmark.

├── bp-algorithm
├── datasets
│   ├── splits
│   │   ├── bcg_dataset
│   │   │   ├── feat_fold_0.csv
│   │   │   ├── ...
│   │   │   └── feat_fold_4.csv

Running

# train and generate synthetic PPG with the default options
python main.py

To evaluate the generated PPG signals, use bp-benchmark.

Arguments

Argument Default Description
--seed 1000 Random seed
--benchmark bcg Dataset to use
--num_samples 5 Number of samples in the few-shot setting
--seq_length 625 Sequence length of the signal
--train_batch_size 32 Training batch size
--diffusion_time_steps 2000 Number of diffusion steps
--train_num_steps 32 Number of training steps
--train_lr 8e-5 Learning rate
--sample_only off Skip training and only sample
--sample_batch_size Batch size for sampling
--target_group -1 Group to sample: -1 all, 0 hypo, 1 normal, 2 prehyper, 3 hyper2, 4 crisis
--regressor_scale 1.0 Scale of the regressor guidance

Abstract

Recent advancements in deep learning for predicting Arterial Blood Pressure (ABP) have prominently featured photoplethysmography (PPG) signals. Notably, PPG signals exhibit significant variability due to differences in measurement environments, alongside stark disparities in the distribution of collected signal data among different labels. To address these challenges, this study introduces a Bi-Guided Diffusion Model designed to generate PPG signals with expected features of ABP within a few-shot setting for each label group. We propose a guided diffusion model architecture that simultaneously considers both the determinant group condition and the continuous label condition for each group in a few-shot setting. To our knowledge, this is the first study to use a diffusion model for generating PPG signals with a limited dataset. Initially, we categorized them into four groups based on SBP and DBP values: Hypo, Normal, Prehyper, and Hyper2. In each group, we sample an equal number of data points according to the few-shot setting and then generate appropriate PPG signals for each group through guidance. Additionally, our study proposes a post-processing technique to address the limitations of generative models in few-shot settings, consistently boosting performance across various methods such as training from scratch, transfer learning, and linear probing. When benchmarked, our methodology demonstrated performance improvements across all datasets, including BCG, PPGBP, and SENSORS. We confirmed data quality by comparing training, generated, and actual data. We analyzed error cases, morphology features, and t-SNE distribution to highlight the role of synthetic data in enhancing performance.

Citation

@article{kang2024few,
  title={Few-Shot PPG Signal Generation via Guided Diffusion Models},
  author={Kang, Jinho and Lim, Yongtaek and Kim, KyuHyung and Lee, Hyeonjeong and Kim, KwangYong and Kim, Minseong and Jung, Jiyoung and Song, Kyungwoo},
  journal={IEEE Sensors Journal},
  year={2024},
  publisher={IEEE}
}

The lab-maintained copy of this repository is at MLAI-Yonsei/BG-Diff.

About

Official PyTorch code for "Few-Shot PPG Signal Generation via Guided Diffusion Models" (IEEE Sensors Journal 2024)

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages