Machine Learning-Based Real-Time Detection of Compensatory Trunk Movements Using Trunk-Wrist Inertial Measurement Units
Organizations: Rehabilitation Engineering Laboratory, ETH Zurich, Switzerland · TU Munich, Germany · Neuroscience Center Zurich (ZNZ), Switzerland · Singapore-ETH Centre (CREATE), Singapore
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.
Figures & tables
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| Task Category | Objects & Setup | Movement Tasks |
|---|---|---|
| Planar Reaching & Transport | Single cup at Start | – Reaching to T1–T4 (Task No. 1–4) – Cup transport between Start and T1–T4 (Task No. 5–8) – Sequential transport: Start T2 T3 Start and Start T3 T2 Start (Task No. 9–10) – Continuous reaching between T1–T4 in pseudo-random order (Task No. 11–12) |
| Drinking & Pouring | Two cups positioned to the left and right of T1 | – Water pouring (right left) (Task No. 13–14) – Drinking from right and left cup (Task No. 15–16) |
| Elevated Reaching & Transport | One large block at T1 and two smaller blocks on either side | – Elevation of small block onto large block with flip and return (Task No. 17–18) – Transport over large block to opposite side and return (Task No. 19–20) |
| Planar Sliding | Single card at Start | – Two-handed sliding: Start T2 T3 Start and Start T3 T2 Start (Task No. 21–22) – Two-handed sliding: Start T1 Start and Start T4 Start (Task No. 23–24) – Single-handed sliding to T1–T4 with card flip (Task No. 25–28) – Single-handed sequences: Start T2 T3 Start and Start T3 T2 Start (Task No. 29–30) – Continuous multi-target sliding sequences (Task No. 31–32) |
| Fine Object Manipulation | Five-drawer box at T1 and a coin placed to its right | – Coin manipulation across drawers (opening, closing, insertion, transfer) (Task No. 33–34) – Sequential opening and closing of all drawers (Task No. 35–36) |
| Continuous Movements | — | – Hand-biking motion (20–30 s) (Task No. 37) – Swimming motion (20–30 s) (Task No. 38) |
| Label | Description |
|---|---|
| Movement: Trunk Compensation | Movement Pattern: Visible trunk displacement in the sagittal plane relative to the pelvis. Elbow extension and shoulder flexion remain below the required range, and trunk flexion compensates for limited reach. Onset: Initiation of forward trunk displacement with limited shoulder and elbow motion. Offset: Return to upright posture and stabilization. |
| Movement: No Trunk Compensation | Movement Pattern: Arm movement occurs while trunk displacement remains within the functional range required for task execution. No compensatory trunk motion is observed. Onset: Visible arm movement while the trunk remains stable. Offset: Arm returns to calibration position and posture stabilizes. |
| Calibration | Movement Pattern: Arm rests in a bent position close to the body with no visible trunk or wrist movement. Neutral alignment of shoulders, pelvis, and spine. Onset: Completion of previous task and stabilization in calibration posture. Offset: Initiation of movement via visible displacement of wrist, shoulder, or trunk. |
| Modality | Kinematic data streams | Frame |
| IMU | Wrist/trunk acceleration (3-axis & magnitude) | Local & Calibrated |
| Wrist/trunk angular velocity (3-axis & magnitude) | Local & Calibrated | |
| Absolute wrist/trunk orientation (3-axis) | Calibrated | |
| Relative wrist–trunk orientation (3-axis & 3D rotation angle) | Calibrated | |
| OMC | Wrist/trunk/upper-arm acceleration (3-axis & magnitude) | Recording |
| Wrist/trunk/upper-arm angular velocity (3-axis & magnitude) | Recording |
| Metric Category | Measures |
|---|---|
| Univariate channel-wise statistics | Mean, standard deviation (std), minimum (min), maximum (max), range, root mean square (RMS), mean absolute deviation (MAD), trend, skewness, kurtosis |
| Bivariate channel-wise similarity metrics (applied on acceleration, absolute orientation, linear/angular velocity) | Maximum normalized cross-correlation, normalized dynamic time warping distance (DTWD) |
| Smoothness metrics (applied on acceleration and linear velocity) | Logarithmic dimensionless jerk (LDJ) for wrist & trunk + LDJ ratio between wrist & trunk |
| Configuration | MCC | Calib | Mov: No TC | Mov: TC | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Prec | Rec | F1 | Prec | Rec | F1 | Prec | Rec | F1 | |||
| IMU (W+T) | 0.80 0.07 | 0.73 0.08 | 0.92 0.06 | 0.86 0.13 | 0.88 0.07 | 0.85 0.08 | 0.81 0.12 | 0.82 0.07 | 0.64 0.21 | 0.82 0.14 | 0.68 0.11 |
| OMC (W+T+UA) | 0.86 0.05 | 0.81 0.08 | 0.95 0.03 | 0.92 0.08 | 0.93 0.05 | 0.88 0.07 | 0.88 0.07 | 0.88 0.06 | 0.75 0.12 | 0.83 0.13 | 0.78 0.09 |
| OMC (W+T) | 0.85 0.06 | 0.79 0.09 | 0.95 0.04 | 0.91 0.10 | 0.92 0.05 | 0.89 0.07 | 0.84 0.12 | 0.86 0.08 | 0.72 0.17 | 0.86 0.10 | 0.77 0.10 |
| OMC (T) | 0.66 0.12 | 0.50 0.13 | 0.72 0.08 | 0.68 0.26 | 0.65 0.16 | 0.73 0.14 | 0.62 0.11 | 0.66 0.10 | 0.60 0.24 | 0.83 0.16 | 0.65 0.17 |
| OMC (W) | 0.78 0.06 | 0.71 0.08 | 0.95 0.03 | 0.91 0.10 | 0.92 0.06 | 0.86 0.07 | 0.77 0.09 | 0.81 0.06 | 0.54 0.13 | 0.77 0.09 | 0.62 0.09 |
| Model A | Model B | Class | Sig. | ||
|---|---|---|---|---|---|
| W+T+UA | W+T | Calib | 0.232 | 1.000 | |
| W+T+UA | W+T | Mov: No TC | 0.193 | 1.000 | |
| W+T+UA | W+T | Mov: TC | 0.625 | 1.000 | |
| W+T+UA | T | Calib | 0.002 | 0.035 | |
| W+T+UA | T | Mov: No TC | 0.002 | 0.035 | |
| W+T+UA | T | Mov: TC | 0.004 | 0.039 |
| Patient | MCC | Calib | Mov: No TC | Mov: TC | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Prec | Rec | F1 | Prec | Rec | F1 | Prec | Rec | F1 | ||||
| P03 (Right) | 0.51 | 0.35 | 0.85 | 0.15 | 0.34 | 0.21 | 0.90 | 0.96 | 0.93 | 0.67 | 0.27 | 0.38 |
| P18 (Left) | 0.40 | 0.28 | 0.73 | 0.96 | 0.39 | 0.55 | 0.34 | 0.91 | 0.50 | 0.39 | 0.09 | 0.15 |
| P63 (Left) | 0.34 | 0.26 | 0.82 | 0.96 | 0.15 | 0.27 | 0.40 | 0.99 | 0.57 | 0.96 | 0.11 | 0.20 |
| P31 (Right) | 0.45 | 0.25 | 0.72 | 0.86 | 0.31 | 0.44 | 0.48 | 0.85 | 0.61 | 0.28 | 0.34 | 0.30 |
| Avg Std | 0.43 0.06 | 0.28 0.04 | 0.78 0.06 | 0.73 0.35 | 0.30 0.09 | 0.37 0.14 | 0.53 0.22 | 0.93 0.06 | 0.65 0.16 | 0.57 0.28 | 0.20 0.11 | 0.26 0.09 |
Wearable Sensing
Wearable sensing uses body-worn devices to measure motion, physiology, and interaction for health, activity, and assistive applications.
See all 130 papers