Personalized Electrocardiographic and HRV Dynamics for Acute Stress Detection: A Leave-One-Subject-Out Benchmark on WESAD
Automated classification of acute psychological stress from non-invasive wearable electrocardiography (ECG) is a fundamental problem in physiological computing and affective state recognition. A central barrier to cross-subject generalization is inter-individual baseline heterogeneity: resting heart rate and basal heart rate variability (HRV) metrics vary widely across individuals due to genetic, cardiorespiratory fitness, and circadian factors, causing uncalibrated global classifiers to degrade substantially on unseen subjects. In this work, we present an end-to-end reproducible research pipeline benchmarked across all 15 subjects (N=15, 445 standardized 60-second windows) of the public Wearable Stress and Affect Detection (WESAD) dataset. Single-lead (Lead-II) ECG acquired at 700 Hz is conditioned via zero-phase 4th-order Butterworth filtering (0.5–40 Hz), followed by adaptive noise-floor peak prominence detection and physiological interval gating. A selected 8-feature representation capturing heart rate, time-domain variability, and robust spread metrics is transformed via subject-specific relative baseline calibration: X* = (X - Bs) / |Bs|. Evaluated under strict 15-Fold Leave-One-Subject-Out Cross-Validation (LOSO-CV), baseline-relative calibration elevates classification accuracy from 81.57% to 92.36% (+10.79%) and stress F1-score from 73.03% to 89.03% (+16.00%) over identical unnormalized baselines. At a calibrated decision threshold of τ = 0.35, the primary model achieves an ROC-AUC of 0.9494, PR-AUC of 0.9467, sensitivity of 86.25%, and specificity of 95.79%. A comparative benchmark across six machine learning architectures demonstrates consistent generalization (ROC-AUC > 0.937). Permutation importance and odds ratio analyses indicate that cardiac interval compression (ΔMeanRR) and heart rate acceleration (ΔMeanHR) are the primary contributors to the learned boundary. Finally, sub-millisecond feature extraction (<0.85 ms per window on benchmark hardware) and an ultra-compact streaming buffer requirement indicate potential for real-time edge implementation.
Authors
- Mukesh Yadav
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-09-17
- DOI
- https://doi.org/10.5281/zenodo.22806709
- Primary Topic
- Heart Rate Variability and Autonomic Control
- Type
- preprint