Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
metrics:
|
| 5 |
+
- mae
|
| 6 |
+
- mse
|
| 7 |
+
- r_squared
|
| 8 |
+
library_name: keras
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
This model is a Transformer-based encoder for heart rate (HR) sequences, designed to learn robust representations of short-term HR fluctuations (HF components) in a self-supervised pretraining setup.
|
| 12 |
+
|
| 13 |
+
Key features:
|
| 14 |
+
|
| 15 |
+
- HR-only input: Sequence of heart rate measurements (BPM).
|
| 16 |
+
- Adaptive Normalization: Internal Normalization layer learns mean and variance from training HR data.
|
| 17 |
+
- Pre-LN Transformer: Multi-layer Pre-LayerNorm Transformer with residual connections for stable sequence modeling.
|
| 18 |
+
- Masked pretraining: Randomly masks portions of the HR sequence during training to learn contextual representations.
|
| 19 |
+
- Robust to short-term HR spikes: Designed to handle physiological or situational changes (e.g., exercise, stress, sudden excitement).
|
| 20 |
+
|
| 21 |
+
## Intended Use
|
| 22 |
+
- Pretraining for downstream HR/HRV tasks, such as:
|
| 23 |
+
- Heart rate prediction / imputation
|
| 24 |
+
- Wearable biosignal modeling
|
| 25 |
+
- Works on fixed-length HR windows, e.g., 128-minute sequences.
|
| 26 |
+
|
| 27 |
+
## Training Data
|
| 28 |
+
- Derived from the AFDB (Atrial Fibrillation Database) ECG recordings.
|
| 29 |
+
- HR sequences extracted via fast R-peak detection and sliding-window HR computation.
|
| 30 |
+
- Masking ratio: 0.05 (configurable during training).
|
| 31 |
+
|
| 32 |
+
## Evaluation Metrics
|
| 33 |
+
- Masked sequence reconstruction evaluated via:
|
| 34 |
+
- Mean Absolute Error (MAE)
|
| 35 |
+
- Root Mean Squared Error (RMSE)
|
| 36 |
+
- R² (variance explained)
|
| 37 |
+
|
| 38 |
+
### Example validation performance:
|
| 39 |
+
|
| 40 |
+
MAE ≈ 1.45 BPM
|
| 41 |
+
RMSE ≈ 3.59 BPM
|
| 42 |
+
R² ≈ 0.86
|
| 43 |
+
Limitations
|
| 44 |
+
Model trained on AFDB dataset; generalization to other populations or devices may require fine-tuning.
|
| 45 |
+
Designed for resting or moderate activity HR; extreme exercise scenarios may require additional smoothing or adaptation.
|
| 46 |
+
|
| 47 |
+
## AFDB Citation
|
| 48 |
+
Goldberger, A., Amaral, L., Glass, L., Hausdorff, J., Ivanov, P. C., Mark, R., ... & Stanley, H. E. (2000). PhysioBank, PhysioToolkit, and PhysioNet: Components of a new research resource for complex physiologic signals. Circulation [Online]. 101 (23), pp. e215–e220. RRID:SCR_007345.
|