# Anxiety Detection System Based on Galvanic Skin Response Signals
## 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  
Figure 4: Classification results obtained with statistical and automatic feature extraction approaches. 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. Figure 5: Confusion matrix for the KNN algorithm. [PERSON] 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, Naive Bayes, RF, and SVM algorithms. The results demonstrated accurate stress detection, with 92% accuracy achieved using 10-fold cross-validation for the KNN algorithm. [PERSON] et al.