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.
Figures & tables
Reference
Model
Dataset
Prediction Target
Bilateral
Multi-Step
Gait Phase
Manual Labels
Main Contribution
Wang et al. (2023)
TCN–BiLSTM
19 healthy subjects (IMU)
Joint angle & joint moment estimation
No
No
No
Yes
Estimated lower-limb joint angles and joint moments from wearable IMU signals using a hybrid temporal deep learning model.
Mohammadi Moghadam et al. (2023)
CNN, RF, SVM, MARS
17 healthy subjects (IMU + EMG)
Kinematics, kinetics, muscle force
No
No
No
Yes
Compared conventional machine learning models for predicting lower-limb biomechanics from wearable sensors.
Ding et al. (2024)
Self-Attention + LSTM
10 healthy subjects (IMU)
Knee and ankle joint-angle estimation
No
No
No
Yes
Introduced a self-attention network for continuous lower-limb joint-angle estimation during different locomotion modes.
Daryakenari and Farizeh (2025)
Transformer Neural Network
22 healthy subjects (sEMG + IMU)
Lower-limb joint-angle and moment prediction
Yes
Yes
No
Yes
Predicted lower-limb kinematics and kinetics over short- and long-term horizons using wearable sensors.
Proposed Work
Transformer Seq2Seq
25 healthy subjects (Xsens MVN Awinda ® IMU)
Future bilateral knee-angle prediction
Yes
Yes
Yes
No
A unified Transformer-based framework for long-horizon bilateral knee-angle prediction and automatic gait-phase recognition using rule-based pseudo-labeling without manual annotation.
TABLE I : Comparison of the Proposed Framework with Recent Studies on Wearable Sensor-Based Lower-Limb Motion Prediction
Fig. 1 : Representative gait activities performed during data collection: (a) level-ground walking, (b) inclined walking, (c) declined walking, (d) stair ascent, and (e) stair descent while wearing the Xsens MVN Awinda ® IMU system.
Fig. 2 : N-pose calibration performed before gait data acquisition
Fig. 3 : Wearable IMU sensor arrangement for gait data collection: (a) front view and (b) back view
Fig. 4 : Data acquisition pipeline using the Xsens MVN Awinda ® IMU system.
Fig. 5 : Workflow of the proposed knee joint angle prediction framework
Component
Description
Sensor Platform
Xsens MVN Awinda ® IMU System
Sampling Frequency
100 Hz
Input Signals
Free acceleration, angular velocity, and segment orientation
Body Segments
Left and right thigh, shank, and foot
Input Representation
Multivariate time-series sequence
Prediction Target
Left and right knee flexion–extension angles (degrees)
TABLE II : Summary of Input Features and Prediction Targets
Fig. 6 : Data preprocessing pipeline for Transformer model input generation.
Fig. 7 : Sliding window representation for generating input–output sequences used in sequence-to-sequence knee joint angle prediction
Parameter
Value
Input Sequence Length
128
Prediction Horizon
60
Embedding Dimension
96
Encoder Layers
3
Decoder Layers
2
Attention Heads
4
TABLE III : Transformer Model Hyperparameters
Fig. 8 : Architecture of the proposed Transformer model for bilateral knee joint angle prediction and gait phase estimation
Fig. 9 : Flowchart of the proposed rule-based pseudo-labeling strategy for automatic gait-phase interpretation.
Metric
Value
Sampling Rate
100 Hz
Input Window Length
128 Time Steps
Future Prediction Length
60 Time Steps
Future Start Delay
20 ms
Training Time
172.7 s
Testing Time
0.58 s
TABLE IV : Knee Joint Angle Prediction Performance
Fig. 10 : Actual and predicted bilateral knee joint angles obtained using the proposed Transformer model.
Metric
CPU
GPU (CUDA)
Improvement
Training Time (s)
5866.33
172.71
33.97 × Faster
Testing Time (s)
32.78
0.58
56.52 × Faster
Average Latency (ms)
23.81
5.82
4.09 × Lower
TABLE V : CPU and CUDA-Enabled GPU Performance Comparison
Fig. 11 : Actual and predicted bilateral knee joint angles obtained using the LSTM model with recursive 60-step forecasting.
Model
Prediction Strategy
Input Window
MAE ( ∘ )
RMSE ( ∘ )
LSTM
60-step Recursive
30 samples (0.3 s)
5.70
7.90
GRU
60-step Direct
30 samples (0.3 s)
11.11
17.32
TCN
60-step Direct
30 samples (0.3 s)
10.72
16.54
Transformer
60-step Direct
128 samples (1.28 s)
1.95
2.65
TABLE VI : Comparison of LSTM, GRU, TCN, and Transformer-Based Knee Angle Prediction Models
Metric
Value
Number of Gait Phases
4
Pseudo-Labeling Method
Rule-Based
Right Knee Accuracy
84.41%
Left Knee Accuracy
83.22%
Average Accuracy
83.82%
TABLE VII : Gait Phase Interpretation Performance
Fig. 12 : Confusion matrices for bilateral knee gait phase classification using the proposed Transformer model
Fig. 13 : Bilateral knee joint angle trajectories with the corresponding predicted gait phases
Capital University of Physical Education and Sports. · Beijing Institute of Technology. · 3Beijing Key Laboratory of Interdisciplinary Intelligent Technologies of Sports, Medicine and Engineering.