Detection of Human Stress Using Optimized Feature Selection and Classi ﬁ cation in ECG Signals

An autonomic nervous system (ANS) of humans is majorly affected by psychological stress. The changes in ANS may cause several chronic diseases in humans. The electrocardiogram (ECG) signal is used to observe the variation in ANS. Numerous techniques are presented for an ECG stress signal handling feature extraction and classi ﬁ cation. This work managed a heart rate variability feature acquired from smaller peak waveforms such as P, Q, S


Introduction
For every human, stress is a physical and mental reaction caused due to feelings such as depression, anxiety disorders, and bipolar disorders.The variation of emotional stress behavior is affected physiological activity and causes chronic diseases, like heart disease, high blood pressure, cancer, and sometimes death.According to the World Health Organization statistics, stress has caused several issues to people, such as 66% of workers as sleepless and 75% of adults being affected with tiredness, headaches, and variation in sleeping patterns.Overall, 37% of people feel loneliness.The stress observation is significant to evaluate in contemporary society.In such cases, an autonomic nervous system plays a vital role in recognizing physiological characteristics [1,2].
There are numerous studies have been carried out on EEG signals, namely focal and nonfocal subjected to support vector machine (SVM) and K-nearest neighbor (KNN) classifier [3].However, all the above signal-based methods are expensive and require a vast system to fetch data.These systems are so complex and costlier for usage and need an expert for signal analysis [4].Therefore, electrocardiogram (ECG) stress signal classification has been famous recently due to its simplest signal acquisition method and precise waveform results.The ECG stress signal can be classified using several algorithms, and the features play a vital role.
The time domain features of the ECG signal are considered for stress level feature extraction and classification [5].Stress classification is hard to obtain due to its time complexity for estimating an R-R interval's standard deviation.Therefore, feature selection (FS) is needed to choose a practical feature to minimize the feature processing [6].
In this work, the ECG stress signals based on effective FS and classification are done using African vulture optimization (AVO) and optimized modified Elman recurrent neural network (MERNN) methods.The proposed work contributed to several tasks: feature extraction, FS, and classification [7].The feature extraction has extracted 13 features in a time domain, and the AVO technique is used to select the optimal best feature for classification.The Classification task is performed using an AVO-based MERNN method to achieve greater accuracy and efficiency than traditional techniques.The motivation behind the proposed work is to accomplish a precise and proficient classification approach for the detection of stress in ECG signals.
Existing studies have been performed with several deep learning methods in considering stress classification, namely convolutional neural networks (CNNs) and convolutional recurrent neural networks (CRNNs).The CNN has achieved 87.39% accuracy, and the CRNN has attained 90.19% accuracy [8,9].The stress classification processed in a hierarchical structure is sometimes more complex and provides some tolerable noise, making it challenging to process high-stress classification.An approximate R peak value should be detected to overcome these issues and attain high accuracy in stress classification.Thus, the long short-term memory (LSTM) model detects this R peak value with 88.13% accuracy [10].Also, evaluating an R-R interval's root mean square (RMS) is complex due to its high signal noises.
The standard deviation is estimated to consider the heart rate variability (HRV) signal's R-R interval.The literature of [11,12] has estimated the standard deviation with an accuracy of 75% and 89%, respectively.In some cases, it was difficult to classify stress due to the slight distance between the data and the center point and minimum training data.For these purposes [13,14], the CNN and fuzzy C-means (FCM) model is processed with 63.97% and 82.7% accuracy, respectively.However, it has an easier underfitting.Several studies presented feature extraction and classification using an SVM method with 89.21% and 84.4% accuracy [15,16].Due to the noise, the multichannel ECG signals are challenging to evaluate, and the preprocessing attained is inaccurate.
The features like mean R-R intervals (MRI), HR, and mean R peak amplitude are extracted using an SVM and KNN with an accuracy of 66.49%, 56.95%, and 61.52% [17].The CNN-based multiple stress levels classification is done for an R-R peak without any feature extraction and achieves an 85.45% accuracy [18].Some stress identification cases-based EMG signals are presented [19].The trapezius and spinal erector are reviewed to identify multilevel stress with a 96.2% accuracy.The Gaussian mixture model is used for HRV features combined with SVM to provide a classification accuracy of 95% [20].In another case [21], the SVM and Naïve babies are combined to evaluate an R-S peak, R-R interval, and Q-T interval of the ECG data features with an accuracy of 97.6%.
A dynamic encryption technique is presented based on a biometric detail among ECG signals with more than 90% accuracy to prevent stress-based heart diseases [22].The study of Tanev et al. [23] used linear and nonlinear HRV features to classify an image, mental tasks, sounds, and rest from an ECG signal with 80% accuracy.For ECG HSV features recognition, the six-fold cross-validation based on kernel networks is presented to achieve a classification accuracy of 99.1% [24].The SVM and self-organizing map technique are combined to classify no stress and medium/high stress with an radial basis function kernel and achieve a performance accuracy of 91% [25].Based on the number of interbeat interval features, the CNN model is used to determine the cognitive stress levels with an accuracy of 98.79% [26].In the study of Ahn et al. [27], various stressors such as Stroop color word and mental arithmetic tests are identified as HRV-based EEG features using the SVM method with an accuracy of 87.5%.The mental stress classification was performed by a hybrid CNN and LSTM techniques based on ECG signals.The preprocessing was done using fast Fourier transform and spectrograms and provided a classification accuracy of 98.3% [28].Another SVM based on five-level ECG signal classification in the study of Rajagopalan and Clifford [29] is presented and acquired an 88.07%accuracy.The study of Mar et al. [30] used a sequential forward floating search (SFFS) algorithm combined with a new criterion function index for effective FS in ECG signal.This SFFS algorithm was started from an empty vector map at an initial stage and propagated to the next stage if this vector map reached the feature values.In the study of Hsu et al. [31], a hybrid FS algorithm is developed by combining SFFS with generalized discriminant analysis (GDA) to reduce the dimensions of the selected features.To remove irrelevant features, a new FS algorithm of sequential backward search (SBS) combined with SVM in the study of Sabzekar and Aydin [32].In the study of Lakshmi Padmaja and Vishnuvardhan [33], a new FS algorithm of random subset FS (RSFS) is proposed, which uses random forest-based classification for FS.This RSFS algorithm selected the feature value from the set of the vector feature values by the method of random.The existing techniques have been extensively applied in classification problems, but there are some difficulties in the application process, such as unacceptable effects, minimum classification accuracy, and poor adaptive ability.As a result, optimization techniques are still compulsory, enabling further investigation into better classification techniques and accuracy.The remaining section of this article is structured: Section 2 discusses the methods.The result and discussion are presented with a comparative difference between proposed and conventional techniques in Section 3. At last, the conclusion is summarized in Section 4.

Proposed Method
The block diagram of the proposed methodology is shown in Figure 1.The proposed system has several phases for stress The find peaks and delineate functions are identified a peak detection using a Pan-Tompkins technique [34].The features are measured as a standard deviation and mean in time intervals among the peaks of P, Q, R, S, and T, respectively.All these features are extracted to eliminate a time stamp among chosen peaks.Next, all the acquired features are converted into the center of the data and z-score to scale.In this extraction, the features based on the time domain are used.Because the frequency domain features are hard to derive in a small sample length.

FS.
After performing a feature extraction, the feature extractions are not moved directly to the classification technique because it requires a maximum time to reach it.Therefore, the FS is much processed to ignore a redundant feature and transfer a needed feature.This selection of features reduced the number of data features that transferred to the classification models.The optimizer is used to identify a specific and important feature choice.In this work, the FS is made using a recent metaheuristics method named the AVO algorithm.

AVO Method.
A metaheuristic model manages the optimization issues efficiently.In the metaheuristic model, many models are motivated by the natural behavior of animals and birds.In this work, the AVO method is used based on African vultures' hunting and navigation behavior.The literature proved that the AVO method was the best to provide an optimal solution, scoring 30 out of 36 benchmark functions with a massive performance [35].
The AVO model is implemented based on the following steps: Step 1: Assume the n-number of African vultures and evaluate its population.
Step 2: There are several vultures classified into two categories.Initially, the fitness function for the population is calculated and divided the vultures into various groups.The best solution is considered a first vulture, and the second best is assumed to be a second vulture.The remaining vultures are used to form a population.These vultures can be replaced or moved into the two best vultures in every performance.
Step 3: The divided vulture groups are lived to find a portion of food, but only some of the vulture groups can find food and eat.
Step 4: The vulture's tendency to search for foods to relieve them from the hungry.Consider the weakest and hungriest vulture as the worst solution.That is why the vultures have become the best solution for hunting foods.In the AVO model, the first two best vultures are considered the best solutions, and the other tried to achieve the best.
Based on the above concepts, the AVO method is formulated in algorithm 1.
By using the AVO FS model, some features are selected to process an effective classification, such as RMS of successive difference among R-R intervals (RMSSD), median-based variation in coefficient (MCVNN), R-R interval's standard deviation (SDNN), MRI (MeanNN), successive difference in coefficient variation (CVSD), median of absolute values (MedianNN), interquartile range (IQRNN), R-R interval percent more significant than 20 ms (PNN20), R-R interval percent greater than 50 ms (PNN50), R-R intervals baseline width distribution (TINN), total R-R divided by histogram's height (HTI), mean of P-T interval (PTmean), mean of P-R interval (mean), mean of S-T interval (mean), standard deviation of P-R interval (PRsd), standard deviation of S-T interval (STsd) and standard deviation of P-S interval (PSsd), respectively.Therefore, the feature results based on p-values, coefficients, and validity coefficients are tabulated in Table 1.The rpb has a p-value lesser than 0.01.

Classification
After the FS, the selected features are transferred to the classification blocks.Then, the classification tasks will be Mathematical Problems in Engineering performed using a hybrid of two methods, the AVO technique and the MERNN technique.These methods are explained in the following.

MERNN Technique.
The MERNN is based on a backpropagation neural network and has unique learning strategies.The MERNN model has effectively classified a longer distance of essential data.The MERNN structure comprised various layers to perform classification, as shown in Figure 2. The layers presented in MERNN models are an input layer, a hidden layer, an output layer, and a recurrent or context layer.Each neuron has biased inputs, one output, and an activation function.The input layer is fetched the data and permits the next hidden layer that is used to move data to an output layer.This hidden layer provided the last moment in Elman neural networks.Then, the hidden layer outputs are stored in a recurrent layer [36].
Assume the number of inputs as i = 1,2….n, the number of hidden neurons as j = 1,2….. m, the number of recurrent neurons as r = 1,2….. m, and the network's weight as W ij , W rj , and W jo , respectively.
The output of the hidden layer at t is expressed in Equation ( 1) [32]:  6) for (every vulture (P i )) do // P i denotes the current vector location of the vulture (7) choose R(i) as the best vulture by using the below equation ( 8) Update satisfied vultures (F) by using the below equation ( 10) 12) if (P 1 ≥ random P 1 ) then ( 13) Update vulture's position by Pði þ 1Þ ¼ RðiÞ − DðiÞ × F (14) else (15) Evaluate vulture's position using the below equation (16 where d(t)represents the distance between a vulture and one of the best vultures ( 23) else (24) Estimate vulture's position using the below equation (25  27) else (28) if (P 3 ≥ random P 3 ) then (29) Evaluate vulture's position using the below equation (30 where g denotes a tangent hyperbolic function.The output layer is expressed in the following Equation (3): 3.2.Performance Analysis of Proposed Classifier.This study's datasets are acquired from a WESAD Database [37].These datasets are attained from various stress environments, which recorded 28 people's ECG stress data, 15 males and 13 females.It has 30 ECG stress signals from 12 male and three female that is measured at the wrist and chest part of them.
where h represents a purelin function The MERNN technique has several limitations, which have a lower convergence speed and the worst performance for generalization and is rectified by the MERNN technique combined with AVO methods.The hyperparameter of the MERNN method, i.e., the weight, is to be finetuned by using the AVO technique to achieve an effective classification performance.Therefore, the results showed that the proposed techniques scored higher than the conventional methods.
The experimental results of the proposed technique and conventional techniques are discussed in this section.The WESAD ECG stress signal Database is used for this demonstration.Thirty ECG stress signals were taken from the 28 subjects to perform feature extraction, selection, and classification tasks.The performance metric of the proposed technique is evaluated in terms of Accuracy (ACC), Precision (P), F1 score (F1), and Recall (R), respectively.
Output layer

Recurrent layer
Hidden layer Table 2 and Figure 3 show the feature optimization results of the proposed technique.The precision, Recall, Accuracy, and F1 score metrics are evaluated for all the five peaks, such as R, P, Q, S, and T, respectively.From Table 3, it is evident that the proposed AVO based FS has attained a maximum Precision, Accuracy, F1 score, and Recall rate than other FS approaches.
The result showed that the proposed technique had attained precision, Recall, Accuracy, and F1 score of 92.78%, 91.56%, 92.43%, and 95.86%, respectively.Therefore, the proposed technique has achieved a maximum value in all the metrics than the conventional techniques.The precision result attained by the proposed and conventional techniques [7][8][9][10][11][12][13][14][15]    Receiver operating characteristic (ROC) analysis is carried out to highlight the accuracy of the proposed model.Figure 4 shows the ROC curve proposed model.

Conclusions
This article presented effective FS and classification techniques based on ECG stress signals.The features are extracted from the WESAD Dataset and provide several features in time domain analysis.The AVO technique is managed to select the features prominently and provide an optimal result on FS.The feature data are minimized with the help of the AVO technique.The optimized MERNN technique is proposed to perform a classification.The AVO finetuned the weight of MERNN to achieve superior outperforms in classification metrics.The experimental result of the proposed technique computed the precision, Recall, Accuracy, and F1 score as 92.78%, 91.56%, 92.43%, and 95.86%, respectively.Therefore, the proposed technique has attained superior outperforms the conventional techniques.In future, the hybrid optimization models will be used to tune the hyperparameters of the classifier models.

TABLE 1 :
Coefficient values of the features.

TABLE 2 :
Performance result of the proposed feature optimization technique.
FIGURE 3: Comparative analysis of proposed work with other state-of-the-art methods in terms of Precision, Recall, ACC, and F1.