Next Article in Journal
Smart PZT-Embedded Sensors for Impedance Monitoring in Prestressed Concrete Anchorage
Previous Article in Journal
Hybrid FSK-PSK Waveform Optimization for Radar Based on Alternating Direction Method of Multiplier (ADMM)
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Mental Stress Classification Based on a Support Vector Machine and Naive Bayes Using Electrocardiogram Signals

AI Healthcare Research Center, Department of IT Fusion Technology, Chosun University, Gwangju 61452, Korea
*
Authors to whom correspondence should be addressed.
Sensors 2021, 21(23), 7916; https://doi.org/10.3390/s21237916
Submission received: 26 October 2021 / Revised: 19 November 2021 / Accepted: 25 November 2021 / Published: 27 November 2021
(This article belongs to the Section Biosensors)

Abstract

:
Examining mental health is crucial for preventing mental illnesses such as depression. This study presents a method for classifying electrocardiogram (ECG) data into four emotional states according to the stress levels using one-against-all and naive Bayes algorithms of a support vector machine. The stress classification criteria were determined by calculating the average values of the R-S peak, R-R interval, and Q-T interval of the ECG data to improve the stress classification accuracy. For the performance evaluation of the stress classification model, confusion matrix, receiver operating characteristic (ROC) curve, and minimum classification error were used. The average accuracy of the stress classification was 97.6%. The proposed model improved the accuracy by 8.7% compared to the previous stress classification algorithm. Quantifying the stress signals experienced by people can facilitate a more effective management of their mental state.

1. Introduction

Recently, mental illnesses such as stress have emerged as social problems in modern society. Stress refers to the physical and mental responses of a body to physical, emotional, or mental factors [1]. Mental stress is a type of stress caused by the emotional state of a person. Since excessive mental stress can cause chronic diseases such as headaches, high blood pressure, and skin diseases, their prevention and prompt treatment are essential [2,3].
Stress assessment determines the level of stress of an individual using a questionnaire [4]. However, this method cannot determine the exact state of the stress owing to individual deviations. In addition, the reliability of stress assessment is low, as people might be reluctant to provide honest answers to certain questions. To accurately determine the stress state, several studies have been conducted to measure the stress signal using a bio-signal and determine the stress state using machine learning.
Huang et al. [5] used regression analysis to diagnose early-stage lung adenocarcinoma. After extracting serum from healthy control groups and lung cancer patients, the blood volume was calculated using a spectrogram. Lung adenocarcinoma was diagnosed by analyzing the blood. In addition, as a result of calculating the area under the curve (AUC) value of the receiver operating characteristic (ROC) curve to evaluate the classification performance of regression analysis, the classification accuracy was up to 92.6%.
Rongxin et al. [6] used regression analysis to diagnose schizophrenia. Urine and serum samples were obtained from healthy controls and patients with schizophrenia. Subsequently, urine and serum patterns were analyzed using regression analysis. Furthermore, as a result of calculating the AUC value of the ROC curve to evaluate the classification performance of regression analysis, the classification accuracy improved to 96.5%.
Biological processes generate bio-signals inside a living body and electroencephalogram (EEG), electromyogram (EMG), electrocardiogram (ECG), electrodermal activity (EDA), and respiratory signals [7,8] are a few representative examples. However, stress measurement methods that utilize bio-signals have difficulty in extracting accurate feature points owing to the varying signal size and the presence of excessive noise depending on the location of the electrode.
In a previous study, Subhani et al. [9] classified EEG signals using logistic regression (LR), a support vector machine (SVM), and naive Bayes (NB) to obtain an accuracy of 94.6%. Existing studies used a dataset that measured EEG signals from 42 subjects, comprising 11 females and 31 males, aged 19–25 years. The Mental Arithmetic Task (MAT) method was used to induce stress. MAT is used to calculate an arithmetic problem using four operators after randomly designating three numbers. The experiment was conducted by attaching 128 electrodes between the EEG cap and scalp. First, MAT was calculated for 1 h, and then the EEG signal was measured. Subsequently, the stress signal was analyzed by measuring the EEG signal during a resting state of 1 h. However, because of the large number of channels, the analysis of the stress signal is time-consuming, and the measurement technique is very complicated.
Prasanthi et al. [10] classified EMG, galvanic skin response (GSR), and respiratory signals using SVM and K-nearest neighbors (KNN) to obtain an accuracy of 93.65%. However, in this study, the accurate classification of stress signals was difficult because of the presence of excessive noise in each bio-signal and a low number of parameters.
Stress classification by signal analysis is very complicated because stress measurement methods using EEG or EMG signals contain a lot of signal noise and require a large number of channels in the measurement system. In particular, the cost of the system is very expensive to measure the EEG, and accurate measurements of the stress signal are difficult because the EMG has different amplitudes and high noise for the same motion. Electrocardiography is the most common and convenient way to non-invasively check the heart condition using electrical signals. In addition, the ECG signal has elements with various characteristic points depending on the shape of a specific signal. The activation state of the sympathetic and parasympathetic nerves of the autonomic nervous system can be identified using ECG signals.
In the studies of David and Karthikeyan et al. [11,12], ECG signals were converted into a heart rate variability (HRV) signal and classified using SVM, NB, and KNN. This method had accuracies of up to 88% and 96.41%. However, this method cannot accurately detect the R peak values, and the standard deviation of the R-R interval cannot be calculated because of the excessive noise in the HRV signals. Furthermore, it is difficult to determine accurate stress conditions with extraction feature point methods using the R-R interval.
Ishaque et al. [13] classified ECG, GSR, and respiratory signals using linear discriminant analysis (LDA), decision tree (DT), SVM, and NB. The detection accuracy of this method was 85%. However, the low standard deviation for the R-R interval extracted from the time domain and LF/HF ratio extracted from the frequency domain made it difficult to confirm the stress state.
Jeroh et al. [14] classified ECG and GSR signals using LDA and SVM, and the highest accuracy obtained by this method was 92%. However, the small distance between the classes made it difficult to classify the stress signal. Markova and Radhika et al. [15,16] classified ECG and EDA signals using SVM and convolutional neural networks (CNN), obtaining accuracies of 88.9% and 71.8%, respectively. In this study, the R-R interval was extracted from the ECG signal and classified into two levels (high-arousal negative valence and low-arousal positive valence) using SVM and CNN. However, it was difficult to determine various emotional states because the classification process and criteria for stress signals using SVM and CNN are unclear.
Therefore, to compensate for these shortcomings, an algorithm was proposed in this study to ensure the accurate classification of stress signals using an ensemble model combining SVM and NB. The R-S peak, R-R interval, and Q-T intervals were extracted from the ECG signal, and the criteria for classifying the stress signal were established using these signals. Subsequently, the stress signal was classified using an ensemble model combining one-against-all (OAA), one of the NB and SVM methods. The stress classification performance was evaluated using the confusion matrix, ROC curve, and MCE. An accuracy of 97% was obtained by analyzing the cognitive load effect and stress (CLAS) database.

2. Materials and Methods

2.1. Subject

Figure 1 shows the classification procedure of the ECG data using a stress classification model that combines SVM and NB. In this study, the CLAS database was used to analyze HRV according to the emotional state of the test subject [17]. A Butterworth low-pass filter was used to remove noise from the ECG signal. After detecting the Q, R, S, and T peaks of the ECG signal using the threshold values, the average values of the R-S peak, R-R interval, and Q-T intervals were calculated. Then, the average values of these quantities were applied to the SVM-NB algorithm to classify the stress signal. Finally, the stress classification performance used the confusion matrix, ROC curve, and minimum classification error. The dataset consisted of 31 ECG data in four categories (Picture Test, Music Video, Stroop Test, and Math Test). Stress levels 1 and 2 indicate calmness and excitement, respectively, and the signals measured in the picture test and music video environments in the four emotional states are included. Stress levels 3 and 4 are boredom and stressed, and include the Stroop Test and Math Test in four emotional states. Therefore, stress levels 1 and 2 correspond to conditions without stress, whereas stress levels 3 and 4 indicate stress.

2.2. Preprocessing and Feature Extraction

The ECG signal is widely used owing to its simple measurement technique. When measuring an ECG, noise is generated by various factors. Noise originating from various causes hinders the extraction of feature points for analyzing signals and greatly reduces accuracy [18]. A low-pass filter, such as the Butterworth low-pass filter or Chebyshev low-pass filter, is used to solve this problem.
However, since the Chebyshev Low Pass Filter has more ripples in the pass band than the Butterworth low pass filter, noise may occur owing to signal distortion. The Butterworth low-pass filter is a flat filter that does not generate ripples in the passing band and attenuates the high-frequency band. Therefore, it is possible to increase the accuracy of stress classification by outputting ECG signals more clearly than using other filters.
Equation (1) represents the design process of the Butterworth low-pass filter, where | H   B   ( jw ) | , k, ε , ω , and n represent the size of the low-pass filter, scalar variable, transition band, low band, and order, respectively:
| H B ( jw ) | = K 1 + ϵ 2 ω 2 n n = 1 ,   2 ,   3 ,
Figure 2 shows the ECG signal with the noise removed using the Butterworth low-pass filter. Noise was reduced by setting the sampling frequency of the ECG signal to 330 Hz and the cutoff frequency to 120 Hz.
Figure 3 shows the ECG signals measured under and without stress. The blue and red curves represent signals measured in the presence and absence of stress, respectively. In the presence of stress, the heart beats irregularly and rapidly, the R-R interval of the ECG signal is narrowed, and the R-S peak is increased. On the other hand, in the absence of stress, the heart beats stably, the R-R interval of the ECG signal is widened, and the R-S peak decreases. The average R-S peaks were 0.95 mV and 1.23 mV in the absence and presence of stress, respectively. The heart rate is closely related to stress [19]. When stressed, the sympathetic nervous system of the autonomic nervous system is activated. The sympathetic nervous system indicates whether a person is excited or tense and enables the determination of the stress the subject is under. For example, negative emotions such as anger or fear activate the sympathetic nervous system and increase the heart rate. On the other hand, positive emotions such as happiness or joy activate the parasympathetic nervous system which responds to psychological stability.
Under stress, the heart rate increases and the R-S and Q-T peaks increase. Conversely, without stress, the heart rate stabilizes and the R-S and Q-T peaks become smaller [20].
To clearly set the stress classification criteria, the characteristic points of the R-S peak, R-R interval, and Q-T interval were extracted, as shown in Table 1 andTable 2 in the manuscript. First, the average value of the R-S peak was calculated, and then the stress classification criteria were presented [21]. Subsequently, the average values of the R-R and Q-T intervals were calculated, and the stress classification criteria were presented [22,23]. The stress classification criteria were assigned after calculating the average values of R-S peak, R-R interval, and Q-T interval using Equations (2)–(5). Equation (2) represents the process of calculating the R-S peak value, where X, I, and N represent the R-S peak value, first dataset, and last ECG data, respectively:
i = 1 N X i N ,   X = ( R peak     S peak )
Equation (3) represents the process for calculating the R-R interval, where Y represents the RR interval:
i = 1 N Y i N ,   Y = 60 HR
Equation (4) represents the process for calculating the Q-T interval, where Z represents the Q-T interval value:
i = 1 N Z I N ,   z = QT RR
Equation (5) represents the process of calculating an average value using the R-S peak, R-R interval, and Q-T interval obtained in Equations (2)–(4):
j 1 N ( X j + X j + 1 + + X N ) N ,   j 1 N ( Y j + Y j + 1 + + Y N ) N ,   j 1 N ( Z j + Z j + 1 + + Z N ) N

3. Training Model

3.1. Support Vector Machine (SVM)

SVM is a classification method that uses optimal decision boundaries to classify nonlinear data in various dimensions [24,25]. As shown in Figure 4, the stress classification model using the existing SVM by the CLAS database analysis uses the sequential minimal optimization (SMO) algorithm. The green line represents the decision boundary between the two classes. The red line represents the boundary line of the support vector according to the positive value. The blue line represents the boundary line of the support vector according to the negative class. SMO was used to perform binary classification of the training data [26]. However, the parameter value should be adjusted to determine the decision boundary between the two sets of data in the presence of enormous amounts of data. In addition, owing to the excessive computation and complexity in adjusting the parameter values, overfitting occurs, leading to poor classification accuracy for several classes.
To address these problems, classification was performed applying the OAA technique to the SVM [27]. The OAA technique was used to classify multiple classes. Given K classes, the label of data in class i is set to +1, the label of data in the remaining classes is set to −1, and binary classification is performed by the number of classes. Figure 5 represents the classification process of ECG data for the four emotional states using the OAA technique of SVM. The picture test corresponds to a signal measured by showing various landscape photos, while the music video corresponds to ECG data measuring the emotional state after listening to classical music. The Stroop Test was measured in the process of solving various color-matching quizzes, and the math test is the measured data after calculating arithmetic operations.
The data for the R-S peak, R-R interval, and Q-T interval were classified according to stress levels after determining the margin for the decision boundary between the classes of the four emotional states using Equations (6) and (7), where c represents the number of classes, X represents a decision boundary, W represents a vector perpendicular to the decision boundary, B represents a bias, and Min represents the margin:
W · X c   + B =   ± 1 , c = 1 N
Min 1 2   W 2

3.2. Naive Bayes

NB is a conditional probability-based statistical classification method that calculates the feature probability of data belonging to each class [28]. Naïve means that all variables are equal, and Bayes means the probability that a variable belongs to a specific class. NB calculates the probability that the variable belongs to a specific class using Equation (8), which represents a data classification method using Bayes theorem [29], where P(A) represents the probability determined before the result appears and p ( B | A ) represents the probability that B occurs under the condition that A occurs:
p ( B | A ) = p ( A , B ) / P ( A ) ,   p ( A , B ) = p ( B | A ) P ( A )
Figure 6 shows the classification process of ECG data for four emotional states using contours according to NB.

3.3. Support Vector Machine and Naive Bayes

The graph in Figure 7 represents the stress classification process according to the four emotional states using a stress classification model that combines SVM and NB. Using the OAA technique of SVM, labels are assigned to the class corresponding to each state, and the ECG data range is indicated using the decision boundary point. Subsequently, the probability that the parameter belongs to the corresponding class is calculated using the contour line according to the NB theorem.

3.4. K-Fold Cross-Validation

Figure 8 shows the cross-validation process used to evaluate the performance of the SVM-NB model. K-fold cross-validation divides the data into k groups, extracts one of the groups, uses it as a test set, and uses the remaining K-1 groups as a training set. Repeated K times, each test yields one classification accuracy and then an average K to obtain the final performance of the classification [30].
As shown in Figure 9, the performance of the stress classification model combining SVM and NB was demonstrated using 10-fold cross-validation. Owing to the classification, overfitting can be prevented by achieving accuracies of 98.9%, 98.7%, and 98.4% using 7-fold cross-validation.

4. Experimental Results

Table 3 presents the values of average accuracy, average precision, and average recall of the stress classification model combining SVM and NB using Equations (9)–(11) [31,32]. Equation (9) is used to determine the accuracy, which is the probability of accurately classifying the four emotional states, where Total Dataset represents the total amount of data in the CLAS database. The average accuracy according to the R-S peak, R-R interval, and Q-T interval was 97.6% using a stress classification model that combines SVM and NB.
Accuracy = TP Total   Dataset
Equation (10) was used to determine the precision. For example, the precision is the probability that the algorithm is accurately classified as a Picture Test during the Picture Test. After calculating the precision for the four emotional states using a similar method, the average precision was determined. Our model achieved a maximum accuracy of 98.2% and a minimum accuracy of 96.7%.
Precision = TP TP + FP
Equation (11) was used to calculate the recall. Among the data predicted by the Picture Test, the recall is the probability that the algorithm is accurately classified as a Picture Test. After calculating the recall for the four emotional states in a similar manner, the average recall is shown. Using a stress classification model that combines SVM and NB, the average recall according to the R-S peak, R-R interval, and Q-T interval was 97.4%.
Recall = TP TP + FN
Figure 10 shows the performance of a stress classification model that combines SVM and NB using a confusion matrix [33]. The green squares indicate true positives. The blue rectangle results from the correct classification of data by the designed classifier. The red squares indicate false positives. The purple rectangle results when the designed classifier incorrectly classifies music video-related data as Stroop Test data. Therefore, it indicates that the data related to the Math Test and the Picture Test were classified more correctly than the data related to the Stroop Test and Music video.
Existing research results for classifying stress using SVM achieved an accuracy of 88.9%. On the other hand, the average accuracy of the stress classifier proposed in this study was 96.3%. In addition, the performance of the stress classification model was evaluated by combining the NB model with the SVM. The average accuracy of the stress classification model combining SVM and NB was 97.6%. These results demonstrate that the accuracy improved by 8.7% compared to that of the existing stress classification model using the CLAS dataset. Additionally, stress classification using four levels classifies emotional status more accurately compared to that using two levels.
Figure 11 shows the ROC curve according to the R-S peak, R-R interval, and Q-T interval of the four emotional states using a stress classification model that combines SVM and NB. ROC curve analysis is a curve drawn with the Y-axis as the true positive rate and the X-axis as the false positive rate of the tested values [34]. The performance of the stress classification model was evaluated using the AUC in the graph of the ROC curve.
Table 4 compares the performance with the existing stress classification model using the AUC value of the ROC curve. The average AUC according to the stress classification model combining SVM and NB was 97.9%. The AUC of the best stress classification model using the existing ROC curve was 87%. Therefore, the AUC of the ROC curve improved by up to 10.9% compared to that of the conventional stress classification model [35]. In addition, models that combined SVM and NB had 1.1% and 2.5% higher AUC values than those of the SVM and NB models, respectively.
Figure 12 shows the MCE and elapsed time according to the R-S peak, R-R interval, and Q-T interval of the stress classification model combining SVM and NB [38]. MCE is a method of minimizing classification errors that occur while attempting to classify new datasets. This method defines the discriminant function G k ( ; ) using log likelihood. The log likelihood refers to a method of extracting parameters from a set of data while the discriminant function refers to a function that determines the category of a parameter [39]. The classification error function D k ( X k ;   θ ) is defined by applying g k ( X k ;   θ ) , which is the log likelihood of the feature vector X k , to the model parameter θ to Equation (12):
D k ( X k ;   θ ) = G k ( X k ;   θ )     g k ( X k ;   θ )
If D k ( X k ;   θ ) is positive, it indicates that the discriminant function G k   ( ; ) is largely reflected. G k ( ; ) indicates that a classification error has occurred because it is a log likelihood using the remaining classes except for the corresponding class k. Conversely, a negative value of D k ( X k ;   θ ) indicates that classification errors have not occurred by reflecting a larger log likelihood g k ( X k ;   θ ) for the corresponding class. Therefore, the classification model performs better if the value of D k ( X k ;   θ ) is small for the given data.
Table 5 compares the performance with the existing stress classification model using the MCE and elapsed time values. The average MCE of the stress classification model combining the SVM and NB was 0.054%. In comparison with the MCE of the stress classification models of SVM and NB, the MCE decreased by 0.012% and 0.026%, respectively, indicating that its performance improved by 0.068% compared with that of the conventional stress classification model [34]. The stress classification model combining the SVM and NB improved the elapsed time by having the lowest MCE compared to the previous study. Hence, the proposed model can judge determine stress faster and more accurately than the existing classifier.
In this study, the p-value was calculated, as shown in Table 6, to improve the performance of the SVM-NB stress classification model. The p-value evaluates the significance of an experimentally obtained value. For example, the p-value of SVM-NB was 0.032%, and the average stress classification accuracy was 96.7%. If the stress classification accuracy is measured by adding the ECG dataset or improving the algorithm of SVM-NB, the probability that it will decrease to less than 96.7% can be assumed to be 0.032%. A lower p-value indicates a better stress classification performance.

5. Discussion

In this study, four stress classification processes of emotional states according to stress levels were presented using an ensemble model that combines SVM and NB. The stress signals under stress and without stress were analyzed by extracting the Q, R, S, and T peak values of the ECG signals for four emotional states using threshold values. In addition, after calculating the average values of R-S peak, R-R interval, and Q-T interval, the stress level classification criteria according to the four emotional states were established to improve the accuracy of the stress classification model. Subsequently, the performance of the stress classification model was evaluated using the confusion matrix, ROC curve, and MCE. The stress classification model combining SVM and NB exhibited an average accuracy of 97.6%, average precision of 97.5%, and average recall of 97.4%. The accuracy of the stress classification model combining the proposed SVM and NB was 97.6%, which was 8.7% higher than that of the existing model. The stress classification model that combines SVM and NB evaluated the MCE to obtain an optimal data classification performance, yielding an average MCE of 0.054%. In comparison with the stress classification models of SVM and NB, the MCE decreased by 0.012% and 0.026% on average, and MCE decreased by 0.068% compared with that of the existing stress classification models. In addition, ROC curves according to R-S peak, R-R interval, and Q-T interval of the four emotional states were evaluated using a stress classification model that combines SVM and NB. Hence, it was observed that the stress classification performance using four levels is superior to that using two levels, and enables the identification of stress levels and states according to various emotional states.

6. Conclusions

In this study, an ensemble model combining SVM and NB was used to classify ECG data into four emotional states according to the stress levels. To confirm the four stress states according to the stress level, the stress classification accuracy was improved by calculating the average values of R-S peak, R-R interval, and Q-T interval after extracting the Q, R, S, and T peak values of the ECG signals. The accuracy of the proposed stress classification model combining SVM and NB was 97.6%. These results showed an 8.7% improvement in accuracy compared to that of the existing stress classification model. The stress classification model can be applied to ECG and pulse diagnosis medical devices or U-health devices may help to prevent various health conditions such as headaches, high blood pressure, and myocardial infarction by easily examining the stress conditions. Additionally, it can be applied in the development of a remote medical system that can diagnose the health of a patient in real time using the classified ECG data.

Author Contributions

M.K. contributed diligently to this work in conceptualization, methodology, and writing the manuscript; S.S. developed the algorithm and analyzed the data; G.Z. contributed to experiments related to stress classification using ECG signals; J.J. and Y.T.K. supervised the writing of the article, gave suggestions, and analyzed the data for the research. All of the authors wrote and critically revised the paper. All authors have read and agreed to the published version of the manuscript.

Funding

This research was supported by the Healthcare AI Convergence R&D Program through the National IT Industry Promotion Agency of Korea (NIPA) funded by the Ministry of Science and ICT (No. S1601-20-1041) and the Basic Science Research Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Education (No. 2018R1A6A1A03015496).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data are available at: https://www.sensornetworkslab.com/database/CLASdataset (accessed on 31 August 2021).

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. O’Connor, D.B.; Thayer, J.F.; Vedhara, K. Stress and health: A review of psychobiological processes. Annu. Rev. Psychol. 2021, 72, 663–688. [Google Scholar] [CrossRef] [PubMed]
  2. Chauvet-Gelinier, J.-C.; Bonin, B. Stress, anxiety and depression in heart disease patients: A major challenge for cardiac rehabilitation. Ann. Phys. Rehabil. Med. 2017, 60, 6–12. [Google Scholar] [CrossRef]
  3. De Hert, M.; Detraux, J.; Vancampfort, D. The intriguing relationship between coronary heart disease and mental disorders. Dialogues Clin. Neurosci. 2018, 20, 31–40. [Google Scholar]
  4. Knol, L.L.; Brantley, C. Weight Status and Emotion-and Stress-Related Eating: Testing Constructs of the Transactional Model of Stress and Coping. Am. J. Health Educ. 2021, 52, 117–126. [Google Scholar] [CrossRef]
  5. Huang, L.; Wang, L.; Hu, X.; Chen, S.; Tao, Y.; Su, H.; Yang, J.; Xu, W.; Vedarethinam, V.; Wu, S.; et al. Machine learning of serum metabolic patterns encodes early-stage lung adenocarcinoma. Nat. Commun. 2020, 11, 1–11. [Google Scholar] [CrossRef] [PubMed]
  6. Li, R.; Zhou, Y.; Liu, C.; Pei, C.; Shu, W.; Zhang, C.; Liu, L.; Zhou, L.; Wan, J. Design of multi-shelled hollow Cr2O3 spheres for metabolic fingerprinting. Angew. Chem. 2021, 133, 12612–12620. [Google Scholar] [CrossRef]
  7. Jebelli, H.; Hwang, S.; Lee, S. EEG-based workers’ stress recognition at construction sites. Autom. Constr. 2018, 93, 315–324. [Google Scholar] [CrossRef]
  8. Orguc, S.; Khurana, H.S.; Stankovic, K.M.; Leel, H.S.; Chandrakasan, A.P. EMG-based real time facial gesture recognition for stress monitoring. In Proceedings of the 2018 40th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Honolulu, HI, USA, 18–21 July 2018; IEEE: New York, NY, USA, 2018; Volume 257, pp. 2651–2654. [Google Scholar]
  9. Subhani, A.R.; Mumtaz, W.; Saad, M.N.B.M.; Kamel, N.; Malik, A.S. Machine learning framework for the detection of mental stress at multiple levels. IEEE Access 2017, 5, 13545–13556. [Google Scholar] [CrossRef]
  10. Prasanthi, T.L. Machine Learning-based Signal Processing by Physiological Signals Detection of Stress. Turk. J. Comput. Math. Educ. 2021, 11, 4831–4840. [Google Scholar]
  11. Liu, D.; Ulrich, M. Listen to your heart: Stress prediction using consumer heart rate sensors. Final. Proj. Standford CS 229 Mach. Learn. 2014, 229–233. [Google Scholar]
  12. Karthikeyan, P.; Murugappan, M.; Yaacob, S. ECG signals based mental stress assessment using wavelet transform. In Proceedings of the 2011 IEEE International Conference on Control System, Computing and Engineering, Penang, Malaysia, 25–27 November 2011; pp. 258–262. [Google Scholar]
  13. Ishaque, S. Physiological Signal Analysis and Classification of Stress from Virtual Reality Video Game. In Proceedings of the 2020 42nd Annual International Conference of the IEEE Engineering in Medicine & Biology Society, Montreal, QC, Canada, 20–24 July 2020; IEEE: New York, NY, USA, 2020; pp. 867–870. [Google Scholar]
  14. Jeroh, O.E.; Powers, L.S.; Roveda, J.M. Determination of stress in humans using data fusion of off-the-shelf wearable sensors data for electrocardiogram and galvanic skin response. J. Biomed. Sci. 2018, 7, 11–14. [Google Scholar] [CrossRef]
  15. Valentina, M.; Ganchev, T.; Kalinkov, K. Clas: A database for cognitive load, affect and stress recognition. In Proceedings of the 2019 International Conference on Biomedical Innovations and Applications, Varna, Bulgaria, 8–9 November 2019; IEEE: New York, NY, USA, 2019; pp. 1–4. [Google Scholar]
  16. Radhika, K.; Oruganti, V.R.M. Deep Multimodal Fusion for Subject-Independent Stress Detection. In Proceedings of the 2021 11th International Conference on Cloud Computing, Data Science & Engineering, Noida, India, 28–29 January 2021; IEEE: New York, NY, USA, 2021; pp. 105–109. [Google Scholar]
  17. Veselin, A.; Sivkov, Y.; Velikov, N. An approach of Feature extraction of ECG signal of CLAS database. In Proceedings of the 2020 International Conference on Biomedical Innovations and Applications, Varna, Bulgaria, 24–27 September 2020; IEEE: New York, NY, USA, 2021; pp. 93–96. [Google Scholar]
  18. Seok-Joo, Y.; Kim, G.-J. Personal Biometric Identification based on ECG Features. J. Korea Inst. Electron. Commun. Sci. 2015, 4, 521–526. [Google Scholar]
  19. Ravaja, N. Contributions of psychophysiology to media research: Review and recommendations. Media Psychol. 2004, 6, 193–235. [Google Scholar] [CrossRef]
  20. Dori, G.R.; Bitterman, H. ECG variability contour—A reference for evaluating the significance of amplitude ECG changes in two states. Physiol. Meas. 2008, 29, 989–997. [Google Scholar] [CrossRef] [PubMed]
  21. Gamal El Din Fathy, A. Respiratory Information Extraction from Electrocardiogram Signals. Master’s Thesis, King Abdullah University of Science and Technology, Thuwal, Kingdom of Saudi Arabia, December 2010. [Google Scholar]
  22. Zheng, B.S.; Murugappan, M.; Yaacob, S. FCM clustering of emotional stress using ECG features. In Proceedings of the 2013 International Conference on Communication and Signal Processing, Melmaruvathur, India, 3–5 April 2013; IEEE: New York, NY, USA, 2013; pp. 305–309. [Google Scholar]
  23. Karmakar, C.; Imam, M.H.; Khandoker, A.; Palaniswami, M. Influence of psychological stress on QT interval. In Proceedings of the Computing in Cardiology 2014, Cambridge, MA, USA, 7–10 September 2014; IEEE: New York, NY, USA, 2014; pp. 1009–1012. [Google Scholar]
  24. Manikandan, J.; Venkataramani, B. Design of a modified one-against-all SVM classifier. In Proceedings of the 2009 IEEE International Conference on Systems, Man and Cybernetics, San Antonio, TX, USA, 11–14 October 2009; IEEE: New York, NY, USA, 2009; pp. 1869–1874. [Google Scholar]
  25. Belousov, A.I.; Verzakov, S.A.; von Frese, J. A flexible classification approach with optimal generalisation performance: Support vector machines. Chemom. Intell. Lab. Syst. 2002, 1, 15–25. [Google Scholar] [CrossRef]
  26. Changki, L.; Jang, M.-G. Fast Training of Structured SVM Using Fixed-Threshold Sequential Minimal Optimization. ETRI J. 2009, 2, 121–128. [Google Scholar]
  27. Duan, Y. OAA-SVM-MS: A fast and efficient multi-class classification algorithm. Neurocomputing 2021, 454, 448–460. [Google Scholar] [CrossRef]
  28. Sharma, N.; Singh, M. Modifying Naive Bayes classifier for multinomial text classification. In Proceedings of the 2nd International Conference on Recent Advances and Innovations in Engineering (ICRAIE), Jaipur, India, 23–25 December 2016. [Google Scholar]
  29. Purbolaksono, M.D.; Widiastuti, K.C.; Mubarok, M.S.; Adiwijaya; Ma’Ruf, F.A. Implementation of mutual information and bayes theorem for classification microarray data. J. Phys. Conf. Ser. 2018, 1, 971. [Google Scholar] [CrossRef]
  30. Schneider, J.; Moore, A.W. Cross validation. In A Locally Weighted Learning Tutorial Using Vizier; Carnegie Mellon University: Pittsburgh, PA, USA, 1997; Volume 1. [Google Scholar]
  31. Ohsaki, M. Confusion-matrix-based kernel logistic regression for imbalanced data classification. Trans. Knowl. Data Eng. IEEE 2017, 29, 1806–1819. [Google Scholar] [CrossRef]
  32. Likun, X.; Malik, A.S.; Subhani, A.R. A physiological signal-based method for early mental-stress detection. Biomed. Signal Process. Control IEEE 2018, 46, 18–32. [Google Scholar]
  33. Bhanushali, S.P.; Sadasivuni, S.; Banerjee, I.; Sanyal, A. Digital Machine Learning Circuit for Real-Time Stress Detection from Wearable ECG Sensor. In Proceedings of the 2020 IEEE 63rd International Midwest Symposium on Circuits and Systems, Springfield, MA, USA, 9–12 August 2020; IEEE: New York, NY, USA, 2020; pp. 978–981. [Google Scholar]
  34. Janssens AC, J.; Martens, F.K. Reflection on modern methods: Revisiting the area under the ROC curve. Int. J. Epidemiol. 2020, 49, 1397–1403. [Google Scholar] [CrossRef] [PubMed]
  35. Zhang, P.; Li, F.; Zhao, R.; Zhou, R.; Du, L.; Zhao, Z.; Chen, X.; Fang, Z. Real-Time Psychological Stress Detection According to ECG Using Deep Learning. Appl. Sci. 2021, 9, 3838. [Google Scholar] [CrossRef]
  36. Zhang, P.; Li, F.; Zhao, R.; Zhou, R.; Du, L.; Zhao, Z.; Chen, X.; Fang, Z. Stress Classification of ECG-Derived HRV Features Extracted from Wearable Devices. Math. Comput. Sci. 2021, 21, 2873–2892. [Google Scholar]
  37. Castaldo, R.; Xu, W.; Melillo, P.; Pecchia, L.; Santamaria, L.; James, C. Detection of mental stress due to oral academic examination via ultra-short-term HRV analysis. In Proceedings of the 2016 38th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Orlando, FL, USA, 16–20 August 2016; IEEE: New York, NY, USA, 2016; pp. 3805–3808. [Google Scholar]
  38. Cruz, A.P.; Pradeep, A.; Sivasankar, K.R.; Krishnaveni, K.S. A Decision Tree Optimised SVM Model for Stress Detection using Biosignals. In Proceedings of the 2020 International Conference on Communication and Signal Processing, Chennai, India, 28–30 July 2020; IEEE: New York, NY, USA, 2020; pp. 841–845. [Google Scholar]
  39. Naeem, M.; Asghar, S. A Parameter Free BBN Discriminant Function for Optimum Model Complexity versus Goodness of Data Fitting. J. Appl. Res. Technol. 2014, 12, 734–749. [Google Scholar] [CrossRef]
Figure 1. Composition diagram of stress classification using ECG data.
Figure 1. Composition diagram of stress classification using ECG data.
Sensors 21 07916 g001
Figure 2. Filter design using a Butterworth Low Pass filter.
Figure 2. Filter design using a Butterworth Low Pass filter.
Sensors 21 07916 g002
Figure 3. Feature extraction of the ECG signal.
Figure 3. Feature extraction of the ECG signal.
Sensors 21 07916 g003
Figure 4. Stress classification using the SMO algorithm.
Figure 4. Stress classification using the SMO algorithm.
Sensors 21 07916 g004
Figure 5. Stress classification using SVM. (a) R-S peak results using SVM; (b) R-R interval results using SVM; (c) Q-T interval results using SVM.
Figure 5. Stress classification using SVM. (a) R-S peak results using SVM; (b) R-R interval results using SVM; (c) Q-T interval results using SVM.
Sensors 21 07916 g005
Figure 6. Stress classification using NB. (a) R-S peak results using NB, (b) R-R interval results using NB, and (c) Q-T interval result using NB.
Figure 6. Stress classification using NB. (a) R-S peak results using NB, (b) R-R interval results using NB, and (c) Q-T interval result using NB.
Sensors 21 07916 g006
Figure 7. Stress classification combining SVM and NB. (a) R-S peak results combining SVM and NB, (b) R-R interval result combining SVM and NB, and (c) Q-T interval result combining SVM and NB.
Figure 7. Stress classification combining SVM and NB. (a) R-S peak results combining SVM and NB, (b) R-R interval result combining SVM and NB, and (c) Q-T interval result combining SVM and NB.
Sensors 21 07916 g007
Figure 8. Stress classification using cross-validation.
Figure 8. Stress classification using cross-validation.
Sensors 21 07916 g008
Figure 9. Stress classification using 10-fold cross-validation.
Figure 9. Stress classification using 10-fold cross-validation.
Sensors 21 07916 g009
Figure 10. Stress classification performance evaluation using the confusion matrix.
Figure 10. Stress classification performance evaluation using the confusion matrix.
Sensors 21 07916 g010
Figure 11. Evaluation of the stress classification performance using the ROC curve. (a) R-S peak results using the ROC curve, (b) R-R interval result using the ROC curve, and (c) Q-T interval result using the ROC curve.
Figure 11. Evaluation of the stress classification performance using the ROC curve. (a) R-S peak results using the ROC curve, (b) R-R interval result using the ROC curve, and (c) Q-T interval result using the ROC curve.
Sensors 21 07916 g011
Figure 12. Evaluation of stress classification performance using MCE. (a) Evaluation of stress classification performance of SVM using MCE. (b) Evaluation of stress classification performance of NBs using MCE. (c) Evaluation of stress classification performance combining SVM and NB using MCE.
Figure 12. Evaluation of stress classification performance using MCE. (a) Evaluation of stress classification performance of SVM using MCE. (b) Evaluation of stress classification performance of NBs using MCE. (c) Evaluation of stress classification performance combining SVM and NB using MCE.
Sensors 21 07916 g012
Table 1. Average values of the R-S peak, R-R interval, and Q-T interval according to the four emotional states.
Table 1. Average values of the R-S peak, R-R interval, and Q-T interval according to the four emotional states.
Mean ValueR-S Peak
(mv)
R-R Interval
(s)
Q-T Interval
(s)
Method
Picture Test1.4 mv0.88 s1.38 s
Music video2.3 mv0.78 s1.24 s
Stroop Test2.9 mv0.68 s1.09 s
Math Test3.7 mv0.61 s0.9 s
Table 2. Stress classification criteria values according to four emotional states.
Table 2. Stress classification criteria values according to four emotional states.
Feature ValueStress LevelR-S Peak
(mv)
R-R Interval
(s)
Q-T interval
(s)
Method
Picture Test1–1.90–1.690.85–0.951.3–1.44
Music video2–2.91.7–2.50.76–0.8491.191–1.29
Stroop Test3–3.92.51–3.30.65–0.7590.981–1.19
Math Test4–4.93.31–40.57–0.6490.85–0.98
Table 3. Performance evaluation using a stress classification model that combines SVM and NB.
Table 3. Performance evaluation using a stress classification model that combines SVM and NB.
ModelR-S Peak (mv)R-R Interval (s)Q-T Interval (s)Mean
AC
(%)
AP
(%)
AR
(%)
AC
(%)
AP
(%)
AR
(%)
AC
(%)
AP
(%)
AR
(%)
AC
(%)
AP
(%)
AR
(%)
SVM97.69695.494.49392.896.895.494.496.394.894.2
NB96.895.794.193.592.892.295.294.893.695.294.392.3
SVM and NB98.498.298.196.896.796.797.697.597.397.697.597.4
Table 4. Comparison of the stress classification performance using the AUC value of the ROC curve.
Table 4. Comparison of the stress classification performance using the AUC value of the ROC curve.
AUC (ROC Curve)R-S Peak
(mv)
R-R Interval
(s)
Q-T Interval
(s)
Mean
AUC
(%)
SVM97.5%96.8%96.2%96.8%
NB96.2%95.1%94.9%95.4%
SVM and NB98.2%98%97.6%97.9%
CNN-LSTM
(Zhang, et al. 2021 [35])
-87%-87%
RF, SVM, MLP, KNN
(Dalmeida, et al. 2021 [36])
-(avg.) 83.25%-(avg.) 83.25%
MLP, NB, SVM
(Castaldo, et al. 2016 [37])
-(avg.) 70% (avg.) 70%
Table 5. Comparison of stress classification performance using MCE and elapsed time.
Table 5. Comparison of stress classification performance using MCE and elapsed time.
ModelMCE
(%)
Elapsed
Time (s)
MCE
(%)
Elapsed
Time (s)
MCE
(%)
Elapsed
Time (s)
MCE
(%)
Elapsed
Time (s)
SVM0.03486.260.05281.480.11478.840.06682.19
NB0.04298.650.06797.160.13396.540.08097.45
SVM and NB0.02468.890.04169.190.09761.920.05466.66
MLP, RF, GB
(Dameida, et al)
--(avg.)
0.092
---(avg.)
0.092
-
Table 6. Evaluation of the stress classification performance using the p-value.
Table 6. Evaluation of the stress classification performance using the p-value.
Stress ClassificationMean Accuracy (%)p-Value (%)
SVM96.30.094
NB95.20.065
SVM and NB97.60.032
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Kang, M.; Shin, S.; Zhang, G.; Jung, J.; Kim, Y.T. Mental Stress Classification Based on a Support Vector Machine and Naive Bayes Using Electrocardiogram Signals. Sensors 2021, 21, 7916. https://doi.org/10.3390/s21237916

AMA Style

Kang M, Shin S, Zhang G, Jung J, Kim YT. Mental Stress Classification Based on a Support Vector Machine and Naive Bayes Using Electrocardiogram Signals. Sensors. 2021; 21(23):7916. https://doi.org/10.3390/s21237916

Chicago/Turabian Style

Kang, Mingu, Siho Shin, Gengjia Zhang, Jaehyo Jung, and Youn Tae Kim. 2021. "Mental Stress Classification Based on a Support Vector Machine and Naive Bayes Using Electrocardiogram Signals" Sensors 21, no. 23: 7916. https://doi.org/10.3390/s21237916

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop