The photoplethysmogram (PPG) signal is widely used in pulse oximeters and smartwatches. A fundamental step in analysing the PPG is the detection of heartbeats. Several PPG beat detection algorithms have been proposed, although it is not clear which performs best. Objective: This study aimed to: (i) develop a framework with which to design and test PPG beat detectors; (ii) assess the performance of PPG beat detectors in different use cases; and (iii) investigate how their performance is affected by patient demographics and physiology. Approach: Fifteen beat detectors were assessed against electrocardiogram-derived heartbeats using data from eight datasets. Performance was assessed using the F1 score, which combines sensitivity and positive predictive value. Main results: Eight beat detectors performed well in the absence of movement with F1 scores of ≥90% on hospital data and wearable data collected at rest. Their performance was poorer during exercise with F1 scores of 55-91%; poorer in neonates than adults with F1 scores of 84-96% in neonates compared to 98-99% in adults; and poorer in atrial fibrillation (AF) with F1 scores of 92-97% in AF compared to 99-100% in normal sinus rhythm. Significance: Two PPG beat detectors denoted ‘MSPTD’ and ‘qppg’ performed best, with complementary performance characteristics. This evidence can be used to inform the choice of PPG beat detector algorithm. The algorithms, datasets, and assessment framework are freely available.
This study used two key resources:
The analysis reported in this study can be reproduced by following these steps:
The datasets used in the study are listed on this page. Download each dataset in turn by following the instructions provided on each dataset’s page.
Install the PPG-beats toolbox by following the instructions on this page.
Use the assess_multiple_datasets.m
script (within PPG-beats) to assess the performance of PPG beat detectors across all of the datasets. To do so:
assess_multiple_datasets.m
script:
specify_path_of_dataset_file
function within the assess_multiple_datasets.m
script.up.paths.plots_root_folder
variable within the setup_universal_params
function within the assess_multiple_datasets.m
script.setup_universal_params
function within the assess_multiple_datasets.m
script:up.assessment_datasets = {'capnobase', 'bidmc', 'mimic_train_all', 'mimic_test_all', 'wesad_meditation', 'wesad_amusement', 'wesad_baseline', 'wesad_stress', 'ppg_dalia_sitting', 'ppg_dalia_working', 'ppg_dalia_cycling', 'ppg_dalia_walking', 'ppg_dalia_lunch_break', 'ppg_dalia_car_driving', 'ppg_dalia_stair_climbing', 'ppg_dalia_table_soccer'};
up.comparison_datasets = {'mimic_B', 'mimic_W', 'mimic_test_a', 'mimic_test_n', 'mimic_non_af', 'mimic_af'};
specify_options
function within the assess_multiple_datasets.m
script:options.beat_detectors = {'SWT', 'ATmax', 'SPAR', 'IMS', 'AMPD', 'MSPTD', 'ABD', 'qppgfast', 'HeartPy', 'COppg', 'PPGPulses', 'ERMA', 'PWD', 'PDA', 'WFD'};
assess_multiple_datasets.m
script, which will:
The additional figures in the manuscript can be generated as follows:
create_ppg_beat_detection_fig.m
script.make_plot_of_ecg_ppg_time_alignment.m
script.make_plot_of_ppg_beat_detection_challenges.m
script.