*3.1. Regression Model Design*

There is a relatively complicated non-linear relationship between MMG and human joint torque, which seems difficult to accurately describe using the traditional polynomial

regression model. We try to introduce a machine learning method to solve this problem, using a large amount of test data to fit the real mapping law. Considering that the joint torque estimation algorithm is oriented to a wearable power-assisted system, the requirement for its stability and reliability must take precedence over that of other aspects. Since RFR (shown as Figure 5) has these advantages, it can be well qualified for this task. joint torque, which seems difficult to accurately describe using the traditional polynomial regression model. We try to introduce a machine learning method to solve this problem, using a large amount of test data to fit the real mapping law. Considering that the joint torque estimation algorithm is oriented to a wearable power−assisted system, the requirement for its stability and reliability must take precedence over that of other aspects. Since RFR (shown as Figure 5) has these advantages, it can be well qualified for this task.

There is a relatively complicated non−linear relationship between MMG and human

*Electronics* **2022**, *11*, x FOR PEER REVIEW 7 of 15

**3. Off-Line Torque Estimation** *3.1. Regression Model Design*

**Figure 5.** Schematic diagram of RFR algorithm. **Figure 5.** Schematic diagram of RFR algorithm.

The RFR belongs to a bagging type algorithm of ensemble learning, which aims at improving overall performance by packaging and combining several weak models, namely decision trees, into a strong one. The entire model consists of multiple classification and regression trees (CARTs) that are not related to each other. All CARTs jointly determine the final output result. The specific implementation steps of the algorithm are described as follows. The RFR belongs to a bagging type algorithm of ensemble learning, which aims at improving overall performance by packaging and combining several weak models, namely decision trees, into a strong one. The entire model consists of multiple classification and regression trees (CARTs) that are not related to each other. All CARTs jointly determine the final output result. The specific implementation steps of the algorithm are described as follows.


Only when more than half of the CARTs make wrong predictions will the output of the RFR model seriously deviate from the true value. Even if an abnormal data point appears, it does not affect the performance of entire algorithm too much, which fully reflects the strong robustness to stop interference signals. Only when more than half of the CARTs make wrong predictions will the output of the RFR model seriously deviate from the true value. Even if an abnormal data point appears, it does not affect the performance of entire algorithm too much, which fully reflects the strong robustness to stop interference signals.

#### *3.2. Off-Line Training and Testing 3.2. Off-Line Training and Testing*

We recruited three healthy adult men to participate in training data acquisition. Based on the abovementioned platform and methods, the information collection experiment for three motion modes obtains 150,000 sets of sample data in total. In accordance with the idea of cross−validation, one−fifteenth of them are selected as the test set, and the remaining data act as the training set. Finally, on the basis of setting the number of sub−regression trees of the RFR to 10, and the minimum leaf size to 1, the training process has We recruited three healthy adult men to participate in training data acquisition. Based on the abovementioned platform and methods, the information collection experiment for three motion modes obtains 150,000 sets of sample data in total. In accordance with the idea of cross-validation, one-fifteenth of them are selected as the test set, and the remaining data act as the training set. Finally, on the basis of setting the number of sub-regression trees of the RFR to 10, and the minimum leaf size to 1, the training process has been carried out, and the verification result of the test set is also obtained.

been carried out, and the verification result of the test set is also obtained. Taking shoulder static adduction/abduction as an example, Figure 6a shows that the minimum mean square error (MSE) decreases and tends to be stable with the increase in iterations, and Figure 6b indicates that the difference between the predicted results and

the actual values on the test set is relatively small. In general, the model training effect has reached the desired level. the actual values on the test set is relatively small. In general, the model training effect has reached the desired level.

Taking shoulder static adduction/abduction as an example, Figure 6a shows that the minimum mean square error (MSE) decreases and tends to be stable with the increase in iterations, and Figure 6b indicates that the difference between the predicted results and

*Electronics* **2022**, *11*, x FOR PEER REVIEW 8 of 15

**Figure 6.** Machine learning effect of shoulder static adduction/abduction: (**a**) iterative training process with training set; (**b**) verification result of test set. **Figure 6.** Machine learning effect of shoulder static adduction/abduction: (**a**) iterative training process with training set; (**b**) verification result of test set.

To measure the predictive performance of trained RFR model, a root mean square error (*RMSE*) and a coefficient of determination (*R*<sup>2</sup> ) are introduced as evaluation indexes. The *RMSE* is a commonly used method to express numerical errors, representing the sample standard deviation of the difference between the predicted value and the actual one. It can be calculated by using the following formula. To measure the predictive performance of trained RFR model, a root mean square error (*RMSE*) and a coefficient of determination (*R* 2 ) are introduced as evaluation indexes. The *RMSE* is a commonly used method to express numerical errors, representing the sample standard deviation of the difference between the predicted value and the actual one. It can be calculated by using the following formula.

$$RMSE = \sqrt{\frac{1}{n} \sum\_{t=1}^{n} (\mathcal{g}\_t - y\_t)^2} \tag{11}$$

The *R*<sup>2</sup> reflects how much the regression relationship can account for changes to the dependent variable. A higher value indicates that the regression model can produce better prediction results. The corresponding calculation process is shown below. The *R* 2 reflects how much the regression relationship can account for changes to the dependent variable. A higher value indicates that the regression model can produce better prediction results. The corresponding calculation process is shown below.

$$R^2 = 1 - \frac{\sum\_{t=1}^{n} \mathcal{Y}\_t - y\_t)^2}{\sum\_{t=1}^{n} (y\_t - \overline{y})^2} \tag{12}$$
