The repository contains open-source code for IMWUT 2023 paper “FewShotBP: Towards Personalized Ubiquitous Continuous Blood Pressure Measurement”
The environment can be prepared using conda package managing.
conda env create -f environment.yml
Please refer to Managing environments for detailed information
- Option 1: The cleaned dataset can be downloaded from Hugging Face and the mdb file should be placed in
./datasource/ucibpds/
- Option 2: Please refer to section below to build dataset from scratch.
python transfer_finetune.py -n N -e EXP_NAME
, where N
is the number of samples for personalization. The experiments are logged in ./tensorboard/EXP_NAME/RUN_NAME
, and can be visualized using tensorboard. Please refer to HPARAMS
section in tensorboard to see hyperparameters and obtained results.
In addition, the results (ground truth and predictions for every subjects) will be dumped to ./tensorboard/EXP_NAME/RUN_NAME/perf_train_stat_group.trialdump
and ./tensorboard/EXP_NAME/RUN_NAME/perf_valid_stat_group.trialdump
python transfer_pa.py -e EXP_NAME
The scriptss will run personalization with 5, 10, 25, 50 samples sequentially, and the results (ground truth and predictions) will be dumped to ./records/pa2ucibp/
To print the statistics, run show_pa_results.ipynb
. Note, the argument of read_pa_trial_dump()
should be changed to file name of generated dump file in previous step.
- Place the UCIBP dataset (derived from MIMIC-II) in
./datasource/ucibp/
, the dataset can be downloaded from Cuff-Less Blood Pressure Estimation. - Split the dataset into independent case files using MATLAB script
generate_cases.m
. - Clean the independent case files using MATLAB script
clean_dataset.m
. - Generate LMDB dataset by
python generate_lmdb.py
Note, the dataset_folder
and lmdb_folder
variable in generate_lmdb.py
should be changed to actual paths of cleaned independent case files and desired output lmdb data folder.
The model structure of MSTNN is defined in ./models/PPGECGNet_V0e2x1b.py
. Run the following code to pre-train the model.
python train.py
The model file can be replaced with your own implementations.