# Genetic algorithms for force polytopes prediction

G. Laisné<sup>a*</sup>, J-M. Salotti<sup>b</sup>, and N. Rezzoug<sup>a,c</sup>

<sup>a</sup>INRIA Bordeaux, Université de Bordeaux, Talence, France; <sup>b</sup>Univ. Bordeaux, CNRS, Bordeaux INP, INRIA, IMS, UMR 5218, F-33400 Talence, France;

<sup>c</sup>Institut PPrime, CNRS-Université de Poitiers-ENSMA, UPR 3346, Poitiers, France

## 1. Introduction

Knowledge of human's force capacities enables the design of physical Human-Robot Interaction (pHRI) workspaces. As measuring force capacities for all postures is time consuming, predicting force capacities from a subset of measurements performed in a limited number of postures is crucial. The force capacities can be described as a convex polytope by means of a personalized musculoskeletal (MSK) model (Skuric et al. 2022). However, the tuning of a MSK model is difficult due to the high number of parameters. Thanks to its constraint-free nature on the optimization function, a genetic algorithm is implemented to find a MSK model parameter set, which fits and predicts force polytopes (Van Soest and Casius, 2003; Peng et al., 2015).

## 2. Methods

### 2.1 Force polytope

The upper-limb is considered as a n degree-of-freedoms kinematic chain actuated by d muscles. In isometric conditions, the (convex) force polytope localized at the center of the hand is defined as:

$$P = \{ \mathbf{f} \in \mathbb{R}^3 \mid J^T \mathbf{f} = -L^T \mathbf{t}, \mathbf{t} \in [\mathbf{t}_{\min}, \mathbf{t}_{\max}] \} \quad (1)$$

where $J^T \in \mathbb{R}^{n \times 3}$ and $-L^T \in \mathbb{R}^{n \times d}$ map respectively the forces at the end-effector $\mathbf{f} \in \mathbb{R}^3$ and the muscle tensions $\mathbf{t} \in [\mathbf{t}_{\min}, \mathbf{t}_{\max}]$ onto the torque space. These mappings and the muscle tensions depend on the joint configuration $\mathbf{q} \in \mathbb{R}^n$. The Iterative Convex Hull method with a tolerance of 1N is used to approximate the polytope vertices (Skuric et al., 2022).

For an arbitrary $k \in \mathbb{N}$, the discretization of a polytope is a scaled-down representation in $2k$ vertices. It ensures easier comparisons. The polytope is intersected with lines $L_1, L_2, \dots, L_k$ passing through the origin and $k$ points evenly distributed on the upper sphere, with $L_1$ passing through (1,0,0). Each line produces two vertices noted $v_{L_1}^+$ and $v_{L_1}^-$. The discretized polytope is defined as:

$$P^D = (v_{L_1}^+, v_{L_1}^-, \dots, v_{L_k}^+, v_{L_k}^-) \in \mathbb{R}^{2k} \quad (2)$$

### 2.2 Musculoskeletal model

A biorbd-compatible version of Stanford's upper-limb model (Holzbaur et al., 2005) is used and consists of 50 muscles and 7 degrees-of-freedom. The muscle tensions are computed using Thelen's muscle model.

### 2.3 Optimization problem

Our goal is to find a MSK model parameter set $\mathbf{M}^*$ which generates discretized forces polytopes close to discretized polytopes computed from an unknown model parameter set in $p$ postures:

$$\mathbf{M}^* = \operatorname*{argmin}_{\mathbf{M}} f_p(\mathbf{M}) \quad (3)$$

$$\text{with } f_p(\mathbf{M}) = \frac{1}{p} \sum_{i=1}^{p} \text{MSE}(\hat{P}_i^D, P_i^D(\mathbf{M})) \quad (4)$$

with $\mathbf{M}$ a model parameter set, $p$ the number of postures considered, $\hat{P}_i^D$ the discretized polytope to estimate at posture $i$, and $P_i^D(\mathbf{M})$ the computed discretized polytope at posture $i$.

### 2.4 Genetic algorithm

Genetic algorithms are based on the biological concept of evolution. They are particularly efficient compared to classic optimization methods to find solutions for hard optimization problems, with conditions such as unsteadiness, non-derivability, or noise (Van Soest and Casius, 2003). A genetic algorithm begins with randomly or manually initialized solutions called the initial generation. The solutions are then assessed according to a cost function. The best solutions, called parents, define a new generation by means of small changes called mutations. The process is iterated until a terminating criterion is met.

### 2.5 Simulations

A genetic algorithm is used to minimize (4). A solution is a set of 150 parameters defining Stanford's MSK model. This set includes 3 parameters per muscle (the maximum isometric force, the optimal muscle length at which the muscle creates its maximal isometric force and the tendon slack length). These parameters have direct impact on muscle tensions computed using the force-length relationship. Each generation has 128 solutions. An initial generation is created using uniform random perturbations up to 30% (arbitrarily chosen due to computation considerations) of the Stanford's model parameter set. Small perturbations, up to 5%, are also applied on each muscle origin and insertion points. Five initial generations $G_1, G_2, G_3, G_4$ and $G_5$ are defined.

To assess the impact of the number of postures in the optimization process, two sets of postures $S_4$ and $S_6$ are considered: $S_4$ includes 4 common upper-limb postures ($Q_1, Q_2, Q_3$, and $Q_4$), while $S_6$ includes 2 more ($Q_5$ and $Q_6$). The model is defined in the global reference frame following the ISB recommendations:
the x-axis is normal to the coronal plane, the y-axis normal to the transverse plane and the z-axis normal to the sagittal plane. The postures are described by 7 Euler angles in degrees using a y-z'-y'' sequence for the shoulder, a z-y' sequence for the elbow and a x-z' sequence for the wrist: $Q_1 = (31°, 12°, -34°, 74°, 17°, 15°, 15°)$, $Q_2 = (79°, 54°, -73°, 53°, 90°, 0°, 0)$, $Q_3 = (124°, 56°, -75°, 32°, 88°, 0°, 0°)$, $Q_4 = (27°, 66°, -59°, 34°, 88°, 0°, 0)$, $Q_5 = (-41°, 79°, -6°, 104°, -46°, 6°, 0)$, and $Q_6 = (108°, 104°, 7°, 31°, -46°, 6°, 0°)$.

A cost function is defined per posture set and are respectively $f_4$ and $f_6$, using (4). The 5 best solutions which minimize the cost function define the parents. An elitist strategy is used to keep the parents in the next generation. For each parent, the mutation process generates 5 new parameter sets randomly selected in the neighbourhood of the parent parameter set. The neighbourhood size varies depending on the number of times a solution has been selected as a parent: below 4 times, the neighbourhood includes up to 10% around the parent parameters. Between 5 and 9 times, up to 1%. Between 10 and 29, up to 0.5% and above 30 times, up to 0.1%. Each generated parameter set also includes up to 1% random perturbations for the muscle origin and insertion points. They induce small perturbations in the generated force polytopes, allowing us to verify the genetic algorithms robustness.

### 3. Results and discussion

A genetic algorithm was used to tune a MSK model using force polytopes discretized in 26 vertices. A simplified version of the Stanford's MSK model (Holzbaur et al., 2015) with 7 degree-of-freedoms and 50 muscles was used as the model parameter set to estimate. For the five different initial generations considered using each posture sets, the algorithm converged to a solution (Fig 1). Predictions show better results using 6 postures, due to overfitting when using 4 postures only (Table 1).

<figure><img src="image_1.png" /><figcaption>Figure 1 Force polytope fitting for posture $Q_1$ from loop 1 to loop 500 using the posture set $S_6$.</figcaption></figure>

Posture number should be optimized to get better results. Also, found solutions were expectedly distant from the model parameter set to estimate, due to redundancy in joint torques generation.

<table><caption>Table 1 Mean±SD of discretized force polytopes RMSEs (N) between Stanford's and solutions found for $G_1$ to $G_5$ using $S_4$ and $S_6$ in fitting postures (white) and in 10 new prediction postures (grey).</caption><thead><tr><th></th><th>G<sub>1</sub></th><th>G<sub>2</sub></th><th>G<sub>3</sub></th><th>G<sub>4</sub></th><th>G<sub>5</sub></th></tr></thead><tbody><tr><th>S<sub>4</sub></th><td>4±1</td><td>3±1</td><td>4±1</td><td>5±1</td><td>5±2</td></tr><tr><th>S<sub>4</sub></th><td>14±7</td><td>16±13</td><td>32±45</td><td>31±39</td><td>31±53</td></tr><tr><th>S<sub>6</sub></th><td>5±2</td><td>6±1</td><td>6±1</td><td>6±2</td><td>9±3</td></tr><tr><th>S<sub>6</sub></th><td>20±14</td><td>16±13</td><td>11±9</td><td>11±8</td><td>14±8</td></tr></tbody></table>

### 4. Conclusions

Simulation results attest the performance of finding a model parameter set which fits and predicts force polytopes for different postures (Fig 2). The cost functions should be adapted to consider the polytopes geometry. The method was tested in silico and will be validated experimentally using a similar protocol for force polytopes measurements as in (Rezzoug et al., 2013).

<figure><img src="image_2.png" /><figcaption>Figure 2 Example of force polytope predictions for 3 new postures.</figcaption></figure>

### Acknowledgements

The simulations were carried out using the PlaFRIM experimental testbed (Inria, CNRS, LABRI, IMB, Université de Bordeaux, Bordeaux INP and Conseil Régional d'Aquitaine) (see https://www.plafrim.fr).

### References

- Van Soest AJK, Casius LJRR. 2003. The Merits of a Parallel Genetic Algorithm in Solving Hard Optimization Problems. J. Biomech. Eng. 125(1):141-146.

- Peng Lo, Hou Z-G, Peng Li, Wang W-Q. 2015. A practical EMG-driven musculoskeletal model for dynamic torque estimation of knee joint. IEEE Int. Conf. on Robotics and Biomimetics. p. 1036-1040.

- Skuric A, Padois V, Rezzoug N, Daney D. 2022. On-Line Feasible Wrench Polytope Evaluation Based on Human Musculoskeletal Models: An Iterative Convex Hull Method. IEEE Robotics and Automation Letters. 7(2):5206-5213.

- Holzbaur KRS, Murray WM, Delp SL. 2005. A Model of the Upper Extremity for Simulating Musculoskeletal Surgery and Analyzing Neuromuscular Control. Ann Biomed Eng. 33(6):829-840.

- Rezzoug N, Hernandez V, Jacquier-Bret J, Gorce P. 2013. Comparison between model-based and
measured force polytopes: towards isometric force
capacity evaluation. Comput. Meth. Biom.
Biomed. Eng. 16(sup1):172-174

**Keywords:** force polytope; genetic algorithm; musculoskeletal model.

*Corresponding author.
gautier.laisne@inria.fr

Email: