1. Introduction
Monitoring physical activity (PA) and acute psychological stress (APS) throughout daily life is important in the management of chronic diseases because regular PA can promote cardiovascular health, whereas episodes of APS can increase the risks of adverse cardiovascular events. Wearable device sensors continuously measure multiple physiological variables to enable self-monitoring of health and preventive medicine [
1,
2,
3,
4,
5,
6]. These signals provide valuable information in real time and act as surrogates for reporting variations in the levels of hormones such as cortisol, lactate, and epinephrine, which cannot be measured in real-time, noninvasively, and in daily living, to indicate PA and APS [
7,
8,
9,
10,
11,
12]. Physiological measurements are also useful in automated medical intervention decisions in chronic diseases. For example, in diabetes, PA and APS may affect blood glucose concentrations in opposite directions. Signals from a wearable device would complement the information received from a continuous glucose monitoring device and provide advance information of the presence of PA and/or APS, which will ultimately affect the glucose level, enabling better insulin dosing decisions [
6,
9,
13,
14,
15,
16]. The convenience of noninvasive wearable sensors means that the devices can be worn continuously in daily living to monitor the PA of users without hindering or limiting the motions of the users. However, the signals from wearable devices such as wristbands are corrupted by noise and artifacts. They require powerful signal processing algorithms to extract reliable information from noisy data and eliminate the effects of artifacts.
The physiological variables collected from wearable devices have been useful in noninvasive detection of PA and APS [
7,
8,
9,
10,
11]. Recent developments in signal processing of wearable device biosignals and machine learning (ML) algorithms enabled the integrated analysis of PA and APS by enabling the detection and discrimination of concurrent incidences of PA and APS [
17,
18]. This was made possible by clinical experiments designed to enrich the training data with various PA and APS inducements, multiple physiological biosignals measured using a single convenient wearable device, and recent advances in signal processing, feature extraction, and ML [
17,
18,
19,
20,
21]. The recent developments in signal processing are particularly important since noise and artifacts are routinely encountered in real-world data, which can easily mask the differentiating features among the possibly simultaneous incidences of PA and APS [
19,
22,
23,
24,
25,
26]. Despite the significant impact of signal processing on the accuracy of the algorithms, the effects of signal processing on the performance of ML algorithms is often not reported in studies on the detection and discrimination of PA and APS [
17,
18].
The role of signal processing is even more critical in discriminating between concurrent PA and APS because they may result in similar responses in measurable physiological variables [
17,
18]. The psychological stressors prompt the activation of various physiological systems that result in the overall stress response with the aim of restoring homeostasis [
7,
27,
28]. The response to APS is typically coordinated by the hypothalamus through the activation of the autonomic nervous system and the pituitary and adrenal glands in the hypothalamus–pituitary–adrenal axis, resulting in the release of stress hormones such as catecholamines and cortisol [
27,
28]. The stress hormones are difficult to measure continuously in free-living ambulatory conditions [
7]. This necessitated research into surrogate biomarkers of APS, including readily measurable physiological biosignals such as heart rate (HR), respiration rate, pupil diameter, skin temperature (ST), electrodermal activity (EDA, also known as galvanic skin response (GSR)), blood volume pulse (BVP), electrocardiogram, and blood pressure [
7,
11,
13,
29,
30]. The validity of these conveniently measured physiological biosignals for detecting APS has been demonstrated in several studies [
7,
11,
13,
19,
29,
30,
31]. Previous works illustrated that reliably discriminating between different types of APS is possible, including emotional anxiety stress and mental stress [
7,
11,
32,
33].
Figure 1 illustrates the structure of use of biosignals for APS detection, PA classification, and for various healthcare and public health research applications.
The proposed work consists of signals processing, feature extraction, data preparation, machine learning algorithm development, and evaluation of results (
Figure 2). To achieve this aim, we designed experimental protocols to collect data, and we developed ML algorithms to detect APS in the presence of PA, which is a challenging problem as the readily-measurable physiological biosignals used to detect APS, such as HR and GSR, are also affected by PA [
13]. The challenges in discriminating among different types of APS during periods of possibly simultaneous occurrences of PA are not only due to the overlapping responses in the physiological measurements, but also due to the noise and artifacts in the biosignals measured from wearable devices, which necessitates effective data filtering and adaptive noise cancellation (ANC) algorithms to extract and enhance the informative signal from the measurements for use in ML algorithms [
7,
13,
17,
18,
19].
The practicality of simultaneous PA and APS detection extends beyond routine monitoring of health. The detection and discrimination of simultaneous PA and APS can generate reliable digital biomarkers of the physiological and psychological states of people for use in the treatment of chronic conditions like diabetes and cardiovascular disease [
34,
35]. Diabetes treatment, in particular, can significantly benefit from more accurate assessments of the PA and APS states of people with Type 1 diabetes (T1D) [
9,
13,
14,
15,
16]. People with T1D must administer exogenous insulin to compensate for the loss of pancreatic insulin production and maintain their blood glucose concentration within the desired safe range [
36]. However, insulin requirements vary due to the type and intensity of PA and the possibly concurrent incidence of APS [
9,
13,
14,
15,
16,
37]. This creates difficulties for people with T1D in effectively regulating their glucose levels because PA and APS typically have divergent effects on glucose levels [
9,
13,
14,
37]. Prolonged low- and moderate-intensity aerobic exercise causes a reduction in glucose concentrations because of the increase in glucose use by the working muscles and a heightened sensitivity to insulin as muscle cells are more effective using any available insulin to take up glucose during and after PA [
9,
14,
37]. In contrast to PA, APS causes the release of neuroendocrine hormones that stimulate the release of free energy and restricts the uptake of glucose into various tissues, causing the blood glucose concentration to temporarily rise [
38]. This can be problematic for regulating glucose levels in people with T1D. Tasks considered routine by healthy individuals, like training or recreational activity versus competitive sporting events, can cause glucose values to drift out of the desired range and increase the risk of developing diabetes-related complications. Some of the routine activities in everyday life, like running due to being late for important events, or undesirable hindrances or disruptions in common tasks can also trigger APS, which may be easily masked by the concurrent PA [
13,
17,
18]. Appropriate signal processing and feature extraction can improve the accuracy of discriminating between physical activity and psychological stress. The necessity of feature extraction in ML is well established [
31]. The development of signal processing techniques to handle the noise and artifacts in the measured physiological biosignals from wearable devices is an active research area [
19,
22,
23,
24,
25,
26].
Motivated by the above considerations, in this work, we studied the effects of data filtering and adaptive noise cancellation techniques on the accuracy of detecting and discriminating PA and APS, and quantifying the PA intensity using a variety of ML algorithms and physiological measurements collected from a wristband. We demonstrate that effective signal processing and feature extraction are important to ensure high accuracy for ML algorithms (naïve Bayes, decision tree, k-nearest neighbor, linear discriminant, ensemble learning, and support vector machine) to discriminate among different types of individual or concurrent incidences of PA and APS and quantify the intensity of the PA through estimates of energy expenditure (EE). The PA and APS classification provides users with important information on the individual or concurrent simultaneous occurrences of physiological and psychological stressors that they are experiencing, and EE provides an assessment of the physical exertion. The results show that the proposed signal processing techniques increase the detection and discrimination accuracy for PA and APS and decrease the EE estimation error.
4. Discussion
This paper presents an application for obtaining psychological and physiological states from the signals of a wearable device that can be used in everyday life—a wristband. The performance of several signal processing algorithms and ML methods were assessed. k-NN, NB, and DT performed worse than the other algorithms because these algorithms require more data. However, SVM, LD, and EL produced more accurate performance since they can work with a relatively small amount data with a low risk of overfitting.
The GPR is a powerful ML model; however, it requires a large amount of data. For this reason, in our EE estimation model, it had a large estimation error. SVM, EL, and k-NN achieved similar results that were significantly better than those of the other ML techniques considered.
The signal processing algorithm denoised the wristband PPG signal and removed the artifacts to clearly show the peaks, enabling an accurate estimation of HR. Signals from wristband devices are corrupted with artifacts caused by arm and wrist motion during most physical activities. The developed algorithm improved HR estimation during PA (
Figure 6). The contributions of signal processing to accuracy enhancements were evaluated by comparing processed and raw biosignals for the same implementation of various ML algorithms used in this work. Signal processing improved classification accuracies by 0.7% to 4.5%. It also significantly improved the EE estimation.
Table 6 presents the improvements with the use of filtered data.
During SS activities, NS was distinguished from other types of APS with a high accuracy (97.7%;
Figure 8). However, during exercise, NS could not be discriminated as accurately from other types of APS (92.9–74.4%;
Figure 8). The accuracy decreased because exercise and APS can affect some biosignals such as HR. Similarly, both APS and exercise increase HR.
Filtering improves signal quality by smoothing the signals and reducing the amount of noise, sharp and sudden changes, and outliers. Features are extracted from both filtered and raw data. Features with filtered data represent reasonable distributions in a limited range scale with fewer outliers, which is crucial because features are used for the design of all ML algorithms. The raw BVP signal is also used for feature extraction because motion artifacts can help capture the type of PA and discriminate PA from APS.
Figure 10 illustrates the improvements with filtering for various biosignals. Signal processing algorithms also improve the classification and estimation outcomes. Filtered signals performed better by up to 3% for APS classification and 18% for EE estimation (
Table 6).
We analyzed the effect of each sensor modality on the classification accuracy. In this analysis, we excluded the feature variables derived from ACC, GSR, HR, BVP, and ST measurements, and built the classification models with the retained measurements only, which included the PS, APS-SS, APS-TR, and APS-SB classifications. The results showed a decrease in classification accuracy when any individual measurement variable was removed, thus demonstrating the advantage of the multisensor fusion method in improving the classification accuracy (
Figure 11). The different modalities of sensing physiological variables provide various contributions to the classification accuracy. For example, the galvanic skin response measurements contribute significantly to improving the psychological stress during biking relative to the other biosignals. The accelerometer signals contribute to improving the physical state classification.
One limitation of the current work is that the data collected were not sufficient to develop advanced deep learning models; because of this limitation, we found that other machine learning techniques performed better than the deep learning approaches. More data are needed to appropriately train the advanced deep learning models and these results should not be considered for assessing deep learning models.
Our research focused on identifying the effects of physical activity and acute psychological stress on the glucose–insulin dynamics of people with Type 1 diabetes. Due to insufficient insulin secretion, people with Type 1 diabetes must administer exogenous insulin to regulate their blood glucose levels. The amount of insulin dose to administer depends on the physical and psychological state of the subject. The algorithms developed in this work will enable real-time assessment of the physical and psychological stressors experienced by people with Type 1 diabetes and how their insulin requirements vary based on these factors.