Multistage Anxiety State Recognition based on EEG Signal using Safe-Level SMOTE

Anxiety is a complicated emotional condition that has a detrimental effect on people’s physical and mental health. It is critical to accurately recognize anxiety levels in early stage. The anxiety can be detected by pattern of brain signal using brain imaging tools. However, the common problem with dataset acquired from brain is imbalanced class distribution. Hence, the purpose of this work is to mitigate the imbalanced class distribution issue by removing data outlier and using improved Synthetic Minority Oversampling Technique (SMOTE) for improving the classification performance. This work used of the freely accessible Database for Anxious States based on Psychological stimulation (DASPS) that comprises of 14 channels electroencephalography (EEG) signal. It acquired from 23 subjects when they were exposed to psychological stimuli that elicited fear. The DASPS need to be processed for removing noises, extracting important features and sampling with Safe-level SMOTE method. Then, the processed DASPS was categorized into three types of model: Model A, Model B, and Model C. The feature Model C from enhanced DASPS class distribution obtained the precision of 89.7% and accuracy of 89.5% using optimized K-nearest neighbour (K-NN) algorithm. The proposed method showed outstanding classification performance than others existing methods in recognizing multistage anxiety.


Introduction
Currently, clinical symptoms or a set of questionnaires, such as the Beck Anxiety Inventory, the Self-Rating Anxiety Scale, the State-Trait Anxiety Inventory, the Hamilton Anxiety Scale, and the Manifest Anxiety Scale, are used to make the diagnosis of anxiety disorder.However, this diagnosis approach is not objective enough and is vulnerable to the possibility of subjective bias [1].This might degrades the overall quality of the evaluation.However, many researchers have found that the subjective feelings of anxiety, stress, and emotion can be quantified objectively using a variety of techniques to acquire physiological signals from individuals.Among of the techniques are electroencephalography (EEG), electrocorticography, and functional magnetic resonance imaging (fMRI).The main reason of this technique used for research is because the physiological signals are harder to be control or manipulated by individual when facing stress situation.The use of EEG based technologies to monitor the individual mental health and cognitive performance is becoming more widespread, and researchers have investigated many approaches to diagnosing the anxiety disorder.The DASPS was proposed by Baghdadi et al., [2] where it contains EEG information from 23 subjects during anxiety elicitation in six different settings.The time, frequency and time-frequency domain features were extracted from DASPS and feed into the Stacked Sparse Autoencoder for classification purpose.They had found that the anxiety was well elicited in 1 second with the maximum accuracy for 2-level of 83.5% and 4-level of 74.6% classes of anxiety based k-NN and support vector machine (SVM) classifier.In another work, Shikha et al., [3] applied recursive feature elimination with crossvalidation (RFECV) with the classifiers on the publicly available DASPS database to decrease redundancy between features and improve results.They found that the classification accuracy was 83.9% for 2-level class of anxiety.Their result showed enhancement of around 5% for time-domain, 8% for time-frequency domain, and 0.5% for all features combination.Table 1 summarized the other related studies of anxiety and stress classification using EEG signal.However, these solutions above, to some part, overlook a crucial issue related to the treatment of data imbalance.The imbalance dataset quantity of samples in different classes of the original dataset may vary substantially, especially in the multi-classification process.It will have a direct impact on the final model performance [8].Therefore, this project will focus on using computational approach based supervised machine learning to create a model to classify the anxiety state level of an individual using EEG signals.The Safe-level SMOTE was applied in the pipeline of machine learning to tackle the imbalanced DASPS class distribution issue.

EEG dataset description
This project employs the publicly accessible DASPS dataset for the purpose of detecting anxiety level, which was gathered by Baghdadi et al., [2].This database consists of raw EEG data (.mat format) acquired from the 23 participants.Ten of them were male and 13 of them were female with average age of 30 years old.The Emotiv EPOC wireless EEG headset based on 14 channels and two mastoids was used to measure and record the brain signal of participant during mental assessment.The frequency sampling rate of acquired EEG signals was 128 hertz.The study stimulus anxiety was using in-vivo exposure therapy.The assessment was divided into six different situations and each situation was divided into two parts.The first was the psychotherapist recites the situation for the first 15 seconds.Then, the next part was the subject recalls it for the next 15 seconds.After each situation, the participants need to rate their felt during assessment based on Self-Assessment Manikin (SAM).The participants were instructed to closed eyelids and keep minimal motions while the EEG data was being recorded.

Pre-processing of raw EEG signal
To begin, the extrinsic signal artifacts were removed using a FIR bandpass filter with a cut-off frequency of 45 Hz and a cut-off frequency of 4 Hz to eliminate the high-frequencies and lowfrequencies artifacts.These artifacts usually occurred due to power line interference, excessive motion, and eyes blinks and movements.It is crucial to identify artifacts components in order to minimize inherent signal artifacts.Therefore, the raw EEG signals were decomposed using the Informax independent component analysis (ICA) approach.The IClabel EEGLAB plugin classified the components into six categories which are brain, muscle, eyes, heart, line noise, channel noise, and others.Subsequently, those components containing most non-brain components will be removed.
Finally, the automatic artifact removal in the toolbox is applied to the processed signal for improving the quality of data.This technique removed bad data sections, which unable to be eliminated via both ICA and FIR filtered.The entire procedure was automated by an EEGLAB script.

Features extraction
The main intend of extracting features are to reduce the losing of important attributes consisted within the interest signal.It converts the signal into the identifiable measurement, a distinguishing attribute, and a functioning component by reducing the number of resources from large dataset.This was necessary to reduce the implementation complexity, cut-off the cost for signal processing, and to prevent the necessity for data compression.In this work, the hybrid pools of the features is from three distinct domains which are time domain (Higuchi's Fractal Dimension and Hjorth parameter: complexity, mobility, and activity), frequency domain (spectral entropy and sample entropy), and time-frequency domain (absolute power of frequency bands, alpha/beta ratio, theta/alpha ratio, power spectral density of frequency bands, and root mean square of frequency bands).The discrete wavelet transform (DWT) is used in the time-frequency domain to extract both the time and frequency components of the data.Wavelet transforms provide a higher level of resolution than Fourier Transforms.The DWT based Daubechies function of order 4 with five decomposition level was used extract the EEG rhythms from DASPS dataset.This wavelet attributes was chosen because it well suited for processing biomedical signals [9].The input signal will pass through low-pass and high-pass filter, which divided the frequencies into two bands of low-pass component (approximation component) and high-pass component (detail component).Figure 1 showed the DWT decomposition tree for extracting EEG signal with 128 Hz of frequency sampling.After decomposition, the EEG rhythms absolute power were obtained using Welch's approach through estimation of power spectral density.Each decomposed signal also contains a statistical feature called the Root Mean Square.

Data augmentation
The data augmentation is an artificial process to increase the number of samples and datapoints by yielding a new samples and datapoints from existing data.In this work, the safe-level SMOTE method was used for data augmentation to compensate the inequitable class distribution of DASPS dataset.This step is critical because the minority classes of light and moderate are 5 to 10 times lesser compared to majority classes of severe and normal anxiety state.In addition, a few classes of DASPS dataset are overlap and positioned next to categorization boundary.In this regard, it caused low classification performance.The safe-level SMOTE was operating based on k-NN rules and selection of appropriate properties is necessary to acquire promising augmentation output.Three main steps taken using k-NN rules which are calculating the distance between neighbors, identify the k closest neighbors to determine the bias-variance trade-off related with solve of underfitting and overfitting issue, and finally select the new label of samples.The Bayesian optimization will chose the optimal hyperparameter for the k-NN model.It had been found that the most optimal k-value was 5.The basic steps implement for augmented DASPS using safe-level SMOTE method were locate the criteria area to yield the synthetic data and produce the synthetic dataset based on a safe-level ratio.It can be summarized as below: 1. Calculate the distance of nearest neighbors (n) and minority class instances in observe set (p) using Euclidean distance.2. Executing the safe-level SMOTE method based on k-value of 5. 3. Chose one of k nearest neighbors generated from the minority class.4. Recalculate the distance between n and its neighbors with the same k using Euclidean distance.5. Chose one of the k nearest neighbors generated from the minority class.6. Determine the safe-level to p, n, slp, and sln as represents in equations ( 1) and (2).slp = the number of positive instances in k -nearest neighbors for p (1) sln = the number of positive instances in k -nearest neighbors for n (2) 7. Determine the safe-level ratio for p and n as in equation ( 3) and categorized into respective cases as in Table 2.Then, the new synthetic instance (si) was generated in the coordinate of si as shown in equation ( 4).safelevel_ratio, sl_ratio = slp/sln (3) si = pi+(gap×diff) (4) 8. Calculate the difference between p and n. 9. Refer to the range of random numbers based on the safe level ratio (sl_ratio) in Table 2. 10.The difference acquired in step 8 was multiplied by a random number in step 9. 11.The result yield from step 10 was adding to p for generating the new instances.12.The steps were repeated until the number of minority class observations was approximately similar to that of majority class observations.

Data classification and evaluation
Several methods were used for classified and evaluated before and after DASPS dataset augmented.Detail explanation as discussed below.

k-NN algorithms
The k-NN technique is then used to classify the pool of extracted features.This has the advantage of simplifying model and minimizing complexity of process for small datasets.It is efficient to utilize for a small, featured dataset because of its non-parametric properties and samples classification was based on the votes of the k-nearest neighbors [11].After each classification, Bayesian optimization is implemented to select the maximized hyperparameters for the k-NN model.This optimization minimized the scalar objective function f(x) for x in a bounded domain.The x represents the different value of hyperparameters of k-NN which includes the number of nearest neighbors, standardization, distance, weight, and exponent [12].The n instance is safer than the p instance; therefore, synthesis is closer to the n position.
The synthetic data will be generated closer to n at a distance [1-SLR,1].

k-fold cross validation
Finally, the performance of the DASPS features model is determined based on the k-fold cross validation.This work used a 10-fold cross validation, where the dataset was randomly categorized into 10-fold.Each of fold acquires 1 over 10 of the datasets for validation set and the remain dataset was for training set.The validation set was shifting for each iteration of fold.The remain data was feeding into the classification model for training.The final accuracy of model performance was obtained from average accuracy result from each iteration fold [13].

2.5.3.Model performance evaluation metrics
The performance of classifier in this work was determine via a confusion matrix.There are four classification performance measures in confusion matrix which are accuracy, precision, F-value, and true positive rate (TPR).The accuracy refers to the number of correct predictions yielded by model via the entire test dataset, whereas the precision is an accuracy of a positive prediction.Besides, the precision also indicates the reliability of a predicted positive result.It can be controlled through tuning of model hyperparameters and parameters.Meanwhile, the F-value is a metric for determining the correctness of a model based on its precision and recall.The TPR is a metric that determines the number of expected true positive (TP) from all positives in dataset instead the expected number of false positives (FP).The classification parameter used in this work was represented in equation ( 5)-( 8).

𝐴𝑐𝑐𝑢𝑟𝑎𝑐𝑦 = 𝑇𝑃+𝑇𝑁 𝑇𝑃+𝑇𝑁+𝐹𝑃+𝐹𝑁
(5) Three models obtained from this work which are Model A (dataset from original DASPS dataset), Model B (synthetic dataset from Model A after augmented using safe-level SMOTE method), and Model C (synthetic dataset from Model C after outlier removal).The outlier removal method refers to the process of removing bad data point that far from average value of others.The z-score was performed to remove the bad data point.Then, the classification results from these models were compared and evaluated.

Results and Discussions
This section was discussed on outcomes obtained from classification performance of DASPS dataset models.

Classification performance of Model A
Table 3 represents the classification performance from different domain features of DASPS dataset.The main purpose was to determine and select the optimal classification performance of domain features by k-NN to be further processed with safe-level SMOTE method and outlier removal.).Therefore, it suggested that the time-frequency domain was better than other features domain and this features was selected to be augmented with safe-level SMOTE and undergo outlier removal process.Through features selection, more time can be saved and less architecture complexity instead of performed data improvement on each features.

Classification performance of Model B
Figure 2 showed the classification performance of time-frequency domain features after augmented using safe-level SMOTE.The classes distribution was improved and balanced especially for minority classes of light and moderate anxiety state.It was 80 and 94 new samples had been successfully synthesized for the light and moderate anxiety states, respectively.Hence, the number of samples was more evenly distributed in the DASPS dataset.The percentage improvement of class distribution for each states was: normal (52% to 31%), light (8% to 24%), moderate (4% to 21%), and severe (36% to 24%).  ) in comparison to Model A. Therefore, it showed that the Model B obtained better and balanced classes distribution, which revealed the safe-level SMOTE was efficient for augmented DASPS dataset.The class imbalanced issue had been tackle by using this method.Then, the effect of adding an outlier removal method of rejecting bad data point on classification will be known in the following section.

Classification performance of Model C
The classification performance of Model C aims to determine the effect of implemented safe-level SMOTE method and outlier removal.Based on Table 5, it can be stated that the classification performance of Model C was better than Model B. The accuracy of Model C was improved about 10% than Model B. All of the indicators also showed better result, where the percentage increment of precision was 10.7%, recall was 9.0%, and F1-score was 9.8%.Therefore, it indicated that combination of those method yield better classification performance, which considered as a good model since it has high F1-score and accuracy.

Figure 1 .
Figure 1.Decomposition tree of discrete wavelet transform for extracting time and frequency features of EEG rhythms[10]

Figure 2 .
Figure 2. Class distribution before and after augmented using safe-level SMOTE method

Table 1 .
Past studies related to anxiety and stress classification using EEG signal

Table 3 .
The classification performance of different features from DASPS dataset before augmented

Table 4
indicated the classification performance for Model B. This model was generated from Model A that augmented using safe-level SMOTE method.It had significantly improved performance than Model A of about 16.3%.The others parameter also showed improvement such as precision (23.1%), recall (27.3%), and F1-score (41.5%

Table 4 .
Classification performance of Model B

Table 5 .
Classification performance of Model C