Abstract
Stroke rehabilitation seeks to accelerate motor recovery by training functional activities, but may have minimal impact because of insufficient training doses. In animals, training hundreds of functional motions in the first weeks after stroke can substantially boost upper extremity recovery. The optimal quantity of functional motions to boost recovery in humans is currently unknown, however, because no practical tools exist to measure them during rehabilitation training. Here, we present PrimSeq, a pipeline to classify and count functional motions trained in stroke rehabilitation. Our approach integrates wearable sensors to capture upper-body motion, a deep learning model to predict motion sequences, and an algorithm to tally motions. The trained model accurately decomposes rehabilitation activities into elemental functional motions, outperforming competitive machine learning methods. PrimSeq furthermore quantifies these motions at a fraction of the time and labor costs of human experts. We demonstrate the capabilities of PrimSeq in previously unseen stroke patients with a range of upper extremity motor impairment. We expect that our methodological advances will support the rigorous measurement required for quantitative dosing trials in stroke rehabilitation.
Introduction
A critical challenge in stroke rehabilitation is the "dosing problem." While animal models demonstrate that high-intensity training—performing hundreds of repetitions daily—is essential for significant motor recovery, measuring these doses in human clinical settings has remained elusive. Clinicians typically rely on "time-in-therapy" as a proxy, but this metric fails to distinguish between active functional training and passive activities like stretching. Manual annotation of video data, the current gold standard for counting repetitions, is prohibitively labor-intensive, requiring approximately 80 minutes of expert time for every minute of recorded movement. To bridge this gap, we developed PrimSeq, an automated pipeline that utilizes wearable sensors and deep learning to identify and count functional movements with high precision.
Methodology
Hardware and Data Acquisition
The PrimSeq system employs an array of nine Inertial Measurement Units (IMUs) worn on the patient's upper body, including the arms, hands, and torso. This configuration captures 76-dimensional kinematic data, providing a high-fidelity representation of movement during rehabilitation tasks.
Sequence-to-Sequence Modeling
Rather than using traditional windowed classification, PrimSeq treats motion capture as a sequence-to-sequence (Seq2Seq) problem, a technique borrowed from natural language processing. The architecture uses a three-layer bi-directional Gated Recurrent Unit (GRU) as an encoder to compress 6-second windows of motion data, and a single-layer GRU decoder to translate that data into a sequence of motion labels. A custom deduplication algorithm then resolves overlapping predictions to ensure an accurate final count.
Functional Primitives
The core innovation of PrimSeq is the decomposition of complex rehabilitation activities (e.g., feeding, drinking, grooming) into five universal "functional primitives": reach, transport, reposition, stabilization, and idle. By focusing on these fundamental building blocks, the model learns the temporal context of movement—for instance, recognizing that a "reach" is typically followed by a "transport."
Experimental Design
The study involved 41 chronic stroke patients with varying levels of upper extremity impairment. The dataset comprised over 64,000 labeled primitives, with ground truth established through two years of manual video annotation. The model was trained on 33 patients and tested on 8 previously unseen patients to evaluate its generalizability across different impairment levels.
Results and Discussion
PrimSeq demonstrated superior performance compared to standard machine learning benchmarks (CNN, Random Forest, and ASRF), achieving a significantly higher F1 score of 0.799.
Precision and Efficiency
The model's counts were between 86.1% and 99.6% accurate compared to human experts. Most notably, PrimSeq achieved a 366x increase in efficiency. The pipeline processed 6.4 hours of therapy data in just 1.4 hours, a task that would have required over 513 hours for human experts to complete. This massive speedup makes large-scale clinical dosing trials feasible for the first time.
Clinical Robustness
Performance remained stable regardless of the patient's motor impairment level (as measured by Fugl-Meyer scores). This robustness is critical for clinical use, as stroke survivors often exhibit highly variable and "messy" movement patterns that can confuse simpler classification systems.
Conclusion and Future Work
PrimSeq provides a scientifically rigorous and clinically feasible tool for quantifying the dose of functional training in stroke rehabilitation. While currently focused on counting repetitions, future iterations aim to incorporate kinematic quality measures and computer vision to provide richer context for unstructured, "in the wild" activities. This methodological advance is a vital step toward establishing evidence-based dosing guidelines for stroke recovery.
Summary updated