<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Movement Digital Twins | Sina Mehdiz, PhD</title><link>https://sinamehdiz.com/tag/movement-digital-twins/</link><atom:link href="https://sinamehdiz.com/tag/movement-digital-twins/index.xml" rel="self" type="application/rss+xml"/><description>Movement Digital Twins</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Thu, 01 Oct 2026 00:00:00 +0000</lastBuildDate><image><url>https://sinamehdiz.com/images/icon_hu0b7a4cb9992c9ac0e91bd28ffd38dd00_9727_512x512_fill_lanczos_center_3.png</url><title>Movement Digital Twins</title><link>https://sinamehdiz.com/tag/movement-digital-twins/</link></image><item><title>Toward Digital Twins of Human Movement: A Pipeline from Motion-Capture Data to Musculoskeletal Control Policies (Work in progress)</title><link>https://sinamehdiz.com/project/movement-dt/</link><pubDate>Thu, 01 Oct 2026 00:00:00 +0000</pubDate><guid>https://sinamehdiz.com/project/movement-dt/</guid><description>&lt;h2 id="1-introduction">1. Introduction&lt;/h2>
&lt;p>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&amp;rsquo;s Gait2354 and Rajagopal–Lai–Uhlrich (2023) models, and their MuJoCo counterparts in MyoSuite, make this possible, but producing &lt;em>controllers&lt;/em> 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.&lt;/p>
&lt;p>This project aims to build a &lt;strong>digital twin pipeline for human movement&lt;/strong> with three goals:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Data fidelity&lt;/strong> – ingest mocap recordings into a canonical, unit-consistent representation with full provenance.&lt;/li>
&lt;li>&lt;strong>Model fidelity&lt;/strong> – retarget the recordings to musculoskeletal models through IK, producing a joint-space reference trajectory the simulator can track.&lt;/li>
&lt;li>&lt;strong>Control&lt;/strong> – learn muscle-level policies that reproduce the reference under physics, and compare them with real data.&lt;/li>
&lt;/ol>
&lt;p>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.&lt;/p>
&lt;p>&lt;img src="pipeline_overview.png" alt="Pipeline overview">
&lt;em>Figure 1. Overall pipeline from raw motion capture to a trained policy. Blue: data/model stages; orange: learning stages.&lt;/em>&lt;/p>
&lt;h2 id="2-methods">2. Methods&lt;/h2>
&lt;h3 id="21-motion-data-and-canonicalization">2.1 Motion data and canonicalization&lt;/h3>
&lt;p>Recordings come from different human movement datasets. Source adapters convert each recording to a canonical representation (stored as paired &lt;code>.h5&lt;/code> + &lt;code>.json&lt;/code> files) with right-handed axes (x forward, y left, z up), metres, seconds, radians, and &lt;code>wxyz&lt;/code> unit quaternions; every coordinate/unit conversion is recorded in a &lt;code>provenance&lt;/code> field.&lt;/p>
&lt;p>Movements studied:&lt;/p>
&lt;ul>
&lt;li>Standing jump&lt;/li>
&lt;li>Backward walk&lt;/li>
&lt;li>Injured-leg walk&lt;/li>
&lt;li>Floor pick-up&lt;/li>
&lt;/ul>
&lt;h3 id="22-musculoskeletal-models">2.2 Musculoskeletal models&lt;/h3>
&lt;p>We use MuJoCo models from MyoSuite: first the lower-limb &lt;strong>MyoLeg&lt;/strong> model, then the &lt;strong>MyoFullBody&lt;/strong> 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.&lt;/p>
&lt;h3 id="23-inverse-kinematics">2.3 Inverse kinematics&lt;/h3>
&lt;p>For each motion, a joint-based IK routine fits the MuJoCo model&amp;rsquo;s generalized coordinates to the canonical marker/joint trajectories frame by frame, producing a reference file.&lt;/p>
&lt;p>&lt;img src="ik_standing_jump.jpg" alt="IK fit: standing jump">
&lt;em>Figure 2a. IK fit of the standing jump (evenly spaced frames).&lt;/em>&lt;/p>
&lt;p>&lt;img src="ik_backward_walk.jpg" alt="IK fit: backward walk">
&lt;em>Figure 2b. IK fit of the backward walk.&lt;/em>&lt;/p>
&lt;p>&lt;img src="ik_injured_walk.jpg" alt="IK fit: injured-leg walk">
&lt;em>Figure 2c. IK fit of the injured-leg walk.&lt;/em>&lt;/p>
&lt;p>&lt;img src="ik_pick_up.jpg" alt="IK fit: pick-up">
&lt;em>Figure 2d. IK fit of the floor pick-up.&lt;/em>&lt;/p>
&lt;h3 id="24-imitation-rl-on-cpu">2.4 Imitation RL on CPU&lt;/h3>
&lt;p>Policies are trained to track the IK reference in a MyoSuite Gymnasium environment (derived from &lt;code>LegWalkEnvV0&lt;/code>). 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 &lt;strong>PPO&lt;/strong> policy for the standing jump (MyoLeg) and a &lt;strong>DDPG&lt;/strong> policy for the backward walk (MyoFullBody), and used CPU runs mainly for debugging rewards and observations.&lt;/p>
&lt;p>&lt;img src="rl_cpu_standing_jump.jpg" alt="CPU RL standing jump">
&lt;em>Figure 3. Rollout frames of the CPU-trained standing-jump policy (early, partial result).&lt;/em>&lt;/p>
&lt;h3 id="26-imitation-rl-on-gpu">2.6 Imitation RL on GPU&lt;/h3>
&lt;p>To scale to the full-body model, we ported the task to &lt;strong>MJLab / MuJoCo Warp&lt;/strong> and train with &lt;strong>PPO&lt;/strong> on a CUDA GPU (Linux). Key design choices:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Rewards:&lt;/strong> joint pos/vel, COM pos/vel, &lt;strong>foot&lt;/strong> pos/vel tracking, effort cost, and failure penalty.&lt;/li>
&lt;li>&lt;strong>Failure:&lt;/strong> COM height below a threshold; episodes also end when the reference completes.&lt;/li>
&lt;li>&lt;strong>Random reference-start initialization:&lt;/strong> resets sample from the first 80 % of the motion; playback starts at frame zero.&lt;/li>
&lt;li>&lt;strong>Observation history:&lt;/strong> current plus two previous control steps.&lt;/li>
&lt;li>&lt;strong>Reference-horizon curriculum:&lt;/strong> 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 &lt;em>and&lt;/em> mean tracking quality ≥ 0.8. Early cutoffs are treated as PPO truncations (value bootstrapping), not failures. Horizon, completion rate, and tracking quality are logged.&lt;/li>
&lt;/ul>
&lt;h2 id="3-preliminary-results-and-discussion">3. Preliminary Results and Discussion&lt;/h2>
&lt;h3 id="31-data-and-ik">3.1 Data and IK&lt;/h3>
&lt;p>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).&lt;/p>
&lt;h3 id="32-cpu-training">3.2 CPU training&lt;/h3>
&lt;p>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.&lt;/p>
&lt;h3 id="33-gpu-curriculum-training">3.3 GPU curriculum training&lt;/h3>
&lt;p>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 &lt;strong>not&lt;/strong> yet reproduced the entire movement; short-prefix completion should not be read as full-motion success.&lt;/p>
&lt;p>&lt;img src="gpu_curriculum_curves.png" alt="GPU curriculum training curves">
&lt;em>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).&lt;/em>&lt;/p>
&lt;h3 id="34-discussion">3.4 Discussion&lt;/h3>
&lt;p>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.&lt;/p>
&lt;h2 id="4-conclusions">4. Conclusions&lt;/h2>
&lt;p>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.&lt;/p>
&lt;h2 id="5-future-directions">5. Future Directions&lt;/h2>
&lt;ul>
&lt;li>Complete full-reference imitation, and train on diverse movements with a single multi-motion policy.&lt;/li>
&lt;li>Tune rewards/terminations and explore adaptive curricula and reference-state-initialization variants.&lt;/li>
&lt;li>&lt;strong>Validation:&lt;/strong> compare simulated joint kinematics, ground-reaction forces, and muscle activations against measured data (biomechanics, EMG, statistics modules planned).&lt;/li>
&lt;li>&lt;strong>Inverse dynamics&lt;/strong> stage (OpenSim) to cross-check joint torques and muscle forces.&lt;/li>
&lt;li>Subject-specific scaling and injury modelling (e.g., weakened muscles for the injured-leg gait) for &amp;ldquo;what-if&amp;rdquo; simulation.&lt;/li>
&lt;li>Synthetic data augmentation and a web front-end for interactive visualization of digital twins.&lt;/li>
&lt;/ul>
&lt;h2 id="references">References&lt;/h2>
&lt;ol>
&lt;li>Li, et al. (2026). &lt;em>Towards Embodied AI with MuscleMimic: Unlocking full-body musculoskeletal motor learning at scale.&lt;/em>&lt;/li>
&lt;li>Caggiano, V., et al. (2022). MyoSuite: A contact-rich simulation suite for musculoskeletal motor control. &lt;em>PMLR (L4DC)&lt;/em>.&lt;/li>
&lt;li>Todorov, E., Erez, T., &amp;amp; Tassa, Y. (2012). MuJoCo: A physics engine for model-based control. &lt;em>IROS&lt;/em>.&lt;/li>
&lt;li>Rajagopal, A., et al. (2016). Full-body musculoskeletal model for muscle-driven simulation of human gait. &lt;em>IEEE Trans. Biomed. Eng.&lt;/em>&lt;/li>
&lt;li>Lai, A. K. M., Arnold, A. S., &amp;amp; Wakeling, J. M. (2017) / Uhlrich, S. D., et al. (2023). Musculoskeletal model for gait and exercise simulation (Rajagopal–Lai–Uhlrich 2023).&lt;/li>
&lt;li>Seth, A., et al. (2018). OpenSim: Simulating musculoskeletal dynamics and neuromuscular control. &lt;em>PLoS Comput. Biol.&lt;/em>&lt;/li>
&lt;li>Schulman, J., et al. (2017). Proximal policy optimization algorithms. &lt;em>arXiv:1707.06347&lt;/em>.&lt;/li>
&lt;li>Lillicrap, T. P., et al. (2016). Continuous control with deep reinforcement learning (DDPG). &lt;em>ICLR&lt;/em>.&lt;/li>
&lt;li>Peng, X. B., et al. (2018). DeepMimic: Example-guided deep reinforcement learning of physics-based character skills. &lt;em>ACM TOG&lt;/em>.&lt;/li>
&lt;li>MuJoCo Warp / MJLab: GPU-accelerated MuJoCo simulation and RL framework (Google DeepMind / MJLab contributors).&lt;/li>
&lt;/ol></description></item></channel></rss>