Keywords

1 Background

Accelerometer-based activity monitors produce an automated, objective, valid and reliable measure of mobility [1], and are used frequently in both research and clinical environments. Several studies have used accelerometry in inpatient and assisted living settings to gather activity data [2,3,4,5]. Recent studies support that wearable device-measured activity in hospitalized patients predicts readmission risk, length of stay, and disability [5,6,7,8,9,10].

While accelerometers are popular amongst researchers and clinicians to capture activity and mobility in patient populations, other sensors and platforms have also been used with various levels of success [11,12,13]. A commercial accelerometer was used for this study due to its low cost, high frequency data collection, flexibility in sensor placement, small size, and ability to maintain patient privacy (in comparison to camera activity monitoring platforms). While many commercial accelerometer sensors and platforms have been validated with younger, healthy people and some patient populations, many of these devices are not validated in specialized populations, such as hospitalized older adults.

Hospital providers make clinical decisions that depend in part on activity (e.g. whether a patient is physically improving or declining, or if discharge should be to home versus skilled nursing facility). Often there is little verifiable objective data upon which to guide these decisions because hospital health care providers must depend on patient report and/or other chart documentation, which has been shown to be suboptimal [14, 15]. Accelerometry has the potential to provide clinicians with objective information to gauge a patient’s activity more accurately. Higher accuracy allows providers to detect early immobility and take timely clinical action to mitigate the risk of functional decline. Commercially available devices such as smart watches and activity trackers are robust and reliable devices that collect activity data, but these devices do not offer movement classification accuracy and flexibility within specialized populations (e.g. the acutely ill or other populations with varied health issues).

Clinicians and researchers at Duke University Medical Center are working to better understand the movement in an acutely ill population. This is especially important for hospitalized older adults because better outcomes, such as reduced need for post-acute care and decreased risk of death are directly linked to increased mobility while hospitalized [16, 17].

The aim of our work is ultimately to collect and use accelerometer data to train a machine learning algorithm to classify posture and movement changes in acutely ill, hospitalized patients. In this study we develop technology and software to reliably collect activity data and establish procedures to create machine learning models. Specifically, our algorithm uses accelerometer data to classify a patient’s movement as laying, reclining, sitting, standing, or walking to better reflect specific activity movements during hospitalization.

2 Research Design and Methods

2.1 Participants

We recruited two cohorts from convenience samples at two locations in Durham, NC, under the review of the Duke University Medical Center Institutional Review Board. The first cohort (N = 15), consisting of older adults, 55 years or older (7 males 70.7 ± 6.3; 8 females 63.3 ± 8.7 years old) were recruited from the GeroFit program, an older adult exercises program run in conjunction with the Durham VA but held at a private health club, for older veterans. The second cohort (N = 15), were adults between 22 and 54 years (4 males 35.5 + 10.3; 11 females 30.9 + 9.3 years old) and were recruited from administrative offices at Duke University Medical Center. Due to the high sampling rate of the sensors, the small sample size (N = 30) was determined to be appropriate by our machine learning expert to be sufficient for model training and testing for this proof of concept development. Subjects with physical, cognitive, or behavioral impairment that would prevent the safe completion of the testing or be unable to follow study directions were excluded from participation. All subjects were required to be able to 1) lay supine, 2) reclined, 3) sit, 4) stand, and 5) walk in 1-min intervals, twice, and transition between positions independently, with or without the use of an assistive device (e.g. cane or walker).

2.2 Study Design

To train our machine learning algorithm to detect the five test positions (laying, reclining, sitting, standing, and walking), ten minutes of labeled sensor data was collected on each subject. Two small wireless 3-axis commodity accelerometers (MetaMotionR; MbientLab, San Francisco, CA) were used. The data was streamed at 25 Hz to a custom iOS mobile application connected via Bluetooth Low Energy (BLE) 4. While the sensor allows for gyroscope, accelerometer, and temperature measurements, for this study data was only collected from the accelerometer. Since most typical human movements are less than 10 Hz [18], we selected a sample rate of 25 Hz based on a 12.5 Hz Nyquist frequency needed to abstract meaningful data. The Nyquist Theorem states that a sample rate at least two times higher than the highest frequency input signal is required for accurate measurements [19]. Data logging speed and long battery life of the Mbient sensors allowed us to record at a frequency higher than minimally required by the Nyquist Theorem for our study.

One sensor was worn on the upper front of the chest under the right clavicle attached with cloth tape. A second sensor was worn on the anterior of the right thigh attached with self-adhering bandage (e.g. sport wrap). Once instrumented, subjects were directed through the test positions in 1-min intervals, twice. The order of positions was laying, reclining, sitting, standing, walking - walking, standing, sitting, reclining, and laying. Each position was indicated to the subject with verbal instructions by the investigators and can be identified by: laying prone on a flat surface, reclining at an approximately 125–135° angle (assisted by a raised PT table or PT wedges), sitting with legs hanging off of bed/table height surface with back approximately at 90°, standing straight without movement, and walking at a normal pace.

2.3 Data Processing

Prior to beginning data collection, a non-identifying subject ID was entered into the mobile app. Each reading streamed from the accelerometer included x, y, and z axes and a timestamp. As the app collected the readings and persisted them into on-device storage, it displayed a stop-watch-style timer for each position duration. An investigator used the app to manually label the subject’s position as it changed. This data was aggregated into a single CSV file on the mobile app and exported via email for post-processing. Data was processed offline after the collection from all participants.

The triaxial accelerometer data was buffered into 4-s time windows with magnitude-and-variance-based features extracted (e.g. trimmed-mean position and standard deviation of position). A Random Forest classifier was trained to automatically discriminate between the positions using leave-one-subject-out cross-validation to ensure robust performance estimates. This validation means that each participant’s data was held aside for testing against the remaining participants’ data that was used to train the classifier. This process was repeated for each participant and the results pooled across participants to estimate classifier performance.

3 Results

This paper describes the results of three tests: Comparison of performance of 1 vs. 2 sensors, importance of custom trained algorithms to classify for the given tasks, and overall classifier accuracy between older adults (55 or older) and adults under 55.

3.1 Comparison of Performance of 1 vs. 2 Sensors

To confirm reports, literature, and past studies, the data was analyzed to determine if one sensor would provide the accuracy needed to capture all posture movements. By using data recorded form a single sensor, we concluded that a single sensor worn on the chest or thigh would not provide reasonable accuracy for all posture movements. Specifically, when wearing only a chest sensor, sitting and standing were indistinguishable from each other. Using only a thigh sensor, laying, reclining, and sitting were indistinguishable from each other (Fig. 1).

Fig. 1.
figure 1

Confusion matrices showing posture task with only one sensor used to identify body position. A) Only chest sensor used. B) Only leg sensor used.

3.2 Importance of Training for Task

To verify that sensor position and task performed are important to algorithm performance, we trained the classification algorithm based on one sensor location and tested the accuracy using data obtained from a different sensor location. Using a sensor on the leg when the classifier had been trained with a chest position sensor shows poor results (Fig. 2A) with only an 82.7% accuracy for standing/walking. However, using a sensor on the chest when the classifier had been trained on the leg did not have a negative impact (Fig. 2B) when comparing prone (laying/reclining) vs. upright (sitting, standing, and walking).

Fig. 2.
figure 2

Confusion matrices showing results of switching sensor locations after a classifier has been trained for the sensor placed on another location.

3.3 Classifier Accuracy – Older Adults and Adults

After confirming one sensor would not provide accuracy for each posture position, labeled data pooled from both sensors were used to train the classification algorithm for the test positions in a controlled setting. Accuracy for adults under 55 is overall 93.2% (Fig. 3A) and 95% overall accuracy (Fig. 3B) for adults 55 or older. Accuracy in both populations ranged from 96.5% to 99.4% in the sitting, standing, and walking positions and 83.5% to 95.1% for laying and reclining.

Fig. 3.
figure 3

Confusion matrices depicting classification accuracy in percent for older adults and adults wearing two sensors, one on the thigh and one on the chest. A) Adult (non-geriatric) results showing overall 93.2% accuracy. B) Older adults (geriatric) showing overall 95% accuracy.

To observe classifier accuracy based on training within a different population than the testing population, the algorithm was trained using labeled data from older adults and tested on data from adults under 55. The classifier accuracy for this condition is 93.7% accuracy (Fig. 4A). The accuracy for an algorithm trained on labeled data from adults under 55 and tested using data from older adults, yielded a 94% accuracy (Fig. 4B).

Fig. 4.
figure 4

Confusion matrices depicting classification when training algorithm on one population and testing on another population. A) Train on older adult (geriatric), test on adult (non-geriatric). B) Train on adult (non-geriatric), test on older adult (geriatric).

4 Discussion and Implications

When training and testing the algorithm within a specific population while wearing two sensors, we showed a 93.2% accuracy for adults and a 95% accuracy for older adults across the five positions. Performance using a single sensor worn on either the chest or thigh to classify multiple posture positions was less accurate. This indicates that more than one sensor may be needed to classify granular movement, and that multiple sensors may be needed to identify laying, reclining, sitting, standing, and walking posture movements with accelerometry.

By observing new classification tasks and using one sensor to distinguish all posture movements, we showed that sensor position is important to the specific task (e.g. walking). Specifically, changing a sensor position without retraining the algorithm proves to get inaccurate results, depending on the specific task. This is an important implication when using commercially available sensors because the algorithm must have the ability to be trained on data collected at that specific body position. Commercially available sensor and software packages only allow users to place the sensors in specific locations on the body which might not be sufficient for some research projects. For example, the Actigraph wGT3X-BT and ActiLife software limits sensor position to the wrist, waist, ankle, and thigh [20]. These results and discussion underscore the need for a customizable software solution that allows the user to generate their own algorithm based on training data specific to a population and sensor location.

Our results comparing algorithm performance using an algorithm trained on one population and tested on another population proved to be almost as accurate as training and testing within the same population. This is likely due to the similarities in these populations, both abled bodied and mobile, and the fact that subjects were performing specific constrained tasks. More research is needed to make an accurate statement regarding training within one population and testing in another. We speculate that testing on a population significantly different from the training group (e.g. mobility compromised, acutely ill, hospitalized subjects) would show poor classification accuracy.

To address this, structured testing is underway on hospitalized older adults and adults. Although more analysis and testing are needed, preliminary data analysis demonstrates the importance of training classifiers with data from the target population as speculated in this paper. The next step of this project is to finish testing on hospitalized adults and older adults. Additionally, we will further validate our findings by testing movement for different population groups in at-home environments.