Papers
Topics
Authors
Recent
Search
2000 character limit reached

GenGait: A Transformer-Based Model for Human Gait Anomaly Detection and Normative Twin Generation

Published 2 Apr 2026 in cs.AI | (2604.01997v1)

Abstract: Gait analysis provides an objective characterization of locomotor function and is widely used to support diagnosis and rehabilitation monitoring across neurological and orthopedic disorders. Deep learning has been increasingly applied to this domain, yet most approaches rely on supervised classifiers trained on disease-labeled data, limiting generalization to heterogeneous pathological presentations. This work proposes a label-free framework for joint-level anomaly detection and kinematic correction based on a Transformer masked autoencoder trained exclusively on normative gait sequences from 150 adults, acquired with a markerless multi-camera motion-capture system. At inference, a two-pass procedure is applied to potentially pathological input sequences, first it estimates joint inconsistency scores by occluding individual joints and measuring deviations from the learned normative prior. Then, it withholds the flagged joints from the encoder input and reconstructs the full skeleton from the remaining spatiotemporal context, yielding corrected kinematic trajectories at the flagged positions. Validation on 10 held-out normative participants, who mimicked seven simulated gait abnormalities, showed accurate localization of biomechanically inconsistent joints, a significant reduction in angular deviation across all analyzed joints with large effect sizes, and preservation of normative kinematics. The proposed approach enables interpretable, subject-specific localization of gait impairments without requiring disease labels. Video is available at https://youtu.be/Rcm3jqR5pN4.

Summary

  • The paper introduces a transformer-based, self-supervised approach that detects gait anomalies and reconstructs normative gait patterns using a two-pass masking procedure.
  • It leverages a compact spatiotemporal joint-frame token representation, combining Euler angles, rotation matrices, and velocity embeddings, for robust kinematic correction.
  • Experimental results demonstrate high specificity and sensitivity, with significant RMSE reductions in pathological trials and accurate anomaly localization.

GenGait: Transformer-Based Gait Anomaly Detection and Normative Twin Generation

Introduction

The GenGait framework introduces a self-supervised, label-free approach for anomaly detection and kinematic correction in human gait, leveraging a masked autoencoder (MAE) Transformer architecture trained exclusively on normative gait data. This model addresses limitations inherent in classical supervised classification frameworks, primarily the poor generalization to heterogeneous or unseen pathological presentations—an especially acute challenge due to the broad inter-individual variability and compensatory phenomena present in clinical gait abnormalities.

Model Architecture and Two-Pass Inference Procedure

The method utilizes markerless, multi-camera motion-capture data processed into compact spatiotemporal joint-frame tokens. The model frames a 7-frame temporal window with 12 anatomically relevant joints as a J×TJ \times T token grid, each represented by a hybrid encoding of intrinsic Euler angles and geometric rotation matrix features. The transformer employs both joint-type, temporal position, and instantaneous velocity embeddings, facilitating nuanced cross-joint and temporal context integration.

At inference, the proposed pipeline applies a two-pass masking procedure:

  1. Pass 1—Anomaly Scoring: Each joint is iteratively masked, and the model computes deviation scores quantifying biomechanical inconsistency between the joint’s baseline and masked reconstructions. Scores integrate both the geometric misalignment and the functional significance (ranges of motion) of angular deviation, producing per-joint "badness scores" which identify candidate pathological joints.
  2. Pass 2—Targeted Kinematic Correction: Only the flagged joints are masked and reconstructed, leveraging the full spatiotemporal context of the remaining, presumed reliable, joints. The model's output yields a "normative twin"—a joint-level corrective trajectory reconstructing the gait as it would appear absent the identified anomalies.

This approach is specifically designed to decouple the detection of abnormal biomechanical patterns from reliance on pre-existing diagnostic labels, thus increasing generalization capability.

Experimental Validation

Experiments were conducted on a large normative motion-capture dataset (150 subjects for training, 10 for testing), augmented with simulated anomaly trials where test subjects mimicked seven clinically relevant abnormal gait patterns. The evaluation focused on two orthogonal objectives:

  • Specificity: The model should preserve normative kinematics for unseen healthy subjects, introducing negligible deviation after reconstruction.
  • Sensitivity: The model should accurately localize and reduce kinematic deviations for pathological patterns.

Qualitative and Quantitative Results

Visualizations of reconstructed skeletons highlight precise localization of biomechanically inconsistent joints (typically the primary site of impairment and adjacent compensatory regions), with blue skeletons (reconstructed) closely tracking normative input for control trials and correcting pathological deviations for anomalous gait (Figure 1). Figure 1

Figure 1: Skeletal reconstruction overlays for normative and pathological trials, with flagged joints shown in red and corrected kinematics in blue.

Cycle-normalized joint angle trajectory plots demonstrate that post-correction kinematics for pathological cases consistently shift toward the normative reference envelope (μ±2σ\mu \pm 2\sigma), while for normative trials, reconstructed and original trajectories remain nearly congruent (Figure 2). Figure 2

Figure 2: Gait cycle joint angle trajectories for selected joints; original (red), reconstruction (green), and normative band (blue), showing anomaly attenuation post-correction.

Statistical validation using RMSE (degrees) of key joint angles versus normative reference confirms:

  • Specificity: Bootstrap 90% confidence intervals for RMSE differences between reconstructed and original normative trials fall well within the 1.5∘1.5^\circ equivalence margin, denoting statistical equivalence (Figure 6a).
  • Sensitivity: Wilcoxon signed-rank tests show highly significant (p<0.001p < 0.001 for most joints) RMSE reductions in pathological trials post-correction, with large effect sizes (rank-biserial correlation ∣rrb∣>0.75|r_{rb}| > 0.75 for proximal joints), except for knee flexion/extension, where artifact and architectural constraints reduce effect size (Figure 6b). Figure 3

Figure 3

Figure 3: (a) RMSE distributions for normative gait show statistical equivalence pre/post correction. (b) Pathological cases demonstrate significant deviation reductions after targeted reconstruction.

Discussion

GenGait operationalizes "anomaly" as local biomechanical inconsistency with learned normative spatiotemporal constraints, not as deviation from a fixed prototype. The two-pass masked reconstruction allows for robust, interpretable detection and correction, even with high intrinsic kinematic variability. The method avoids class collapse by reconstructing plausible configurations within the normative manifold, supported by strong non-collapse in RMSE and visual tracking of subject-specific motion patterns. Notably, correction effectiveness varies by joint: it is strongest in planes/axes with high biomechanical coupling and redundancy and less so for distal joints with limited context or tracking fidelity.

The pipeline's performance—high specificity, strong localization, and significant correction for synthetic pathologies—demonstrates potential for clinical interpretability and utility, particularly in guiding subject-specific rehabilitation tailoring or longitudinal outcome tracking, as outputs are granular (joint-level, cycle-aligned).

However, current limitations include: (i) test anomalies are simulated by healthy subjects, and thus may not fully capture the complexity of clinical pathodynamics, (ii) limited input context (7-frame window) restricts capture of global gait patterns, (iii) model performance for knee/ankle joints is compromised by markerless estimation noise and window length, and (iv) the normative training set, while large, may not encompass full variation across the population or pathological compensations.

Implications and Future Directions

This framework highlights the efficacy of self-supervised generative modeling for structured time-series anomaly detection, particularly in domains where label acquisition is infeasible or pathophysiological presentation is heterogeneous and continuous. The explicit generation of normative twins enables not only detection but also direct (counterfactual) correction, a valuable asset for clinical interpretation.

Potential future directions include:

  • Extension to longer or overlapping windows to capture full gait cycles, improving context and distal joint correction;
  • Application/validation on clinical populations with real pathologies to test invariance to motor adaptation and multi-morbidity;
  • Integration with more accurate or multi-modal (e.g., IMU+vision) pose estimation systems;
  • Exploration of unsupervised contrastive learning objectives to regularize the normative manifold;
  • Real-time deployment for continuous, in-the-wild gait monitoring.

Conclusion

GenGait demonstrates that transformer-based, self-supervised models trained on normative populations can provide high-fidelity, granular, and interpretable gait anomaly detection and kinematic correction without reliance on disease annotations. When validated on real patient data, this paradigm has the potential to substantially improve subject-specific motion analysis and individualized disease monitoring.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We found no open problems mentioned in this paper.

Collections

Sign up for free to add this paper to one or more collections.