Enhancing Upper Limb Rehabilitation with Unsupervised Machine Learning Models

Introduction This article proposes a support system designed to assist healthcare professionals in upper limb motor rehabilitation. The system analyzes patient movement data collected through AR/VR-based games like e-Puzzle, which captures joint angle measurements (shoulderLangle, elbowRangle, etc.) and movement patterns during rehabilitation sessions. By employing unsupervised machine learning techniques - including K-Means clustering and Self-Organizing Maps (SOM) for patient classification, combined with Principal Component Analysis (PCA) for dimensionality reduction, the system identifies distinct movement patterns and provides quantitative assessments of rehabilitation progress. The processed data is then visualized through an interactive dashboard, enabling physicians to monitor patient evolution and optimize treatment protocols based on data-driven insights. The architecture follows a client-server model where movement data from multiple treatment sessions is centrally processed and stored. This approach addresses the need for comprehensive movement analysis noted in the study's motivation, while overcoming limitations of traditional rehabilitation methods that lack detailed performance tracking. The system's analytical capabilities are particularly valuable for identifying subtle variations in movement amplitude (ADM) that may indicate recovery progress or the need for treatment adjustment, ultimately supporting clinical decision-making in motor rehabilitation. Key contributions of this work include: A client-server architecture, which processes data collected from the patient’s device, enabling multiple treatment sessions across different patients to communicate with a centralized data storage layer. Unsupervised learning models (K-means and Self Organizing Maps) classify patients into clusters based on movement amplitude—low, medium, and normal range. With larger datasets, the system can refine cluster accuracy, enhancing pattern detection and providing deeper insights for healthcare professionals. An interactive dashboard visualizes patient performance metrics and rehabilitation progress over time, presenting processed movement data (including joint angles and amplitude measurements) through intuitive visualizations. The interface provides healthcare professionals with immediate access to quantitative analyses - such as cluster classifications and variance trends - in a single centralized view. Applications in Motor Rehabilitation This article presents a client-server system for motor rehabilitation that collects upper limb movement data through AR/VR-based games like e-puzzle, tracking joint angles and movement amplitudes (shoulderLangle, elbowRange, etc.) using unsupervised learning methods (K-means, SOM). These techniques automatically cluster patients into distinct movement pattern groups, as demonstrated by the three clusters identified in the study (low, medium, and normal range of motion). Clinical annotations of movement quality (e.g., "improved" or "regressed") combined with existing goniometric assessments could enable predictive models to track recovery progress and potentially offer real-time feedback during rehabilitation sessions. Unsupervised Machine Learning Methods We now present the analytical framework developed to classify upper limb movement patterns in motor rehabilitation, focusing on three core techniques: Principal Component Analysis (PCA), K-Means clustering, and Self-Organizing Maps (SOM). The methods were applied to movement data collected from AR/VR-based rehabilitation sessions (e.g., e-Puzzle), with the goal of identifying distinct patient clusters based on kinematic features such as joint angles (shoulderLangle, elbowRange) and movement amplitude (ADM). Principal Component Analysis (PCA) was first employed to reduce the dimensionality of the dataset while preserving its essential structure. The analysis revealed that the first three principal components (PCA1, PCA2, PCA3) accounted for 78.14% of the total variance in movement patterns, with PCA1 alone explaining 39.34%. This reduction allowed for efficient visualization and processing of the data without significant loss of meaningful information. The components primarily captured variations in shoulder and elbow movements, highlighting their importance in distinguishing between different rehabilitation profiles. The K-Means clustering algorithm was applied to categorize patients based on their movement characteristics during rehabilitation sessions. To determine the optimal number of clusters, the elbow method was employed by calculating the sum of squared errors (SSE) for cluster solutions ranging from k=1 to k=9. The resulting showed a distinct elbow point at k=3, indicating this as the most appropriate number of clusters to capture the natural grouping in the movement data while avoiding overfitting. This finding was further validated using the jump method, whic

May 18, 2025 - 13:10
 0
Enhancing Upper Limb Rehabilitation with Unsupervised Machine Learning Models

Introduction

This article proposes a support system designed to assist healthcare professionals in upper limb motor rehabilitation. The system analyzes patient movement data collected through AR/VR-based games like e-Puzzle, which captures joint angle measurements (shoulderLangle, elbowRangle, etc.) and movement patterns during rehabilitation sessions. By employing unsupervised machine learning techniques - including K-Means clustering and Self-Organizing Maps (SOM) for patient classification, combined with Principal Component Analysis (PCA) for dimensionality reduction, the system identifies distinct movement patterns and provides quantitative assessments of rehabilitation progress.
The processed data is then visualized through an interactive dashboard, enabling physicians to monitor patient evolution and optimize treatment protocols based on data-driven insights.
The architecture follows a client-server model where movement data from multiple treatment sessions is centrally processed and stored. This approach addresses the need for comprehensive movement analysis noted in the study's motivation, while overcoming limitations of traditional rehabilitation methods that lack detailed performance tracking. The system's analytical capabilities are particularly valuable for identifying subtle variations in movement amplitude (ADM) that may indicate recovery progress or the need for treatment adjustment, ultimately supporting clinical decision-making in motor rehabilitation.

Key contributions of this work include:

  • A client-server architecture, which processes data collected from the patient’s device, enabling multiple treatment sessions across different patients to communicate with a centralized data storage layer.

  • Unsupervised learning models (K-means and Self Organizing Maps) classify patients into clusters based on movement amplitude—low, medium, and normal range. With larger datasets, the system can refine cluster accuracy, enhancing pattern detection and providing deeper insights for healthcare professionals.

  • An interactive dashboard visualizes patient performance metrics and rehabilitation progress over time, presenting processed movement data (including joint angles and amplitude measurements) through intuitive visualizations. The interface provides healthcare professionals with immediate access to quantitative analyses - such as cluster classifications and variance trends - in a single centralized view.

Applications in Motor Rehabilitation

This article presents a client-server system for motor rehabilitation that collects upper limb movement data through AR/VR-based games like e-puzzle, tracking joint angles and movement amplitudes (shoulderLangle, elbowRange, etc.) using unsupervised learning methods (K-means, SOM). These techniques automatically cluster patients into distinct movement pattern groups, as demonstrated by the three clusters identified in the study (low, medium, and normal range of motion). Clinical annotations of movement quality (e.g., "improved" or "regressed") combined with existing goniometric assessments could enable predictive models to track recovery progress and potentially offer real-time feedback during rehabilitation sessions.

Unsupervised Machine Learning Methods

We now present the analytical framework developed to classify upper limb movement patterns in motor rehabilitation, focusing on three core techniques: Principal Component Analysis (PCA), K-Means clustering, and Self-Organizing Maps (SOM). The methods were applied to movement data collected from AR/VR-based rehabilitation sessions (e.g., e-Puzzle), with the goal of identifying distinct patient clusters based on kinematic features such as joint angles (shoulderLangle, elbowRange) and movement amplitude (ADM).

Principal Component Analysis (PCA) was first employed to reduce the dimensionality of the dataset while preserving its essential structure. The analysis revealed that the first three principal components (PCA1, PCA2, PCA3) accounted for 78.14% of the total variance in movement patterns, with PCA1 alone explaining 39.34%. This reduction allowed for efficient visualization and processing of the data without significant loss of meaningful information. The components primarily captured variations in shoulder and elbow movements, highlighting their importance in distinguishing between different rehabilitation profiles.

K-Means clusters

The K-Means clustering algorithm was applied to categorize patients based on their movement characteristics during rehabilitation sessions. To determine the optimal number of clusters, the elbow method was employed by calculating the sum of squared errors (SSE) for cluster solutions ranging from k=1 to k=9. The resulting showed a distinct elbow point at k=3, indicating this as the most appropriate number of clusters to capture the natural grouping in the movement data while avoiding overfitting. This finding was further validated using the jump method, which similarly identified three clusters as optimal.

SOM clusters

The resulting patient groups - classified as low, medium, and high movement ranges - demonstrated clear separation across key biomechanical features. Particularly notable differences appeared in shoulderRangle and shoulderLTransv measurements, with Cluster 0 showing significantly higher variance in these parameters compared to Clusters 1 and 2. This variability pattern suggests that patients in Cluster 0 exhibited more diverse movement strategies during rehabilitation exercises. The cluster centroids revealed progressive improvement in movement amplitude across the three groups, providing physicians with an objective framework for assessing rehabilitation progress and customizing treatment plans.

The visualization below presents the final K-Means clustering results, showing the distribution of patients across the three movement pattern groups and their characteristic kinematic profiles. This quantitative classification system enables more precise tracking of recovery trajectories and supports data-driven adjustments to therapy protocols.

K-Means clustering

The Self-Organizing Map (SOM) analysis revealed three distinct clusters of patient movement patterns during upper limb rehabilitation. This method does not rely on a number of clusters provided by the user and is a good choice to compare the results obteined by it to K-Means. The topological mapping preserved nonlinear relationships in the kinematic data, with particular differentiations visible in features like medianelbowRangle and mediankneeLangle. Below, we have the results using SOM.

SOM clustering

Cluster 1 showed higher median values across most movement features, while Cluster 2 displayed more restricted ranges , suggesting varying rehabilitation progress levels among patients.

Patient Performance Visualization Dashboard

The interactive dashboard serves as the primary interface for healthcare professionals to monitor and evaluate patient progress during upper limb rehabilitation. Designed for intuitive use, it presents processed movement data collected from AR/VR sessions (e.g., e-Puzzle) through multiple visualization components that highlight key biomechanical metrics and rehabilitation trends.

The dashboard displays filtered movement signals using Savitzky-Golay filter smoothing to remove noise while preserving clinically relevant patterns in joint angle measurements.
We are using cluster analysis results from K-Means algorithm, which is visually represented, showing how individual patients align with the three identified movement pattern groups (low, medium, and normal range). Box plots and amplitude graphs provide statistical summaries of movement characteristics, enabling quick assessment of patient performance relative to their cluster group.
The interface allows selection of specific sessions for detailed review, with all quantitative metrics (medians, variances) accessible in a unified view. Designed with clinical usability in mind, the dashboard transforms complex movement analytics into actionable insights, supporting data-driven adjustments to rehabilitation protocols. Future enhancements could incorporate longitudinal progress tracking and predictive analytics based on the accumulated session data.

Dashboard preview

Dashboard preview

Conclusion

This article presents a comprehensive support system that enhances upper limb motor rehabilitation through advanced data analytics and interactive visualization. The integration of unsupervised machine learning techniques—such as PCA for dimensionality reduction, K-Means clustering for patient classification, and SOM provides a robust way for identifying distinct movement profiles and assessing rehabilitation outcomes.
The interactive dashboard synthesizes these analytical insights into an intuitive interface, empowering healthcare professionals to make data-driven decisions and tailor rehabilitation protocols effectively.
Together, these innovations address critical gaps in traditional rehabilitation methods, offering a sophisticated tool for monitoring recovery, detecting subtle movement variations, and optimizing therapeutic interventions.
This system not only advances the field of motor rehabilitation but also demonstrates the transformative potential of combining immersive technologies with machine learning to improve clinical decision-making and patient outcomes.

This article is based on my master's dissertation "Treatment Support System for Upper Limb Motor Rehabilitation" , Universidade de São Paulo, 2024. It is a FOSS project.