# Unsupervised Classification of Human Activity with Hidden Semi-Markov Models
## 4 Discussion  
A lack of physical activity is the fourth leading cause of global mortality [25]. However, accurately measuring physical activity is a challenging task, as its objective proxy is body energy expenditure, which can be precisely measured only in laboratory conditions. Various wearable sensory systems have been developed to provide information about physical activity, but the time-varying signals generated by the sensors need adequate processing in order to produce reliable results. However, sensors and algorithms create results that are strongly dependent on the subject wearing them, and significant research effort has been invested into finding ideal positions for the sensors, such as those for inertial measurements [26; 27], in order to reduce the estimation error. Our approach is using standard accelerometers (on a smartwatch or smartphone) that are readily available and an unsupervised algorithm to process the time-varying signal and make inferences about the class of the physical activity.  
Unsupervised methods for activity inference are a powerful tool for epidemiological research studies, as they allow trials to be conducted without an ad hoc calibration study for the specific wearable device and population tested, thus saving time and resources. With this aim, we used an HSMM as an unsupervised method to classify activity from accelerometer data. We used a Bayesian framework to infer the parameters of the model described in Equation (1) and selected the optimal model based on features used and informativeness of the prior. On the basis of this analysis related to the feature choice and parameter selection, we found the best model to be the one which used the accelerometer magnitude and a very uninformative prior, as it achieved the highest Pearson's correlation between the inferred activities and the reference ones, as shown in Tables 4 and 5. We evaluated the agreement between the HSMM and supervised classification using Bland-Altman plots (Figure 3) and showed a good method agreement for sedentary behaviour and overall physical activity. We also validated the model by reproducing the widely accepted association between physical activity and sedentary time with BMI and waist circumference. We showed that the activities inferred by the HSMM produced linear regression coefficients similar to the ones achieved by activities classified using supervised methods (Table 7).  
A limitation of the current work with the HSMM is the failure to differentiate between activity types, namely moderate activity, walking and light tasks. In fact, the HSMM seems to only reliably distinguish between activity intensities. This is likely due to the features employed in the inference. While using acceleration magnitude only ensures shorter computational times and an easier interpretation of the states, limiting the inference to only this feature may be preventing successful segmentation of different activities with similar intensities. Although the effect of axes angles was explored and did not produce good correlations, future work should explore the use of other time- and frequency-related features.