Skip to content
Robotics.world

Research

Transformer-Based Trajectory Prescription for sEMG-Optimizing Robot-Mediated Rehabilitation

Robot-mediated rehabilitation typically guides a patient's limb along a desired kinematic path, and the authors note that such systems "have not yet demonstrated meaningful improvement in…

The paper’s first page · arXiv:2611.08295
arXiv
2611.08295 · accepted · CORL
Published
2026-11-05
Authors
Gabriel Parra, Kimia Khoshnami, Daniel S. Brown, Laura A. Hallock

AI summary

Overview

Research area: Rehabilitation robotics, human–robot interaction, and sEMG-based sequence modeling (transformers with flow matching).

Technical level: Advanced.

Scope: A proof-of-concept system that learns to invert the map from a person's measured muscle activations to the force trajectory they were asked to follow, so that a rehabilitation robot can later prescribe trajectories designed to elicit a therapist-specified activation pattern, with fast per-user calibration.

What This Paper Is About

Robot-mediated rehabilitation typically guides a patient's limb along a desired kinematic path, and the authors note that such systems "have not yet demonstrated meaningful improvement in rehabilitation outcomes over standard of care." Neuroscientific work suggests recovery depends on reinforcing healthy muscle activation patterns, not just motion, but no model has related a prescribed therapy trajectory to a given individual's neuromotor activations, because muscle activity is hysteretic and stochastic, sEMG is noisy and placement-dependent, and interventional datasets are expensive.

The paper's goal is to learn the inverse direction: given a desired time series of 8-channel sEMG activations, predict the end-effector force trajectory that would induce them, in a way that is personalizable within a single therapy session, fast enough for real-time use, and able to flag when a requested activation pattern lies outside what the model can be trusted on.

Key Contributions

  1. A transformer encoder–decoder using rotary positional embeddings (RoPE) that maps desired sEMG activation windows to end-effector force trajectories, with the latent representation split into a trajectory-related factor and a user-specific neuromotor factor, augmented by a flow-matching model that produces a distribution over plausible trajectories and is quickly fine-tunable to new users.
  2. A demonstration on 16 healthy participants performing 15 isometric trajectory-tracking tasks showing generalization to held-out tasks and held-out users, with the abstract and introduction reporting mean trajectory prediction errors of under 8%, alongside naive MLP and LSTM baselines and component ablations.
  3. Evidence that user-specific calibration meaningfully reduces error using only minutes of additional data collection and training, with a quantified time–performance tradeoff, plus a live deployment with 5 healthy users in which the average accumulated target-activation error was 15% (activation RMSE mean 0.155, standard deviation 0.026).
  4. An open-source release of all data and modeling code as part of the OpenRobotRehab project on SimTK (simtk.org/projects/openrobotrehab).

Main Findings

  • Held-out generalization: The Full model's deterministic trajectory error ($\mathrm{MSE_{TD}}$) was 0.084 ± 0.227 on new tasks for known users, 0.086 ± 0.252 on known tasks for new users, 0.082 ± 0.211 on new tasks and new users, and 0.009 ± 0.110 on the training set. Section 4.1 summarizes this as roughly 8.5% deterministic transformer-decoded error on held-out data, while the abstract and introduction state the figure as under 8%.

  • Flow matching improves the estimate: Using the flow-matching sample mean ($\mathrm{MSE_{FM}}$) reduced error to 0.067 ± 0.190 (new tasks), 0.077 ± 0.211 (new users), and 0.062 ± 0.174 (new tasks and users), a performance boost the paper describes as roughly 1–2%.

  • Ablations matter: Removing the activation decoder or the flow-matching term raised held-out error (for example, the "Minimal" trajectory-decoder-only model reached 0.108, 0.099, and 0.115 across the three held-out sets).

  • Baselines: The naive MLP was uniformly worse than the Full model (for example, 0.238 ± 0.462 on new users). The LSTM matched the Full model's deterministic error on new tasks (0.068 ± 0.143) and new tasks with new users (0.063 ± 0.128) but generalized poorly to new users on known tasks (0.191 ± 0.354) and performed poorly on the training set (0.155 ± 0.308), which the authors flag as a real deficiency because therapy often involves returning to similar tasks.

  • Variance is large relative to mean error: For almost all models and ablations the standard deviation substantially exceeds the mean, which the authors attribute to flow matching pulling out-of-distribution portions of a trajectory toward the training distribution; in-distribution regions are predicted much more accurately.

  • Speed is therapy-compatible: Deterministic inference of one prescribed trajectory took 5 ms, and 250 flow-matching samples took under 1 s. A full baseline training run took approximately 1.5 h on an NVIDIA RTX 4070 with 12 GB of VRAM.

  • Fine-tuning helps every user: Retraining with incrementally more of a user's own tasks (from 1 to as many as 12) reduced loss for all test users, with variable effect sizes of roughly 2–12%. Training all 12 models for a participant took approximately 7 min, about 35 s per model, giving a total calibration cost of $n_{\text{trials}_{\text{new}}} \times {60, 20} + 35$ s for 60 s and 20 s tasks respectively.

  • Closed-loop prescription worked in a small live test: A trajectory generated from an exemplar activation pattern (participant P07, task T08) was followed by 5 participants (P08 and P13 from the original cohort plus new participants P17–P19); activation error was consistent across them, with mean RMSE 0.155 and standard deviation 0.026, described in the abstract as 15% error accumulated across the task.

  • Locked and unlocked tasks behaved differently but scored similarly: Unlocked tasks produced oscillating corrections across all three axes, while locked tasks produced smoother motion with user-specific offsets in non-prescribed axes; overall model error was comparable on both.

Methodology in Plain English

Participants sat with an end-effector rehabilitation robot — a KUKA LBR iiwa 14 R820 7-degree-of-freedom cobot with a custom handle on a SensONE 6-axis force–torque sensor — and pushed on the handle. Their force along each axis was mapped to the velocity of an on-screen avatar ball, which they steered to follow a target ball along a displayed path; motion into and out of the screen was shown as the avatar shrinking and growing. Surface EMG was recorded at 2.22 kHz from 8 upper limb muscles (anterior, middle, and posterior deltoid and biceps brachii with a ground at the acromion; triceps brachii long head, brachioradialis, wrist flexors, and wrist extensors with a ground at the olecranon) using two Delsys Trigno Quattro 4-channel sensor motes and a Trigno Base Station. Force and game trajectory data were logged at 1000 Hz and 60 Hz respectively, with all streams synchronized through Redis.

The 16 participants (5 female, 11 male; age 28.4 ± 7.0, min 19, max 47; 5 left-handed, 11 right-handed) each performed 15 isometric tasks with their right arm. Table 1 enumerates T01–T12 (single-axis motions, performed at 15/15/36 N and 30/30/72 N force levels, with non-target axes either locked or free, 3 repetitions of 60 s each) plus T14–T15 (stochastic trajectories around the x and y axes generated by smoothed Brownian motion, 20 s, with 20/20/48 N). T13 does not appear in the table.

The model compresses each 10 s window of processed sEMG (1 s stride) into a 64-dimensional latent split into a 32-dimensional trajectory vector and a 32-dimensional user/neuromotor vector. One decoder rebuilds the target trajectory from the trajectory vector, and a second decoder rebuilds the activations from both vectors — used only during training. A flow-matching model learns the conditional distribution of the trajectory vector given the user vector, so many samples can be decoded into a spread of candidate trajectories, which serves as an uncertainty signal and biases outputs toward the training distribution. The three loss terms (trajectory error, activation reconstruction error, and flow-matching error) are minimized jointly with PyTorch and AdamW at a learning rate of 0.001, batch size 64, for 100 epochs, with dropout p = 0.1 and 10 flow-matching samples per training example.

The baseline model trained on participants P01–P10 and tasks T01–T12, yielding 6480 training windows and 4562 test windows, and was evaluated on unseen tasks for known users, known tasks for unseen users, and both unseen. For personalization, the authors greedily selected a new user's tasks one at a time, retrained, and measured the resulting loss on that user's remaining test tasks.

Why This Matters

The paper reframes robot-mediated therapy from "move the limb along this path" to "generate the muscle activity that supports recovery," and shows that a learned, personalizable inverse model can be built with current tools and run inside a real session. Releasing the data and code gives the rehabilitation and machine learning communities a shared benchmark for a problem that has been hard to study because interventional data is costly.

Real-world applications:

  • Post-stroke muscle coordination training, where the therapeutic aim is often to move outside abnormal muscle synergies and avoid excessive co-contraction.
  • Post-injury, muscle-specific strength training targeting under-recruited muscles.
  • Sports medicine, where increasing activation of under-recruited muscles and improving coordination is used to avoid injury.
  • sEMG biofeedback-enhanced therapy and calibration of assistive or rehabilitative devices, where the model's uncertainty output could tell a therapist when to gather more user data before trusting a prescription.

Industry relevance: rehabilitation robot manufacturers, prosthetics and exoskeleton control groups, and clinical decision-support vendors all depend on per-user calibration that fits inside an appointment; the reported 5 ms inference, sub-second sampling of 250 trajectories, and roughly 35 s per fine-tuned model are directly relevant to that constraint.

Future Directions

  • Validate with clinical and pathology-specific cohorts, possibly by combining the global model with a pathology- or user-specific residual model.
  • Train on more diverse trajectories rather than stereotyped single-axis motions at a limited set of force levels, and determine how to select training trajectories most efficiently.
  • Extend from isometric interaction to prescribing dynamic end-effector trajectories.
  • Quantify what prediction accuracy is actually required to induce therapeutically meaningful activations, and move flow-matching behavior from qualitative observation to a rigorous treatment — the authors stress that its uncertainty is a decision-support signal, not a safety guarantee, and suggest pairing it with hardware joint and speed limits and control-barrier-function or reachability-based control layers.
  • Run a systematic hyperparameter search, since values were largely chosen by intuition, and examine factors such as handedness (5 of 16 participants were left-handed but all used the right arm).

Target Audience

Rehabilitation robotics and human–robot interaction researchers; machine learning researchers working on sEMG, multivariate time series, transformers, or flow matching applied to physiological signals; clinicians and physical therapists interested in how activation-targeted therapy might be operationalized; and engineers building personalizable control or prescription systems that must calibrate within a single session.

Authors’ abstract

Robot-mediated rehabilitation has the potential to deliver high-intensity, individualized therapy, but existing systems (which have not consistently improved outcomes) typically prescribe kinematic trajectories rather than explicitly targeting the neuromotor activations thought to support recovery. To address this gap, and ultimately enable activation-optimizing rehabilitation robot behavior, we present a personalizable transformer-based model mapping individuals' muscle…

The full abstract on arXiv
Read the original paper

Related papers