Transformer-Based Multi-Step Bilateral Knee Angle Prediction and Gait Phase Recognition Using Wearable IMU Sensors

TL;DR A Transformer reads 1.28 s of leg IMU signals and predicts the next 0.6 s of both knee angles, and fixed rules on the predicted angles label four gait phases. Error is 1.95° MAE when test samples are pooled, but 17.54° MAE on subjects held out from training.
What they do
The authors train a Transformer sequence-to-sequence model that maps the last 1.28 s of IMU signals from both legs to the next 0.6 s of right and left knee flexion-extension angles. Fixed rules then derive gait phases from the predicted angles, so no manual gait labels are needed. The data come from 25 healthy participants wearing an Xsens MVN Awinda suit (17 IMUs, 100 Hz) while walking on level ground, inclines and declines, and up and down stairs.
How it works
- Inputs. Free acceleration, angular velocity and orientation of the thigh, shank and foot on both legs (6 sensors × 9 features). The signals are Gaussian-smoothed and z-scored with statistics from the training data only.
- Model. 3 encoder layers, 2 decoder layers, 4 heads, width 96. 60 learned decoder queries output all 60 future steps in one pass. The forecast starts 20 ms after the input window to allow for sensing delay. Trained with an MAE loss.
- Gait phases. Thresholds on the knee angle and its rate of change label every step as swing, initial contact/loading response, stance or pre-swing.
- Evaluation. Five-fold cross-validation with 5 subjects held out per fold. The reference angles come from Xsens sensor fusion.
Results
- Original evaluation, test samples pooled: 1.95° MAE and 2.65° RMSE. Baselines reach 5.70° MAE (recursive LSTM), 10.72° (TCN) and 11.11° (GRU), but they see only 0.3 s of input, so the authors say this is not a like-for-like comparison.
- Held-out subjects (subject-level cross-validation): 17.54 ± 6.75° MAE and 21.79 ± 8.23° RMSE. The authors note that the two protocols differ and should not be compared directly.
- Gait-phase labels from predicted angles agree with labels from the reference angles 84.41% of the time (right knee) and 83.22% (left). Disagreements sit mostly at transitions between adjacent phases.
- Inference takes 5.82 ms on a GPU (23.81 ms on a CPU), below the 10 ms IMU sampling interval.
Limitations
Only healthy participants and five locomotion modes. Evaluation is offline; the model has not run on a wearable device or exoskeleton. Accuracy is measured against Xsens-derived angles, not marker-based motion capture, and the gait phases are rule-based pseudo-labels, not annotated gait events. The much higher error on unseen subjects shows that accuracy depends strongly on the individual.
Figures




Abstract
Anticipating future knee joint movements is important for rehabilitation, wearable robotics, gait analysis, and assistive systems, where motion prediction can help compensate for sensing and control delays. This study presents a Transformer-based multi-step sequence-to-sequence framework for predicting bilateral knee flexion--extension angles using wearable IMU data acquired from the Xsens MVN Awinda system. Motion data from 25 healthy participants performing level-ground walking, inclined and declined walking, stair ascent, and stair descent were used for evaluation. The model processes 128 historical time steps to predict 60 future knee-angle samples. A rule-based pseudo-labeling method is applied to the predicted knee-angle trajectories to provide gait-phase interpretation without manually annotated gait labels. The original experimental evaluation yielded a mean absolute error (MAE) of 1.95 and a root mean square error (RMSE) of 2.65. A separate five-fold subject-level cross-validation evaluation yielded an MAE of 17.54 and an RMSE of 21.79 respectively. The gait-phase interpretation achieved pseudo-label agreement accuracies of 84.41% and 83.22% for the right and left knees, respectively. The results demonstrate the feasibility of combining multi-step bilateral knee-angle prediction with rule-based gait-phase interpretation. The framework provides a basis for further investigation of predictive gait analysis and wearable assistive systems.
Summaries are written automatically from each paper's text. Figures and videos come from the paper and its project page; all credit goes to the authors.
