# A Smart Motor Rehabilitation System Based on the Internet of Things and Humanoid Robotics
## 5 Performance Evaluation
### Results  
To evaluate their performance in recognizing the activities performed by the participants, specifically the exercises they executed, a comparative analysis between various algorithms was conducted. After an extensive literature review, it was analyzed that tree-based algorithms supporting vector machine and neural networks are the most commonly used classifiers for Human Activity Recognition (HAR) tasks [29,30]. Therefore, in this work, we propose the evaluation of several algorithms, including a Feed Forward Neural Network (FFNN) [31] as a DL approach, and traditional ML methods, such as Decision Tree (DT) [32], Random Forest (RF) [33], Gradient Boosting (GB) [34], and Support Vector Machine (SVM) [35]. Given the nature of the data collected and the objectives of this study, the analysis focused not only on the accurate classification of exercises, but also on assessing the adaptability of the models to new data. With multiple study participants, three key aspects were explored, which we, respectively, called Personalized, Traditional, and Inboard Learning, as listed below. * **Personalized Learning**: evaluates how well the models were able to recognize activities when analyzing each participant individually. * **Traditional Learning**: evaluates the performance when combining data from all participants. Figure 4: Accelerometer and gyroscope raw data—AR exercise. Figure 5: Accelerometer and gyroscope raw data—BL exercise. * **Inboard Learning**: tests the generalization of models by training on data from some participants and scoring on data from others, measuring how well the models can adapt to unseen data. Before analyzing the performance, it is worth mentioning that, for both Personalized and Traditional Learning approaches, the experiments were conducted by averaging the results over multiple runs, and the calculated confidence interval was 95%. In each run, different hyperparameter configurations were used to optimize the performance of the models. The hyperparameters included variations in learning rate, batch size, and network architecture, to identify the optimal settings for each learning strategy. Table 3 presents the hyperparameter configurations for each model implemented in this study. This process ensured a robust evaluation, by accounting for variability in model performance due to different training conditions. In the case of Inboard Learning, we evaluated the generalization capabilities of the models using a leave-one-out approach. Specifically, with six subjects, we iteratively selected each participant as a test subject, ensuring that each individual was used, as a test case, exactly once. During each iteration, the model was trained on data from the remaining five participants. After completing all six combinations, we calculated the average performance across all iterations, to provide a comprehensive assessment of the model's ability to generalize to unseen subjects. To facilitate a more complete understanding of the following results, we provide an explanation of the performance metrics employed. The evaluation was conducted using the Accuracy metric, which serves to quantify the proportion of accurate predictions (True positive, TP) made by the models in all runs. Additionally, the F1-Score was used, as it combines the Precision and Recall metrics into a single unit, thus ensuring that both false positives (FP) and false negatives (FN) are minimized. \[Accuracy=\frac{TP}{TP+TN+FP+FN}\, \tag{6}\]  
\[F1_{score}=2\times\frac{Precision\times Recall}{Precision+Recall}\, \tag{7}\]  
\[Precision=\frac{TP}{TP+FP}\, \tag{8}\]  
\[Recall=\frac{TP}{TP+FN}. \tag{9}\]  
As shown in Figure 5(a),b, there is a similar pattern in all evaluations. If we compare the algorithms based on their ability to detect activities when analyzing each participant individually or together, the performance is equivalent and all the algorithms achieve