Next Article in Journal
PTSD Case Detection with Boosting
Previous Article in Journal
Development of an Integrated System of sEMG Signal Acquisition, Processing, and Analysis with AI Techniques
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Acute Psychological Stress Detection Using Explainable Artificial Intelligence for Automated Insulin Delivery

1
Department of Chemical and Biological Engineering, Illinois Institute of Technology, 10 W 33rd St., Chicago, IL 60616, USA
2
College of Nursing, University of Illinois at Chicago, 845 S Damen Avenue, Chicago, IL 60612, USA
3
Department of Biomedical Engineering, Illinois Institute of Technology, 3255 S Dearborn St., Chicago, IL 60616, USA
*
Author to whom correspondence should be addressed.
Signals 2024, 5(3), 494-507; https://doi.org/10.3390/signals5030026
Submission received: 30 April 2024 / Revised: 8 July 2024 / Accepted: 18 July 2024 / Published: 30 July 2024

Abstract

:
Acute psychological stress (APS) is a complex and multifactorial phenomenon that affects metabolism, necessitating real-time detection and interventions to mitigate its effects on glycemia in people with type 1 diabetes. This study investigates the detection of APS using physiological variables measured by the Empatica E4 wristband and employs explainable machine learning to evaluate the importance of the physiological signals. The extreme gradient boosting model is developed for classification of APS and non-stress (NS) with weighted training, achieving an overall accuracy of 99.93%. The Shapley additive explanations (SHAP) technique is employed to interpret the global importance of the physiological signals, determining the order of importance for the variables from most to least as galvanic skin response (GSR), heart rate (HR), skin temperature (ST), and motion sensors (accelerometer readings). The increase in GSR and HR are positively correlated with the occurrence of APS as indicated by high positive SHAP values. The SHAP technique is also used to explain the local signal importance for particular instances of misclassified samples. The detection of APS can inform multivariable automated insulin delivery systems to intervene to counteract the APS-induced glycemic excursions in people with type 1 diabetes.

1. Introduction

People with type 1 diabetes (T1D) often experience unexplained glycemic excursions that deteriorate glucose control. T1D is an autoimmune disorder caused by the destruction of pancreatic beta cells that produce insulin, leading people with T1D to be dependent on exogenous insulin administration to maintain their blood glucose concentrations within a target range. An obscure disturbance to glycemia is acute psychological stress (APS), which can worsen glucose control in people with T1D through physiological and endocrine stress responses that cause hyperglycemia, or high glucose concentrations [1]. Prolonged hyperglycemia can lead to the development of complications that significantly impair quality of life and reduce life expectancy [2]. Detecting APS is important for mitigating the glycemic effects of APS and maintaining tight glycemic control.
It is challenging to mitigate the glycemic effects of APS using automated insulin delivery (AID) systems that rely solely on glucose measurements to modulate insulin delivery. AID systems integrate insulin pumps, continuous glucose monitors, and control algorithms to automatically modulate delivery of rapid acting insulin analogues. Using glucose measurements solely for feedback presents a challenge because elevated glucose levels can be caused by other stimuli, such as meals or anaerobic physical activities, in addition to APS [3,4,5,6,7].
APS detection using readily measurable physiological variables is an important topic in affective computing [8,9,10]. Numerous machine learning (ML) models have been developed to detect APS, including logistic regression, nearest neighbor methods, random forest, support vector machines, and neural networks [11]. Deep learning approaches with multiple hidden layers, which allow the model to learn complex representations of the input variables, have recently obtained high accuracy performance in detecting APS [12,13]. Enhancing the interpretability of the ML models developed to detect APS in everyday life is critical to increasing trustworthiness of the models, particularly in medical applications such as AID in people with T1D.
Accurate detection of APS necessitates a multivariable approach in which multiple signals from wearable devices are analyzed to deduce the presence of APS. This has led to the development of multivariable AID systems that incorporate numerous physiological measurements from wearable devices such as wristband activity trackers. Multivariable AID systems use the additional physiological signals for feedforward control, and are able to assess the glycemic effects of disturbances such as APS before its effects are observed in the blood glucose concentration measurements. This feedforward mechanism in combination with feedback is more proactive, and represents a substantial improvement over AID systems that react to the blood glucose concentration measurements and only employ feedback control.
Multivariable AID systems can use the real-time physiological measurements from wearable devices to detect APS and assess its effects on the predicted future glucose trajectory. This allows the multivariable AID system to accurately predict the future blood glucose levels, which enables timely insulin adjustments to maintain blood glucose levels within the desired range and prevent hyperglycemia. This proactive approach to handling APS necessitates accurate, reliable, and trustworthy artificial intelligence techniques that can detect the presence of APS.
Previous research works have studied the detection of APS using the eXtreme Gradient Boosting (XGBoost) algorithm and recurrent neural networks with long short-term memory [12]. Class imbalances were handled using upsampling, downsampling, weighted training, and an adaptive synthetic sampling approach. The ML models were trained with features generated from convolutional kernels and features were retained for training based on the sequential forward selection algorithm [13]. These ML algorithms are typically black-box models evaluated based on accuracy. Accuracy is important, though the ML models should also be interpretable.
One previous work introduced a stress monitoring system utilizing heart rate (HR) variability, galvanic skin response (GSR), and skin temperature (ST), but without interpretation using machine learning techniques [14]. Another work have highlighted the benefits of physiological measures to detect anxiety states, but did not integrate multiple biosignals and machine learning models [15]. A review of various stress detection methodologies emphasized the effectiveness of multisignal biosignal analysis, but noted the absence of systematic integration [16]. Physiological sensors for stress detection were used in real-world driving tasks, but did not focus on model interpretability using explainable AI techniques, underscoring the potential of various biosignal features but without detailed integration [17].
The need for explainable ML in medical applications has led researchers to develop methods for interpreting complex models and explaining the rationales for model predictions. A number of methods, such as local interpretable model-agnostic explanations (LIME), explain predictions of a classifier or regressor by locally approximating the model as a simpler interpretable surrogate model [18,19]. Another approach to interpreting ML models is SHapley Additive explanations (SHAP), which assigns each feature variable an importance value for each output prediction, with positive or negative values indicating the direction of influence [20,21].
In this work, we investigate the importance of the physiological signals collected using a wearable wristband device for the detection of APS. We combine data from various physiological sources, including HR, GSR, ST, and three-axis accelerometer (ACC) data, for a comprehensive analysis of APS indicators using wearable devices. An XGBoost model is developed with weighted training for classification of APS and non-stress (NS) [22]. Employing XGBoost, an optimized gradient boosting algorithm, this work achieves an 99.93% accuracy for the classification of APS and NS states. In Section 2, we first describe the study protocol for the data collection experiments, provide a brief overview of the methods used for data preprocessing, and detail the weighted training method for handling imbalanced classes along with the XGBoost and SHAP algorithms used for detecting APS and assigning an importance to each feature variable when predicting a particular data sample. The results of the XGBoost prediction model and SHAP algorithm are detailed in Section 3, followed by a discussion of the key findings of the study in Section 4. The use of SHAP values ensures explainability of the global importance of physiological signals, which indicates that the order of importance for the variables (from most to least) is GSR, HR, ST, and motion sensor (accelerometer) readings. In addition, this approach elucidates the local signal importance for particular samples. Finally, Section 5 provides concluding remarks.

2. Materials and Methods

2.1. Clinical Experiment Protocol

Clinical experiments were conducted to induce APS while subjects wore a physical activity tracker, the Empatica E4 wristband (Empatica Srl, Milan, Italy), to collect physiological biosignals data for training the APS detection models. The APS model was trained on data collected from eight subjects with T1D and two healthy subjects, with all ten subjects participating in APS sessions and six of them participating in NS sessions. The methods for inducing APS employed in this study are well-established and reliable techniques used in numerous studies and detailed in the literature [1,3,8,9]. The experiments were conducted while subjects were in a sedentary state. The experimental protocol consisted of sessions with and without APS inducement. During the APS sessions, subjects encountered either mental stress (MS) or exciting anxiety stress (EAS). In sessions with MS, subjects participated in an arithmetic test and letter/number sequence test. In the arithmetic test, subjects were asked to solve arithmetic problems including addition, subtraction, multiplication, and division of numbers. In the letter/number sequence test, subjects were presented with a sequence of letters and numbers and asked to repeat the sequence of the numbers followed by the letters in the order presented. In the EAS session, subjects had meetings with their supervisors or had exams at an allocated time. In the sessions without APS inducement, subjects watched neutral videos or read books. Table 1 shows the number of subjects and experiments performed for data collection. The experiments adhered to ethical guidelines and were approved by the institutional review board of the university. Table 2 provides demographic information on the study participants, including their age and maximum HR.
Physiological biosignals were collected using Empatica E4 wristbands. The E4 is equipped with a GSR sensor that measures changes in the electrical properties of the skin; a photoplethysmogram (PPG) sensor that measures blood volume pulse (BVP), from which HR variability is derived; an infrared thermopile that reads peripheral ST; and a three-axis accelerometer (ACC) to detect movement and changes in acceleration along the X, Y, and Z axes [23,24].

2.2. Data Preprocessing Pipeline

The Empatica E4 wristband collects the various physiological biosignals at different frequencies. Table 3 provides the frequency for each biosignal. GSR or electrodermal activity (EDA) is a physiological measurement of electricity flowing through the skin in which the amount of sweating can change the skin electrical activity. GSR can be divided into skin conductance level (SCL), representing the slow change background of the GSR, and skin conductance response (SCR), representing the time-varying peaks in response to a stimulus. It is reported in the literature that the peak of the SCR in the GSR signal occurs in reaction to a single stimulus, and appears between 1.5 and 6.5 s after the stimulus [25]; however, the individual’s physiological response and the nature of the stimulus can cause deviations from this range.
Data segmentation is the process of splitting signals into smaller data segments or windows for use in training models. The selection of an appropriate signal window is crucial, as it can affect the accuracy and interpretability of the analysis [26]. We segmented the time series biosignals into windows of 10 s with two-second time steps, which resulted in 39,021 samples for APS and 5967 samples for NS. The mean of GSR, HR derived directly from the BVP using the Empatica E4 algorithm, ST, and three-axis ACC were calculated over each window. The means of the signals for each time window were then used as features for training the XGBoost model. The label of each window was determined by taking the mode of the labels within the window. The dataset was split into training, validation, and testing sets with the following ratios: 80% for training, 10% for validation, and 10% for testing. We employed the stratified shuffle split, a combination of stratified k-fold and shuffle splitting, to maintain the same class distribution in the training, validation, and testing datasets as in the original dataset, thereby eliminating the risk of biased evaluation results due to class imbalance [27]. To ensure that all signals had the same scale, the training, validation, and testing data were standardized by subtracting the mean and dividing by the standard deviation of the training data. Figure 1 shows the overview of the machine learning pipeline, including data collection, data preprocessing, XGBoost model training, and model interpretation using SHAP.

2.3. Explainable Machine Learning for APS Detection

2.3.1. Imbalanced Data Handling

The dataset exhibits class imbalances, with a larger number of APS samples (39,021, 87%) compared to NS samples (5967, 13%). We employed a weighted training approach to assign relatively greater weights that penalized inaccuracies in the NS minority class during model training [13]. The value of the penalty weight assigned to each class was inversely proportional to its frequency in the dataset, as calculated by
w i = n S n C · n S ( i ) ,
where w i is the weight of class i, n S is the total number of samples, n C is the number of classes, and n S ( i ) is the number of samples in class i. The weights assigned to the APS and NS classes were 0.58 and 3.8, respectively. We used the compute_class_weight function from the sklearn.utils module to determine the weights for the classes.

2.3.2. XGBoost Model Training

Gradient boosting is an ensemble learning method that integrates several weak learners such as decision trees to improve the overall algorithm performance. The trees are constructed consecutively, with each tree aiming to rectify the errors of the preceding tree. The prediction of the constructed model is the sum of the predictions of all individual weak learners weighted by their corresponding importance [28].
XGBoost is a parallelized and optimized gradient boosting algorithm that accelerates the training process by enabling the utilization of multiple central processing unit cores or graphics processing units [22,29]. XGBoost trains numerous instances of decision trees on various subsets of the training dataset while employing techniques such as gradient boosting, regularization, and efficient tree construction to improve precision and accuracy while avoiding overfitting. We implemented the XGBoost algorithm, specifically the XGBClassifier from the XGBoost library (version 2.0.3), with the objective set to ’binary’ to perform binary classification. The XGBoost Python library is designed to be highly efficient and flexible for training and deploying gradient boosting models [22]. We trained the XGBoost model for APS detection using the physiological signals GSR, HR, ST, and the three-axis ACC [12]. To prevent overfitting, we employed early stopping by halting the training process if the model accuracy on the validation dataset did not improve, setting the early_stopping_rounds parameter to 10.

2.3.3. SHAP Interpretation Technique

The use of multiple physiological signals to detect APS can improve accuracy, although the model must be validated in other ways in order to determine whether the model has acquired physiologically correct relations among the biosignals and the APS classification. SHAP is a unified model-agnostic technique that can interpret the output of various machine learning methods, including support vector machines, neural networks, decision trees, and ensembles of decision trees such as random forests or gradient boosting machines [20]. The SHAP technique is based on Shapley values, which assign a marginal contribution of each feature value across all possible combinations of features. SHAP computes the Shapley values for individual features to explain the model’s predictions. The mathematical representation of calculating the Shapley value for an input variable in a prediction is provided by [30]
ϕ q ( m ) = S F { q } | S | ! ( | F | | S | 1 ) ! | F | ! [ m ( S { q } ) m ( S ) ] ,
where ϕ q ( m ) is the Shapley value of input variable q in prediction m, S is a coalition of the input variables without input variable q, F is the set of all input variables, m ( S ) is the prediction made using the coalition S of the input variables without input variable q, and m ( S { q } ) is the prediction made using the coalition S including input variable q.
We applied the SHAP technique to interpret the XGBoost model predictions and calculate the contributions of each physiological signal in APS detection using the SHAP Python library (version 0.44.1) [20]. SHAP values were computed for each sample to deduce the contributions of each physiological signal to the model prediction, and a beeswarm SHAP summary plot was generated to visualize the SHAP values for each physiological signal sorted by their importance.

3. Results

3.1. XGBoost Model Performance

The XGBoost model with weighted training for classification of APS and NS achieved an overall testing accuracy of 99.93 %. Table 4 summarizes the classification accuracy using the metrics of precision, recall, and F1 score. Figure 2 shows the corresponding confusion matrix.

3.2. Model Interpretation Using SHAP

We employed the SHAP technique to rank the marginal contribution of the physiological variables to the XGBoost model for APS detection. The marginal contribution of each feature is measured by calculating the mean of the absolute SHAP values per feature across the testing data. Figure 3 shows the beeswarm SHAP summary plot, which shows the feature importance in descending order on the vertical axis. The plot indicates that GSR is the most important signal, HR is the second most important, and ST is the third most important, followed by the ACC X-axis, ACC Y-axis, and ACC Z-axis. Each dot on the feature row represents the SHAP value of a sample in the testing data. Dark navy-colored dots represent high biosignal feature values, while yellow dots represent low biosignal feature values. To visualize the distribution, overlapping points are jittered in the Y-axis direction. Figure 3 shows that the increases in GSR and HR values are positively correlated with the occurrence of APS, as indicated by high positive SHAP values. The decrease in ST is positively correlated with APS, while accelerometer signals have the least contribution to the APS detection model. Acceleration in the direction of the positive X-axis, negative Y-axis, and negative Z-axis are correlated with APS. Acceleration in the direction of the positive X-axis can be attributed to lateral motions of the left arm moving to the right, such as when crossing the arms over the chest. Similarly, acceleration in the direction of the negative Y-axis captures movements of the hand moving backward or towards the body. Lastly, the negative Z-axis records the lowering of the hand or arm downwards.
The SHAP technique can provide an interpretation of model predictions for individual instances. Figure 4 shows the force plot for a correctly classified APS instance. The contribution of each physiological signal to the prediction is indicated by its SHAP value, represented as a horizontal arrow. The length of the arrow indicates the magnitude of the SHAP value, with red arrows indicating positive SHAP values and blue arrows indicating negative SHAP values. The mean standardized values of the biosignals are shown under the arrows. In this correctly classified APS instance, the GSR, HR, ST, ACC Z-axis, and ACC Y-axis all have positive SHAP values, while the ACC X-axis has a negative SHAP value. The base value, or the expected value, represents the average model prediction over the entire training dataset, which equals 10.46. The sum of all SHAP values for this instance (2.87 for GSR, 1.99 for HR, 1.05 for ACC Y-axis, 0.81 for ST, 0.75 for ACC Z-axis, and −0.62 for ACC X-axis) combined with the expected base value of 10.46 equals 17.31. The sum of all SHAP values for this instance combined with the expected base value is higher than the base value alone, indicating that the sum of all signal contributions positively affects the model’s APS prediction for this instance. The positive standardized mean GSR value of 2.037 has the most significant positive effect on the model’s APS prediction, with a SHAP value of 2.87. The positive standardized mean HR value of 1.081 has the second-most significant positive effect, with a SHAP value of 1.99. Meanwhile, the negative standardized mean ACC Y-axis value of −1.989 has the third most significant effect, contributing positively to the model’s APS prediction with a SHAP value of 1.05.
Figure 5 shows the force plot for the NS sample misclassified as APS. The sum of all the SHAP values for this instance combined with the expected base value is equal to 2.23, which is lower than the expected base value of 10.46. This indicates that the sum of all the contributions from the signal has a positive effect on the prediction of NS. However, ST contributed to the misclassification of the NS sample as APS; the negative standardized mean ST value of −0.672 has a positive SHAP value of 0.45, causing the model to indicate APS.
Figure 6 illustrates the dependency plot, showcasing the influence of GSR on the model’s predictions of APS detection considering the interaction with HR. The plot shows the SHAP values for standardized GSR versus the standardized GSR values, with each data point representing an individual prediction from the testing dataset color-coded based on the HR values. As seen in the figure, there is a positive correlation between the standardized GSR values and the GSR SHAP values. Higher GSR values are associated with higher SHAP values, indicating a stronger influence of GSR on the model’s predictions. Additionally, the color-coding based on standardized HR values demonstrates that elevated HR values (indicated by darker shades) are generally associated with higher GSR values. To quantify the relationship between GSR and HR, we calculated the Pearson’s correlation coefficient for the test set. The Pearson’s correlation coefficient, a measure of the linear correlation between GSR and HR, is 0.46 for the test set, a moderate positive correlation, suggesting that APS occurrence is associated with elevated GSR and HR values.

3.3. Independent Testing

To evaluate the model’s performance on an independent dataset, we collected E4 data on a real-life APS event from a healthy subject during a 40-min oral presentation in front of an audience. This independent dataset was not used in the training or validation of the model. The data collection involved a healthy individual wearing an Empatica E4 wristband during an APS inducement event. The collected data were preprocessed similar to the training data, including standardization using the mean and standard deviation of the training set. The model was able to detect APS accurately during the entirety of the 40-min presentation. This high accuracy is attributed to the pronounced changes in physiological variables, specifically, an increase in GSR and HR and a reduction in ST. These changes were more significant compared to the mild APS inducement in the clinical experiments. The significant physiological changes observed in the real-life scenario underscore the model’s robustness and its ability to generalize to different APS events. Figure 7 shows the beeswarm SHAP summary plot, which shows that the ranking of feature importance is identical to the order of importance deduced using the testing dataset of the clinical experiment.

4. Discussion

The complexity of the APS response necessitates the use of multiple physiological signals to achieve a high-accuracy detection model. By utilizing GSR, HR, ST, and three-axis ACC signals collected non-invasively by the Empatica E4 device for training our XGBoost model, we were able to achieve accuracy of 99.93%. Interpretation of complex models such as XGBoost is crucial for ensuring accurate predictions, model transparency, and informed decision-making. We used the SHAP technique to quantify the contribution of each physiological signal to the detection model and individual predictions as well as to identify potential sources of misclassifications. Interpreting the APS model is essential when integrating the model into the multivariable AID system for mitigating the effects of APS on glucose concentration in individuals with T1D.
Using the SHAP technique, the GSR variable is shown to be the most important signal for detection of APS. Figure 3 shows that the increase in GSR is positively correlated with the occurrence of APS. In the literature, it is reported that both SCR [14,15,25,31,32,33] and SCL [15,34,35,36,37] components of GSR consistently demonstrate increased variability in response to APS [16]. Sweat gland function is primarily regulated by the sympathetic nervous system, leading to elevation of SCR during periods of emotional arousal [38]. This outcome has led to the recognition of SCR as a reliable indicator of APS [25,39]. Additionally, studies have noted that the SCL component of GSR exhibits the highest correlation among features such as HR variability, increased respiration rate, and electromyography [17].
The SHAP technique also revealed HR as the second most important signal for detection of APS. Figure 3 shows that the increase in HR is positively correlated with the occurrence of APS. Numerous studies in the literature have reported a significant increase in HR during APS [16,40,41,42,43,44,45,46,47,48,49,50,51,52,53].
ST is shown to be the third-most important signal for APS detection. ST can increase or decrease in different regions of the human body in response to APS. The release of stress hormones such as cortisol and adrenaline in response to APS can lead to an increase in body temperature as part of the fight-or-flight response [54]. Conversely, the decrease in ST observed during APS can be attributed to vasoconstriction, a process in which blood vessels narrow, reducing blood flow to the skin surface. The literature reports that APS leads to a decrease in ST on the finger surface of the human body [14,40,41,55,56].
ACC can capture movement patterns that could be indicative of APS behaviors [57]. The ACC signals were found to have the least contribution to the APS detection model. This is explained by hand movements, which can vary substantially among subjects.
We used the SHAP technique to interpret the model’s predictions for individual instances in order to ensure the accuracy of the predictions. For example, the XGBoost model misclassified one of the NS samples as APS; however, the SHAP analysis correctly indicated NS, and also identified ST as the potential sources of the misclassification.
This work is focused on the interpretation of an APS model during a sedentary state. Future work will investigate the interpretation of APS models during periods when both physical activity and APS can be present either individually or concurrently. The changes in physiological signals such as HR and GSR signals caused by APS can sometimes be obscured by the concurrent changes resulting from physical activity. This presents a significant challenge when attempting to differentiate the specific physiological responses linked to APS from the alterations induced by physical activity such as scheduled exercise or spontaneous activities. While HR tends to increase during both APS and exercise due to increased cardiovascular demands, GSR can also intensify in response to heightened emotions during APS and because of increased perspiration during physical exertion.
A limitation of the current study is its limited number of subjects. As more data are collected in future studies, independent testing will be conducted to further validate the robustness and generalizability of our APS detection model.

5. Conclusions

An XGBoost model was developed for classification of APS and NS states, achieving an overall accuracy of 99.93%. The SHAP technique was employed to compute the global importance of the physiological signals used for detection of APS by the XGBoost model. The order of importance for the variables from most to least was determined to be GSR, HR, ST, and motion sensor ACC readings. Increases in GSR and HR were positively correlated with the occurrence of APS, as indicated by high positive SHAP values. The SHAP method highlighted the importance of local biosignals for particular instances of correctly and misclassified samples, further validating our approach. These findings underscore the significant contributions of GSR and HR signals in detecting APS, supporting our conclusions about the model’s effectiveness in APS detection.

Author Contributions

Conceptualization, M.M.R., M.R.A. and A.C.; methodology, M.M.A.-L. and M.M.R.; software, M.M.A.-L. and M.R.A.; validation, M.M.A.-L. and M.M.R.; formal analysis, M.M.A.-L., M.M.R. and A.C.; investigation, M.M.A.-L., M.M.R. and A.C.; resources, M.P., L.Q. and A.C.; data curation, M.P., M.M.A.-L. and M.R.A.; writing—original draft preparation, M.M.A.-L., M.M.R. and A.C.; writing—review and editing, M.M.A.-L., M.M.R., A.C., A.S., L.S., L.Q. and M.A.; visualization, M.M.A.-L. and M.R.A.; supervision, A.C., L.Q. and M.M.R.; project administration, M.P., M.M.A.-L. and M.M.R.; funding acquisition, A.C, L.Q. and L.S. All authors have read and agreed to the published version of the manuscript.

Funding

Financial support from the NIH under grants 1DP3DK101075, 1R01DK130049, and R01DK135116 and the JDRF under grants 2-SRA-2017-506-M-B and 3-APF-2022-1134-A-N was made possible through collaboration between the JDRF and the Leona M. and Harry B. Helmsley Charitable Trust, and is gratefully acknowledged.

Institutional Review Board Statement

This study was conducted in accordance with the Declaration of Helsinki and approved by the Institutional Review Board of the Illinois Institute of Technology (protocol code IRB 2019-018, date 16 October 2019).

Informed Consent Statement

Informed consent was obtained from all subjects involved in the study.

Data Availability Statement

The data presented in this study are available on request from the corresponding author.

Conflicts of Interest

The authors declare that they have no known competing financial interests or personal relationships that could have influenced or appeared to influence the work reported in this paper.

Abbreviations

The following abbreviations are used in this manuscript:
APSAcute Psychological Stress
SHAPShapley Additive Explanations
GSRGalvanic Skin Response
HRHeart Rate
T1DType 1 Diabetes
AIDAutomated Insulin Delivery
MLMachine Learning
XGBoostExtreme Gradient Boosting
LIMELocal Interpretable Model-Agnostic Explanations
NSNon-Stress
MSMental Stress
EASExciting Anxiety Stress
PPGPhotoplethysmogram
BVPBlood Volume Pulse
STSkin Temperature
ACCAccelerometer
EDAElectrodermal Activity
SCLSkin Conductance Level
SCRSkin Conductance Response

References

  1. Marcovecchio, M.L.; Chiarelli, F. The effects of acute and chronic stress on diabetes control. Sci. Signal. 2012, 5, pt10. [Google Scholar] [CrossRef] [PubMed]
  2. Skyler, J.S.; Bergenstal, R.; Bonow, R.O.; Buse, J.; Deedwania, P.; Gale, E.A.; Howard, B.V.; Kirkman, M.S.; Kosiborod, M.; Reaven, P.; et al. Intensive glycemic control and the prevention of cardiovascular events: Implications of the ACCORD, ADVANCE, and VA diabetes trials. Diabetes Care 2009, 32, 187–192. [Google Scholar] [CrossRef] [PubMed]
  3. Gonder-Frederick, L.A.; Grabman, J.H.; Kovatchev, B.; Brown, S.A.; Patek, S.; Basu, A.; Pinsker, J.E.; Kudva, Y.C.; Wakeman, C.A.; Dassau, E.; et al. Is Psychological Stress a Factor for Incorporation into Future Closed-Loop Systems? J. Diabetes Sci. Technol. 2016, 10, 640–646. [Google Scholar] [CrossRef]
  4. Kesavadev, J.; Saboo, B.; Krishna, M.B.; Krishnan, G. Evolution of Insulin Delivery Devices: From Syringes, Pens, and Pumps to DIY Artificial Pancreas. Diabetes Ther. 2020, 11, 1251–1269. [Google Scholar] [CrossRef] [PubMed]
  5. Dermawan, D.; Purbayanto, M.A.K. An overview of advancements in closed-loop artificial pancreas system. Heliyon 2022, 8, E11648. [Google Scholar] [CrossRef] [PubMed]
  6. Peyser, T.; Dassau, E.; Breton, M.; Skyler, J.S. The artificial pancreas: Current status and future prospects in the management of diabetes. Ann. N. Y. Acad. Sci. 2014, 1311, 102–123. [Google Scholar] [CrossRef]
  7. Nwokolo, M.; Hovorka, R. The Artificial Pancreas and Type 1 Diabetes. J. Clin. Endocrinol. Metab. 2023, 108, 1614–1623. [Google Scholar] [CrossRef] [PubMed]
  8. Sharma, S.; Singh, G.; Sharma, M. A comprehensive review and analysis of supervised-learning and soft computing techniques for stress diagnosis in humans. Comput. Biol. Med. 2021, 134, 104450. [Google Scholar] [CrossRef]
  9. Assabumrungrat, R.; Sangnark, S.; Charoenpattarawut, T.; Polpakdee, W.; Sudhawiyangkul, T.; Boonchieng, E.; Wilaiprasitporn, T. Ubiquitous Affective Computing: A Review. IEEE Sensors J. 2022, 22, 1867–1881. [Google Scholar] [CrossRef]
  10. Giannakakis, G.; Pediaditis, M.; Manousos, D.; Kazantzaki, E.; Chiarugi, F.; Simos, P.G.; Marias, K.; Tsiknakis, M. Stress and anxiety detection using facial cues from videos. Biomed. Signal Process. Control. 2017, 31, 89–101. [Google Scholar] [CrossRef]
  11. Sevil, M.; Rashid, M.; Askari, M.R.; Maloney, Z.; Hajizadeh, I.; Cinar, A. Detection and Characterization of Physical Activity and Psychological Stress from Wristband Data. Signals 2020, 1, 11. [Google Scholar] [CrossRef]
  12. Abdel-Latif, M.; Askari, M.R.; Rashid, M.M.; Park, M.; Sharp, L.; Quinn, L.; Cinar, A. Multi-Task Classification of Physical Activity and Acute Psychological Stress for Advanced Diabetes Treatment. Signals 2023, 4, 167–192. [Google Scholar] [CrossRef]
  13. Askari, M.R.; Abdel-Latif, M.; Rashid, M.; Sevil, M.; Cinar, A. Detection and Classification of Unannounced Physical Activities and Acute Psychological Stress Events for Interventions in Diabetes Treatment. Algorithms 2022, 15, 352. [Google Scholar] [CrossRef]
  14. Lee, M.H.; Yang, G.; Lee, H.K.; Bang, S. Development Stress Monitoring System Based on Personal Digital Assistant (PDA). In Proceedings of the 26th Annual International Conference of the IEEE Engineering in Medicine and Biology Society, San Francisco, CA, USA, 1–5 September 2004; Volume 26. [Google Scholar] [CrossRef]
  15. Blechert, J.; Lajtman, M.; Michael, T.; Margraf, J.; Wilhelm, F.H. Identifying anxiety states using broad sampling and advanced processing of peripheral physiological information. Biomed. Sci. Instrum. 2006, 42, 136–141. [Google Scholar]
  16. 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]
  17. Healey, J.A.; Picard, R.W. Detecting stress during real-world driving tasks using physiological sensors. IEEE Trans. Intell. Transp. Syst. 2005, 6, 156–166. [Google Scholar] [CrossRef]
  18. Ribeiro, M.T.; Singh, S.; Guestrin, C. “Why Should I Trust You?” Explaining the Predictions of Any Classifier. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, 13 August 2016. [Google Scholar] [CrossRef]
  19. Guidotti, R.; Monreale, A.; Ruggieri, S.; Pedreschi, D.; Turini, F.; Giannotti, F. Local Rule-Based Explanations of Black Box Decision Systems. CoRR 2018, arXiv:1805.10820. [Google Scholar] [CrossRef]
  20. Lundberg, S.M.; Lee, S.I. A Unified Approach to Interpreting Model Predictions. In Proceedings of the Advances in Neural Information Processing Systems, Long Beach, CA, USA, 4–9 December 2017; pp. 4766–4775. [Google Scholar] [CrossRef]
  21. Nohara, Y.; Matsumoto, K.; Soejima, H.; Nakashima, N. Explanation of machine learning models using shapley additive explanation and application for real data in hospital. Comput. Methods Programs Biomed. 2022, 214, 106584. [Google Scholar] [CrossRef]
  22. Chen, T.; Guestrin, C. XGBoost: A Scalable Tree Boosting System. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, 13–17 August 2016. [Google Scholar] [CrossRef]
  23. E4 Wristband | Real-Time Physiological Signals. 2024. Available online: https://www.empatica.com/research/e4/ (accessed on 30 March 2024).
  24. Data Streaming Packets. 2024. Available online: https://developer.empatica.com/windows-streaming-server-data.html (accessed on 30 March 2024).
  25. Setz, C.; Arnrich, B.; Schumm, J.; Marca, R.L.; Tröster, G.; Ehlert, U. Discriminating stress from cognitive load using a wearable eda device. IEEE Trans. Inf. Technol. Biomed. 2010, 14, 410–417. [Google Scholar] [CrossRef]
  26. Banos, O.; Galvez, J.M.; Damas, M.; Pomares, H.; Rojas, I. Window size impact in human activity recognition. Sensors 2014, 14, 6474. [Google Scholar] [CrossRef]
  27. Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Müller, A.; Nothman, J.; Louppe, G.; et al. Scikit-Learn: Machine learning in Python. J. Mach. Learn. Res. 2011, 12, 2825–2830. [Google Scholar] [CrossRef]
  28. Friedman, J.H. Greedy function approximation: A gradient boosting machine. Ann. Stat. 2001, 29, 1189–1232. [Google Scholar] [CrossRef]
  29. Zhang, H.; Si, S.; Hsieh, C.J. GPU-Acceleration for Large-Scale Tree Boosting. arXiv 2017, arXiv:1706.08359. [Google Scholar] [CrossRef]
  30. Shapley, L.S. A Value for n-Person Games; Princeton University Press: Princeton, NJ, USA, 1953; pp. 307–317. [Google Scholar] [CrossRef]
  31. Ren, P.; Barreto, A.; Gao, Y.; Adjouadi, M. Affective assessment by digital processing of the pupil diameter. IEEE Trans. Affect. Comput. 2013, 4, 2–14. [Google Scholar] [CrossRef]
  32. Nomikos, M.S.; Opton, E.; Averill, J.R. Surprise versus Suspense in the Production of Stress Reaction. J. Personal. Soc. Psychol. 1968, 8, 204–208. [Google Scholar] [CrossRef]
  33. Lanzetta, J.T.; Cartwright-Smith, J.; Eleck, R.E. Effects of nonverbal dissimulation on emotional experience and autonomic arousal. J. Personal. Soc. Psychol. 1976, 33, 354–370. [Google Scholar] [CrossRef]
  34. Saric, R.H.; Mcleod, D.R.; Zimmerli, W.D. Somatic Manifestations in Women with Generalized Anxiety Disorder: Psychophysiological Responses to Psychological Stress. Arch. Gen. Psychiatry 1989, 46, 1113–1119. [Google Scholar] [CrossRef]
  35. Giakoumis, D.; Drosou, A.; Cipresso, P.; Tzovaras, D.; Hassapis, G.; Gaggioli, A.; Riva, G. Using Activity-Related Behavioural Features towards More Effective Automatic Stress Detection. PLoS ONE 2012, 7, e43571. [Google Scholar] [CrossRef]
  36. Ritz, T.; Steptoe, A.; DeWilde, S.; Costa, M. Emotions and stress increase respiratory resistance in asthma. Psychosom. Med. 2000, 62, 401–412. [Google Scholar] [CrossRef]
  37. Reinhardt, T.; Schmahl, C.; Wüst, S.; Bohus, M. Salivary cortisol, heart rate, electrodermal activity and subjective stress responses to the Mannheim Multicomponent Stress Test (MMST). Psychiatry Res. 2012, 198, 106–111. [Google Scholar] [CrossRef]
  38. Dawson, M.E.; Schell, A.M.; Filion, D.L. The Electrodermal System. In Handbook of Psychophysiology, 4th ed.; Cacioppo, J.T., Tassinary, L.G., Berntson, G.G., Eds.; Cambridge University Press: Cambridge, UK, 2016. [Google Scholar] [CrossRef]
  39. Sharma, N.; Gedeon, T. Objective measures, sensors and computational techniques for stress recognition and classification: A survey. Comput. Methods Programs Biomed. 2012, 108, 1287–1301. [Google Scholar] [CrossRef] [PubMed]
  40. Engert, V.; Merla, A.; Grant, J.A.; Cardone, D.; Tusche, A.; Singer, T. Exploring the use of thermal infrared imaging in human stress research. PLoS ONE 2014, 9, 1287–1301. [Google Scholar] [CrossRef]
  41. Vinkers, C.H.; Penning, R.; Hellhammer, J.; Verster, J.C.; Klaessens, J.H.; Olivier, B.; Kalkman, C.J. The effect of stress on core and peripheral body temperature in humans. Stress 2013, 16, 520–530. [Google Scholar] [CrossRef] [PubMed]
  42. Krantz, G.; Forsman, M.; Lundberg, U. Consistency in physiological stress responses and electromyographic activity during induced stress exposure in women and men. Integr. Physiol. Behav. Sci. 2004, 39, 105–118. [Google Scholar] [CrossRef] [PubMed]
  43. Finsen, L.; Søgaard, K.; Jensen, C.; Borg, V.; Christensen, H. Muscle activity and cardiovascular response during computer-mouse work with and without memory demands. Ergonomics 2001, 44, 1312–1329. [Google Scholar] [CrossRef] [PubMed]
  44. Acerbi, G.; Rovini, E.; Betti, S.; Tirri, A.; Rónai, J.F.; Sirianni, A.; Agrimi, J.; Eusebi, L.; Cavallo, F. A wearable system for stress detection through physiological data analysis. In Ambient Assisted Living: Italian Forum; Springer International Publishing: Berlin/Heidelberg, Germany, 2017; Volume 426. [Google Scholar] [CrossRef]
  45. Ring, C.; Burns, V.E.; Carroll, D. Shifting hemodynamics of blood pressure control during prolonged mental stress. Psychophysiology 2002, 39, 585–590. [Google Scholar] [CrossRef] [PubMed]
  46. Steptoe, A.; Willemsen, G.; Owen, N.; Flower, L.; Mohamed-Ali, V. Acute mental stress elicits delayed increases in circulating inflammatory cytokine levels. Clin. Sci. 2001, 101, 185–192. [Google Scholar] [CrossRef]
  47. Moriguchi, A.; Otsuka, A.; Kohara, K.; Mikami, H.; Katahira, K.; Tsunetoshi, T.; Higashimori, K.; Ohishi, M.; Yo, Y.; Ogihara, T. Spectral change in heart rate variability in response to mental arithmetic before and after the beta-adrenoceptor blocker, carteolol. Clin. Auton. Res. 1992, 2, 267–270. [Google Scholar] [CrossRef] [PubMed]
  48. Tugade, M.M.; Fredrickson, B.L. Resilient Individuals Use Positive Emotions to Bounce Back From Negative Emotional Experiences. J. Personal. Soc. Psychol. 2004, 86, 320–333. [Google Scholar] [CrossRef]
  49. Schubert, C.; Lambertz, M.; Nelesen, R.A.; Bardwell, W.; Choi, J.B.; Dimsdale, J.E. Effects of stress on heart rate complexity-A comparison between short-term and chronic stress. Biol. Psychol. 2009, 80, 325–332. [Google Scholar] [CrossRef]
  50. Lima, R.; Osório, D.; Gamboa, H. Heart rate variability and electrodermal activity in mental stress aloud: Predicting the outcome. In Proceedings of the 12th International Joint Conference on Biomedical Engineering Systems and Technologies (BIOSTEC 2019), Prague, Czech Republic, 22–24 February 2019. [Google Scholar] [CrossRef]
  51. Clays, E.; Bacquer, D.D.; Crasset, V.; Kittel, F.; Smet, P.D.; Kornitzer, M.; Karasek, R.; Backer, G.D. The perception of work stressors is related to reduced parasympathetic activity. Int. Arch. Occup. Environ. Health 2011, 84, 185–191. [Google Scholar] [CrossRef] [PubMed]
  52. Lackner, H.K.; Papousek, I.; Batzel, J.J.; Roessler, A.; Scharfetter, H.; Hinghofer-Szalkay, H. Phase synchronization of hemodynamic variables and respiration during mental challenge. Int. J. Psychophysiol. 2011, 79, 401–409. [Google Scholar] [CrossRef] [PubMed]
  53. van Lien, R.; Neijts, M.; Willemsen, G.; Geus, E.J.D. Ambulatory measurement of the ECG T-wave amplitude. Psychophysiology 2015, 52, 225–237. [Google Scholar] [CrossRef] [PubMed]
  54. Marazziti, D.; Muro, A.D.; Castrogiovanni, P. Psychological stress and body temperature changes in humans. Physiol. Behav. 1992, 52, 393–395. [Google Scholar] [CrossRef]
  55. Rimm-Kaufman, S.E.; Kagan, J. The psychological significance of changes in skin temperature. Motiv. Emot. 1996, 20, 63–78. [Google Scholar] [CrossRef]
  56. Palanisamy, K.; Murugappan, M.; Yaacob, S. Descriptive analysis of skin temperature variability of sympathetic nervous system activity in stress. J. Phys. Ther. Sci. 2012, 24, 1341–1344. [Google Scholar] [CrossRef]
  57. Mozos, O.M.; Sandulescu, V.; Andrews, S.; Ellis, D.; Bellotto, N.; Dobrescu, R.; Ferrandez, J.M. Stress detection using wearable physiological and sociometric sensors. Int. J. Neural Syst. 2017, 27, 1650041. [Google Scholar] [CrossRef]
Figure 1. Overview of the machine learning pipeline, including data collection using the Empatica E4 followed by data preprocessing involving data segmentation, calculation of the mean for each sample, and splitting of the data into training, validation, and testing sets. This is followed by training, validation, and testing of the APS XGBoost model, then interpretation of the signal importance using SHAP.
Figure 1. Overview of the machine learning pipeline, including data collection using the Empatica E4 followed by data preprocessing involving data segmentation, calculation of the mean for each sample, and splitting of the data into training, validation, and testing sets. This is followed by training, validation, and testing of the APS XGBoost model, then interpretation of the signal importance using SHAP.
Signals 05 00026 g001
Figure 2. Confusion matrix for APS classification XGBoost model.
Figure 2. Confusion matrix for APS classification XGBoost model.
Signals 05 00026 g002
Figure 3. Beeswarm SHAP summary plot for the XGboost APS model.
Figure 3. Beeswarm SHAP summary plot for the XGboost APS model.
Signals 05 00026 g003
Figure 4. Force plot for correctly classified APS instance.
Figure 4. Force plot for correctly classified APS instance.
Signals 05 00026 g004
Figure 5. Force plot for NS sample misclassified as APS.
Figure 5. Force plot for NS sample misclassified as APS.
Signals 05 00026 g005
Figure 6. Dependency plot of GSR on APS detection with HR interaction.
Figure 6. Dependency plot of GSR on APS detection with HR interaction.
Signals 05 00026 g006
Figure 7. Beeswarm SHAP summary plot for the XGBoost APS model using the independent dataset from the oral presentation session.
Figure 7. Beeswarm SHAP summary plot for the XGBoost APS model using the independent dataset from the oral presentation session.
Signals 05 00026 g007
Table 1. Number of subjects and experiments performed for data collection.
Table 1. Number of subjects and experiments performed for data collection.
Number of SubjectsNumber of Experiments
NS628
APS1061
Table 2. Subjects’ demographic information.
Table 2. Subjects’ demographic information.
Demographic VariableMeanMin–Max
Age (years)25.020–31
Max HR (bpm)195.0189.0–200.0
Table 3. E4 wristband physiological signal frequency.
Table 3. E4 wristband physiological signal frequency.
BiosignalsFrequency
BVP64 Hz
ACC32 Hz
GSR4 Hz
ST4 Hz
HR1 Hz
Table 4. Precision, recall, and F1 score for APS classification XGBoost model.
Table 4. Precision, recall, and F1 score for APS classification XGBoost model.
MetricAPSNS
Precision (%)99.9599.83
Recall (%)99.9799.66
F1-score (%)99.9699.75
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

Abdel-Latif, M.M.; Rashid, M.M.; Askari, M.R.; Shahidehpour, A.; Ahmadasas, M.; Park, M.; Sharp, L.; Quinn, L.; Cinar, A. Acute Psychological Stress Detection Using Explainable Artificial Intelligence for Automated Insulin Delivery. Signals 2024, 5, 494-507. https://doi.org/10.3390/signals5030026

AMA Style

Abdel-Latif MM, Rashid MM, Askari MR, Shahidehpour A, Ahmadasas M, Park M, Sharp L, Quinn L, Cinar A. Acute Psychological Stress Detection Using Explainable Artificial Intelligence for Automated Insulin Delivery. Signals. 2024; 5(3):494-507. https://doi.org/10.3390/signals5030026

Chicago/Turabian Style

Abdel-Latif, Mahmoud M., Mudassir M. Rashid, Mohammad Reza Askari, Andrew Shahidehpour, Mohammad Ahmadasas, Minsun Park, Lisa Sharp, Lauretta Quinn, and Ali Cinar. 2024. "Acute Psychological Stress Detection Using Explainable Artificial Intelligence for Automated Insulin Delivery" Signals 5, no. 3: 494-507. https://doi.org/10.3390/signals5030026

APA Style

Abdel-Latif, M. M., Rashid, M. M., Askari, M. R., Shahidehpour, A., Ahmadasas, M., Park, M., Sharp, L., Quinn, L., & Cinar, A. (2024). Acute Psychological Stress Detection Using Explainable Artificial Intelligence for Automated Insulin Delivery. Signals, 5(3), 494-507. https://doi.org/10.3390/signals5030026

Article Metrics

Back to TopTop