# Also in the Article

Genetic algorithm optimization
This protocol is extracted from research article:
Restoration of bilateral motor coordination from preserved agonist-antagonist coupling in amputation musculature
J Neuroeng Rehabil, Feb 17, 2021;

Procedure

A genetic algorithm was used to optimize the model’s morphological parameters for each subject to minimize the residual sum of squares between the mirrored subtalar trajectory and the model’s output trajectory within a three-second window of training data. Because slow movements are difficult for humans to produce smoothly [47], and fast movements are difficult to produce accurately [23], the three-second window of training data was taken from the intermediate 1.4 Hz section of each subject’s blind symmetry trials to minimize trajectory error generated by the subject. From this window, raw sEMG data from residual inverter and everter muscles were processed using techniques described previously to produce estimated neural excitations $μ(t)$. Mirrored IE trajectories from the contralateral intact subtalar were used as the desired reference trajectory.

The subtalar model was implemented in OpenSim 4.0, an open source dynamics environment widely used for neuromuscular modeling [48, 49]. MATLAB’s genetic algorithm (GA) toolbox was used to find the global optimum values of the MTU morphological and dynamic model parameters (Additional file 1: Table S1). MTU variables which belong to OpenSim’s Thelen2003Muscle class not explicitly mentioned here were fixed to their default values. A total of 18 MTU and 2 model parameters were investigated over the ranges specified in the table. The optimal parameter set minimized the residual sum of squares between generated trajectory and reference trajectory using the single objective cost function

where t is the discretized time index for trajectories n ms long. A full process diagram is provided (Additional file 1: Fig. S3).

Every GA run was uniformly initialized across the solution space with 5,000 members and set to run for 100 generations or until stalling for 3 generations. Two elite members were preserved per generation. Each iteration within the GA performed an OpenSim forward simulation with the specified AMI neural excitation inputs into a neuromuscular subtalar model initialized to a specific population member’s parameters and the initial position of the reference trajectory. Three separate GA runs were performed for each subject, each taking approximately 12 hours on an AMD $RyzenTM$ 2950X CPU with 16 parallel processing threads. The optimized parameter set from the three runs with the best performance was used for all subsequent analysis per subject.

Note: The content above has been extracted from a research article, so it may not display correctly.

Q&A