An explainable transformer-driven network for electrocardiogram-based stress monitoring for resource-constrained devices
Stress is the body’s adaptive reaction to psychological or physiological threats, manifesting through several physical, behavioral, and emotional reactions. The conventional stress assessment methods that rely on handcrafted features or converted signal images are often subjective and error-prone; hence, underscoring the necessity for an automated stress detection framework to minimize stress-related health issues. In this study, we have proposed a novel model that integrates transformer encoder with a convolutional neural network and bidirectional long short-term memory architecture that detects stress from raw electrocardiogram signals. Two publicly available datasets, WESAD and Vollmer, are used to evaluate the proposed model. Our proposed approach shows an F1 score of 93.9%, an accuracy of 94.7%, a recall of 94.0%, and a precision of 94.4% on the WESAD dataset. On the Vollmer dataset, the model demonstrates an 88.1% F1 score, 88.2% accuracy, 88.2% recall, and 88.1% precision. To enhance the trustworthiness of the model, we have proposed two novel explainability methods analyzing the temporal and frequency components of the signal. Furthermore, the model was deployed on a resource-constrained device to evaluate its practical implementability. The experimental results, along with the model interpretability, demonstrate its robustness and generalizability, making it well-suited for sensor-based wearable healthcare and consumer devices in automatic stress detection.
Authors
- Sapnil Sarker Bipro
- Mohammod Abdul Motin (ORCID: https://orcid.org/0000-0003-1618-3772)
- Shuqiang Wang
- Mufti Mahmud
Institutions
- King Fahd University of Petroleum and Minerals (SA)
- Shenzhen Institutes of Advanced Technology (CN)
- Rajshahi University of Engineering and Technology (BD)
- University of Rajshahi (BD)
Publication Details
- Journal
- Computers & Electrical Engineering
- Published
- 2026-09-11
- DOI
- https://doi.org/10.1016/j.compeleceng.2026.111489
- Primary Topic
- Emotion and Mood Recognition
- Type
- article
- Field-Weighted Citation Impact
- 0.00