Abstract
According to the World Health Organization, stress is a considerable problem that affects both the mental well-being and physical health of people, so stress detection becomes an important task. Various stress detection methods based on the human brain and human behavior exist, but none of them uses both brain signals and heart signals together to detect stress. In this paper, a novel approach to detect stress using EEG and ECG signals is proposed. The proposed Stress Recognition by Neuroanalysis (Se.Re.Ne.) method is validated for k-nearest neighbors (KNN) and decision tree (DT) using the correlation method. Results evaluated using Se.Re.Ne. with KNN detect stress with a precision of 0.87, recall of 0.71, and f1-score of 0.78 with total accuracy of 68%, whereas Se.Re.Ne. with DT detects stress with a precision of 0.85, recall of 0.84, and f1-score of 0.84 with a total accuracy of 75%.
Access provided by Autonomous University of Puebla. Download conference paper PDF
Similar content being viewed by others
Keywords
- Electroencephalography (EEG)
- Electrocardiography (ECG)
- Stress detection
- Decision tree (DT)
- K-nearest neighbors (KNN)
1 Introduction
In day-to-day life, everyone feels stressed either because of high workload or relationship dispute. These high brain activities for a prolonged period of time can lead to chronic stress which can further cause mental disorders like depression or anxiety. Stress can be detected through facial expressions, behavioral patterns, and varying voices, but people can deliberately hide these features which can result in false analysis. Gradually, researchers have shifted their focus on technologies like electroencephalogram (EEG) and electrocardiogram (ECG) as signals come directly through the human brain and heart, respectively.
This paper focuses on EEG and ECG signals which are recorded noninvasively to detect stress. EEG is a common test used for the recording of brain activities. It uses small metal disks known as electrodes that are placed on the scalp, and when brain cells send messages, they pick electrical signals. In this paper, out of the 64 electrode locations, 14 locations are used. The 10–20 system, which is an internationally recognized system to describe the electrode placement on the scalp, is referred in this paper.
The ‘10’ and ‘20’ refer to the actual distance between adjacent electrode locations which is either 10 or 20%, and for this, the brain is divided into four regions—frontal cortex, parietal cortex, temporal cortex, and occipital cortex.
ECG is used to measure the electrical activity of the heart by recording the heart rhythm. ECG waves, as in Fig. 1 consist of P-wave that detects alteration of atria, Q-R-S complex which provides information of alteration of ventricles, and T-wave which shows ventricular repolarization. When a person is in a stressful state, his heart rate changes, causing changes in the ECG pattern [1], and these changes are used to detect stress.
According to the PAD emotional state model proposed by Mehrabian and Russell [2], three numerical dimensions, Pleasure, Arousal, and Dominance, can be used to represent all emotions such as pleasant (joy and happiness) and unpleasant (fear and anger) using Pleasure, energetic(boredom and rage) using Arousal, dominant (anger) and submissive (fear) using Dominance.
2 Literature Review
Lahane and Thirugnanam [3], in their journal, demonstrated how emotion detection can be carried out with the help of the DEAP dataset using the Teager–Kaiser Energy Operator(TKEO) approach with the k-nearest neighbor (KNN), neural network(NN), and other classifiers. This study explains how using TKEO improves feature extraction and proves a better way of emotion detection as compared to other conventional methods. Li et al. [4], in their study, recognized human emotions by EEG signals in two steps; first, it integrates the spatial attributes, frequency attributes, and time attributes of the EEG signals which map these into 2-D images. Then, it builds a series of EEG-MFI sequences to show emotion variation with EEG inputs. Secondly, it deals with the formed images by constructing a hybrid deep NN along with CNN. Kalas [5] in their research paper demonstrates decision tree, SVM classifier, and linear regression model on the patterns obtained by eye blinking via EEG using the data collected by activities like vehicle driving and heavy equipment operation where conciseness plays an important role. Patel et al. [6] use neuroimaging to differentiate between depressed and non-depressed patients and propose ways for treatment. It analyzes the past methodologies and suggests ways for future research. Subhani et al. [7] in their journal use a very famous experimental paradigm Montreal Imaging Stress Task (MIST) that consists of computerized arithmetic challenges. It has three levels—rest, control, and experimental, through which they induce stress among individuals which were then detected by applying ML models—support vector machine (SVM), logistic regression and Naive Bayesian classification on EEG data. Al-Shargie et al. [8] study the effect of mental stress on the prefrontal cortex subregion of the brain to improve the accuracy of mental stress detection using EEG. The result of their studies was that mental stress is subregion specific, and for better accuracy, right ventrolateral PFC is a suitable candidate.
3 Motivation for the Proposed Approach
There has been a lot of research on stress and emotion detection using EEG [9], and separate studies have been done on stress detection using ECG. This paper aims at improving the accuracy of stress detection by making a hybrid model that predicts stress on the basis of both EEG and ECG. Furthermore, this paper refers the Russel’s Circumplex model of affect [2] which provides a promising way to classify stress.
4 Proposed Stress Detection Method (Se.Re.Ne.)
In this paper, an ensemble method to detect stress using EEG and ECG signals (Se.Re.Ne.) has been proposed. Se.Re.Ne. works in four phases—data gathering, data analysis, stress classification, and statistical analysis. Figure 2 represents the block diagram of this work.
4.1 Data Gathering
Dataset used in Se.Re.Ne. is DREAMER [10] dataset which is made from EEG and ECG signals recorded during audio and visual stimuli used to entice specific emotions. Signals from 23 individuals were documented with their self-evaluation scores in the category of Valence, Arousal and Dominance [11] for each of the 18 clips shown. For EEG signals, theta, alpha, and beta power spectral density (PSD) for each electrode [12] was taken. For preprocessing, the dataset was stored in a ‘.mat’ format which had to be converted to a suitable format of ‘.csv’ for evaluation, and the emotional features from the dataset, namely Valence and Arousal, were used to classify stress using the Russell’s Circumplex model of affect which uses a 2D plane to classify various emotions on the basis of Valence and Arousal. Stress is described at the top-left quadrant of Russell’s plane with Valence represented at X-axis and Arousal represented at Y-axis. So, values of Valence and Arousal are taken as 2 and 4, respectively (on a scale of 5), and stress classification is done according to the conditions shown in Fig. 3.
After applying the proposed stress detection method, the data were divided into two classes—stressed (7979 data points or values) and not stressed (32,017 data points or values).
Due to this uneven distribution, upsampling of data was required to make the dataset even for both classes. Figure 4 shows the data points for target attribute before and after the sampling.
4.2 Feature Extraction for Se.Re.Ne.
Feature extraction is done by using the correlation method in this paper, and results of which are represented in Table 1. It was observed that variation in age did not correlate with change in the stress class. Also, out of two ECG channels and 14 channels of EEG signals which were considered for this paper positions of which are shown in Fig. 5, EEG_7, EEG_10, and ECG_0 have a negative correlation with stress showing that these attributes are inversely related to stress. The negative correlation of Valence with stress is in alignment with our approach of lesser the value of Valence, more stressed the person will be.
The following 14 EEG channels are considered in this paper.
4.3 Stress Classification
Many algorithms for mood analysis have been proposed, but to date, to the best of our knowledge, none of the algorithms has been used to detect stress. In this paper, we use two methods to detect stress.
The first method uses KNN [13], a lazy and non-parametric algorithm that is required for nonlinear EEG data. The value of k was taken as ‘7’ for stress classification by hit and trial.
The second method uses DT, a white box type statistical algorithm used for classification. It is a non-parametric algorithm and does not rely upon the probability distribution theory. Attribute selection is done on the basis of measures such as the Gini index.
where pi is the probability that a tuple in G belongs to Class Ci and is estimated by |Ci, G|/|G|.
For each attribute, the possible binary split is considered on the basis of the maximum Gini index which will be there after splitting. A part of the decision tree of height 2 is shown in Fig. 6.
4.4 Results Using the Proposed Method
Statistical analysis of the proposed stress classification method (Se.Re.Ne.) is conducted to get the results as in Table 2.
The ROC curve shown in Fig. 7 also helps to identify better algorithms [14] on the basis of the area under the curve (AUC). The area under the curve tests separation of data into two class labels. The more the area, preferable the result and better the algorithm. So, this plot helps us to identify DT as a better algorithm as compared to KNN which is also proved by the statistical results in Table 2.
5 Conclusion
In this paper, Se.Re.Ne., an ensemble method to detect stress using EEG and ECG signals, has been proposed. The proposed method works in four phases of data gathering, data analysis stress classification, and finally statistical analysis. Se.Re.Ne. records both audio and video signals to entice emotions along with self-evaluation scores. The correlation method is used to observe the variation in signals. Se.Re.Ne. stress classification is done using two methods KNN and decision trees. Results obtained through statistical analysis show that Se.Re.Ne. using KNN detects stress with a precision of 0.87, recall of 0.71, f1-score 0.78, and total accuracy of 68%, whereas Se.Re.Ne. using decision tree detects stress with a precision of 0.85, recall of 0.84, f1-score 0.84, and total accuracy of 75%. Hence, evaluation proves that extreme stress conditions Se.Re.Ne. detects using EEG and ECG signals with decision tree better than KNN, whereas normal stress condition Se.Re.Ne. detects using EEG and ECG signals with KNN better than decision tree.
Abbreviations
- AUC:
-
Area Under the Curve
- CNN:
-
Convolutional Neural Network
- DT:
-
Decision Tree
- EEG:
-
Electroencephalography
- ECG:
-
Electrocardiography
- KNN:
-
K Nearest Neighbours
- MFI:
-
Multidimensional Feature Image
- MIST:
-
Montreal Imaging Stress Task
- ML:
-
Machine Learning
- NN:
-
Neural Network
- PSD:
-
Power Spectral Density
- PAD:
-
Pleasure, Arousal and Dominance
- PFC:
-
Prefrontal Cortex
- ROC:
-
Receiver Operating Characteristic
- SVM:
-
Support Vector Machines
- TKEO:
-
Teager–Kaiser energy operator
References
Goel S, Kaur G, Tomar P (2017) A novel technique for stress recognition using ECG signal pattern. Current Pediatr Res 21(4)
Russell JA (1980) A circumplex model of affect. J Pers Soc Psychol 39(6):1161
Lahane PU, Thirugnanam M (2019) Human emotion detection and stress analysis using EEG signal
Li Y, Huang J, Zhou H, Zhong N (2017) Human emotion recognition with electroencephalographic multidimensional features by hybrid deep neural networks. Appl Sci 7(10):1060
Kalas MS, Momin BF (2018) Modelling EEG dataset for stress state recognition using decision tree approach, pp 82–88
Patel MJ, Khalaf A, Aizenstein HJ (2016) Studying depression using imaging and machine learning methods. NeuroImage Clin 10:115–123
Subhani AR, Mumtaz W, Saad MNBM, Kamel N, Malik AS (2017) Machine learning framework for the detection of mental stress at multiple levels. IEEE Access 5:13545–13556
Al-Shargie F, Tang TB, Kiguchi M (2017) Assessment of mental stress effects on prefrontal cortical activities using canonical correlation analysis: an fNIRS-EEG study. Biomed Opt Express 8(5):2583–2598
Liu Y, Sourina O (2013, Oct) EEG databases for emotion recognition. In: 2013 international conference on cyberworlds. IEEE, pp 302–309
Katsigiannis S, Ramzan N (2017) DREAMER: A database for emotion recognition through EEG and ECG signals from wireless low-cost off-the-shelf devices. IEEE J Biomed Health Info In press. https://doi.org/10.1109/JBHI.2017.2688239
Reuderink B, Mühl C, Poel M (2013) Valence, arousal and dominance in the EEG during game play. Int J Autonom Adapt Commun Syst 6(1):45–62
So WK, Wong SW, Mak JN, Chan RH (2017) An evaluation of mental workload with frontal EEG. PloS One 12(4)
Li M, Xu H, Liu X, Lu S (2018) Emotion recognition from multichannel EEG signals using K-nearest neighbor classification. Technol Health Care 26(S1):509–519
Faraz S, Ali SSA, Adil SH (2018, Dec) Machine learning and stress assessment: a review. In: 2018 3rd international conference on emerging trends in engineering, sciences and technology (ICEEST). IEEE, pp 1–4
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.
About this paper
Cite this paper
Virmani, D., Minocha, A., Goyal, L., Malhotra, M., Gupta, M. (2021). Se.Re.Ne.: Stress Detection Using EEG and ECG. In: Abraham, A., Castillo, O., Virmani, D. (eds) Proceedings of 3rd International Conference on Computing Informatics and Networks. Lecture Notes in Networks and Systems, vol 167. Springer, Singapore. https://doi.org/10.1007/978-981-15-9712-1_16
Download citation
DOI: https://doi.org/10.1007/978-981-15-9712-1_16
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-15-9711-4
Online ISBN: 978-981-15-9712-1
eBook Packages: EngineeringEngineering (R0)