Gait Prediction for Children with Spasticity Using Machine Learning

Background: Spastic equinovarus is a common musculoskeletal deformity in children with cerebral palsy, causing abnormal load distribution and mobility limitations. Intramuscular onabotulinumtoxinA injections are widely utilized to manage focal spasticity, yielding predictable reductions in muscle overactivity for 3 to 6 months. However, evaluating therapeutic effects on gait dynamics remains complex due to wide variability across datasets. This study aims to identify key features from local and open-source datasets to accurately predict gait classifications in children with spasticity using supervised machine learning algorithms.

Methods: A dataset comprising 1309 instances (55 pre-injection and 15 post-injection from a local pediatric cohort; 1239 typically developing controls from open-source databases) was evaluated using 10 numerical features (spatiotemporal metrics and physical attributes) and 1 nominal feature (gender). Quantitative gait dynamics were captured barefoot using an instrumented treadmill system (Zebris Gait Analysis FDM-T). Six machine learning models (k-nearest neighbours, naive Bayes, support vector machines, random forest, logistic regression, feed-forward neural networks) were trained using an 80/20 holdout strategy and 10-fold cross-validation with class-weight balancing. Ethics approval was obtained (IRB PAED-2025-159).

Results: The Random Forest classifier optimized with class-weight balancing achieved the highest predictive performance: 98.93% accuracy, 98.60% precision, 98.93% recall, and 98.73% F1-score. Feature importance analysis revealed that spatiotemporal metrics strongly dominated predictions, with stride length (18.3%), walking speed (17.4%), cadence (14.2%), and step length (13.2%) collectively accounting for over 60% of decision weight (Figure 1). Conversely, demographic factors (gender, age, body weight, height) possessed negligible predictive value (<7% each), demonstrating that the model classifies patients primarily based on gait mechanics rather than demographic characteristics.

Conclusions: Combining objective treadmill kinematics with a Random Forest classifier provides an accurate, objective decision support method for predicting gait patterns and evaluating intervention responses in pediatric spasticity. Machine learning can serve as an effective tool, translating complex, high-volume gait data into transparent, actionable clinical insights to guide personalized pediatric rehabilitation.

Figure 1. Important features identification (random forest)
Gait Prediction for Children with Spasticity Using Machine Learning
Relative importance (Gini) of each gait feature.