# Telehealth Using PoseNet-Based System for In-Home Rehabilitation
## 3 Proposed System
### Statistical Computation  
After the patient has performed the same rehabilitation exercises on the selected days, the doctor can compare the patient's angular movements between the different days by referring to the Mean Absolute Deviation (_MAD_), Mean Squared Error (_MSE_) and Mean Absolute Percentage Error (_MAPE_), as defined in Equations (1)-(3). These statistical computations are very useful to assist in the evaluation process because they offer a more-in-depth analysis metrics for the doctor to write their prescription. _MAD_ is used to calculate the average distance between the current and previous skeleton results for each angle point of each frame, whereas the _MSE_ is used to calculate the average squared difference. Lastly, the _MAPE_ displays the percentage deviation rate of the current skeleton result as compared to the previous skeleton result. These three formulae are commonly used in measuring the forecasting performance [29; 30; 31]. _MSE_ is more sensitive to errors than _MAD_ because all forecast errors are squared, which causes the value of _MSE_ to always be greater than _MAD_. Therefore, the forecast error in _MSE_ becomes more pronounced. However, the major shortcoming of _MAD_ and _MSE_ is that they do not consider the magnitude of the actual value [29]. As a result, the forecast error does not reflect the accuracy of the angular movements. Hence, _MAPE_ is applied to address this issue as it takes into account the magnitude of the actual values. It sums up all the absolute errors for each period with respect to actual values and then expresses the average error in term of generic percentage. This is useful for reporting purposes in our proposed system as it can be used to determine a patient's recovery rate. This is because the average accumulated error rate in _MAPE_ corresponds to the patient's angular data in each frame as compared to the actual values. The lower values of _MAD_, _MSE_ and _MAPE_ signify a more accurate model, which indicates that the postural movements performed by the patient are relatively better. The low values of _MAD_ and _MSE_ show that the average and squared error of the patient's angular movements in each frame is small as compared to the actual data from the physician's movements. Similarly, a low value of _MAPE_ indicates that the average accumulation error percentage of the patient's angular movements in each frame has a small deviation rate. Most importantly, the _MAPE_ plays a crucial role because the doctor can further analyze the patient's recovery status through the percentage deviation rate to determine whether the patient's condition has improved. \[MAD=\frac{\sum_{t=1}^{N}\lvert A_{t}-F_{t}\rvert}{N} \tag{1}\]  
\[MSE=\frac{\sum_{t=1}^{N}\left(A_{t}-F_{t}\right)^{2}}{N} \tag{2}\]  
20 years old female were invited to participate in the functional tests. Both subjects were required to stand in front of the laptop webcam to perform the rehabilitation exercises, as shown Figure 9. A series of benchmark poses were selected from the well-known KIT dataset [32] to represent the ground-truth skeleton-angular movements to be compared to those movements performed by both subjects. The KIT Whole-Body Human Motion Database is a large-scale dataset that offers a data corpus of 2615 different movements, focusing not only on mere whole-body motions but also on whole-body actions (this study makes use only of the motions). Since the invited subjects did not have any previous experience in rehabilitation exercises, two functional tests were conducted. The purpose of conducting these two tests was to compare the different postures of hand and leg movements performed by both subjects to those from the KIT dataset. Both subjects were required to follow the selected movements from the KIT dataset for two selected days.