## 5 Discussion
The high similarity between different types of APS and NS classes causes biased interpretation of the trained model from the synthetic samples. A comparison between Figures 6 and 8 illustrate the difference in architecture of the two models. In the multi-task architecture, mutual features contributing to both classes were used for the classification task. It should be noted that the number of model layers, trainable units, and other hyper parameters remain invariant. Hence, overfitting of \"data-hungry\" LSTM layers drops the performance of classification. However, this issue can be solved by introducing a regularization feature in trainable layers. The independent models also require performing of repeating feature engineering for each model; hence, the issue can be troublesome in model deployment in real time. The estimated EE values for an individual subject running on the treadmill under the influence of EAS are illustrated in Figure 10. The EE estimation algorithms for both the independent LSTM RNN model and the multi-task LSTM RNN model are able to track the EE measured by the Cosmed K5 Calorimeter with high accuracy. A significant drop in the performance of XGboost models can be observed as compared with both independent and multi-task NN architectures. Training XGboosted trees is a challenging task and requires constant monitoring of models to avoid the problem of overfitting as well as biased model training. For both XGboost models, off-diagonal predictions in the confusion matrices Figures 11b and 12b increased drastically. Apart from biased predictions that stemmed from synthetic samples, a range number of samples were misclassified as NS events. A major difference between the two models is the time series structures in RNN models while XGboost models only trained on a single slice of the data and no past time windows were used in the model. Since different episodes of APS and PA take place in piece-wise patterns, the recurrent model is a better choice for modeling from these types of measurements, as RNN models capture the dynamic behavior in estimating the probability of the classes. In contrast, the trained XGboost only predicts probabilities based on the current snapshot of biosignals and as a consequence, non-smooth predictions and more oscillations between the predicted classes are anticipated. A limitation of the current work is that the EE data collected during MS experiments are not sufficient to include MS type in the case of multi-task LSTM RNN classification of APS types and PA types and estimation of EE. The presented approach can cover the common PA in daily life. Future work will extend the presented approach to include other classification scenarios to obtain an accurate classification during all kinds of daily activities. Incorporating information on the type and intensity of PA in diabetes therapies improves time in range (TIR) and prevents hypoglycemia in people with T1D by modulating the insulin requirements to counteract the effects of PA on the blood glucose dynamics [15; 57]. Additionally, incorporating information on the APS can improve treatment outcomes. Researchers have documented that athletic competition stress increases blood glucose levels and reduces insulin sensitivity in individuals with type 1 diabetes preceding and during an athletic competition in comparison to the same physical activity performed in training at the same intensity [58]. In addition to incorporation of PA information, future work will incorporate APS information in AP systems to adjust the insulin dosage in people with diabetes to account for the glycemic disturbance effects of both PA and APS.