Next Article in Journal
Microbes and Parameters Influencing Dark Fermentation for Hydrogen Production
Previous Article in Journal
The Development of Fiber–Cement Flat Sheets by Young and Mature Coconut Fibers to Replace Asbestos for Eco-Friendly Products
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Anxiety Detection System Based on Galvanic Skin Response Signals

by
Abeer Al-Nafjan
1,*,† and
Mashael Aldayel
2,†
1
Computer Science Department, College of Computer and Information Sciences, Imam Mohammad Ibn Saud Islamic University, Riyadh 11432, Saudi Arabia
2
Information Technology Department, College of Computer and Information Sciences, King Saud University, Riyadh 11543, Saudi Arabia
*
Author to whom correspondence should be addressed.
The authors contributed equally to this work.
Appl. Sci. 2024, 14(23), 10788; https://doi.org/10.3390/app142310788
Submission received: 27 September 2024 / Revised: 13 November 2024 / Accepted: 16 November 2024 / Published: 21 November 2024
(This article belongs to the Special Issue Advanced Technologies and Applications of Emotion Recognition)

Abstract

:
Anxiety is a significant mental health concern that can be effectively monitored using physiological signals such as galvanic skin response (GSR). While the potential of machine learning (ML) algorithms to enhance the classification of anxiety based on GSR signals is promising, their effectiveness in this context remains largely underexplored. This study addresses this gap by investigating the performance of three commonly used ML algorithms, support vector machine (SVM), K-nearest neighbor (KNN), and random forest (RF), in classifying anxiety and stress activity using a benchmark dataset. We employed two feature extraction methods: traditional statistical feature extraction and an innovative automatic feature extraction approach utilizing a 14-layer autoencoder, aimed at improving classification performance. Our findings demonstrate the effectiveness of using GSR signals and the robust performance of the KNN algorithm in accurately classifying anxiety levels. The KNN algorithm achieved the highest accuracy in both the statistical and automatic feature extraction approaches, with results of 96.9% and 98.2%, respectively. These findings highlight the effectiveness of KNN for anxiety detection and emphasize the need for advanced feature extraction techniques to enhance classification outcomes in mental health monitoring.

1. Introduction

Anxiety disorder (AD) is a mental illness that is considered the most common mental disorder among groups and individuals. According to the World Health Organization (WHO), ADs “are characterized by excessive constant fear and worrying”, and they cause various physical symptoms, e.g., chest pain, headaches, elevated heart rate (HR), and abdominal pain [1]. In 2018, a survey [2] highlighted the prevalence of ADs worldwide, ranging from 6% to 16% of the population. According to the WHO, one in four people worldwide will experience a mental disorder at some point in their lives. The WHO also ranks mental disorders as the second leading cause of economic loss globally, after ischemic heart disease. In addition, 23% of all deaths worldwide are attributed to depression and anxiety [3]. This alarming trend is further compounded by the insufficient number of specialists in this field, and the number of specialists is not growing at a rate that is commensurate with the surge in individuals suffering from ADs [1].
Currently, psychological instruments, e.g., self-questionnaires, and commercial measurement instruments to analyze biological signals are the primary tools used to detect anxiety and stress [4]. Commonly used tools, e.g., interviews, questionnaires, and self-reports, rely on subjective responses and interpretation, leading to debatable results [5]. However, the early identification and assessment of stress is challenging. To overcome this limitation, previous studies have proposed the use of sensors, electronic measurement systems, and data processing algorithms to acquire and analyze physiological signals and biological markers associated with stress and anxiety [5,6,7].
Several studies have investigated biomarkers that correlate with the physiological response to stress and anxiety, with HR and blood pressure being utilized commonly [8]. In addition, the skin conductance response (SCR) and skin conductance level measured using electrodermal activity (EDA) sensors have shown promise in detecting stress [9]. Physiological signals are considered reliable for anxiety detection because they cannot be controlled consciously by the subject [10].
Research has reported that analyzing psychological signals using computational algorithms has shown promising results when applied to the detection of anxiety and stress [4]. However, few studies have investigated computing technologies or technological platforms that can assist in identifying individuals with mental health issues in nonclinical settings.
Thus, this study attempts to detect anxiety through physiological signals, specifically the galvanic skin response (GSR). The GSR is a sensitive indicator of the skin’s electrical conductance, which varies with emotional arousal. Anxiety is a state of heightened emotional arousal; thus, the GSR can be an effective tool for detecting anxiety. Previous studies [11,12] have demonstrated that the GSR can differentiate between anxious and nonanxious individuals, and it can be used to predict anxiety levels in response to stressors. The procedures involved in recognizing anxiety include signals preprocessing, feature extraction, and classification of EDA data.
The remainder of this paper is organized as follows. Section 2 presents a brief overview of the knowledge and terminologies required to understand the scope of GSR signal–based anxiety detection using ML. Section 3 summarizes previous research efforts in this field. Section 4 designs the experimental methodology. Section 5 discusses the results. Section 6 presents the research conclusion.

2. Background

This section provides an overview of emotion detection, focusing on the challenges specific to anxiety detection.

2.1. Emotion Detection

Emotions play a fundamental role in human cognition and decision-making processes, and they influence attention, memory, and perception, ultimately shaping human behavior and guiding adaptive responses to environmental stimuli [13]. Recognizing human emotions is a growing research domain with applications in diverse fields, e.g., driver emotion monitoring [14], healthcare [15], software engineering [16], and entertainment [13,17,18]. Emotion recognition can be accomplished through different modalities, including behavioral (facial expressions [19], gestures [20], and speech [13,21]) and physiological (e.g., electroencephalogram (EEG), electrocardiogram (ECG), and GSR) [16,17,18,22,23] modalities.
Physiological approaches often involve interpreting changes in hormones, metabolites, vital signs, and diaphoresis as indicators of pain and anxiety; however, the direct correlation between physiological responses and the experience of pain and anxiety remains inconclusive [24]. Emotion recognition also has various applications in stress detection and management, risk prevention, mental health monitoring, and interpersonal relation building [25].

2.2. Challenges in Anxiety Detection

Addressing social anxiety, which is a common mental health condition, poses several challenges that can hinder the development of effective detection and treatment methods. As discussed in the literature [26], the inherent complexity of social anxiety and ethical considerations surrounding its study make it difficult to research and develop effective interventions. The subtle and frequently internalized nature of social anxiety symptoms makes it difficult to identify using conventional methods. In addition, ethical considerations surrounding the collection of personal data and potential for stigmatization further complicate research efforts [26].
Developing a universally effective emotion-recognition system remains a challenge due to the inherent variability in individual emotional expression and the diverse ways in which different brains manifest emotions. Researchers advocate for the use of compact and user-friendly sensors to capture emotional cues and obtain reliable results [27].
Challenges pertaining to computational algorithms and physiological signals include the effect of individual living habits on the collection of physiological indicators, which potentially hinders the accuracy of mental health detection systems. In addition, relying solely on a single indicator poses limitations because different data categories reflect distinct aspects of mental health. Thus, integrated signal collection is required to realize accurate screening [28].
Intersubject data variance also poses a significant challenge in emotion recognition, and researchers have focused on developing novel machine learning (ML) algorithms, particularly deep learning architectures, to address this complexity. For example, data annotation, preprocessing, splitting, and multimodal fusion techniques have been explored [10]. Acquiring high-quality physiological signals also faces considerable challenges, e.g., noise, artifacts from body movements, participant variability, and low-graded signals. Thus, establishing stable laboratory setups, carefully selecting stimuli, and properly training subjects are crucial factors to address these challenges. Furthermore, generalizability to new datasets is also a critical issue that must be considered [10].

3. Related Work

Research in anxiety detection has garnered significant interest due to the increasing prevalence of anxiety disorders and the need for effective monitoring tools. Various approaches have been explored, utilizing different devices and targeting a range of physiological signals to enhance detection accuracy. Notable signals include heart rate (HR), respiratory rate (RR), heart rate variability (HRV), electronic noses (E-nose), galvanic skin response (GSR), electrocardiograms (ECGs), skin temperature (SKT), electroencephalograms (EEGs), and sleep status. Many studies have recorded and collected their own datasets, employing diverse computational methods to test various approaches in different contexts. This section reviews these contributions, highlighting the advancements and methodologies used in the field of anxiety detection.
Hernando et al. [15] validated the Apple Watch’s ability to measure HRV during relaxed and stressed states. A comparison was also made between the Apple Watch and Polar H7 when identifying autonomic nervous system responses. They found that both the devices demonstrated good reliability and consistency; however, the Apple Watch exhibited gaps in the RR interval data, thereby affecting the frequency of the HRV measurement.
Durán et al. [12] developed an artificial electronic nose and a GSR analysis technique to detect academic stress in engineering students, and they achieved a high success rate when classifying stress levels. Santos et al. [29] focused on using physiological signals (i.e., HR and GSR signals) to detect stress during password writing, and they developed a fuzzy logic-based decision system that achieved high accuracy in detecting stress in a short period. Nuno et al. [30] developed Anxolotl, which is an anxiety companion application that detects stress levels and panic attacks using wearable devices. This application provides real-time monitoring and notifications to help users manage their mental health.
Apostolidis et al. [31] investigated the use of biofeedback techniques, including those based on GSR, HR, and skin temperature, to measure the anxiety levels of university students during examinations. They observed significant correlations between the biofeedback measurements and anxiety levels, indicating the potential effectiveness of biofeedback for anxiety detection. Fukuda et al. [32] developed a questionnaire and utilized Fitbit data to predict anxiety, depression, and positive moods of company staff. In particular, ML techniques were used to process sleep features collected from Fitbit, exhibiting promising results for estimating anxiety and depression levels. In addition, Alexandros et al. [33] designed a mood recognition framework using HR, skin temperature, and acceleration data collected through a smartphone application. Their classifiers outperformed baseline methods, with the bagged ensembles of a decision tree algorithm achieving the highest accuracy.

4. Experimental Design

This section outlines the experimental framework used in this study. We begin by describing the WESAD dataset, detailing the materials and methods employed for data collection and analysis. Following this, we present our proposed system, which includes data preprocessing, feature extraction, and classification processes.

4.1. Materials and Methods

WESAD Dataset

In this study, we used the publicly available wearable stress and affect detection (WESAD) dataset (Table 1). The WESAD dataset was designed for stress and affect detection through data obtained from wearable devices, including physiological and emotional data collected using the professional Empatica E4 (wrist-worn) and RespiBAN (chest-worn) devices.
The data included different types of signals: ECG, blood volume pulse, electromyogram, respiration, skin temperature, three-axis accelerometer, HR, and EDA. The dataset was collected from 15 subjects (12 males and 3 females) in a laboratory setting. The purpose of using the WESAD dataset was to evoke and classify three affective states, i.e., the baseline or normal state (neutral reading), a stress state (exposed to the Tier Social Stress Test (TSST)), and an amusement state (watching funny videos) [34].
The WESAD dataset was selected in this study due to its extensive usage in over 600 research papers, indicating its widespread acceptance in the academic community. The reliability of the dataset is attributed to the inclusion of high-quality data that are well-labeled and defined, which established it as a valuable resource for testing our anxiety detection method [34].
Previous studies focused on utilizing multiple signals using different physiological readings, which were used for classification. In the current study, we focused on using only the EDA data obtained from wrist-worn devices.
The data represent time-series signals where all features are real numbers. The data were segmented into 60 s windows with 50% overlap, resulting in 240 trials (features). The length of each trial was 315,120 instances. We used holdout cross-validation to split the data into training and testing sets. The data were split into training and testing sets in an 80:20 ratio, with 80% of the data used for training and 20% used for testing.

4.2. Proposed System

In this section, we described the framework used to conduct the experiment to measure an individual’s anxiety levels, as shown in Figure 1. First, signal preprocessing was performed by extracting data from signal recordings and eliminating unwanted noise. Second, feature extraction was applied to identify meaningful features from raw signals. Finally, classification algorithms were employed to predict the anxiety levels. In this study, we utilized the support vector machine (SVM), random forest (RF), and K-nearest neighbor (KNN) algorithms.
The affective states included the neutral, stress, and amusement states. In this study, we formulated a binary classification task by combining the neutral and amusement states into a nonstress class to facilitate a stress vs. nonstress classification problem.
To address class imbalance in the dataset, we employed the synthetic minority oversampling technique (SMOTE), which generates synthetic minority class data, to create an equal representation of the stress and nonstress classes. Note that this approach prevents biases introduced through data imbalance and ensures that the used ML models learn effectively from both the classes. The initial dataset contained 981 nonstress class labels and 332 stress class labels, and after applying the SMOTE, the dataset achieved a balanced representation with 981 labels for each class.

4.2.1. Data Preprocessing

In the data preprocessing stage, we cleaned and segmented the raw EDA signals present in the WESAD dataset to remove noise and artifacts. Further, a low-pass Butterworth filter was employed to remove high-frequency noise and artifacts from the signals while retaining the lower frequency components of interest in the signals. This filtering process allowed us to obtain a cleaner representation of the EDA data.
The data segmentation process involved dividing continuous EDA signals into smaller segments, which enabled a finer-grained analysis by dividing the data into manageable segments for subsequent processing. In particular, we segmented the data into 60 s windows with 50% overlap.
Figure 2 illustrates the data preprocessing procedure. Here, two functions, i.e., low-pass Butterworth filtering and butter low-pass filtering, were utilized. The low-pass Butterworth filtering function calculated filter coefficients based on the desired cutoff frequency, sampling frequency, and filter order. Then, the butter low-pass filter function took the input data and applied the low-pass filter using the filter coefficients obtained from the low-pass Butterworth filter. Note that this function employed the scisig.lfilter function from the Scipy signal module to perform the actual filtering operation. In this study, the filter function was applied to each sample within EDA. Here, the cutoff frequency was set to 1 Hz, and the sampling frequency was set to 160 Hz.

4.2.2. Feature Extraction

In the feature extraction stage, relevant features were extracted from the preprocessed EDA signals to represent the physiological changes associated with stress. Here, two feature extraction approaches were employed, i.e., traditional statistical feature extraction and automatic feature extraction (code in Supplementary Material).
We utilized the pyEDA [35] toolkit, which is an open-source Python 3.12 toolkit, for preprocessing and feature extraction of the EDA data. First, both the approaches adjusted the EDA signal to a different sample rate, where the input signal was resampled from its original data rate to a new sample rate. Then, the resampled data were segmented into smaller windows of a specified width (referred to as a segment). Each segment of the resampled data was preprocessed by applying a rolling mean filter using the rolling mean function, which helped to smooth out the signals. In the following discussion, we explain each feature extraction approach in detail.
  • Statistical Feature Extraction
Statistical feature extraction involves calculating the descriptive statistics of the EDA signals within each window obtained from the preprocessed segments. These statistics capture the overall characteristics of the signals, e.g., mean, standard deviation, minimum, maximum, and peak-to-peak amplitude. These statistical features provide valuable insights into the characteristics of the data within each segment, e.g., the overall level of arousal and phasic changes in skin conductance. Then, the extracted statistical features and preprocessed data are aggregated across all segments.
  • Automatic Feature Extraction
Automatic feature extraction autoencoders were used, which are unsupervised neural networks that learn efficient data coding by compressing and encoding the data. Herein, the autoencoder comprised an encoder and a decoder, which transformed the input data into a lower-dimensional representation (latent variables) and reconstructed the original data, respectively. Note that the latent variables served as the extracted features for the classification process.
The automatic feature extraction process in pyEDA had two functions: prepare automatic and process automatic. The first function was used to prepare the EDA signals and train an autoencoder, while the second function used a pretrained autoencoder model to obtain latent variables of the EDA signals.
We modified the autoencoder model to fit our purpose. In particular, the modified autoencoder model had 14 layers, including 7 encoding layers and 7 decoding layers. Each encoding layer comprised a linear layer and LeakyReLU activation function, and each decoding layer comprised a linear layer and the sigmoid activation function, as shown in Figure 3.
The 14-layer architecture was determined through experimental evaluation, balancing model complexity with performance on the validation set. Deeper and shallower architectures were explored, and we achieved good results with the 14-layer autoencoder architecture.

4.2.3. Classification

Three classification algorithms: the KNN, SVM and RF algorithms, were employed to predict the stress label based on the EDA signals.
The KNN algorithm is a lazy classifier, i.e., it does not learn any decision rules; thus, it does not require training. KNN requires all data to be stored in the memory for the classification or clustering of data, and it also keeps the cluster centers in the memory [1].
SVM is a supervised learning algorithm that works on the concept of margin calculation. In the SVM algorithm, each data item is plotted as a point in an n-dimensional space (where n is the number of features in the dataset). The value of each feature is the value of the corresponding coordinate. The SVM algorithm classifies the data into different classes by finding a line (i.e., the hyperplane) that separates the training datasets into classes. It works by maximizing the distances between the nearest data point (in both classes) and the hyperplane, which we refer to as the margin [36].
The RF algorithm uses a bagging approach to create a group of decision trees with random subsets of data. The output of all decision trees in the RF is then combined to generate the final decision trees. There are two main stages in the RF algorithm. The RF is created in the first stage. In the second stage, a prediction is made from the RF classifier created in the first stage [37].

5. Results and Discussion

We evaluate the performance of machine learning models (KNN, SVM, and RF) for both statistical and automatic feature extraction approaches in terms of accuracy, precision, recall, and F1-score. Figure 4 illustrates classification results obtained with statistical and automatic feature extraction approaches.
Accuracy measures the percentage of correct predictions made by the classifier, calculated by dividing the number of correct predictions by the total number of predictions. Recall, also referred to as sensitivity, measures the model’s ability to accurately classify all actual positive cases. Precision measures the proportion of predicted positive cases that are actually true positives. The F1-score is the harmonic mean of precision and recall, providing a more balanced measure of performance than either precision or recall alone, as it considers both the model’s ability to identify positive cases correctly and its ability to avoid false negatives. As shown in Figure 4, the KNN algorithm achieved the best accuracy in both the statistical and automatic feature extraction approaches, with results of 96.9% and 98.2%, respectively.
A confusion matrix summarizes the performance of a classifier for binary classification tasks. This square matrix comprises columns and rows that list the number of instances as the absolute or relative “actual class” vs. “predicted class” ratios. Here, let P be the label of class 1, and let N be the label of a class 2.
Figure 5 shows the confusion matrix obtained for the statistical and the automatic extraction approaches. The graph displays the True label and Predicted label. The matrix is divided into four sections, and the sections represent the following: 0,0 = True Positives (TP), 1,0 = False Negatives (FN), 0,1 = False Positives (FP), and 1,1 = True Negatives (TN).
The performance of machine learning models is dependent on both the characteristics of the data and the chosen feature extraction algorithms. In our study, the relatively poor performance of the SVM may be attributed to the high dimensionality of the extracted features and the potential presence of noise in the data.
Conversely, the KNN algorithm demonstrated better performance due to its ability to effectively capture local patterns in the data. The relationships between the extracted features and the anxiety classes appear to be highly localized, favoring KNN’s classification approach. The RF model, with 500 trees, exhibited comparatively lower performance. This may be a result of the model’s complexity, potentially leading to overfitting and reduced generalization ability compared to the simpler KNN model.
Furthermore, we evaluated our approach by comparing our results with those of previous studies that utilized the WESAD dataset. Several studies have utilized this dataset to develop models, employing various computational methods and machine learning algorithms in the preprocessing, feature extraction, and classification stages. These studies yielded diverse results and reported distinct findings. Table 2 shows a comparison between these studies.
Aqajari et al. [11] proposed a stress detection system that uses GSR signals. The WESAD data were preprocessed through downsampling, moving averaging, and normalization, and feature extraction involved extracting deep learning features using convolutional neural networks (CNNs) and statistical features by extracting phasic data from the preprocessed GSR signals. In addition, a low-pass Butterworth filter was applied to identify onset and offset, followed by peak detection to find maximum amplitudes. Classification was performed using the KNN, Naïve Bayes, RF, and SVM algorithms. The results demonstrated accurate stress detection, with 92% accuracy achieved using 10-fold cross-validation for the KNN algorithm.
Sah et al. [38] proposed Stressalyzer, a stress classification and personalization framework utilizing the WESAD dataset and ML models. This framework encompassed data preprocessing, which involved segmenting the data into 60 s windows with 50% overlap and normalization using min–max scaling. Feature extraction was performed through convolutional operations between the input and a weight matrix or kernel to capture complex features by learning smaller and simpler features. In addition, classification was performed using CNNs. The results demonstrated excellent performance of the single-channel neural network-based model, with the CNN achieving an accuracy of 92.85% and an F1-score of 0.89 for binary stress classification.
Sah et al. [39] proposed a stress detection and classification framework using a CNN without performing feature computation. In the CNN, the convolution operation was applied between the input and weight matrices or filters to extract complex features by learning smaller and simpler features progressively. Here, a one-dimensional CNN was deemed suitable for their stress detection and classification approach; thus, it was employed as the learning algorithm in their study. The trained CNN model achieved a classification accuracy of 94.8% on the training set and 90.9% on the test set for bi-affective state classification, i.e., stress vs. nonstress classification. In addition, an F1-score of 0.89 was achieved.
Hosseini et al. [40] developed a framework for stress detection using the GSR signals in the WESAD dataset and ML algorithms. They extracted 87 features from the EDA signal, applied normalization per person, and selected the most informative features. Three ML algorithms (i.e., the AdaBoost, RF, and SVM algorithms) were evaluated, and the results demonstrated a stress detection accuracy of 97.03% using the leave-one-out method.
Aqajari et al. [35] developed an open-source Python toolkit for EDA signal preprocessing and automatic feature extraction. They evaluated the toolkit using various ML algorithms on the WESAD dataset. The results exhibited higher accuracy for stress detection using automatically extracted features. They trained two models for each algorithm, i.e., one model using statistical features and the other model using automatic features. The best accuracy of 97% was achieved by the naïve Bayes classifier using the second model with automatic features.
Zhu et al. [41] conducted a feasibility study on stress detection using GRS signals. They employed the publicly available WESAD and VerBIO datasets, and they applied ML methods (KNN, logistic regression, and RF) for binary classification. The results demonstrated that the RF algorithm achieved 85.7% accuracy when predicting stress levels. Their findings demonstrated the potential of using EDA data from wearable devices for stress detection, highlighting the importance of these data in analyzing mental health.
Siirtola et al. [42] proposed a stress detection system using the WESAD dataset. The data preprocessing involved splitting and normalization, which was followed by feature extraction using cvxEDA. The classification algorithms included the RF, LDA, and quadratic discriminant analysis (QDA). The RF algorithm achieved an accuracy of 78.3% for the stress detection task. Here, the classification involved two class labels, i.e., the baseline and stress, with the data sampled at a frequency of 4 Hz.
As shown in Table 2, various preprocessing techniques, feature extraction methods, classification algorithms, and number of class labels were employed for stress detection using EDA signals obtained from wearable devices. The preprocessing techniques included downsampling and moving averaging in two studies, normalization in three studies, segmentation with 60 s windows and 50% overlap in two studies, upsampling and denoising in one study, data segmentation with labels assigned by a 30 s nonoverlapping sliding window and component separation in one study, and data splitting in two studies. For feature extraction, two studies utilized CNNs; three studies employed cvxEDA; two studies used EDA analysis; and one study used modality selection, NeuroKit, PyEDA toolkit, SCR features, and a low-pass Butterworth filter.
The classification algorithms also varied across the studies, with three studies using KNN; two studies using naïve Bayes Gaussian classifiers; five studies using RF models; three studies using SVM; two studies using CNN models; and one study using AdaBoost, 100-bagged classification trees, STAI, logistic regression, LDA, and QDA. In addition, the number of class labels varied, with two studies using neutral, stress, and amusement states; three studies using stress and no-stress states; one study using a scale from “Not at all” to “Very much so”; and one study using baseline and stress states. The frequency of the EDA signals was 5 Hz in two studies and 4 Hz in five studies. The reported accuracy results were also diverse.
As shown in Table 2, one study achieved 90% accuracy using the KNN algorithm, another study achieved 92.85% accuracy for wrist EDA data, one study reported a classification accuracy of 94.8% on the training set and 90.9% on the test set with an F1-score of 0.89, one study obtained 97.03% accuracy and 97.36% precision with AdaBoost, one study achieved an F1-score of 97.03% with the naïve Bayes classifier, one study reported 97% accuracy when using the naïve Bayes classifier, one study achieved 85.7% accuracy with the RF algorithm, and one study obtained 78.3% accuracy with the RF algorithm using EDA. These findings demonstrate the diversity of approaches and the effectiveness of different techniques in stress detection using EDA signals.

6. Conclusions

This study has contributed to the field of anxiety detection using galvanic skin response (GSR) signals and machine learning techniques. Our findings demonstrate the effectiveness of GSR signals and highlight the strong performance of the KNN algorithm in accurately classifying anxiety levels. While the dataset and algorithms we utilized may not demonstrate sufficient novelty, our results outperform previous contributions due to our innovative feature extraction methods, which include both traditional statistical extraction and a 14-layer autoencoder.
Future work will focus on developing an application for accurate anxiety detection, providing individuals with a practical tool for monitoring their mental well-being. We recommend combining GSR with other bio-signals, such as heart rate variability (HRV) and EEG signals, as this multimodal approach could significantly enhance the accuracy and robustness of anxiety detection systems. Integrating these signals will allow us to leverage complementary information and gain deeper insights into individuals’ emotional states. Additionally, expanding research to real-world scenarios and utilizing larger datasets will be crucial for validating our findings and improving the generalizability of our models. We are also considering the evaluation of our data using more advanced and state-of-the-art learning models in future work. Conducting studies in diverse environments and with varied populations will help ensure the developed tools are effective across different contexts. Furthermore, exploring other mental health conditions, such as depression and phobias, will contribute to a more comprehensive understanding of these disorders and aid in the development of effective diagnostic and intervention strategies.

Supplementary Materials

The following link provides code details about training of autoencoder: https://github.com/Meshael-S/autoencoder/tree/main (accessed on 15 November 2024).

Author Contributions

Conceptualization, methodology, resources, supervision, A.A.-N.; investigation, data curation, implementation, M.A.; writing—review and editing, A.A.-N. and M.A. All authors have read and agreed to the published version of the manuscript.

Funding

This scientific paper is derived from a research grant funded by the Research, Development, and Innovation Authority (RDIA)—Kingdom of Saudi Arabia—with grant number (13461-imamu-2023-IMIU-R-3-1-HW-).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Publicly available datasets were analyzed in this study. This data can be found here: [https://ubi29.informatik.uni-siegen.de/usi/data_wesad.html, accessed on 12 February 2023].

Acknowledgments

This research was conducted at the Innovation and Interaction Technology Lab (IIT Lab) at Imam Mohammad Ibn Saud Islamic University (IMSIU), Riyadh, Saudi Arabia. The authors would like to extend their gratitude to the Research, Development, and Innovation Authority (RDIA) of the Kingdom of Saudi Arabia for funding this lab and research under grant number 13461-imamu-2023-IMIU-R-3-1-HW.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Muhammad, A.; Ashjan, B.; Ghufran, M.; Taghreed, S.; Nada, A.; Nada, A.; Maryam, A. Classification of Anxiety Disorders Using Machine Learning Methods: A Literature Review. Insights Biomed. Res. 2020, 4, 95–110. [Google Scholar] [CrossRef]
  2. Canals, J.; Voltas, N.; Hernández-Martínez, C.; Cosi, S.; Arija, V. Prevalence of DSM-5 Anxiety Disorders, Comorbidity, and Persistence of Symptoms in Spanish Early Adolescents. Eur. Child Adolesc. Psychiatry 2019, 28, 131–143. [Google Scholar] [CrossRef]
  3. Sau, A.; Bhakta, I. Screening of Anxiety and Depression among Seafarers Using Machine Learning Technology. Inform. Med. Unlocked 2019, 16, 100228. [Google Scholar] [CrossRef]
  4. Jiménez-Mijangos, L.P.; Rodríguez-Arce, J.; Martínez-Méndez, R.; Reyes-Lagos, J.J. Advances and Challenges in the Detection of Academic Stress and Anxiety in the Classroom: A Literature Review and Recommendations. Educ. Inf. Technol. 2023, 28, 3637–3666. [Google Scholar] [CrossRef] [PubMed]
  5. García, S.; Garzón, L.; Camargo, L.H. Indentification and classification of academic stress by galvanicskin response. Vis. Electrón. 2016, 10, 170–178. [Google Scholar] [CrossRef]
  6. Melillo, P.; Formisano, C.; Bracale, U.; Pecchia, L. Classification Tree for Real-Life Stress Detection Using Linear Heart Rate Variability Analysis. Case Study: Students under Stress Due to University Examination. In World Congress on Medical Physics and Biomedical Engineering May 26–31, 2012, Beijing, China; Springer: Berlin/Heidelberg, Germany, 2013; Volume 39, pp. 477–480. [Google Scholar] [CrossRef]
  7. Rodríguez-Arce, J.; Lara-Flores, L.; Portillo-Rodríguez, O.; Martínez-Méndez, R. Towards an Anxiety and Stress Recognition System for Academic Environments Based on Physiological Features. Comput. Methods Programs Biomed. 2020, 190, 105408. [Google Scholar] [CrossRef]
  8. Morera, L.P.; Tempesti, T.C.; Pérez, E.; Medrano, L.A. Biomarcadores En La Medición Del Estrés: Una Revisión Sistemática. Ansiedad Estrés 2019, 25, 49–58. [Google Scholar] [CrossRef]
  9. Giannakakis, G.; Grigoriadis, D.; Giannakaki, K.; Simantiraki, O.; Roniotis, A.; Tsiknakis, M. Review on Psychological Stress Detection Using Biosignals. IEEE Trans. Affect. Comput. 2022, 13, 440–460. [Google Scholar] [CrossRef]
  10. Ahmad, Z.; Khan, N. A Survey on Physiological Signal-Based Emotion Recognition. Bioengineering 2022, 9, 688. [Google Scholar] [CrossRef]
  11. Aqajari, S.A.H.; Naeini, E.K.; Mehrabadi, M.A.; Labbaf, S.; Rahmani, A.M.; Dutt, N. GSR Analysis for Stress: Development and Validation of an Open Source Tool for Noisy Naturalistic GSR Data. arXiv 2020, arXiv:2005.01834. [Google Scholar]
  12. Durán Acevedo, C.M.; Carrillo Gómez, J.K.; Albarracín Rojas, C.A. Academic Stress Detection on University Students during COVID-19 Outbreak by Using an Electronic Nose and the Galvanic Skin Response. Biomed. Signal Process. Control 2021, 68, 102756. [Google Scholar] [CrossRef] [PubMed]
  13. Akçay, M.B.; Oğuz, K. Speech Emotion Recognition: Emotional Models, Databases, Features, Preprocessing Methods, Supporting Modalities, and Classifiers. Speech Commun. 2020, 116, 56–76. [Google Scholar] [CrossRef]
  14. De Nadai, S.; D’Inca, M.; Parodi, F.; Benza, M.; Trotta, A.; Zero, E.; Zero, L.; Sacile, R. Enhancing Safety of Transport by Road by On-Line Monitoring of Driver Emotions. In Proceedings of the 2016 11th System of Systems Engineering Conference (SoSE), Kongsberg, Norway, 12–16 June 2016; pp. 1–4. [Google Scholar]
  15. Hernando, D.; Roca, S.; Sancho, J.; Alesanco, Á.; Bailón, R. Validation of the Apple Watch for Heart Rate Variability Measurements during Relax and Mental Stress in Healthy Subjects. Sensors 2018, 18, 2619. [Google Scholar] [CrossRef]
  16. Kolakowska, A.; Landowska, A.; Szwoch, M.; Szwoch, W.; Wrobel, M.R. Emotion Recognition and Its Application in Software Engineering. In Proceedings of the 2013 6th International Conference on Human System Interactions (HSI), Sopot, Poland, 6–8 June 2013; pp. 532–539. [Google Scholar]
  17. Szwoch, M.; Szwoch, W. Using Different Information Channels for Affect-Aware Video Games—A Case Study. In Proceedings of the International Conference on Image Processing and Communications, Bydgoszcz, Poland, 11–13 September 2019; Springer: Berlin/Heidelberg, Germany, 2019; pp. 104–113. [Google Scholar]
  18. Li, W.; Zhang, Z.; Song, A. Physiological-Signal-Based Emotion Recognition: An Odyssey from Methodology to Philosophy. Measurement 2021, 172, 108747. [Google Scholar] [CrossRef]
  19. Zhang, Y.-D.; Yang, Z.-J.; Lu, H.-M.; Zhou, X.-X.; Phillips, P.; Liu, Q.-M.; Wang, S.-H. Facial Emotion Recognition Based on Biorthogonal Wavelet Entropy, Fuzzy Support Vector Machine, and Stratified Cross Validation. IEEE Access 2016, 4, 8375–8385. [Google Scholar] [CrossRef]
  20. Noroozi, F.; Corneanu, C.A.; Kaminska, D.; Sapinski, T.; Escalera, S.; Anbarjafari, G. Survey on Emotional Body Gesture Recognition. IEEE Trans. Affect. Comput. 2021, 12, 505–523. [Google Scholar] [CrossRef]
  21. Zheng, H.; Yang, Y. An Improved Speech Emotion Recognition Algorithm Based on Deep Belief Network. In Proceedings of the 2019 IEEE International Conference on Power, Intelligent Computing and Systems (ICPICS), Shenyang, China, 12–14 July 2019; pp. 493–497. [Google Scholar]
  22. Muhammad, G.; Hossain, M.S. Emotion Recognition for Cognitive Edge Computing Using Deep Learning. IEEE Internet Things J. 2021, 8, 16894–16901. [Google Scholar] [CrossRef]
  23. Gunes, H.; Shan, C.; Chen, S.; Tian, Y. Bodily Expression for Automatic Affect Recognition. In Emotion Recognition; Wiley: Hoboken, NJ, USA, 2015; pp. 343–377. [Google Scholar]
  24. Najafpour, E.; Asl-Aminabadi, N.; Nuroloyuni, S.; Jamali, Z.; Shirazi, S. Can Galvanic Skin Conductance Be Used as an Objective Indicator of Children’s Anxiety in the Dental Setting? J. Clin. Exp. Dent. 2017, 9, e377. [Google Scholar] [CrossRef] [PubMed]
  25. Phillips, L.H.; MacLean, R.D.J.; Allen, R. Age and the Understanding of Emotions: Neuropsychological and Sociocognitive Perspectives. J. Gerontol. Ser. B Psychol. Sci. Soc. Sci. 2002, 57, P526–P530. [Google Scholar] [CrossRef]
  26. Bubel, M.; Jiang, R.; Lee, C.H.; Shi, W.; Tse, A. AwareMe. In Proceedings of the 2016 CHI Conference Extended Abstracts on Human Factors in Computing Systems, San Jose, CA, USA, 7–12 May 2016; ACM: New York, NY, USA, 2016; pp. 68–73. [Google Scholar]
  27. Gedam, S.; Paul, S. A Review on Mental Stress Detection Using Wearable Sensors and Machine Learning Techniques. IEEE Access 2021, 9, 84045–84066. [Google Scholar] [CrossRef]
  28. Long, N.; Lei, Y.; Peng, L.; Xu, P.; Mao, P. A Scoping Review on Monitoring Mental Health Using Smart Wearable Devices. Math. Biosci. Eng. 2022, 19, 7899–7919. [Google Scholar] [CrossRef] [PubMed]
  29. de Santos Sierra, A.; Ávila, C.S.; Casanova, J.G.; Del Pozo, G.B. Real-Time Stress Detection by Means of Physiological Signals. Recent Appl. Biom. 2011, 58, 4857–4865. [Google Scholar]
  30. Gomes, N.; Pato, M.; Santos, P.; Lourenço, A.; Rodrigues, L. Anxolotl, an Anxiety Companion App–Stress Detection. arXiv 2022, arXiv:2212.14006. [Google Scholar]
  31. Apostolidis, H.; Papantoniou, G.; Tsiatsos, T. Deployment and Dynamics of a Biofeedback System for Anxiety Awareness during Online Examination Activities. Appl. Sci. 2021, 11, 756. [Google Scholar] [CrossRef]
  32. Fukuda, S.; Matsuda, Y.; Tani, Y.; Arakawa, Y.; Yasumoto, K. Predicting Depression and Anxiety Mood by Wrist-Worn Sleep Sensor. In Proceedings of the 2020 IEEE International Conference on Pervasive Computing and Communications Workshops (PerCom Workshops), Nara, Japan, 23–27 March 2020; pp. 1–6. [Google Scholar]
  33. Zenonos, A.; Khan, A.; Kalogridis, G.; Vatsikas, S.; Lewis, T.; Sooriyabandara, M. HealthyOffice: Mood Recognition at Work Using Smartphones and Wearable Sensors. In Proceedings of the 2016 IEEE International Conference on Pervasive Computing and Communication Workshops (PerCom Workshops), Sydney, Australia, 14–18 March 2016; pp. 1–6. [Google Scholar]
  34. Schmidt, P.; Reiss, A.; Duerichen, R.; Marberger, C.; Van Laerhoven, K. Introducing WESAD, a Multimodal Dataset for Wearable Stress and Affect Detection. In Proceedings of the 20th ACM International Conference on Multimodal Interaction, Boulder, CO, USA, 16–20 October 2018; ACM: New York, NY, USA, 2018; pp. 400–408. [Google Scholar]
  35. Hossein Aqajari, S.A.; Naeini, E.K.; Mehrabadi, M.A.; Labbaf, S.; Dutt, N.; Rahmani, A.M. PyEDA: An Open-Source Python Toolkit for Pre-Processing and Feature Extraction of Electrodermal Activity. Procedia Comput. Sci. 2021, 184, 99–106. [Google Scholar] [CrossRef]
  36. Choi, R.Y.; Coyner, A.S.; Kalpathy-Cramer, J.; Chiang, M.F.; Campbell, J.P. Introduction to Machine Learning, Neural Networks, and Deep Learning. Transl. Vis. Sci. Technol. 2020, 9, 14. [Google Scholar] [CrossRef] [PubMed]
  37. Sidey-Gibbons, J.A.M.; Sidey-Gibbons, C.J. Machine Learning in Medicine: A Practical Introduction. BMC Med. Res. Methodol. 2019, 19, 64. [Google Scholar] [CrossRef]
  38. Sah, R.K.; Cleveland, M.J.; Habibi, A.; Ghasemzadeh, H. Stressalyzer: Convolutional Neural Network Framework for Personalized Stress Classification. In Proceedings of the 2022 44th Annual International Conference of the IEEE Engineering in Medicine & Biology Society (EMBC), Glasgow, UK, 11–15 July 2022; pp. 4658–4663. [Google Scholar]
  39. Sah, R.K.; Ghasemzadeh, H. Stress Classification and Personalization: Getting the Most out of the Least. arXiv 2021, arXiv:2107.05666. [Google Scholar] [CrossRef]
  40. Hosseini, E.; Fang, R.; Zhang, R.; Parenteau, A.; Hang, S.; Rafatirad, S.; Hostinar, C.; Orooji, M.; Homayoun, H. A Low Cost EDA-Based Stress Detection Using Machine Learning. In Proceedings of the 2022 IEEE International Conference on Bioinformatics and Biomedicine (BIBM), Las Vegas, NV, USA, 6–8 December 2022; pp. 2619–2623. [Google Scholar]
  41. Zhu, L.; Ng, P.C.; Yu, Y.; Wang, Y.; Spachos, P.; Hatzinakos, D.; Plataniotis, K.N. Feasibility Study of Stress Detection with Machine Learning through EDA from Wearable Devices. In Proceedings of the ICC 2022—IEEE International Conference on Communications, Seoul, Republic of Korea, 16–20 May 2022; pp. 4800–4805. [Google Scholar]
  42. Siirtola, P. Continuous Stress Detection Using the Sensors of Commercial Smartwatch. In Proceedings of the Adjunct Proceedings of the 2019 ACM International Joint Conference on Pervasive and Ubiquitous Computing and Proceedings of the 2019 ACM International Symposium on Wearable Computers, London, UK, 9–13 September 2019; ACM: New York, NY, USA, 2019; pp. 1198–1201. [Google Scholar]
Figure 1. Framework for anxiety detection system.
Figure 1. Framework for anxiety detection system.
Applsci 14 10788 g001
Figure 2. Data preprocessing.
Figure 2. Data preprocessing.
Applsci 14 10788 g002
Figure 3. Architecture of the proposed autoencoder.
Figure 3. Architecture of the proposed autoencoder.
Applsci 14 10788 g003
Figure 4. Classification results obtained with statistical and automatic feature extraction approaches.
Figure 4. Classification results obtained with statistical and automatic feature extraction approaches.
Applsci 14 10788 g004
Figure 5. Confusion matrix for the KNN algorithm.
Figure 5. Confusion matrix for the KNN algorithm.
Applsci 14 10788 g005
Table 1. WESAD dataset.
Table 1. WESAD dataset.
Anxiety ModelThree Affective States (Neutral, Stress, and Amusement)
StimuliTwo affective stimuli (stress and amusement) were applied. In addition, a baseline and two meditation conditions (introduced to calm the participants after a stimulus) were set.
TaskThree tasks (neutral reading of materials (magazines) to trigger the baseline state, watching funny videos to trigger the amusement state, and exposure to the TSST to trigger the stress state) were set. The TSST induces stress by requiring participants to speak publicly and perform complex mental arithmetic.
SubjectsFifteen subjects (12 males and 3 females) with a mean age of 27.5 ± 2.4 years participated in the study.
TimeStudy duration: approximately 2 h.
EDA devicesEmpatica E4 (wrist-worn) and RespiBAN professional (chest-worn) devices.
Experimental protocolThe baseline condition had a duration of 20 min, the amusement condition had a duration of 392 s (6.5 min), and the stress condition had a duration of 21 min. Having experienced both stressful and amusement stimuli, the subjects were invited to participate in a guided meditation to facilitate emotional recovery. In the stress condition, the participants had to first deliver a 5 min speech on their personal traits in front of a three-person panel, focusing on strengths and weaknesses. After the TSST, the participants were given a 10 min rest, and the meditation condition had a duration of 7 min.
Table 2. Comparative analysis of related research using the same dataset.
Table 2. Comparative analysis of related research using the same dataset.
Ref.PreprocessingFeature ExtractionClassifier# of ClassesAccuracy
Aqajari et al., 2020 [11]Downsampling, moving averaging, low-pass Butterworth filter, and normalizationStatistical features (cvxEDA), e.g., phasic data, onset and offset, and peaksKNN3
Neutral, stress, amusement
90%
Sah et al., 2022 [38]Segmentation and normalization (min–max)Computing the dot product of the kernel creating different layersCNN3
Normal, stress, amusement
92.85%
Sah et al., 2021 [39]Segmentation (60 s overlap of 50%) and normalization (min–max)N/ACNN2
Stress, no stress
90.9%
Hosseini et al., 2022 [40]Upsampling and denoisingcvxEDA algorithm, NeuroKitAdaboost2
Stress, no stress
97.03%
Aqajari et al., 2021 [35]Downsampling and moving averagingpyEDA toolkitNaïve Bayes2
Stress, no stress
97%
Lili Zhu et al., 2022 [41]Data segmentation, component separation, data splittingStatistical features and SCR featuresRF4
1 = “Not at all” to
4 = “Very much”
85.7%
Siirtola et al., 2019 [42]Splitting data, normalizationcvxEDARF2
Baseline, stress
78.3%.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Al-Nafjan, A.; Aldayel, M. Anxiety Detection System Based on Galvanic Skin Response Signals. Appl. Sci. 2024, 14, 10788. https://doi.org/10.3390/app142310788

AMA Style

Al-Nafjan A, Aldayel M. Anxiety Detection System Based on Galvanic Skin Response Signals. Applied Sciences. 2024; 14(23):10788. https://doi.org/10.3390/app142310788

Chicago/Turabian Style

Al-Nafjan, Abeer, and Mashael Aldayel. 2024. "Anxiety Detection System Based on Galvanic Skin Response Signals" Applied Sciences 14, no. 23: 10788. https://doi.org/10.3390/app142310788

APA Style

Al-Nafjan, A., & Aldayel, M. (2024). Anxiety Detection System Based on Galvanic Skin Response Signals. Applied Sciences, 14(23), 10788. https://doi.org/10.3390/app142310788

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