# A Smart Motor Rehabilitation System Based on the Internet of Things and Humanoid Robotics
## 5 Performance Evaluation
### Results
\begin{table}
\begin{tabular}{l c l} \hline \hline
**Model** & \multicolumn{2}{c}{**Hyperparameter Set**} \\ \hline Support Vector & C: & [0.1, 1, 10, 100, 1000], \\ Machine & gamma: & [1, 0.1, 0.01, 0.001, 0.0001], \\ kernel: & [’rbf’, ’poly’, ‘sigmoid’] \\ \hline Decision Tree & criterion: & [’gini’, ’entropy’, ’log\_loss’], \\ splitter: & [’best’, ’random’] \\ \hline Random Forest & n\_estimators: & range(50, 250, 50), \\ criterion: & [’gini’, ’entropy’, ’log\_loss’] \\ \hline Gradient Boosting & n\_estimators: & range(50, 250, 50), \\ criterion: & [’squared’, ’error’, ’friedman\_mse’] \\ \hline Feed Forward & Batch Size: & [8, 16, 32, 64, 128 256, 512], \\ Neural Network & Hidden Sizes: & [8, 16, 32, 64, 128, 256, 512]’, \\  & Learning Rate: & [0.01, 0.001, 0.0001], \\  & Depths *: & [1, 2, 3, 4], \\  & Dropout Probability: & [0.1, 0.2, 0.3, 0.4, 0.5] \\ \hline \hline \end{tabular}  
* Depths is the number of times a network hidden layer will be used.  
\end{table} 
Table 3: Set of Hyperparameters. optimal results, reaching 100% accuracy. In terms of generalization, a similar pattern can also be observed, but with a completely different trend: all the algorithms seem to be unable to generalize across different subjects (Inboard Learning); only the FFNN was able to achieve the best accuracy, with a value of 35%. The best-performing algorithm was selected for further investigation, focusing on the importance of each signal (accelerometer and gyroscope) and their individual impact on model performance. We also assessed the minimum number of devices required for accurate activity classification, by progressively training the model with data from one device up to all available devices. Both personalized and traditional aspects were taken into account, to better understand individual variations across different users and scenarios. Specifically, this approach was adopted to gain insights at the individual level, and also to understand how the usage of different devices, including those not directly involved in the movement, affects the model's ability to accurately classify the activity. The analysis was conducted as follows: given the availability of four different devices, we tried to generalize the results as much as possible by testing all possible combinations for every possible number of devices used in the data collection. For each combination, we evaluated performance using accelerometer data, gyroscope data, and a blending of both. In Figures 7 and 8, we reported the mean and confidence interval of the analyzed metrics, varying the number of devices for both personalized and traditional scenarios. Each column represents the combined results, accounting for all possible device permutations. For instance, focusing on the personalized scenario, the column for a single device reflects the combined results of analyzing the individual data from each sensor (i.e., left wrist, right wrist, left elbow, right elbow). The analysis reveals that, in a personalized scenario, using only one device with accelerometer data, good performance in activity classification is already achieved, measured in terms of accuracy with a score of 93%. As more devices are added, performance improves even when using only one signal type. In particular, when comparing both scenarios (personalized and traditional), we can observe a similar trend where using only two devices with all signal types comes close to the best performance of the algorithm, reaching a total score of 98%, which would otherwise require all devices and signals. Furthermore, the narrow confidence intervals for accelerometers indicate consistent results across different combinations, while the wider confidence intervals for gyroscopes for a small number of devices indicate greater variability in the classification task. Figure 6: Comparison of accuracy and F1-Score metrics in evaluating different learning algorithms. In Figure 8(a,b), we investigated the ability to predict motions using the best-performing algorithm, namely the FFNN algorithm.