## 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  
Figure 7: Beeswarm SHAP summary plot for the XGBoost APS model using the independent dataset from the oral presentation session. 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.