Toward Digital Twins of Human Movement: A Pipeline from Motion-Capture Data to Musculoskeletal Control Policies (Work in progress)
1. Introduction
Understanding and predicting how a specific person moves requires more than kinematic playback: it requires a model that obeys physics (contact, gravity, balance) and is driven by actuators resembling muscles. Musculoskeletal models such as OpenSim’s Gait2354 and Rajagopal–Lai–Uhlrich (2023) models, and their MuJoCo counterparts in MyoSuite, make this possible, but producing controllers for them is hard because of high-dimensional, redundant, and stiff muscle dynamics. Recent work (e.g., MuscleMimic, Li et al. 2026) shows that large-scale, GPU-parallel imitation learning can unlock full-body musculoskeletal motor learning, motivating a pipeline that connects public mocap data to such learners.
This project aims to build a digital twin pipeline for human movement with three goals:
- Data fidelity – ingest mocap recordings into a canonical, unit-consistent representation with full provenance.
- Model fidelity – retarget the recordings to musculoskeletal models through IK, producing a joint-space reference trajectory the simulator can track.
- Control – learn muscle-level policies that reproduce the reference under physics, and compare them with real data.
We deliberately include both CPU and GPU workflows: CPU for development, debugging, and small-scale baselines; GPU for the massively parallel training needed by full-body models.
Figure 1. Overall pipeline from raw motion capture to a trained policy. Blue: data/model stages; orange: learning stages.
2. Methods
2.1 Motion data and canonicalization
Recordings come from different human movement datasets. Source adapters convert each recording to a canonical representation (stored as paired .h5 + .json files) with right-handed axes (x forward, y left, z up), metres, seconds, radians, and wxyz unit quaternions; every coordinate/unit conversion is recorded in a provenance field.
Movements studied:
- Standing jump
- Backward walk
- Injured-leg walk
- Floor pick-up
2.2 Musculoskeletal models
We use MuJoCo models from MyoSuite: first the lower-limb MyoLeg model, then the MyoFullBody model (129 degrees of freedom) from the MuscleMimic model set, once it became clear that upper-body and trunk motion is essential for jump, pick-up, and backward walking.
2.3 Inverse kinematics
For each motion, a joint-based IK routine fits the MuJoCo model’s generalized coordinates to the canonical marker/joint trajectories frame by frame, producing a reference file.
Figure 2a. IK fit of the standing jump (evenly spaced frames).
Figure 2b. IK fit of the backward walk.
Figure 2c. IK fit of the injured-leg walk.
Figure 2d. IK fit of the floor pick-up.
2.4 Imitation RL on CPU
Policies are trained to track the IK reference in a MyoSuite Gymnasium environment (derived from LegWalkEnvV0). Observations include current state and reference look-ahead at 0.1, 0.3, 0.5, and 0.8 s. The reward is a weighted sum of joint position/velocity tracking, centre-of-mass (COM) position/velocity tracking, an effort (muscle-activation) penalty, and a failure penalty (low COM height or excessive root-orientation error). We trained a PPO policy for the standing jump (MyoLeg) and a DDPG policy for the backward walk (MyoFullBody), and used CPU runs mainly for debugging rewards and observations.
Figure 3. Rollout frames of the CPU-trained standing-jump policy (early, partial result).
2.6 Imitation RL on GPU
To scale to the full-body model, we ported the task to MJLab / MuJoCo Warp and train with PPO on a CUDA GPU (Linux). Key design choices:
- Rewards: joint pos/vel, COM pos/vel, foot pos/vel tracking, effort cost, and failure penalty.
- Failure: COM height below a threshold; episodes also end when the reference completes.
- Random reference-start initialization: resets sample from the first 80 % of the motion; playback starts at frame zero.
- Observation history: current plus two previous control steps.
- Reference-horizon curriculum: training begins on a short prefix of the reference (0.2 s) and extends it (+0.2 s increments) only when ≥80 % of evaluation episodes reach the current horizon without failure and mean tracking quality ≥ 0.8. Early cutoffs are treated as PPO truncations (value bootstrapping), not failures. Horizon, completion rate, and tracking quality are logged.
3. Preliminary Results and Discussion
3.1 Data and IK
All four movements were successfully converted to canonical form and fitted to the musculoskeletal model, producing smooth joint-space references (375–700 frames each) that visually match the source motion (Fig. 2). Transitioning from the leg-only to the full-body model resolved the main limitation of lower-body-only fits (missing trunk/arm contribution in jump and pick-up), at the cost of a much larger action and state space (129 DoF).
3.2 CPU training
CPU training validated the reward design and the environment interface, and produced a partially working standing-jump policy (Fig. 3). However, throughput on CPU was insufficient to train the muscle-driven full-body model which motivated the GPU port.
3.3 GPU curriculum training
On GPU, a long backward-walk run (~48,800 PPO iterations, ~1,000 env-steps/s logged throughput) showed steady improvement (Fig. 4): mean episode reward rose from ≈150 to ≈1,400, the curriculum advanced through 8 stages to a horizon of ≈4.2 s, and tracking quality improved from ≈0.55 to ≈0.76 (segment completion ≈0.8–0.9 at the current horizon). Tracking quality has not yet reached the 0.8 promotion threshold for the full reference, so the policy has not yet reproduced the entire movement; short-prefix completion should not be read as full-motion success.
Figure 4. GPU (MJLab/MJWarp PPO) training with a reference-horizon curriculum on backward walk: mean reward, curriculum horizon, tracking quality, and segment completion (raw and 200-iteration moving average).
3.4 Discussion
Three observations stand out. (i) The IK reference quality bounds what RL can imitate; artifacts (foot sliding, ground penetration) appear as unreachable targets. (ii) Muscle-driven full-body control is exploration-hard from frame zero; the curriculum and random-start resets make learning tractable, though plateaus in tracking quality suggest reward-weight and termination tuning are still needed. (iii) CPU and GPU workflows are complementary: CPU for fast iteration and analytic baselines, GPU for scale. Limitations: single-subject references, no contact-force or EMG validation yet, and hand-tuned reward weights.
4. Conclusions
We have established a working, open pipeline from raw motion capture to canonical data, musculoskeletal IK references for four movements, and reference-tracking RL policies on both CPU and GPU. GPU curriculum training reliably improves tracking on backward walking, though full-movement imitation is not yet achieved. The pipeline provides a foundation for subject-specific digital twins of movement.
5. Future Directions
- Complete full-reference imitation, and train on diverse movements with a single multi-motion policy.
- Tune rewards/terminations and explore adaptive curricula and reference-state-initialization variants.
- Validation: compare simulated joint kinematics, ground-reaction forces, and muscle activations against measured data (biomechanics, EMG, statistics modules planned).
- Inverse dynamics stage (OpenSim) to cross-check joint torques and muscle forces.
- Subject-specific scaling and injury modelling (e.g., weakened muscles for the injured-leg gait) for “what-if” simulation.
- Synthetic data augmentation and a web front-end for interactive visualization of digital twins.
References
- Li, et al. (2026). Towards Embodied AI with MuscleMimic: Unlocking full-body musculoskeletal motor learning at scale.
- Caggiano, V., et al. (2022). MyoSuite: A contact-rich simulation suite for musculoskeletal motor control. PMLR (L4DC).
- Todorov, E., Erez, T., & Tassa, Y. (2012). MuJoCo: A physics engine for model-based control. IROS.
- Rajagopal, A., et al. (2016). Full-body musculoskeletal model for muscle-driven simulation of human gait. IEEE Trans. Biomed. Eng.
- Lai, A. K. M., Arnold, A. S., & Wakeling, J. M. (2017) / Uhlrich, S. D., et al. (2023). Musculoskeletal model for gait and exercise simulation (Rajagopal–Lai–Uhlrich 2023).
- Seth, A., et al. (2018). OpenSim: Simulating musculoskeletal dynamics and neuromuscular control. PLoS Comput. Biol.
- Schulman, J., et al. (2017). Proximal policy optimization algorithms. arXiv:1707.06347.
- Lillicrap, T. P., et al. (2016). Continuous control with deep reinforcement learning (DDPG). ICLR.
- Peng, X. B., et al. (2018). DeepMimic: Example-guided deep reinforcement learning of physics-based character skills. ACM TOG.
- MuJoCo Warp / MJLab: GPU-accelerated MuJoCo simulation and RL framework (Google DeepMind / MJLab contributors).