Influence of Input Features and EMG Type on Ankle Joint Torque Prediction With Support Vector Regression

Reliable and accurate EMG-driven prediction of joint torques are instrumental in the control of wearable robotic systems. This study investigates how different EMG input features affect the machine learning algorithm-based prediction of ankle joint torque in isometric and dynamic conditions. High-density electromyography (HD-EMG) of five lower leg muscles were recorded during isometric contractions and dynamic tasks. Four datasets (HD-EMG, HD-EMG with reduced dimensionality, features extracted from HD-EMG with Convolutional Neural Network, and bipolar EMG) were created and used alone or in combination with joint kinematic information for the prediction of ankle joint torque using Support Vector Regression. The performance was evaluated under intra-session, inter-subject, and inter-session cases. All HD-EMG-derived datasets led to significantly more accurate isometric ankle torque prediction than the bipolar EMG datasets. The highest torque prediction accuracy for the dynamic tasks was achieved using bipolar EMG or HD-EMG with reduced dimensionality in combination with kinematic features. The findings of this study contribute to the knowledge allowing an informed selection of appropriate features for EMG-driven torque prediction.


Influence of Input Features and EMG Type on Ankle Joint Torque Prediction With Support Vector Regression
Asta Kizyte , Yuchen Lei , and Ruoli Wang Abstract-Reliable and accurate EMG-driven prediction of joint torques are instrumental in the control of wearable robotic systems.This study investigates how different EMG input features affect the machine learning algorithm-based prediction of ankle joint torque in isometric and dynamic conditions.High-density electromyography (HD-EMG) of five lower leg muscles were recorded during isometric contractions and dynamic tasks.Four datasets (HD-EMG, HD-EMG with reduced dimensionality, features extracted from HD-EMG with Convolutional Neural Network, and bipolar EMG) were created and used alone or in combination with joint kinematic information for the prediction of ankle joint torque using Support Vector Regression.The performance was evaluated under intra-session, inter-subject, and inter-session cases.All HD-EMG-derived datasets led to significantly more accurate isometric ankle torque prediction than the bipolar EMG datasets.The highest torque prediction accuracy for the dynamic tasks was achieved using bipolar EMG or HD-EMG with reduced dimensionality in combination with kinematic features.The findings of this study contribute to the knowledge allowing an informed selection of appropriate features for EMG-driven torque prediction.
Index Terms-Dynamic contraction, electromyography, joint torque, machine learning, support vector regression.

I. INTRODUCTION
W EARABLE robotic systems that assist movements by applying supplemental torque at the joint level, such as exoskeletons and other human-in-the-loop robotic devices, have grown in popularity in recent years.These devices have promising applications in rehabilitation, however accurate and robust torque prediction is essential for ensuring smooth control.EMG-informed torque estimation is one of the approaches commonly applied in a human-in-the-loop control scheme.It allows detecting the movement before the onset [1] thus improving the device acceptance by the users [2], [3].Moreover, this approach allows incorporating the active effort of the user [4], [5] even in cases when the movement is altered due to musculoskeletal impairment [6].Accurately mapping the EMG signals of the muscles surrounding the joint to the joint torque is not trivial due to the non-linear relationship between these variables.Neuromusculoskeletal models have been used extensively to address this problem [7], [8], [9].However, these models can be cumbersome to work with as it requires choosing or optimizing numerous physiological parameters, which both requires domain knowledge and is often time consuming.In recent years, machine learning (ML) has been proposed as an alternative stand-alone method or in combination with neuromusculoskeletal models.Comparable results between both approaches have been shown for ankle torque estimation during the isokinetic movement and gait [10] and knee joint torque estimation during non-weight bearing activities over seven days [11].In particular, recurrent and convolutional neural networks (CNN) were found to perform well in EMG-informed estimation of biceps brachii muscle force in isometric contraction [12] and elbow joint torque during isotonic, isokinetic and dynamic task [13].To achieve good results for increasingly more complex movements, such as dynamic tasks, artificial neural networks (ANN) require increasingly large training datasets, often resulting in a drop in estimation accuracy.However, acquiring bio-signals such as EMG is time-consuming, and the available data is often limited.
Several other ML solutions that are deterministic and do not require searching a large hyperparameter space or rely on large amounts of data have been proposed for EMG-informed joint torque estimation.Ziai et al. compared the performance of the musculoskeletal model, simple ANN, and several supervised ML algorithms for EMG-informed wrist torque estimation and found that all algorithms performed similarly, except locally weighted projection regression, which resulted in higher estimation error [14].Yang et al. found that support vector regression (SVR) outperformed ANN and locally weighted projection regression in grasping force estimation [15].SVR is a robust ML algorithm suitable for non-linear regression, given a small sample size.Nevertheless, even with ML algorithms suitable for small datasets, smaller sample size often leads to worse precision and generalizability of the model if the data used for model training are noisy or unrepresentative of the larger population.These factors make data input into ML models critical.
The conventional surface EMG measurement method uses a pair of EMG electrodes placed on the skin over the muscle belly, resulting in a single channel differential EMG signal.This method allows measuring the sum electrical activity of the muscle within an area under the electrodes over time.However, the electrical activity of the muscle is not uniform over the muscle, and the placement of the electrodes can affect the observed signal [16], [17].High-density EMG (HD-EMG), in contrast to bipolar EMG, uses not just two electrodes but a grid of multiple densely spaced electrodes, creating a three-dimensional map of electrical muscle activity.Compared to bipolar EMG, HD-EMG has been shown to improve muscle force estimation [16] and task and effort level identification [18] during isometric contractions.Due to a high number of channels that measure a similar signal, the HD-EMG is highly redundant and comes with the curse of dimensionality.To address this issue, studies have used linear and non-linear dimensionality reduction techniques to reduce the feature space to latent features.Principal Component Analysis (PCA) applied on HD-EMG was shown to reduce the root mean square difference of the isometric muscle force up to 40% compared to bipolar EMG [16], and in a later study, independent component analysis was shown to further reduce the root mean square difference by another 13% [19].Hajian et al. [20] used linear (PCA) and non-linear (t-distributed stochastic neighbor embedding) dimensionality reduction methods and found that isometric muscle force estimation was improved by the t-distributed stochastic neighbor embedding but not by the PCA.In addition, feature extraction with CNN has been proposed as a non-linear alternative for latent feature extraction and showed promising results for EMG-driven gesture recognition [21], [22] and isometric muscle force estimation [12].Compared to non-linear methods, PCA is fast, but it assumes that the mixture of variables is linear, which may not be true for all dynamic tasks.The non-linear methods are often slow, and CNN, in particular, requires careful selection of the hyperparameters to achieve optimal performance and avoid overfitting to small datasets.
Most HD-EMG studies for muscle force and joint torque estimation focus on isometric contractions.There is a lack of knowledge on the efficacy of the HD-EMG with or without dimensionality reduction on joint torque prediction in dynamic tasks of varying complexity.Therefore, this study aims to explore how different EMG-derived inputs affect the ankle joint torque prediction (sagittal plane) during isometric and dynamic task using ML (SVR) in intra-session, inter-subject, and inter-session cases.We analyzed four different EMG input modes: bipolar EMG, HD-EMG, HD-EMG reduced with PCA, and HD-EMG features extracted with CNN.

A. Data Collection
All experimental sessions were carried out at the KTH MoveAbility Lab.The study was approved by the Swedish Ethical Review Authority (2020-02311).Twelve non-disabled participants with no known neurological disorders or recent lower limb injuries were recruited.Informed written consent was obtained before data collection.
During data collection,the HD-EMG signal was recorded by placing 32-channel electrode grids (GR10MM0804, OT Bioelettronica) above gastrocnemius lateralis and peroneus longus muscles and 64-channel electrode grids (GR08MM1305 and GR10MM0808, OT Bioelettronica) above tibialis anterior, soleus, and gastrocnemius medialis muscles of a randomly selected leg.The grids were attached with an adhesive foam grid filled with conductive and adhesive paste.All grids were placed such that the location of the electrode grid center follows the SENIAM recommendations for EMG electrode placement [23].The skin was shaved and cleaned with an alcohol wipe before placing the electrode grids.The HD-EMG was recorded at a sampling frequency of 2048 Hz and amplified with a multi-channel bioelectrical signal amplifier (Quattrocento, OT Bioelettronica).The data were collected under two different protocols: one for HD-EMG recording during isometric contraction of ankle plantar-and dorsiflexors and another during dynamic task.
1) Isometric Contraction Protocol: HD-EMG and ankle torque were collected from five participants (three males, two females, age 28.6 ± 5.4 years, height 169.0 ± 8.9 cm, weight 64.6 ± 16.1 kg).The participants were seated comfortably on the chair, with the back up straight, their hip and knee fixed at 90 • flexion and the lower leg strapped tightly into an isometric ankle dynamometer (OT Bioelettronica, sampling frequency 100 Hz).The subjects were asked to perform sub-maximal isometric dorsiflexion and plantarflexion following visual feedback of a trapezoid torque profile (5 s on-ramp, 4 s plateau, 5 s off-ramp, and 10 s break) with a plateau at 30%, 50%, or 70% of their maximum voluntary contraction (MVC).The MVC was determined beforehand at every ankle position.This involved recording the maximum torque of three five second-long repetitions of maximal plantar flexion or dorsiflexion performed with verbal encouragement.Each trial constituted five repetitions of the trapezoidal profile and was repeated for every level of the MVC plateau for both plantarand dorsiflexion.Moreover, this procedure was repeated at four ankle angles -15 • and 7.5 • plantarflexion, neutral (0 • ) angle and 10 • dorsiflexion.This resulted in 24 trials per person.The torque was measured with the S-beam bidirectional load cell attached to the isometric dynamometer and then amplified with a single channel general purpose amplifier (Forza, OT Bioelettronica).
2) Dynamic Task Protocol: Seven participants (four males, three females, age 31.6 ± 7.1 years, height 168.0 ± 7.8 cm, 67.6 ± 12.5 kg) were included in the dynamic task protocol.HD-EMG data, marker trajectories, and ground reaction forces were recorded simultaneously with a 10-camera motion capture system (Vicon, sampling frequency at 100 Hz) and one force plate (AMTI, sampling frequency of 100 Hz).Marker placement was according to the 2.3 version of the Conventional Gait Model [24], [25].Each trial consisted of 15 repetitions of one of the following movements (Fig. 1): i) heel rises with legs hip-width apart and two feet in parallel pointing forward; ii) heel rises in a wide stance with two feet pointing outward; iii) stance phase of a gait cycle; iv) stepping up and down an 18-cm high platform (facing the platform); v) stepping down and up an 18-cm high platform (facing away from the platform); vi) one leg reaching and lightly touching the floor as far as possible in front and behind the participant.One of the participants did not perform the stance trial.Movements were performed in a randomized order at a self-selected pace.

B. Data Processing
1) Ankle Angle, Angular Velocity and Torque: Ankle torque was processed in different pipelines for isometric and dynamic protocols (Fig. 2B): • Isometric contraction protocol: The dynamometer output data were normalized to the dynamometer data acquired during the MVC and smoothed by the moving average with an experimentally chosen window size of 500 ms (supplementary material Fig. A.1 (a)) and step size of 250 ms.
• Dynamic task protocol: The ankle angle and torque (sagittal plane) were computed using inverse kinematics and inverse dynamics in Nexus (Plug-in Gait model, Vicon).Angular velocity was calculated as the first derivative with respect to time.Then, the torque was normalized to the maximum torque of all trials of the same subject.Ankle angle, angular velocity, and normalized torque were smoothed using the moving average with an experimentally chosen window size of 125 ms (supplementary material The recorded HD-EMG data were processed following the pipeline (Fig. 2A).The data were first filtered with a band-pass filter with 20 Hz and 500 Hz cut-off frequencies [26], [27].Noisy channels were linearly interpolated from the 8 nearest neighboring channels after visual inspection.The data were then split into test (20% of data samples) and training (80% of data samples) sets and four datasets (HD-EMG, bipolar EMG, HD-EMG principal components (PCs), and HD-EMG CNN) were formed and further processed in the following manner: • HD-EMG: The pre-processed HD-EMG data were rectified and smoothed with the moving average filter.
• Bipolar EMG: Two electrodes at a 20 mm inter-electrode distance [23] were selected from the center of each HD-EMG electrode grid to represent the bipolar EMG.
The pre-processed HD-EMG data from these two electrodes was subtracted to form a single-differential EMG signal, rectified and smoothed with the moving average filter.
• HD-EMG PCs: PCA was applied separately on training and test datasets of pre-processed HD-EMG to reduce the dimensionality.Three PCs with the highest explained variance were chosen from each grid, which was found to be the best configuration (supplementary material B).
• HD-EMG CNN: The training data of the HD-EMG dataset was used to train the CNN (details in II-C.2).The trained CNN model was then used to extract the features from the HD-EMG test dataset.In the dynamic task protocol, each dataset was concatenated with the ankle angle or ankle angle and angular velocity data before applying the moving average filter.The parameters of the moving average filter followed those used for ankle torque and angle processing.

C. Machine Learning Algorithms
This study used two ML algorithms: CNN was used for feature extraction from HD-EMG data, and SVR was used for torque prediction from the four EMG datasets (described in section II-B.2).Both algorithms were implemented in Python 3.7, using Keras [28] and scikit-learn [29] libraries.
1) Support Vector Regression: The ϵ-SVR algorithm (margin of tolerance ϵ = 0.01) with radial basis function kernel was chosen for the 100 ms look-ahead ankle torque prediction.For the supervised learning in the isometric contraction protocol, the SVR takes EMG datasets (defined in 3.2.2) as input features and torque as the ground truth.The dynamic task protocol included kinematic features such as ankle joint sagittal plane angle and angular velocity supplementary to the EMG.
2) Feature Extraction With CNN: The CNN architecture consisted of one convolutional block followed by two fully connected layers and one regression layer.A convolutional block consists of convolutional, batch normalization, and activation layers, followed by max pooling and dropout.A convolutional block was applied separately on each HD-EMG image, the layers were flattened and concatenated before inputting them into the fully connected layer.At the input layer, the network was fed n frames of images of HD-EMG data, where n equals the number of time samples after the moving average calculation.At each frame, there were five image channels representing five electrode grids, where each channel had the dimensions corresponding to the spatial distribution of the grid's electrodes.The best hyperparameters for each trained model were found using the grid search approach.The search space was {8, 32, 64, 128, 256} number of nodes in the convolutional layer, {0.001, 0.0001} learning rate, and {0, 0.2, 0.4} dropout rate.After training, to extract Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.the CNN features, the last fully connected layer was removed from the model before prediction on the test data.The number of training epochs was limited to 500, and the training was stopped if the loss did not improve for the last 20 epochs.

D. Performance Evaluation
The agreement of measured and predicted ankle torque with different input modes was evaluated with normalized mean squared error (NRMSE) E nr ms , normalized to the difference between the maximum y max and minimum y min values of the test torque: where ŷ is the predicted torque, y is the measured torque, and N is the number of samples.
To investigate the robustness of the prediction under different circumstances, three cases were defined: • Intra-session case.The test and training data were from the same trial of the same subject.For each trial, five-fold cross-validation was used, and the mean NRMSE of the five folds was computed.
• Inter-subject case.The test data were one trial of one subject.Trials performed under the same test conditions by all the other subjects were used for training.This creates an n-fold cross-validation scenario where n is the number of subjects.
• Inter-session case.The test data were one trial of one subject.For the isometric contraction protocol, the training data were all the other trials of the same person that were not used for testing.This creates a k-fold crossvalidation scenario where k is the number of trials per person.For dynamic task protocol, the training data were from the same person performing a similar movement, i.e., if the test set was wide heel rises, narrow heel rises were used for the training and vice versa; if the test set was stepping up and down the platform, stepping down and up the platform was used for training and vice versa.This creates a two-fold cross-validation scenario.In addition to evaluating the prediction accuracy, we evaluated the SVR prediction latency, i.e. the time it takes for the SVR prediction to be executed.This parameter is important to account for when considering an online implementation of human-in-the-loop control strategy.The prediction latency was evaluated for each dataset in the intra-session case using only EMG features as input.The analysis was run on a PC with an Intel Core i7-9750H CPU and 32 GB of RAM.

E. Statistical Analysis
Wilcoxon signed-rank test was used to determine significance of the difference between different EMG datasets' results in isometric exercise protocol.Bonferroni correction was applied (α = 0.008) to minimize the risk of type I error.The statistics were not calculated on the dynamic task protocol data due to the small sample size (n = 6 for stance and n = 7 for all other movements).

A. Isometric Contraction Protocol
All input datasets showed good agreement between the predicted and measured isometric ankle joint torque (Fig. 3), with the highest NRMSE under 0.15 in all cases when using HD-EMG derived datasets (HD-EMG, HD-EMG PCs, and HD-EMG CNN) and NRMSE under 0.26 for all cases when using the bipolar EMG dataset (Fig. 4).The datasets derived from HD-EMG in all cases resulted in significantly more accurate (p ≤ 0.01) and less variable prediction.The best prediction accuracy was achieved in the intra-session case (mean NRMSE ± standard deviation: 0.04 ± 0.01 HD-EMG, 0.05 ± 0.02 HD-EMG CNN and HD-EMG PCs, 0.06 ± 0.02 bipolar EMG), and the worst -in the inter-subject case (0.07 ± 0.03 for datasets derived from HD-EMG, 0.10 ± 0.05 for bipolar EMG).Each violin plot at 30%, 50%, and 70% MVC shows the NRMSE results for one of the datasets and levels of MVC (n = 40) and each violin in "all" column -for one of the datasets at all recorded levels of MVC (n = 120).The statistical significance between pairs of datasets is shown with brackets, the star above them marks the p-values ≤ 0.01.

B. Dynamic Task Protocol
The prediction accuracy for the dynamic task was lower than the isometric contraction under all cases using either dataset.The highest prediction accuracy (0.11 ± 0.01 HD-EMG, 0.14±0.02HD-EMG CNN, 0.11±0.01HD-EMG PCs, 0.12 ± 0.01 bipolar EMG) was achieved for the wide stance heel rise movements given any configuration of inputs.Using only EMG datasets as input, HD-EMG CNN, with few exceptions (i.e. the stepping on and off the platform movements in the intra-session case as well as all movements in inter-session case), resulted in the highest prediction error (supplementary material C, tables C.1 -C.3) in most movements and cases (Fig. 5), while the other three datasets all showed similar results.The torque prediction error was especially high for the stance phase of gait when using only EMG inputs in both intra-session (0.24 ± 0.06 HD-EMG, 0.35 ± 0.10 HD-EMG CNN, 0.24 ± 0.07 HD-EMG PCs, 0.26 ± 0.07 bipolar EMG) and inter-subject (0.34±0.43 HD-EMG, 0.33±0.02HD-EMG CNN, 0.32 ± 0.04 HD-EMG PCs, 0.30 ± 0.03 bipolar EMG) cases.The prediction accuracy was lower in the inter-subject and inter-session cases compared to the intra-session case for all movements and all datasets, except for the HD-EMG CNN, which resulted in similar accuracy in most cases.
Adding ankle angle and angular velocity features to complement the EMG input features resulted in improved performance in most movements.The biggest improvement after adding the kinematic features was observed for the gait stance phase torque prediction (61% decrease in mean NRMSE).The prediction accuracy was also improved in all other cases, but on a smaller scale, with the smallest improvement observed for the heel rise movements (18.5% decrease in mean NRMSE for hip-width heel rises and 27.2% for wide heel rises) that also resulted in the best prediction results in all cases.These movements also showed lower variation between subjects and repetitions than other dynamic tasks (Fig. 3).The highest variation was observed in reach and touch.Using EMG datasets with additional kinematic features, the HD-EMG PCs and bipolar EMG datasets resulted in the best performance for all movements in all cases, except stepping up and down the platform in the inter-session case (0.22 ± 0.07 HD-EMG, 0.24 ± 0.01 HD-EMG CNN, 0.21 ± 0.06 HD-EMG PCs, 0.22 ± 0.06 bipolar EMG; Fig. 6).Both of these datasets performed similarly -mean NRMSE and standard deviation for both datasets when considering all movements was 0.13 ± 0.03 in the intra-session case, 0.14 ± 0.03 in the inter-subject case, 0.15 ± 0.4 in the intersession case.In many cases, the HD-EMG dataset did not benefit from additional features as much as the other datasets.

C. Prediction Latency
The mean and standard deviation of the prediction latency in the isometric contraction protocol was 10.

IV. DISCUSSION
This study investigated how different input features affect the ML model prediction of ankle joint torque.We applied four EMG processing pipelines to create four distinct EMG datasets -three datasets derived from HD-EMG and one bipolar EMG dataset -and compared the performance of isometric and dynamic ankle torque prediction using these datasets as SVR input features.We found that prediction accuracy was improved using HD-EMG-derived datasets in an isometric contraction, especially in inter-session and intersubject cases, but not in the dynamic task cases.The prediction error for the dynamic task was higher than the isometric contraction protocol for all movements and with either input dataset.For all dynamic tasks, except heel rises, additional kinematic features were needed to achieve good prediction performance.To the best of our knowledge, this is the first study comparing the performance of HD-EMG and bipolar EMG-driven torque prediction in isometric and dynamic tasks under different training and test conditions (intra-session, intersubject and inter-session cases).The findings of this study could provide guidance when choosing the most appropriate EMG type and processing pipeline for an application.
In this study, HD-EMG improved the accuracy and robustness of the ankle joint torque prediction in highly controlled movements, i.e., isometric contractions.The datasets derived from HD-EMG outperformed the bipolar EMG dataset in all isometric contraction cases.These findings agree with results of the study by Staudenmann et al. [16], [19] that reported improved intra-session elbow torque estimation using HD-EMG of the triceps brachii muscle, especially after applying dimensionality reduction to the HD-EMG signals.However, unlike previous studies, we observed no significant difference in the ankle joint estimation among the three HD-EMG-derived datasets.This may be due to several differences between the studies, including the number and anatomical structure of the observed muscles.The studies by Staudenmann et al. focused on the biceps brachii muscle.This parallel-fusiform muscle was shown to have a heterogeneous EMG activation in the medio-lateral direction [30].In contrast, this study focused on several muscles with bipenate (tibialis anterior and gastrocnemius medialis) or multipenate (soleus) structures.Moreover, the orientation of the fascicles with respect to the skin surface and, thus, the electrodes is different for each muscle, which affects how the EMG signal propagates through the muscle and may, in turn, affect the redundancy of the signals.The prediction accuracy was good with all datasets, including bipolar EMG, in the intrasession case but worsened in more challenging conditions when using bipolar EMG.The performance of HD-EMGderived datasets, on the contrary, remained similar in all cases.This also led to a larger performance discrepancy between the bipolar EMG and HD-EMG-derived datasets in inter-session and inter-subject cases, indicating greater robustness in torque prediction using HD-EMG-derived input.Considering that the prediction accuracy improved with all HD-EMG derived datasets, despite the used processing pipeline, it is likely that the latent spatial information of the HD-EMG contributes to the improvement of the isometric ankle joint torque prediction.
Compared to the isometric contraction cases, the prediction accuracy was lower for all dynamic tasks and cases, and no consistent differences could be observed between the HD-EMG-derived and bipolar EMG datasets.Lower prediction accuracy is expected in this case, as a consequence of the increased complexity of the movements.The results show that the EMG signals alone, regardless of the modality (bipolar or HD-EMG), are not sufficient to effectively capture the increased complexity and accurately predict torques during dynamic tasks.In contrast to isometric contractions, where the assumption of stationary source signals in space holds true, the muscle in dynamic tasks undergo much larger spatial transformations and therefore the sources in dynamic tasks cannot be assumed stationary.Consequently, the contribution of latent spatial information in predicting dynamic task torque diminishes compared to isometric contractions.As a result, the contribution of spatial information in torque prediction diminishes.Therefore, inclusion of spatial information alone (i.e., using HD-EMG) is not enough to overcome the increased complexity.To sum up, the study shows that predicting torques during dynamic tasks requires more than just EMG signals and that spatial information alone is insufficient in addressing the challenges posed by these tasks.
Considering only EMG input, all datasets performed similarly, except for the HD-EMG CNN dataset, which sometimes resulted in much higher mean error than other datasets.For instance, compared to other datasets, the HD-EMG CNN dataset resulted in notably higher prediction errors during heel-rise and stance movements in the intra-session case, Fig. 5.However, these differences were diminished in the inter-subject and inter-session cases.This might be due to low sample size available for training, suggesting that the network is likely under-trained and lacks the specificity needed to perform well on specific tasks.In this study, only 12 repetitions of each movement were used for training in the intra-session Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
case, while other studies using CNN for torque prediction reported using 16 or more repetitions for training.For instance, George et al. [5] reported that at least 20 gait cycles were needed for the CNN prediction (intra-session) of hip sagittal plane joint torque to start improving, and the results only became reliable at around 35 gait cycles.Schulte et al. [11] achieved good CNN prediction of the knee non-weight bearing torque over several days using the trial of 20 repetitions with a 80% training and 20% validation split.Although the studies have several differences, similar requirements can likely be expected.In the inter-subject case and inter-session cases of this study, 90 (15 repetitions from each of the six subjects) and 15 repetitions, respectively, were used for training.However, due to large variability between the subjects (inter-subject case) and movements (inter-session case), an even larger sample size might be required to ensure good prediction accuracy.It is worth pointing out that the need for many samples might be restricting the application of CNN feature extraction in populations of people who cannot perform many repetitions of the same movement due to muscle weakness or other pathological conditions.A possible solution may be using of EMG data augmentation (creating artificial training samples) using additive noise or simulating the electrode shift.Several approaches for EMG data augmentation have been proposed and shown to improve the classification accuracy for hand gesture recognition [31] and wrist movement regression accuracy and robustness [32], although the augmentation via oversampling showed varied results for the ankle torque estimation [33].
Additional kinematic features were necessary to achieve the best torque prediction performance for dynamic tasks.We found that the prediction accuracy improved with additional kinematic features for all movements, except heel rises in the intra-session case, where good prediction accuracy could already be achieved based solely on EMG features.The largest improvement after introducing kinematic features was seen in the stance phase of gait (Fig. 5).These findings are in line with a previous study by Hajian et al. [13] that reported increased elbow torque prediction accuracy for isokinetic and dynamic tasks when using joint position and velocity in combination with EMG data.The need for diverse features in torque prediction of more complex movements might imply that the activation of surrounding muscles does not always fully determine joint torque.In some rather controlled movements, such as heel rises, motion is restricted in all joints proximal to the ankle, and the muscles work mostly against gravity.Thus, EMG data alone is sufficient to accurately predict ankle torque.However, for more complex movements, such as the stance phase of gait, the torques and movement at other joints can also affect the torque at the ankle.In fact, knee and ankle joint positions influence the plantarflexion torque of the bi-articular gastrocnemius muscle [34].It is known that muscle force production is velocity-and length-dependent.Therefore the joint torque generated by the muscles also depends on the joint angle and angular velocity.It is a reasonable inference that the lack of knowledge of joint kinematics may hinder accurately predicting the joint torque.In addition, we observed that in heel rise, the torque prediction not only had the lowest error in all cases but also had the lowest variability between repetitions and subjects (Fig. 3).These observations further support that as an only input, EMG data were best suitable for simple, highly repetitive movements.
The mean SVR prediction latency was small enough to be considered feasible [35] for online prediction with all datasets.For the reference, the the longest was needed for the dataset with the most features (HD-EMG dataset) in both isometric contraction and dynamic task protocols.The other datasets containing less features performed similarly, except for the HD-EMG CNN dataset in dynamic protocol, which required a considerably longer time than the HD-EMG PCs and bipolar EMG datasets.The trend seems to correlate with the number of features in the dataset.The higher number of features will also reflect on other important parameters such as memory usage, data storage and communication overhead, thus increasing overall computational complexity.All these parameters need to be taken into consideration when deciding which dataset is suitable for a particular application.
A major limitation of this study is its small and rather homogeneous cohort of subjects (n = 5 in the isometric protocol and n = 7 in the dynamic protocol), which limits the generalizability of our findings.However, the high accuracy and low variability of torque prediction in the isometric contractions (Fig. 4) and some dynamic tasks (Fig. 6) in inter-subject and inter-session cases are promising.Notably, the isometric contraction protocol limited the ankle range of motion to the middle range of the total range of motion.This restriction might have an impact on the torque prediction at the extremes of the range of motion.In the current study, we were particularly interested in the influence of input features on the torque prediction performance rather than achieving the absolute best performance.Therefore, we chose a deterministic ML algorithm that can work well with little data.Moreover, as discussed previously, the low number of samples may have hindered the performance of the CNN.It is important to note that more data could potentially improve the performance of both CNN and SVR and enable using more complex ML algorithms, such as deep neural networks, that might result in better prediction accuracy.Finally, HD-EMG data were only acquired on five muscles around the ankle joint.The prediction performance could potentially be further improved and more robust if EMG data of other lower limb muscles and joint angles of the knee and hip joints were available.

V. CONCLUSION
In this study, we investigated how four different EMG-derived feature inputs (HD-EMG, HD-EMG PCs, HD-EMG CNN, and bipolar EMG) affect the SVR prediction of ankle sagittal plane joint torque in the intra-session, intersubject, and inter-session cases.We additionally considered kinematic features -ankle joint angle and angular velocity -for the dynamic task prediction.We found that all the HD-EMG-derived datasets resulted in better isometric torque prediction than bipolar EMG.HD-EMG PCs and bipolar EMG datasets resulted in the best torque prediction in dynamic tasks.However, the greatest improvements in the dynamic task torque prediction were achieved by considering the kinematic features rather than selecting the most optimal EMG datasets.Therefore, we conclude that in this study the choice of EMG modality (bipolar or HD-EMG) was important for the prediction of isometric contraction torques, but for dynamic tasks, the inclusion of kinematic features is more important rather than the choice of particular EMG modality.This study demonstrates the importance of suitable feature selection for an accurate and robust prediction of ankle torque using ML.The findings could inform the decision-making of the suitable EMG method choice for applications in wearable robotics.The applications where the isometric torque or simple movements are sufficient, e.g.single joint two degree-of-freedom strength training for rehabilitation, one might consider using HD-EMG.However, to incorporate more complex movements, including kinematic features is necessary.

Fig. 1 .
Fig. 1.Illustrations of six movements performed by participants during the dynamic task protocol.The blue color marks the starting position, the orange color marks the final position of the movement, and the arrows show the direction of the movement.All movements, except the stance phase of gait, are performed in a circular manner, i.e., from starting position transitioning to the final position, and transitioning back to starting position, as indicated by double arrows.The stance phase of gait is performed in only one direction, from the starting to the final position.

Fig. 2 .
Fig. 2. Data processing flow.Frame A shows the flowchart of EMG processing, while B shows the flow of ankle joint torque and kinematic feature calculation.The torque is calculated and handled differently in dynamic and isometric protocols, and only one is used as a reference at a time.The ankle joint angle is concatenated with EMG data only in the dynamic protocol.

Fig. 3 .
Fig. 3. Measured and predicted intra-session case ankle joint torque, shown as mean of all subjects and repetitions ± one standard deviation of the measured torque.The input features used for dynamic task prediction were EMG and kinematic data.The positive values indicate plantar flexion torques.

Fig. 4 .
Fig. 4. SVR ankle torque prediction results during the isometric contraction are shown for intra-session, inter-subject, and inter-session cases.Each violin plot at 30%, 50%, and 70% MVC shows the NRMSE results for one of the datasets and levels of MVC (n = 40) and each violin in "all" column -for one of the datasets at all recorded levels of MVC (n = 120).The statistical significance between pairs of datasets is shown with brackets, the star above them marks the p-values ≤ 0.01.

Fig. 5 .
Fig. 5. Mean NRMSE of torque prediction during dynamic tasks in intra-session, inter-subject, and inter-session cases, using only EMG datasets or EMG datasets combined with ankle joint angle and velocity as input features.

Fig. 6 .
Fig.6.SVR prediction results of dynamic ankle torque shown for intra-session, inter-subject, and inter-session cases.The input to SVR were EMG datasets and kinematic features (ankle angle and angular velocity).