Research Appraisaldiagnostic

Electrocardiogram-Based Mental Stress Detection Amid Everyday Activities Using Machine Learning: Model Development and Validation Study

Journal of medical Internet researchUendes, Buelent, Antonides, Alex, van de Ven, Sjors et al.7 Apr 2026DOI

Clinical Snapshot

65CEBM
Evidence: Moderatediagnostic

PICO Framework

P — Population127 participants undergoing various mental stressors and physical activities
I — InterventionMachine learning models (XGBoost and logistic regression) applied to ECG-derived features
C — ComparatorComposite 'no-stress' background including rest and low-to-moderate intensity activities
O — OutcomesDiagnostic accuracy metrics (AUROC, AUPRC, sensitivity, specificity) for mental stress detection

Bottom Line

This study demonstrates that machine learning models can detect mental stress from ECG signals with moderate accuracy (AUROC ~0.74), but significant limitations exist. The models show poor discrimination from moderate physical activity, limiting real-world applicability where physical exertion is common. While robust to technical constraints like lower sampling rates, the approach requires validation in clinical settings with patient-relevant outcomes. The findings highlight fundamental challenges in single-sensor stress detection and suggest multi-modal approaches may be necessary. For Australian clinicians, this technology shows promise for workplace mental health monitoring but is not ready for clinical decision-making without further validation studies demonstrating clinical utility and patient benefit.

Evidence: Moderate

Key Findings

  • P Value: Not reported for primary comparison

  • Effect Size: XGBoost AUROC 0.741 vs Logistic Regression AUROC 0.724

  • Primary Outcome: Mental stress detection accuracy using ECG-based machine learning models

  • Nnt Or Sensitivity: Specificity for light physical activity: XGBoost 0.787, LR 0.794; poor specificity for moderate activity (~0.44)

  • Confidence Interval: XGBoost: 95% CI 0.701-0.783; LR: 95% CI 0.678-0.772

Clinical Application

Requires wearable ECG devices; models robust to lower sampling rates (125Hz) suitable for consumer devices Relevant for workplace mental health initiatives and preventive care programs; aligns with RACGP mental health screening guidelines but requires clinical validation Adults in occupational or clinical settings where continuous stress monitoring is desired

Abstract

BACKGROUND: Frequent, sustained stress is linked to poor health and requires monitoring for early intervention. Electrocardiograms (ECG) are promising biomarkers because they can be recorded noninvasively and continuously using wearable devices. However, tracking stress with ECG is challenging because daily activities elicit responses similar to mental stress (MS), and various mental stimuli that individuals encounter complicate the use of machine learning (ML) models trained on a limited set of stressors. OBJECTIVE: We (1) evaluated the ability of ML models to distinguish MS episodes from a composite "no-stress" background, including rest and low- to moderate-intensity activities; (2) assessed their generalizability to new stressors and participants; and (3) tested robustness to lower sampling rates and fewer features, to explore their suitability for lightweight wearables. METHODS: We used a comprehensive ECG dataset sampled at 1000 hertz from 127 participants who underwent various mental stressors and engaged in diverse physical activities. A 30-second window was used to extract 55 features from time, frequency, nonlinear, and morphological domains. We trained a logistic regression (LR) model and an extreme gradient boosting (XGBoost) model, splitting the data into 60/20/20 for training, validation, and testing. Shapley additive explanation values were computed to explain model predictions. Additional analyses included leave-one-stressor-out; downsampling to 500, 250, and 125 hertz; a time-window sensitivity analysis; and reducing the number of features to as few as 5. RESULTS: XGBoost achieved an area under the receiver operating characteristic curve (AUROC) of 0.741 (95% CI 0.701-0.783) and an area under the precision-recall curve (AUPRC) of 0.706 (95% CI 0.658-0.753), compared with 0.724 (95% CI 0.678-0.772) and 0.691 (95% CI 0.639-0.742) for LR. The mean performance difference between XGBoost and LR was 0.017 for AUROC (95% CI 0.001-0.032) and 0.015 for AUPRC (95% CI -0.001 to 0.037; clustered bootstrap analysis using 2000 participant-level resamples), suggesting that LR performs comparably to the nonlinear XGBoost model. Both models were robust to downsampling and feature reduction (10 features retained >93% of performance). Extending the analysis window to 60 seconds improved model performance across all sampling rates, highlighting a trade-off between rapid detection and overall performance. When evaluating discrimination from physical activity, models achieved acceptable specificity for light physical activity (XGBoost: 0.787; LR: 0.794) but poor specificity for moderate physical activity (XGBoost: 0.418; LR: 0.444). Both models generalized to most unseen stressors, although performance varied across stressors, with limited transfer to the social-evaluative stressor. Feature importance analysis revealed fuzzy entropy and frequency-based features as key predictors. CONCLUSIONS: ML models can detect MS with high sensitivity and remain robust to lower sampling rates and fewer features. Generalization to novel stressors was stressor-dependent. Importantly, our results highlight challenges in distinguishing stress-related cardiac responses from those caused by physical exertion, revealing critical limitations of single-sensor ECG approaches for MS detection.

References

  1. 1.Uendes, B., Antonides, A., van de Ven, S., van der Mee, D. J., de Geus, E., & Hoogendoorn, M. (2026). Electrocardiogram-Based Mental Stress Detection Amid Everyday Activities Using Machine Learning: Model Development and Validation Study. Journal of Medical Internet Research, 28(4). https://doi.org/10.2196/80450
Share:XLinkedIn

This content is for educational purposes for healthcare professionals only and does not constitute clinical advice. Clinical decisions should be based on individual patient assessment, current guidelines, and appropriate specialist consultation. Editorial Standards · Privacy Policy · Terms of Service