This study aimed to compare performance of machine learning (ML) models for the prediction of important lower-limb gait time series (joint kinematics, joint kinetics, and muscle forces) from wearable sensors’ data with the aid of automatic feature extraction. The first objective was to extract features automatically and determine the most important features for the estimation of each target. To extract all possible features from raw EMG and IMU data, we used a python package called Tsfresh [34]. Tsfresh’s ability to extract a high number of features and determine their significance makes it more suitable than manual feature extraction methods. Furthermore, the most important features that are essential for predicting a particular target might be neglected when extracted manually [43]. As a result, the top features to predict joint kinematics and kinetics were extracted from the IMU data, and the top features for most of the muscle forces were extracted from EMG data. These results were predictable, as the joint angles are closely related to the angular velocity (gyroscope data), joint moments are associated with linear acceleration (accelerometers data) and angular velocity, and EMG data are correlated with muscle activation and therefore, muscle forces.
The second objective of this study was to compare the performance of four non-linear regression ML models (ANN, SVM, RF, and MARS) to estimate pelvis, hip, knee, and ankle joint angles, moments, and muscle forces in both intra-subject and inter-subject examinations. Each model performance were compared based on their resulted RMSE, MAE and R2 against the OpenSim output (used here as ground truth). We found that the RF model gave the best performance in predicting joint kinematics, joint kinetics, and muscle forces for the intra and inter-subject examinations. Based on the figures representing the models’ predictions for one gait cycle, RF model provided smoother outputs, in addition to having less prediction errors compared to other models. The RF algorithm is less prone to overfitting than other models [41], which might explain its higher performance. Moreover, RF is a tree-based model and naturally ranks features by how well they improve the model’s performance and only uses the most important features to build trees. Regardless of the ML model’s type, the level of prediction accuracy decreased when the training dataset did not include any of the testing subjects' trials. This can be partially explained by the fact that individuals' joint motion characteristics are distinct [44].
To avoid limitations of OMC systems like the need for expensive equipment in a controlled environment and time-consuming data processing, previous studies have developed different algortithms to estimate joint kinematics from IMUs [44–55]. One of these algorithms was using filtering approaches to cope with IMU sensor noise and integration drift [44, 52–55]. While these algorithms succeeded to reproduce a similar joint angle waveform, the offset between IMU results and OMC systems is considered relatively high compared to our results. The RMSE ranging from 5 to 10.14 degrees in the hip joint angle sagittal plane was previously reported [45, 46, 48–51, 53, 55], while the present study achieved an RMSE of 2.26 and 5.94 degrees for intra and inter-subject examinations, respectively. Our model produced lower RMSEs in knee joint flexion/extension (2.89 and 7.07 degrees for intra and inter subject examinations) too with reported RMSE between 4.1 to 11.22 degrees in other studies [45, 46, 48–51, 55]. The accuracy of our model for ankle joint dorsi/plantarflexion angle prediction (3.61 and 7.72 for intra and inter-subject examinations) was comparable to previous studies with an RMSE of 1.9 to 9.75 degrees [45, 46, 48, 50, 55]. Other research groups achieved higher accuracy by combining wearable sensors’ data with machine learning techniques for joint kinematics prediction [11–17, 19]. The better performance of this approach (IMUs + ML model) provided lower estimation errors in previous studies, especially in the intra-subject examinations with an RMSE ranging from 1.72 to 3.58 degrees in hip flexion/extension [11, 14, 15], from 2.21 to 3.96 in knee flexion/extension [11, 12, 14, 15] and from 1.81 to 3.58 degrees in ankle dorsi/plantarflexion angle [11, 12, 14, 15]. The performance of our RF model in intra-subject examination was in the range of these studies with an average RMSE of 2.26 degrees at the hip, 2.89 for knee, and 3.61 for ankle angles in the sagittal plane. The prediction error for inter-subject examination in previous studies was higher with hip flexion/extension angle RMSE from 4.6 to 8.85 degrees [14, 16] (5.94 degrees in the present study), knee flexion/extension angle RMSE of 4.5 to 9.28 [14, 16, 19] (7.07 degrees in the present study), and ankle dorsi/plantar flexion angle RMSE of 4.74 to 6.03 [14, 16] (7.72 degrees in the present study). Ren et al. [17] developed five different ML models to predict hip, knee, and ankle joint angles in the sagittal plane and achieved MAE = 4.6, 7.38, and 4.74 degrees, respectively, by using the RF model. They illustrated that the RF model outperforms other ML models (SVR, ANN, multiple linear regression (MLR), and eXtreme gradient boosting (XGboost)) for joint kinematics prediction. The RF model in the current study carried out lower error than their model in hip and knee angles prediction by having MAE = 4.52, and 5.27 degrees, respectively, while we had higher errors than Ren et al. [17] in predicting ankle dorsi/plantar flexion angle (MAE of 5.73 degrees) for inter-subject examination. While previous studies concentrated on joint range of motion in the sagittal plane, our study additionally included the pelvis in all plane, hip int/ext rotation and abd/add and ankle inv/eversion.
Fewer studies were conducted to investigate the performance of different ML models for joint kinetics estimation [12, 20–22] compared to joint kinematics. All previous studies would focus on a specific lower-limb joint kinetics (e.g. knee and ankle moments in sagittal plane [12], knee adduction/abduction moment [20], medial and lateral knee contact forces [21], knee flexion/extension and adduction/abduction moments [22]), while the present study investigated the prediction accuracy for the pelvis (in three planes of motion), hip (in three planes of motion), knee (in sagittal plane) and ankle (in sagittal and frontal planes) joint moments during gait. The RF model presented in our study achieved RMSE of 0.079 Nm/kg for ankle moment prediction in intra-subject examination which is more accurate compared to previous studies with an RMSE of 0.119 Nm/kg [12]. For the knee flexion/extension moment, we had lower accuracy in intra-subject examination compared to other studies (RMSE of 0.102 versus RMSE ranging from 0.042 to 0.068 Nm/kg [12, 20]). However, our model outperformed another study in inter-subject examination (RMSE of 0.18 versus 0.27 Nm/kg) [22].
To the best of our knowledge, there is no other study using wearable sensors’ data to estimate muscle forces. Ardestani et al. [56] used an ANN to estimate muscle activations from EMG signals. They used muscle activations in a forward dynamic model to estimate lower-limb joint moments, but unfortunately, they didn’t report any prediction error for muscle activation or forces. In another study [57], a Gaussian Mixture Regressor (GMR) was employed to estimate muscle kinematics (fiber elongations and moment arms) and EMG data from IMU. They reported NRMSE lower than 30% of muscle activation for all muscles. In the present study, the highest and lowest muscle forces prediction errors were associated with semimembranosus (RMSE of 24 and 35N in intra and inter subject examinations, respectively) and vastus lateralis muscle (RMSE of 208 and 502 N in intra and inter subject examinations, respectively). Higher offset between actual and predicted values for muscle forces prediction compared to joint kinematics and kinetics can be seen in the figures depicting actual and predicted values. The lower accuracy in estimation of muscle forces compared to other targets (joint kinematics and kinetics) was predictable. Data showed different muscle recruitment during walking between individuals and even trials, leading to less consistency in muscle forces across the population. Overall, compared to previous research, we predicted more targets at the same time with a multi-output RF model and achieved prediction errors within the range of what is reported in the literature.
Despite the number of participants (17 total), our RF model resulted to low prediction errors (comparable to the literature) in joints kinematics and kinetics estimation. We will investigate if increasing the number of participants to include a variety of gait profile and self selected speed provides more accurate estimations, specifically for muscle forces prediction. One limitation of the current study is that we used a multi-output RF model to predict many targets at the same time. Although a multi-output models helps us to improve management of the high number of targets, it may result in lower prediction accuracy by feeding many unrelated features to the model for some targets. The differences between performance of a multi-output and a single output model for the prediction of specific gait time series should be explored in a future study.
The personalised musculoskeletal model for each participant were built using the gait 2392 opensim model which lacks the degrees of freedom (dof) on the knee adduction/abduction, knee rotation, and ankle int/ext rotation which does not allow us to study other plane of motion at the knee and ankle. In this study, OpenSim and CEINMS outputs were employed for ML models’ training and considered as the reference for determining the performance of ML models. To produce realistic body motions during gait, movement of each individual joint is constrained in OpenSim inverse kinematics tool. However, this method can not guarantee an optimal solution to inverse kinematics and can lead to inaccurate estimation of body pose. The inaccuracies in inverse kinematics can be transmitted and possibly amplified in later analyses like inverse kinetics and muscle forces estimation [58]. Furthermore, the neural mapping used in CEINMS is a simplification of how muscles are recruited, which may result in inaccurate muscle force predictions [38]. Also, the quality of EMGs can greatly affect CEINMS’ results, as it’s an EMG-informed solution for muscle force estimation.
Although the findings of this study are very promising to benefit the community, more research is required to investigate the optimum number of IMUs needed to achieve these results. Looking back at the top features, it appears that some IMU data are not needed for 3D gait analysis. The optimal number and combination of IMUs can eliminate the need for 7 sensors reducing data processing time and sensor cost. Reducing the number of sensors on the subjects’ bodies will also facilitate workflow implementation in the real world.