Identification and Quantification of Activities Common to Intensive Care Patients; Development and Validation of a Dual-Accelerometer-Based Algorithm

The aim of this study was to develop and validate an algorithm that can identify the type, frequency, and duration of activities common to intensive care (IC) patients. Ten healthy participants wore two accelerometers on their chest and leg while performing 14 activities clustered into four protocols (i.e., natural, strict, healthcare provider, and bed cycling). A video served as the reference standard, with two raters classifying the type and duration of all activities. This classification was reliable as intraclass correlations were all above 0.76 except for walking in the healthcare provider protocol, (0.29). The data of four participants were used to develop and optimize the algorithm by adjusting body-segment angles and rest-activity-threshold values based on percentage agreement (%Agr) with the reference. The validity of the algorithm was subsequently assessed using the data from the remaining six participants. %Agr of the algorithm versus the reference standard regarding lying, sitting activities, and transitions was 95%, 74%, and 80%, respectively, for all protocols except transitions with the help of a healthcare provider, which was 14–18%. For bed cycling, %Agr was 57–76%. This study demonstrated that the developed algorithm is suitable for identifying and quantifying activities common for intensive care patients. Knowledge on the (in)activity of these patients and their impact will optimize mobilization.


Introduction
For inpatient individuals who receive intensive care (IC), including those with extensive burns, physical functioning is severely impaired. This can lead to many secondary problems such as ICU-acquired weakness and other physical, cognitive, or mental disorders. Being physically active as a form of rehabilitation, even in the early stages of recovery, is important for optimizing physical functioning and increasing autonomy [1]. Therefore, adequate physical activity in the IC setting is important for improving physical functioning [2,3]. However, what constitutes "adequate" physical activity has yet to be Sensors 2023, 23, 1720 3 of 18 were recruited via e-mail, telephone, or personal contact. Only employees of the Martini Hospital could participate, due to COVID-19 restrictions.
To provide insight into the heterogeneity of the sample, data on gender and age (years) were collected, and participants' height (centimeters) and weight (kilograms) were measured. Before the study began, they were afforded the opportunity to ask questions. All participants gave informed consent prior to the initiation of the study. Based on the literature on the validation of algorithms for accelerometer data, we aimed for 10 participants [13,[18][19][20].
Data from the ten participants were randomly allocated to be used for (1) the development and optimization of the algorithm (n = 4) or (2) the validation of the algorithm (n = 6). This was performed using an online randomization tool (www.stattrek.com/statistics/ random-number-generator.aspx (accessed on 16 June 2021)) based on earlier research [21].

Activity Protocols
Participants were asked to perform 14 different activities relevant and common to IC patients in and around an IC bed, including transitions between activities (Appendix A). Activities were performed in a fixed order according to four protocols: (1) Protocol natural: activities were performed without further instructions in order to induce natural variation in how participants performed the activities, (2) Protocol healthcare provider: activities were performed with the assistance of a healthcare provider in order to reflect the (passive) status of an IC patient, especially during the transition from one activity to another, (3) Protocol strict: activities were performed strictly based on instructions on how to do so and with additional instructions if they were not performed correctly, and (4) Protocol bed cycling: active bed-biking on a bed-cycle ergometer (MOTO-MED) at a self-selected speed.
Protocols 1-3 took approximately eight minutes, and Protocol 4 about four minutes.

Interrater Reliability of the Video Observations
Video recordings were made with a video camera of all of the activities performed by the participants (Sony, full HD (1080p), type HDR-PJ410, 50 fps). These were used for the development and optimization of the algorithm and as a reference standard for the validation of the algorithm. The camera was placed on a tripod 1.10 m from the end of the IC bed at a height of 1.50 m. For the walking activity, the camera was rotated to ensure that the participants remained in focus. During the last protocol, i.e., the bed-cycling protocol, the camera with the tripod was repositioned to the corner of the ICU room.
Two different raters (YD and ASN) separately and independently determined the type and duration of activities. The latter was calculated as the start time minus the end time of an activity from the video recordings within a 0.004 s window. For this, a video analysis and modeling tool that allowed a detailed analysis of video elements (Tracker, version 5.1.5) was used. To enhance the analysis, a distinction between 'static' and 'dynamic' activities was made. For a static activity, such as lying or sitting, the moment when the participant was completely still in the required position was selected as start time while the moment when the participant moved again was noted as the end time. For dynamic activities, such as transitions and walking, the time when the participant initiated the movement as indicated by a high velocity of postural change leading to a new activity was chosen as the start time; the moment when the participant was in a new activity was noted as the end time. Hesitations and minor repositioning of arms, legs, and clothes before or after the transition were thus disregarded. Slight limb movements during a static activity were scored as noise, whereas extensive limb movements combined with body movement were categorized as transitions as long as they occurred between different activities. If body movement did not correspond to a specific activity in the protocol, it was categorized by the raters as 'undefinable'.

Accelerometer Locations
Six tri-axial accelerometers (ActivPAL4, ActivPALTM micro, PAL Technologies, Glasgow, UK), size, 23.5 mm × 43 mm × 5 mm, weight 9 grams, and a sampling frequency of 20-40 Hz (for this study 20 Hz was chosen) were fixed on the body with Tegaderm ( Figure 1). In the present study, data from two sets of two accelerometers were used, i.e., midclavicular line left to right thigh (MCL-TR) and midclavicular line right to left thigh (MCR-TL) (Figure 1). Data forming the third set of accelerometers (i.e., rib cage or ankles) ( Figure 1) will be analyzed later for different configurations in a separate study. Locations of the accelerometers used in this study were selected based on Rauen et al., 2018 [16] and Hartley et al., 2018 [15], who demonstrated that combinations of two accelerometers at these locations enabled them to distinguish between sitting, lying, and lying on the left or right side. In the current study, in contrast to Rauen et al., 2018 [16], the thigh accelerometer was placed on the anterior side of the thigh in order to avoid pressure on the skin or tissue when someone is lying on his/her side. noted as the end time. Hesitations and minor repositioning of arms, legs, and clothes before or after the transition were thus disregarded. Slight limb movements during a static activity were scored as noise, whereas extensive limb movements combined with body movement were categorized as transitions as long as they occurred between different activities. If body movement did not correspond to a specific activity in the protocol, it was categorized by the raters as 'undefinable'.

Accelerometer Locations
Six tri-axial accelerometers (ActivPAL4, ActivPALTM micro, PAL Technologies, Scotland, UK), size, 23.5 mm × 43 mm × 5 mm, weight 9 grams, and a sampling frequency of 20-40 Hz (for this study 20 Hz was chosen) were fixed on the body with Tegaderm ( Figure 1). In the present study, data from two sets of two accelerometers were used, i.e., midclavicular line left to right thigh (MCL-TR) and midclavicular line right to left thigh (MCR-TL) (Figure 1). Data forming the third set of accelerometers (i.e., rib cage or ankles) ( Figure 1) will be analyzed later for different configurations in a separate study. Locations of the accelerometers used in this study were selected based on Rauen et al. 2018 [16] and Hartley et al. 2018 [15], who demonstrated that combinations of two accelerometers at these locations enabled them to distinguish between sitting, lying, and lying on the left or right side. In the current study, in contrast to Rauen et al. 2018 [16], the thigh accelerometer was placed on the anterior side of the thigh in order to avoid pressure on the skin or tissue when someone is lying on his/her side.

Processing of Accelerometer Data
Raw accelerometer data consisted of an acceleration signal in each axis (x, y, z). From these raw data, three variables were derived, i.e., horizontal and vertical body angles as well as a signal magnitude area (SMA). Accelerometer angles were calculated in three steps. First, the raw acceleration signals for each axis were smoothed using a three-point median filter. Second, the gravitation component (GA) representing the tilt of the accelerometer with respect to the field of gravity was extracted by applying a low pass infinite impulse response filter (IIR) with a cutoff to the acceleration signal at 0.25 Hz. Third, the tilt angles were computed as described by Fisher [22]. In order to account for sensor drift of the accelerometers, baseline corrections were made for all body angles by subtracting the offset of those that were obtained during this supine rest position. This way, horizontal tilt angles (θ, ψ) were set to zero and the vertical tilt angle (ϕ) to 90 in supine rest position (Appendix B) to make the body angles easier to interpret. The SMA represents the magnitude of bodily movements with a larger SMA during larger movements. To calculate the SMA, the GA was first subtracted from the raw acceleration signal from each axis which resulted in values that represent body accelerations. Hereafter, the integrals of the body accelerations were Sensors 2023, 23, 1720 5 of 18 calculated for each axis using a sliding window method of one second and then summed which provided the SMA value for each window [16].

Development and Optimization of the Algorithm
To develop the algorithm classifying the performed IC activities at baseline, a flowchart with body segment angles and SMA values was made based on the algorithm used by Lugade et al. [13] and previous pilot measurements of our group (non-published data). Initial accelerometer body segment angles and a rest-activity-threshold were selected based on these pilot measurements. Initial accelerometer body segment angles were used to classify activities based on different body angles when the participant was performing the different activities with regard to the accelerometer locations. The rest-activity-threshold was used to classify static and dynamic activities using the SMA values and visual inspection of the SMA plots. Accelerometer and video data were aligned in time by selecting the first transition in the protocol; this was indicated by a strong increase in the SMA value as shown in the SMA plots. Data from the four participants of the development group were used to optimize body angles and the rest-activity threshold of the algorithm. After careful consideration, the activity categories 'sitting on the edge of a bed' and 'sitting in a chair' were combined into one category as these differed minimally in angles during performance. Furthermore, transitions during all of the protocols were combined into one category, i.e., 'transitions'. In order to match the frequency of the accelerometers and the video, data from both the accelerometers and video were set to a frequency of 5 Hz. There was a visual inspection of these coded data (i.e., video data that were classified to type of activity organized per 5 Hz, 0.2 s) to check for notable differences between the two raters (YD and ASN). When these were ascertained, this was resolved by discussion and, with remaining uncertainties, by seeking the opinion of a third rater (MKN).

Statistical Analyses
To check on the quality of the reference standard, interrater-reliability of the video observations was determined. This was performed with the total time of activity per protocol with interclass correlations (ICCs) for all ten recorded participants (two-way mixed, absolute agreement, single measures) [23] using SPSS version 25.0. Interrater reliability was considered to be satisfactory when ICC > 0.75 [24].
Following the validation procedure of Lugade et al. [13], coded data (i.e., video data that was classified as type of activity organized per 5 Hz, 0.2 s) from one rater (rater one, YD) served as a reference, and the percentage of agreement (%Agr) was calculated as that of correctly coded activity by rater two (ASN) compared to the coded activity of rater one. In addition, the %Agr between raters on the video observations was used as a target score for developing the algorithm. For example, if the %Agr between rater one and two on a specific activity was 98%, this was subsequently also the target for the algorithm for that specific activity. The validity of the developed algorithm was determined by the %Agr on data from the validation group (n = 6) compared to all observations of rater one (YD). As the %Agr of the algorithm related to the video observations was not expected to be higher than the target score, the algorithm was considered to be valid if 80%Agr was reached [25].

Participants and Protocols
Ten participants (five male, five female, mean age 45.9 years, SD 13.2), height 168-194 cm (mean 179.6 cm, SD 8.1), weight 62-94 kg (mean 76.2 kg, SD 11.7) completed all four protocols of activities. For one of them, the activities 'sitting in a chair,' 'standing,' and 'walking' were excluded from the natural protocol because the midclavicular accelerometer became unattached. In one other participant, a problem with the video camera led to the exclusion of 'bed cycling with the bed head at 30 degrees' in the bed cycling protocol. None of the participants experienced discomfort or side effects from wearing the accelerometers.

Interrater Reliability of the Video Observations
Interrater reliability of video observations between the two raters was high to excellent with all ICCs > 0.76 except for 'walking' in the strict protocol for which the ICC was 0.298 (Table 1). The %Agr of the coded activities between the two raters was very high with most above the 98% (Table 1). The lowest %Agr was determined for 'walking' and 'transitions' (86-94%) ( Table 1). The percentage agreement of the undefinable activity between rater one and two was 91, 88, 78, and 97% for the natural, healthcare provider, strict, and bed-cycling protocol, respectively. Table 1. Interrater reliability of video analysis, percentage agreement between two raters on the coded activities, and percentage agreement of the algorithm related to the video on the development group data.

Development and Optimization of the Algorithm
With the algorithm run on the data of the development group, the %Agr between the algorithm and reference standard nearly reached the target scores for some static activities such as 'supine and prone lying' and 'sitting' in the natural and strict protocol (96-99%) for both accelerometer configurations (Table 1). However, activities with small differences in body angles such as 'semi lying on the right' and 'side lying right' did not reach the predetermined target score, as these categories were interchanged by the algorithm (Table 1). As the distinction between these two activities is of minimal clinical importance, the categories were merged into one category, i.e., 'side-semi lying', prior to algorithm validation on the validation group. Within dynamic activities, the %Agr between the algorithm and the video for activities such as 'walking' almost reached target score (84-85%) (Table 1); however, 'transition' in the healthcare provider protocol scored very low (18-23%) for both configurations compared to the target score (93%) ( Table 1).
As the SMA represents bodily movements with a larger SMA during larger movements, visual inspection of the SMA plots showed that the SMA values in the healthcare provider protocol were much lower than in the other protocols ( Figure 2). When the rest-activitythreshold was lowered, the %Agr for 'transitions' in the healthcare provider protocol increased but also resulted in an overestimation of dynamic activity in the other protocols. As 'transitions' in all protocols should be accurately coded by the algorithm, we decided to establish the cut-off point for the rest-activity threshold at >0.03 ( Figure 2). The main goal of the SMA plots was to obtain an indication of the rest-activity-threshold required to properly classify 'transitions' in all protocols. For this reason, the bed-cycling protocol was not included in Figure 2 due to its more consistent SMA values. After optimizing the algorithm, the body angles and SMA values were displayed in the final flowchart ( Figure 3).    Signal magnitude area (SMA) of one participant during the performance of activities of three protocols (natural, green; healthcare provider, blue; and strict, red). The black line is used to determine the cut-off point to identify dynamic activities during the development of the algorithm. Note that the SMA value in the healthcare provider protocol (blue) is much lower compared to the other protocols.

Validity of the Developed Algorithm
To validate the algorithm, the final algorithm ( Figure 3) was run on all the data of both accelerometer configurations of the validation group (n = 6). The highest %Agr between algorithm and video was found for static activities such as 'prone-supine lying', 'side lying left and right'; all were above 95% (Figure 4). For the activities 'sitting on edge of bed or chair' and 'semi sitting' it was 74-100% ( Figure 4). The %Agr on 'transitions' in the healthcare provider protocol was low (14-17%) while it was high on 'transitions' in the natural and strict protocol (>80%) (Figure 4). For 'bed cycling', the %Agr was 57-76%. The two accelerometer configurations MCR-TL and MCL-TR had similar results (difference between 0-8%Agr) on almost all activities in the four protocols ( Figure 4). Those that scored slightly lower were 'standing' (19%) and 'sitting' (12%) in the natural and (16%) healthcare provider protocol, which is not in favor of a specific configuration (Figure 4). For the absolute values of %Agr per activity per protocol for the two different configurations, see Appendix C.

Discussion
The objective of the present study was to develop and validate a dual-accelerometerbased algorithm to identify activities that are common for IC patients. The results showed that the developed algorithm based on data from two accelerometers, i.e., one accelerometer placed on chest and the other one the opposite thigh, are able to detect almost all static

Discussion
The objective of the present study was to develop and validate a dual-accelerometerbased algorithm to identify activities that are common for IC patients. The results showed that the developed algorithm based on data from two accelerometers, i.e., one accelerometer placed on chest and the other one the opposite thigh, are able to detect almost all static activities that are common and relevant for IC patients with very high agreement scores relative to the video data that served as a reference. The algorithm was also valid for identifying dynamic activities such as transitions. The only activity that had low agreement scores was 'transitions' with the aid of an healthcare provider. The different configurations (i.e., left and right diagonal) of the accelerometers showed similar results, implying that both diagonals can be used.
Just as in other studies using two accelerometers [12,13,16,26], we were able to correctly identify different activities, such as lying and sitting. This is essential, as IC patients spent most of their time engaged in these activities [11]. Our study adds to others in that our developed algorithm can identify additional activities, such as transitions from lying on the left to right side and bed cycling. An assessment of activities is important as, until now, detailed information on the performed physical activity of IC patients during an ICU stay has been lacking. Furthermore, although IC patients are not highly active, a recent study found significant variations in physiological responses to different types of activities [2] indicating that an assessment of all types is immensely important. To enhance rehabilitation in IC patients, an appropriate amount of physical activity is essential [27], and objective measurements about the type, intensity, frequency, and duration of performed activity by IC patients are essential [6]. Therefore, with this detailed information provided by our algorithm, the amount of physical activity that is required to optimize rehabilitation can be studied more thoroughly.
In this study, we chose to manually develop and optimize the algorithm based on body angles and SMA values using the raw data from two tri-axial accelerometers. Recently, many different classifiers have become available, such as machine learning algorithms, that appear to be promising for correctly identifying physical activity [17,28,29]. However, the usefulness of applying them in a clinical setting requires some awareness, as the optimization process is a kind of black box and cut-off points for identifying physical activity may vary depending on the conditions [28,29]. Moreover, as described in detail in a recent study [17], there are many different ways to estimate and validate algorithms; however, a comparison of results from studies is difficult because not all algorithms are described transparently. Using a machine-learning algorithm to identify physical activity is a data-driven method. Stated differently, it can develop an optimal model based on the given (sometimes very large) dataset and is effective to use on a large scale, but, just as in other models, it can only be as good as the quality of the underlying data. Nevertheless, a manually developed algorithm has some advantages, because it is both data-and logicbased, which makes the mechanism of the algorithm and the results easier to understand. This is important because adjustments to it must be clinically relevant in order to improve it so that it captures body movement relevant to a particular population. Consequently, we chose to optimize the algorithm based on video data with a very short window, to ensure that body angles fit the performed activity and not only to ensure increasing %Agr. Therefore, during the development, activities such as sitting and sitting on the edge of the bed were included separately. However, since these categories were interchanged by the algorithm, as the person is sitting and body angles were somewhat the same in both cases, they were merged into one category.
We used the SMA value to distinguish between static and dynamic activities, as this has been shown to have good sensitivity and specificity for distinguishing between these types of activities [30]. However, identifying dynamic activities such as 'transitions' in the healthcare provider protocol was more difficult and resulted in lower %Agr scores. A further analysis of the data in the healthcare provider protocol showed that the absolute SMA values of 'transitions' in it were relatively low compared to those in the natural and strict protocol (Figure 2). Selecting a lower rest-activity threshold (lower SMA value) resulted in a higher %Agr for 'transitions' in the healthcare provider protocol; however, such a lower threshold would have also resulted in an overestimation of the total amount of dynamic activity in the other protocols. Therefore, an SMA value of 0.04 was chosen while, in other studies in other settings, SMA values of 0.135 [13], 0.2 [16], or even 0.80 [13] were used. These findings indicate that selecting the appropriate SMA value to identify clinically relevant activities depends heavily on the situation and population for which the algorithm is being created.
In addition, regarding the lower %Agr score for 'transitions' in the healthcare protocol, results showed that their duration was very brief (1-2 s) while transitions such as transfer to chair performed by the participant itself in the other protocols took approximately 3-5 s. Short activity bouts were difficult to identify as higher agreement can be achieved with longer activity tasks [13].
We found all ICCs between video-observers were sufficient except for one, i.e., 'walking' in the strict protocol. In-depth analyses indicated that it was due to one single video in which the two observers significantly deviated (2 s) from the amount of time that the activity ended and the transition to sit in the chair began. Without this one observation, the ICC for walking in the strict protocol was 0.67 and would have been sufficient. Furthermore, our time frame for classification was 0.004 s, while, in other studies, this was much longer-for example, one second [13] and one minute [14]. As a consequence, categorizing activities was most difficult at the beginning and end of an activity. Nevertheless, we are able to detect short activities, such as turning in bed.
In this study, healthy individuals performed the ICU-related activities of the four protocols. Theoretically, it would have been optimal if the validity of the new method had been developed based on observations in IC patients. In practice, however, this would mean that ICU patients' physical activities would have to be monitored every minute by an observer with an activity diary and/or with video. Both ethically and organizationally, this was not an option. Therefore, the choice was made to use healthy individuals and mimic the setting of ICU patients as much as possible. The various activities of the protocols were chosen based on the literature and on input from highly experienced ICU staff. The latter input in particular was important, and led to the inclusion of activities performed with and without instructions, and even more importantly, with the help of healthcare providers, which has not happened in previous similar studies [13,16,17,26]. It is possible that the validity of the new method is slightly lower when the activities have been performed by IC patients. Reasons for this include that some activities could be misclassified by the algorithm, for example during nursing activities such as washing. This could lead occasionally to the over-or underestimation of a specific activity, for instance more time being spent in dynamic than in static activities. However, we do not think this is a problem, as our algorithm was found to be valid even with many very high agreement scores.
Another issue is that the activities chosen may be performed differently by IC patients than by healthy individuals, such as when a patient is slumped into a chair due to limited trunk balance or walks with a walking aid. In that case, the SMA values and combination of angles may not fall within the predefined ranges for these activities. The algorithm will then classify more time as 'unknown'. This does not influence validity as such, but it does have implications for identifying real-life activities performed by IC patients. To cover all activities in practice, an additional step in the development of the algorithm might be needed. Currently two studies are being conducted, one in a burn ICU and one in a general ICU using the algorithm in combination with an activity diary. Results from these studies will give us insight into which activities are not identified.

Strengths and Limitations
A strength of this study is that we chose to place the thigh accelerometer at the front of the thigh rather than on the lateral side as was performed by Rauen et al., 2018 [16]. This location is more useful in bedridden patients because it avoids pressure when lying on their side. Second, the algorithm developed in this study is appropriate for both tested accelerometer configurations (both diagonals) to identify different activities. This finding implies that, if an IC patient has lines, devices, or wounds at one of the accelerometer locations, a shift of locations can be made without the outcome being different. Third, all participants performed all four different protocols, including one for which transitions were performed with the aid of a healthcare provider. Consequently, all of the different activities were performed multiple times, and variation in how the separate activities were performed by each individual is included which improves external validity for use in an IC setting. Fourth, the activities in the different protocols were widespread (from lying down to walking) which allows this algorithm to also be applied when patients become more active. In this context, this algorithm can provide insight into activities performed throughout the course of hospitalization. Fifth, we randomized the participants' data into a development and a validation group. This afforded us the opportunity to monitor whether the algorithm that was developed would also be valid with an independent set of samples and to ensure that this algorithm can be applied in the ICU setting. Sixth, activities were classified based on video recordings observed by two different raters. Very high ICC values were achieved, guaranteeing the reliability of activity classification.
There are, of course, also limitations to this study. First of all, we did not instruct participants to walk or bed cycle at a certain speed. As a result, it was more difficult to develop the algorithm, and it might have missed part of these activities if these fell beyond the cut-off points. Nevertheless, our algorithm was able to identify these activities even though participants chose their own speed and varied while performing the activities. Another limitation is that the accelerometers and video data did not begin at the exact same time, as the accelerometers had to be installed beforehand. Therefore, the first peak in the SMA value was used to align the accelerometer data and the video observations. Thus, the first transition of the protocol was used. However, especially in the healthcare provider protocol, the transitions were very short (only 1-2 s) which made aligning the data challenging. Though this is a technical limitation, it can only have a positive effect on the validity of the algorithm in a genuine setting as the agreement scores, and thus the validity, might be higher than currently indicated with perfect time alignment. Finally, the activities were performed by healthy participants. When IC patients perform the activities that are incorporated in the algorithm, they can be identified and quantified in IC patients.

Conclusions
The dual-accelerometer-based algorithm developed in this study to identify and quantify activities that are common for IC patients, with video as reference, was found to be valid. It identifies prone lying, supine lying, lying on the left or right side, sitting, semisitting, standing, walking and bed cycling. Both examined accelerometer configurations on the chest and opposite leg showed similar results, which implies that both diagonals can be used and interchanged if clinically necessary. In future clinical studies, this dualaccelerometer-based algorithm can be utilized to provide objective measurements for IC patients over periods of many days regarding the type, frequency, and duration of the different activities that are performed.

Conflicts of Interest:
The authors declare no conflict of interest.   14. Transitions T SMA > 0.04 B theta > −40

Abbreviations
Abbreviations: T, accelerometer placed at het thorax, B, accelerometer placed at the leg, SMA, signal magnitude area.