Abstract

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 classification. This work managed a heart rate variability feature acquired from smaller peak waveforms such as P, Q, S, and T waves. Also, the R peak is detected, which is a significant part of the ECG waveform. In this work, the proposed stress classification work has been categorized into two main processes: feature selection (FS) and classification. The main aim of the proposed work is to propose an optimized FS and classifier model for the detection of stress in ECG signals. The Metaheuristics model of the African vulture optimization (AVO) technique is presented to perform an FS. This selection is made to choose the required features and minimize the data for classification. The AVO-based modified Elman recurrent neural network (MERNN) technique is proposed to perform an efficient classification. The AVO is used for fine-tuning the weight of the MERNN technique. The experimental result of this technique is evaluated in terms of Recall (91.56%), Accuracy (92.43%), Precision (92.78%), and F1 score (95.86%). Thus, the proposed performance achieved a superior result than the conventional techniques.

1. 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.

2. Proposed Method

The block diagram of the proposed methodology is shown in Figure 1. The proposed system has several phases for stress classification using ECG signals, explained in the following. Initially, the collected signals are enhanced using the Butterworth filter. Then, the new feature extraction and selection process is carried out using AVO. The proposed model can able to extract all discriminative features with minimum trainable parameters. The extracted features are classified using MERNN. To achieve higher accuracy in classification, the classifier model is tuned using AVO.

2.1. Preprocessing and Feature Extraction

In this part, every ECG signal is filtered by using a Butterworth filter with a 0.3 cutoff frequency. These samples are divided into 10 s with respect to the stressed and nonstressed periods in the dataset. 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.

2.2. 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.

2.3. 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.

Inputs: n-number of vultures in an environment (population) and number of iterations (T)
Outputs: best vulture location and its fitness function
  (1) Initialization of random population Pi (i = 1, 2, …, N)
  (2) While (stop condition not found) do
  (3) Evaluate fitness function
  (4) Fix first best vulture as PBestVul1 // First best location
  (5) Fix second best vulture as PBestVul2 // Second best location
  (6) for (every vulture (Pi)) do // Pi denotes the current vector location of the vulture
  (7) choose R(i) as the best vulture by using the below equation
  (8)
  (9) Update satisfied vultures (F) by using the below equation
  (10)
  (11) if (|F| ≥ 1) then
  (12) if (P1 ≥ random P1) then
  (13) Update vulture’s position by
  (14) else
  (15) Evaluate vulture’s position using the below equation
  (16)
  (17) if (|F| < 1) then
  (18) if (|F| ≥ 0.5) then
  (19) if (P2 ≥ random P2) then
  (20) Calculate vulture’s position using the below equation
  (21)
  (22) 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) //
  (26) Where and
  (27) else
  (28) if (P3 ≥ random P3) then
  (29) Evaluate vulture’s position using the below equation
  (30)
  (31) else
  (32) Estimate vulture’s position using the below equation
  (33)
  (34) Return PBestVul1

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.

3. Classification

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

3.1. 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 Wij, Wrj, and Wjo, respectively.

The output of the hidden layer at t is expressed in Equation (1) [32]:where b represents the bias term.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.where represents a true positive, denotes a true negative, indicates a false positive and represents a false negative indicates, respectively.

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 [715] is 92.78%, 87.65%, 86.23%, 85.18%, 73.98%, 87.06%, 60.72%, 80.35%, 88.26%, and 82.52%, respectively. The Recall result attained by the proposed and conventional techniques [715] is 91.56%, 86.32%, 85.56%, 86.49%, 74.12%, 88.10%, 62.59%, 81.79%, 88.79%, and 83.3%, respectively. The result performance of this technique has attained a superior Recall result than conventional techniques. The accuracy result acquired by the proposed and conventional techniques [715] is 92.43%, 87.39%, 90.19%, 88.13%, 75%,89%, 63.97 %, 82.7%, 89.21 %, and 84.4%, respectively. The F1 score results for the proposed and conventional techniques [715] are 95.86%, 89.39%, 91.50%, 89.16%, 76.30%, 91%, 68.23%, 85.26%, 89.96%, and 85.23%, respectively.

Receiver operating characteristic (ROC) analysis is carried out to highlight the accuracy of the proposed model. Figure 4 shows the ROC curve proposed model.

4. 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.

Data Availability

The data will be provided to the readers upon request.

Conflicts of Interest

The authors declare that they have no conflicts of interest.