Temporal State-Space Variational Autoencoders for Older-Adult Gait Reconstruction

Introduction

Learning from different ways of measuring movement could help us build models that generate realistic walking patterns. However, Xsens motion capture and video-based pose tracking record different kinds of data at different rates. In the Toronto Older Adults Gait Archive (TOAGD), the two systems were not synchronized, so we cannot directly match their frames. This early study trains a separate state-space variational autoencoder (SSM-VAE) for each system. Each model learns to encode and then reproduce recorded movement.

Methods

The study includes 11 participants with usable Xsens data and selected AlphaPose top-camera recordings. The inputs describe the positions of the left and right hips, knees, and ankles: in 3D for Xsens and 2D for video. The Xsens inputs are joint positions, not raw acceleration measurements. Positions are measured relative to the hip midpoint, and video positions are scaled using the leg length seen in the image. Unusable measurements are marked, short gaps are filled between valid measurements, and recordings are split into three-second windows starting one second apart. Each Xsens window has 300 time points and 18 coordinate signals; each pose window has 90 time points and 12 signals.

Each model uses a state-space network with 64 internal features to process movement over time. The encoder learns a probability distribution over 16 internal values at each time point, rather than reducing the whole window to one vector. The decoder uses these values to reproduce the movement sequence. Training penalizes errors in both position and velocity, alongside a standard VAE penalty that encourages the internal distributions to stay close to a standard Gaussian. Velocity is calculated from changes between neighbouring positions, accounting for the recording rate. Only valid measurements and valid neighbouring pairs contribute to their respective errors.

For the reported runs, nine participants are used for training, OAW02 is used to choose the saved model, and OAW01 is used for testing. Data are standardized using only training participants. Both saved models were selected at training epoch 49, with velocity and VAE penalty weights of 1.0 and 0.001, respectively. Testing uses the encoder’s mean values rather than random samples, making reconstructions repeatable. The two models are trained separately: their frames, coordinate axes, and internal representations are not matched.

Results

Data source Test windows Position MSE Velocity MSE
Xsens-derived 3D trajectories 54 0.00757 0.07991
AlphaPose top-camera 2D poses 33 0.00837 0.07869

MSE means mean squared error; lower values indicate closer reconstruction. Position errors are calculated after standardizing each coordinate with the training data. Velocity errors use those same coordinates per second. These are not errors in metres, and the values should not be used to rank the two measurement systems against each other.

Figures 1 and 2 show all coordinate signals from the first test window for each system, rather than examples chosen for looking best. The models follow many changes in the recorded signals, although some curves remain shifted or differ in size. Matching velocity does not necessarily remove position errors. The figures show different recordings of the same participant, not the same three seconds of movement.

Actual and reconstructed Xsens-derived trajectories for all 18 lower-body coordinate signals in the first fold in test window. Figure 1. Xsens reconstruction for the first fold, window 0 (recording time 0-3 s). Rows show left/right hip, knee, and ankle; columns show X, Y, and Z. Blue shows recorded positions and orange shows reconstructed positions. Positions are in metres relative to the hip midpoint. Each subplot has its own vertical scale.

Actual and reconstructed AlphaPose top-camera poses for all 12 lower-body coordinate signals in the first fold of pose test window. Figure 2. Pose reconstruction for first test window from pose tracking (starting at recording time 0.33 s). Rows show the same six joints; columns show horizontal and vertical image coordinates. Positions are relative to the hip midpoint and divided by the leg length seen in the image. Colours match Figure 1. Each subplot has its own vertical scale; these units are not the same as the Xsens units.

Conclusions

The models can reproduce many features of recorded older-adult movement from both Xsens and video pose tracking. This provides a starting point for learning from both systems, while keeping clear that their recordings are not synchronized. Reproducing an existing movement is a first step, not yet proof that a model can generate realistic new walking sequences.

Limitations and Future Directions

The study is small, and the reported results test only one of the 11 participants. Test plots were also viewed while developing the models, so a fresh evaluation is needed before making strong claims about performance on new people. Overlapping windows share data and should not be counted as independent examples of different people. Some scored values were filled across short gaps, and a model can reproduce pose-tracking mistakes as well as real movement. We have not yet compared otherwise identical models with and without the velocity penalty or the time-by-time internal representation.

The model also keeps 16 internal values at every time point. This gives it much more space to store information than one vector for the entire window, which can make reconstruction easier. Close agreement with recorded curves does not by itself show that the model has learned the rules of walking.

Next, we will test each participant in turn, repeat training with different random starting values, and change one model component at a time to see what helps. We will also check whether reconstructed movements have sensible joint motion, limb lengths, and foot contacts. Before generating new gait sequences, we need to teach the model how its internal values should change together over time. A longer-term goal is to connect the two measurement systems using participant information without assuming their frames were recorded together.

References

  1. Mehdizadeh, S., Nabavi, H., Sabo, A., Arora, T., Iaboni, A., and Taati, B. (2021). Concurrent validity of human pose tracking in video for measuring gait parameters in older adults: a preliminary analysis with multiple trackers, viewing angles, and walking directions. Journal of NeuroEngineering and Rehabilitation, 18, 139. https://doi.org/10.1186/s12984-021-00933-0.

  2. Mehdizadeh, S., Nabavi, H., Sabo, A. et al. (2022). The Toronto older adults gait archive: video and 3D inertial motion capture data of older adults’ walking. Scientific Data 9, 398. https://doi.org/10.1038/s41597-022-01495-z.

Sina Mehdiz
Sina Mehdiz
Human Movement Scientist

Related