|
|
--- |
|
|
license: mit |
|
|
language: |
|
|
- en |
|
|
tags: |
|
|
- medical |
|
|
size_categories: |
|
|
- 100K<n<1M |
|
|
--- |
|
|
## [WildPPG](https://siplab.org/projects/WildPPG): A Real-World PPG Dataset of Long Continuous Recordings (NeurIPS 2024 Datasets & Benchmarks) |
|
|
|
|
|
[Manuel Meier](https://scholar.google.com/citations?user=L6f-xg0AAAAJ), [Berken Utku Demirel](https://scholar.google.com/citations?user=zbgxpdIAAAAJ), [Christian Holz](https://www.christianholz.net)<br/> |
|
|
|
|
|
[Sensing, Interaction & Perception Lab](https://siplab.org), Department of Computer Science, ETH Zürich, Switzerland <br/> |
|
|
|
|
|
--- |
|
|
|
|
|
## 📖 Overview |
|
|
|
|
|
WildPPG provides **216 hours** of continuous physiological recordings from **16 participants** in diverse real-world scenarios. |
|
|
|
|
|
It is the largest dataset for developing and evaluating wearable heart-rate detection algorithms. |
|
|
|
|
|
--- |
|
|
|
|
|
- **Participants, Duration & Ground truth for heart rate estimation:** |
|
|
16 healthy adults; 810 min (~13.5 h) each, 216 h total. Ground truth heart rate: obtained from ECG with Pan–Tompkins and cleaned further during motions. |
|
|
|
|
|
- **Modalities & Placements:** |
|
|
PPG, ECG (Lead I), 3-axis accel, skin temp, barometric altitude |
|
|
@ forehead · sternum · wrist · ankle |
|
|
|
|
|
- **Contexts & Environments:** |
|
|
Mobility (walking, hiking, stairs), Stationary (meals, resting), Transit (car, train, cable car, elevator) |
|
|
Temperatures near 0 °C to full sun; altitudes up to 3 571 m |
|
|
|
|
|
___________ |
|
|
|
|
|
Quick Links: |
|
|
- [Project Website](https://siplab.org/projects/WildPPG) |
|
|
- [Paper](https://static.siplab.org/papers/neurips2024-wildppg.pdf) |
|
|
---------- |
|
|
|
|
|
# Loading the Dataset |
|
|
The dataset is split into .mat MATLAB files representing participants and can be loaded with MATLAB. |
|
|
|
|
|
## Loading the Data |
|
|
You can load the `.mat` file using either Python or MATLAB: |
|
|
|
|
|
- **Python**: |
|
|
Use [`scipy.io.loadmat`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.io.loadmat.html): |
|
|
```python |
|
|
from scipy.io import loadmat |
|
|
data = loadmat('WildPPG.mat') |
|
|
``` |
|
|
|
|
|
- **MATLAB**: |
|
|
Use the built-in `load` function: |
|
|
```matlab |
|
|
data = load('WildPPG.mat'); |
|
|
``` |
|
|
|
|
|
The `.mat` file contains **14 cell arrays**, each representing a variable (e.g., `data_altitude_values`, `data_bpm_values`, `data_ppg_wrist`). |
|
|
Each cell array includes **16 entries**, corresponding to data from 16 individual subjects. |
|
|
|
|
|
|
|
|
|
|
|
### Example loader |
|
|
|
|
|
```python |
|
|
import numpy as np |
|
|
import scipy.io |
|
|
|
|
|
def load_domain_data(domain_idx): |
|
|
"""Loads wrist PPG and heart rate data for a single subject (domain). |
|
|
|
|
|
Args: |
|
|
domain_idx (int): Index of the subject (0–15). |
|
|
|
|
|
Returns: |
|
|
X (np.ndarray): PPG signal data (n_samples × signal_dim). |
|
|
y (np.ndarray): Heart rate values (bpm), adjusted to start from 0. |
|
|
d (np.ndarray): Domain labels (same shape as y), equal to domain_idx. |
|
|
""" |
|
|
data_path = 'data/WildPPG/WildPPG.mat' |
|
|
data_all = scipy.io.loadmat(data_path) |
|
|
|
|
|
# Load PPG signal and heart rate values |
|
|
data = data_all['data_ppg_wrist'] |
|
|
data_labels = data_all['data_bpm_values'] |
|
|
|
|
|
domain_idx = int(domain_idx) |
|
|
X = data[domain_idx, 0] |
|
|
y = np.squeeze(data_labels[domain_idx][0]).astype(int) |
|
|
|
|
|
# Mask out invalid samples (e.g., NaNs, infs, and HR < 30 bpm) |
|
|
mask_Y = y >= 30 |
|
|
mask_X = ~np.isnan(X).any(axis=1) & ~np.isinf(X).any(axis=1) |
|
|
combined_mask = mask_Y & mask_X |
|
|
|
|
|
X = X[combined_mask] |
|
|
y = y[combined_mask] - 30 # Normalize HR: min HR is 30 bpm → range starts from 0 |
|
|
d = np.full(y.shape, domain_idx, dtype=int) |
|
|
|
|
|
return X, y, d |
|
|
``` |
|
|
|
|
|
|
|
|
#### Load PPG & Heart Rate Data for a Single Subject |
|
|
|
|
|
The function `load_domain_data(domain_idx)` loads **wrist PPG signal data** and **heart rate (HR) labels** for a single subject from the `WildPPG.mat` file. |
|
|
|
|
|
- `domain_idx` ranges from `0` to `15`, each corresponding to one of the 16 subjects. |
|
|
- The data is preprocessed by: |
|
|
- Removing invalid samples (NaNs, infs, and HR < 30 bpm) |
|
|
- Normalizing HR values to start from 0 (by subtracting 30 bpm) |
|
|
- The function returns: |
|
|
- `X`: preprocessed PPG signal (shape: `n_samples × signal_dim`) |
|
|
- `y`: adjusted heart rate labels |
|
|
- `d`: domain label (same shape as `y`, filled with `domain_idx`) |
|
|
|
|
|
Example usage: |
|
|
|
|
|
```python |
|
|
x, y, d = load_domain_data(3) # Load data for subject 3 |
|
|
``` |
|
|
|
|
|
|
|
|
|