# Real-Time Psychological Stress Detection According to ECG Using Deep Learning
## 1 Introduction  
Economic development has led to fierce competition among people. People are now more prone to be affected by high psychological stress. Excessive psychological stress reduces work efficiency, affects relationships and transportation safety [1]. Long-term stress can even induce depression, addiction, and cardiovascular and cerebrovascular diseases [2, 3]. Excessive emotional stress has become a major problem affecting human physical and mental health. MAE (ecological momentary assessment) [4] and JITAI (just-in-time adaptive interventions) [5] are two effective methods that can be used to deal with the negative consequences of excessive psychological stress. However, the two methods both require real-time monitoring of psychological stress, and the lack of a method that can monitor emotional stress in real time has become the main problem. It is fortunate that there is an important relationship between psychological stress and the autonomic nervous system, i.e., SNS (sympathetic nervous system) and PNS (parasympathetic nervous system). The exposure to stress will enhance SNS's function,including shortening the RR interval, increasing the low-frequency energy of HRV (heart rate variability), increasing the respiration rate, decreasing HRV's high-frequency energy, and more [6]. After stress, the PNS will be activated to generate the opposite effect. Therefore, the features of the RR interval and other physiological parameters could be used to detect stress. As an electrocardiogram (ECG) signal contains RR interval information and is easy to obtain, a lot of research has been undertaken on judging psychological stress via the ECG signal. Traditionally, five-minute ECG data have been used to detect stress [7]. Although the accuracy of these studies is reliable, the 5 min time phase is too long for real-time monitoring. To promote real-time application, some researchers have successfully detected stress on one-minute ECG and respiration [8] with high accuracy. However, the acquisition of breathing signals requires wearing a bandage, which will greatly reduces the comfort. Furthermore, the interval of one minute is not short enough to satisfy the requirements of real-time monitoring. Deep learning technology, proposed in recent years, has greatly promoted the development of artificial intelligence, especially for the CNN (convolutional neural network) and RNN (recurrent neural network). There have been some studies that have used deep learning techniques to monitor psychological stress. [PERSON] used the LSTM (long short-term memory) model with an attention mechanism to classify stress for spoken language, and the accuracy achieved was 0.741 [9]. [PERSON] built models using DNN (deep neural network) and a conditional random field to classify stress regarding information on adolescent social behavior [10]. [PERSON] used a deep sparse neural network to monitor the stress level from cross-media microblog data [11]. [PERSON] [12] categorized stress using 10 s ECG data with CNN and LSTM, but there are only two categories. [PERSON] [13] categorized stress into four classes, using SBP (systolic blood pressure), DBP (diastolic blood pressure), sleep time, heart rate, and age with DBN (deep belief network) and the accuracy only reached 0.66, and the data sleep time, SBP, DBP used did not satisfy a real-time application well. Although these studies have proven their models to be effective, they did not consider the need for real-time application. To address this issue, considering the effectiveness of deep learning technology and the easy accessibility of ECG signals, we proposed a network according to ECG using deep learning technology. For this proposed network, we also built a psychological stress monitoring platform on which data collection and analysis function were integrated. Using it, the ECG data of 34 people were collected and used for training and testing the models.