Abstract
Pervasive e-healthcare services have evolved rapidly in the recent years with the surge of the Internet of Medical Things (IoMT). Intelligent stress monitoring assistant is such an example that uses affective computing to detect stress levels based on biological signals. Existing works use different forms of machine learning and deep learning methods to successfully detect stress in pre-defined individuals. However, such models fail to recognise stress in unseen people, a problem that is harder to solve but of critical importance when three quarters of people in our society feel unable to cope due to stress. In this work, we propose a deep learning method that leverages self-attention to compute representations of the network's input and output layers and yields a generic stress detection model. We present a comparative analysis in which we examine the efficacy of Random Forest with handcrafted features, CNN-based deep learning, and transformer network with multi-modal data. Our results show that the proposed transformer solution outperforms the state of the art in all scenarios with accuracy of 96% and F1 score of 97%. More importantly, the model is validated using a leave-one-subject-out (LOSO) approach, hence is exportable and can successfully detect the stress condition of any unseen person.