Papers
Topics
Authors
Recent
Search
2000 character limit reached

Machine Learning-Based Real-Time Detection of Compensatory Trunk Movements Using Trunk-Wrist Inertial Measurement Units

Published 14 Apr 2026 in cs.RO | (2604.12591v1)

Abstract: Compensatory trunk movements (CTMs) are commonly observed after stroke and can lead to maladaptive movement patterns, limiting targeted training of affected structures. Objective, continuous detection of CTMs during therapy and activities of daily living remains challenging due to the typically complex measurements setups required, as well as limited applicability for real-time use. This study investigates whether a two-inertial measurement unit configuration enables reliable, real-time CTM detection using machine learning. Data were collected from ten able-bodied participants performing activities of daily living under simulated impairment conditions (elbow brace restricting flexion-extension, resistance band inducing flexor-synergy-like patterns), with synchronized optical motion capture (OMC) and manually annotated video recordings serving as reference. A systematic location-reduction analysis using OMC identified wrist and trunk kinematics as a minimal yet sufficient set of anatomical sensing locations. Using an extreme gradient boosting classifier (XGBoost) evaluated with leave-one-subject-out cross-validation, our two-IMU model achieved strong discriminative performance (macro-F1 = 0.80 +/- 0.07, MCC = 0.73 +/- 0.08; ROC-AUC > 0.93), with performance comparable to an OMC-based model and prediction timing suitable for real-time applications. Explainability analysis revealed dominant contributions from trunk dynamics and wrist-trunk interaction features. In preliminary evaluation using recordings from four participants with neurological conditions, the model retained good discriminative capability (ROC-AUC ~ 0.78), but showed reduced and variable threshold-dependent performance, highlighting challenges in clinical generalization. These results support sparse wearable sensing as a viable pathway toward scalable, real-time monitoring of CTMs during therapy and daily living.

Summary

  • The paper introduces a minimal two-IMU system with machine learning that robustly detects compensatory trunk movements in real time.
  • It employs window-based feature extraction and an XGBoost classifier, validated through nested leave-one-subject-out cross-validation on diverse ADL tasks.
  • The approach demonstrates strong discriminative performance in able-bodied subjects and promising, though variable, results in preliminary clinical populations.

Machine Learning-Based Real-Time Detection of Compensatory Trunk Movements Using Trunk-Wrist Inertial Measurement Units

Introduction

Compensatory trunk movements (CTMs) are a frequent response to upper-limb impairment following stroke, manifesting as deviations in trunk kinematics to compensate for deficit in distal joint function. Persistent CTMs have clinical relevance due to their association with maladaptive motor patterns and chronic musculoskeletal pathology. Despite their importance, continuous and objective assessment of CTMs outside clinical environments remains largely unexplored due to technological constraints. The present study addresses this gap by introducing and systematically evaluating a minimal inertial measurement unit (IMU) configuration combined with ML for robust, real-time detection of CTMs during diverse activities of daily living (ADLs) and in preliminary clinical populations (2604.12591). Figure 1

Figure 1: Experimental setup for data acquisition with optical motion capture, co-located IMUs, multi-view synchronized video, and impairment-mimicking constraints (elbow brace, resistance band) applied on standardized ADL tasks.

Methods

A dual-modality data collection protocol was implemented where ten able-bodied subjects performed 38 upper-limb ADL tasks under three experimental conditions: unrestricted, elbow brace-induced motion constraint, and resistance band-induced flexor-synergy pattern. Synchronized optical motion capture (OMC) and IMU data were gathered with rigid marker/IMU placement at wrist and trunk. Systematic annotation of ground truth was achieved through manual frame-level labeling of synchronized dual-view videos into three classes: Calibration, Movement: No Trunk Compensation (Mov: No TC), and Movement: Trunk Compensation (Mov: TC). The labeling methodology explicitly distinguishes between biomechanically appropriate trunk involvement and true compensatory behavior, in alignment with the Reaching Performance Scale and contemporary recommendations.

A location-reduction analysis using OMC data established that wrist and trunk kinematic streams represent a minimal yet sufficient set for accurate CTM classification. Data streams were subjected to window-based feature extraction (statistical, similarity-based, and movement smoothness metrics), forming the input space for an XGBoost classifier. Generalization was rigorously evaluated via a nested leave-one-subject-out cross-validation (LOSO-CV) protocol. Real-time feasibility was assessed on the full pipeline, including feature extraction, model inference, and latency analysis. Figure 2

Figure 2: Overview of IMU/OMC signal processing, sliding window segmentation, feature computation, and model training with nested LOSO-CV; post-hoc SHAP analysis enabled feature-level interpretability.

Clinical generalization was probed by applying the trained models to four patient data sets, including individuals with stroke and cervical SCI, collected under laboratory and conventional upper-limb therapy situations.

Results

Impact of Sensor Location

Classification performance analysis confirmed that the wrist+trunk sensor configuration yields near-maximal accuracy, with F1_macro = 0.85 ± 0.06 (OMC) versus marginal improvement for additional upper-arm markers. Both wrist-only and trunk-only models exhibited significant reduction in CTM detection precision, and statistical testing revealed these differences to be significant (corrected p < 0.05).

Model Performance and Task Dependence

The two-IMU (wrist+trunk) XGBoost classifier achieved macro F1 = 0.80 ± 0.07, MCC = 0.73 ± 0.08, and ROC-AUC > 0.93 across all classes in able-bodied subjects (Figure 3). Most misclassification events occurred between Mov: No TC and Mov: TC, reflecting the intrinsic challenge of disambiguating subtle trunk compensation from legitimate trunk involvement, especially in tasks with heterogeneous motor strategies (Figure 4). Figure 3

Figure 3: Fold-wise F1 across OMU/IMU modalities, with high ROC-AUC values for all movement classes demonstrating model stability and strong discriminative power.

Figure 4

Figure 4: Confusion matrix and task-stratified F1 scores; Mov: TC detection showed increased variability and reduced recall in fine object manipulation, elevated reaching, and drinking tasks.

Explainability analysis via SHAP identified trunk-derived features (pitch, roll, gyroscope magnitude) as dominant, with interaction metrics (e.g., dynamic time warping between wrist and trunk orientation/gyroscope signals) also contributing strongly to class boundaries. Notably, increased trunk flexion and synchronized trunk-wrist movement patterns most robustly predicted compensatory events (Figure 5). Figure 5

Figure 5: Top 10 SHAP-ranked discriminative features with color-coded directional effects; trunk dynamics and wrist-trunk coordination dominate CTM discrimination.

Pipeline latency testing confirmed real-time suitability, with sub-150 ms total computation per window (preprocessing, features, inference).

Clinical Applicability and Limitations

Application to patient data retained strong ROC-AUC (0.78 ± 0.06), thus affirming preserved discriminative signatures for compensation across the domain shift from simulated to pathological movements (Figure 6). However, threshold-dependent metrics (macro F1 = 0.43 ± 0.06, MCC = 0.28 ± 0.04) indicated reduced recall and variable performance per subject, particularly highlighting missed CTM events during more subtle/heterogeneous compensation patterns. Figure 6

Figure 6: ROC curves and representative time series for patient tasks using the most affected arm; effective Mov: No TC detection but moderate and variable sensitivity for Mov: TC.

These empirical findings support the hypothesis that models trained on simulated impairment in able-bodied cohorts exhibit limited direct transfer to clinical heterogeneity, especially with respect to detection of mild or non-canonical compensatory behaviors.

Discussion

This work establishes that a minimal trunk-wrist IMU configuration, in combination with window-based handcrafted feature extraction and XGBoost classification, is sufficient for robust, real-time CTM detection in unconstrained ADLs. Trunk and wrist kinematics complementarily encode discriminative information, with model interpretability analyses aligning with biomechanical understanding of compensation as primarily altered trunk-limb coordination. High ROC-AUC and consistent cross-subject performance reinforce the validity and generalizability of the approach in unimpaired scenarios.

Task-dependent effects highlight the challenge of detecting subtle compensation across diverse functional contexts, reinforcing the necessity of context-aware, flexible classification frameworks. Preliminary transfer to patient data confirms that clinically relevant kinematic signatures are present and identifiable with minimal instrumentation, yet the variability in recall underscores the importance of domain-specific retraining with larger, more diverse patient cohorts and possibly additional context or severity grading.

The practical implications are substantial: the system's low setup complexity, open-ended workspace, and real-time capability render it well suited for continuous objective monitoring and prospective closed-loop feedback during rehabilitation and unsupervised home therapy. Future work should emphasize multi-site patient collection, stratified labeling protocols (including compensation severity), and deployment trials integrated into assistive rehabilitation technologies.

Conclusion

A minimal two-IMU (trunk, wrist) system, combined with interpretable ML classification, provides robust, real-time detection of compensatory trunk movements during upper-limb tasks. This configuration offers a practical trade-off between deployability and accuracy and demonstrates promising preliminary generalization to clinical populations. While ROC-based metrics confirm cross-domain discriminability, threshold-dependent accuracy remains variable, necessitating further research into model adaptation for pathological cohorts and integration into feedback-driven rehabilitation systems. The presented framework is a viable foundation for scalable CTM monitoring across clinical and real-world environments.

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 haven't generated a list of open problems mentioned in this paper yet.

Collections

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