DOI : 10.5281/zenodo.23186044
- Open Access

- Authors : Mrs. N. Mangaiyarkarasi, S. Swetha, S. Hariharan, M. Vanamadevi, A. Ashviniya
- Paper ID : IJERTV15IS090908
- Volume & Issue : Volume 15, Issue 09 , September – 2026
- Published (First Online): 06-10-2026
- ISSN (Online) : 2278-0181
- Publisher Name : IJERT
- License:
This work is licensed under a Creative Commons Attribution 4.0 International License
Stage-Aware EMG-Based Hand Rehabilitation System for Post-Stroke Patients using On-Device Machine Learning
Mrs. N. Mangaiyarkarasi
Dept. of ECE, Kings College of Engineering Tamil Nadu, India
S. Swetha
Dept. of ECE, Kings College of Engineering Tamil Nadu, India
S. Hariharan
Dept. of ECE, Kings College of Engineering Tamil Nadu, India
M. Vanamadevi
Dept. of ECE, Kings College of Engineering Tamil Nadu, India
A. Ashviniya
Dept. of ECE, Kings College of Engineering Tamil Nadu, India
Abstract – Post-stroke hand rehabilitation still depends largely on therapist observation, so muscle effort is rarely measured continuously and real-time feedback is limited. This paper presents a low-cost surface electromyography (sEMG) system in which forearm muscle activity is acquired, filtered and classified on an ESP32 microcontroller, and feedback is delivered through a web application with exercise videos and a therapist dashboard. The proposed design replaces threshold-based effort estimation with (i) a per-patient calibration that normalizes effort to maximum voluntary contraction (MVC) and estimates a coarse recovery stage, and (ii) a Random Forest classifier operating on six time-domain features (MAV, RMS, WL, ZC, SSC, WAMP) that recognizes the exercise gesture. The processing chain was evaluated on a parametric simulation of two-channel forearm sEMG at three recovery levels (low, medium, high). Stage- specific Random Forest models reached 91.5%, 98.1% and 99.6% grouped cross-validated accuracy for low, medium and high recovery, respectively. These figures come from simulated signals and are not clinical results; validation on hardware recordings from stroke patients is the next step.
Index Termselectromyography, stroke rehabilitation, ESP32, TinyML, Random Forest, Brunnstrom stage, muscle effort, tel- erehabilitation
-
INTRODUCTION
Stroke frequently leaves survivors with impaired hand func- tion, and regaining it requires many repetitions of task-specific exercise. In routine practice these exercises are therapist- guided, and strength and movement are assessed manually. The consequence is that muscle effort is not measured con- tinuously, assessment depends on observation, and the patient receives little real-time feedback between clinic visits.
Surface EMG offers a non-invasive way to measure forearm muscle activation during exercise. Several research platforms already use EMG for robot-assisted therapy [1], [2], synergy- based assessment [3], [4] and mobile EMG-guided training [5].
Most, however, need hospital-grade set-ups, provide analysis without a feedback loop, or have only been tested in clinical settings. Low-cost EMG wearables reviewed in [13] typically alert the user with a fixed RMS threshold, which ignores the large differences in signal strength between patients at different recovery stages.
Two separate lines of work suggest a better design. Clini- cal machine-learning studies show that feature and classifier choices tuned to the Brunnstrom stage improve gesture recog- nition from weak post-stroke EMG [6]. Embedded studies show that such classifiers can run in real time on ESP32- class microcontrollers [7], [8]. To our knowledge these have not been combined into one patient-facing rehabilitation de- vice. This paper describes such a combination and reports a simulation-based evaluation of its signal-processing and classification chain.
The contributions are: (1) a system architecture that adds a calibration stage, on-device classification and a therapist dashboard to the basic acquirefilterfeedback pipeline; (2) a patient-normalized effort score; (3) a stage-specific Random Forest gesture classifier using a compact time-domain feature set; and (4) a simulation study comparing four classifiers and stage-specific versus pooled training.
-
RELATED WORK
Patient-specific EMG detectors for robot-assisted therapy were studied by Yuvaraj et al. [1], and Anand et al. presented an extensible platform for measuring and modifying muscle engagement during robot-facilitated rehabilitation [2]. Both rely on clinical equipment and are not designed for self- administered use. Kwok et al. showed that upper-limb muscle synergies can serve as markers for motor assessment and outcome prediction [3], and Labib et al. applied interpretable
machine learning to lower-limb synergy features [4]; neither provides a patient-facing feedback application. The MyoGuide usability study [5] demonstrated mobile EMG-guided wrist- extension training in subacute stroke, but in a clinical setting without independent home monitoring.
A stage-specific feature optimization study [6] compared LDA, SVM, Random Forest and LightGBM for post-stroke hand-gesture recognition and reported accuracies of roughly 6581% depending on recovery stage, using data from 13 patients and without proposing a deployable device. On the embedded side, [7] benchmarks feature engineering for edge- AI sEMG gesture recognition and [8] deploys a complete EMG classification pipeline on an ESP32 for an exoskele- ton. IoT-based rehabilitation gloves using ESP32 and cloud dashboards [9], [10] and an armband-based system with robotic hand assistance [12] address remote monitoring, but use flex/force sensing or costly robotic hardware rather than muscle activity. Surveys of EMG/EEG-controlled rehabilita- tion robots [11] and of EMG monitoring in rehabilitation [13] confirm that low-cost unsupervised home systems remain scarce and that RMS thresholding is the common baseline. Feature foundations come from Phinyomark et al. [14], who reviewed time- and frequency-domain EMG features, and from multi-domain fusion approaches [15]; EMG-only classification of rehabilitation movements is supported by [16].
-
PROPOSED SYSTEM
Fig. 1. Block diagram of the proposed stage-aware EMG rehabilitation system.
-
Architecture
The system, shown in Fig. 1, begins with a short calibration session in which the patient performs three to five trial contractions. From these the system records the maximum voluntary contraction level and assigns a coarse recovery category (low, medium or high) that selects the stage-specific model and thresholds. The patient then chooses an exercise in the web application, watches the instruction video and performs it while surface electrodes on the forearm flexor and extensor groups feed an analog front end and the ESP32 ADC. The signal is filtered, windowed and converted to features; the classifier returns the gesture class, and the effort score is computed. Feedback is shown immediately in the web application, and session summaries are synchronized to a therapist dashboard whenever a connection is available.
-
Hardware and Software
The hardware comprises surface EMG electrodes, a signal- conditioning stage, and an ESP32 (or Arduino-class) micro- controller with a wireless link to the web application. The web application presents exercise videos, real-time effort and gesture feedback, and progress history.
-
-
Signal Processing and Feature Extraction
-
Pre-processing
Raw sEMG is dominated by motion artifact at low fre- quencies and powerline interference at 50 Hz. A fourth-order Butterworth band-pass filter (20450 Hz) and a 50 Hz notch filter are therefore applied before segmentation. Fig. 2 shows
Fig. 2. Simulated flexor-channel sEMG during grip: (a) raw signal with motion artifact and 50 Hz interfernce, (b) after band-pass and notch filtering,
(c) windowed RMS.
the effect on a simulated grip contraction, and Fig. 3 shows the corresponding spectra. The signal is then divided into 200 ms windows with 50% overlap.
Fig. 3. Power spectral density before and after filtering.
-
Features
For each window of N samples xi, six time-domain features are computed per channel [14], [15]. Mean absolute value and root mean square capture overall activation:
1 N
Fig. 4. Simulated real-time effort score (% of MVC) during alternating grip and rest.
TABLE I
Level
Amplitude
Noise (a.u.)
Pattern separation
Low
0.35
0.10
0.45
Medium
0.65
0.08
0.75
Simulated Recovery-Level Parameters
MAV =
N
,
i=1
|xi| (1)
High 1.00 0.06 1.00
u u 1
RMS = , N
N
x
2
i
i=1
(2)
-
-
CLASSIFICATION METHODOLOGY
Four classifiers were compared on the 12-element feature
Waveform length measures signal complexity:
N1
WL = |xi+1 xi| (3)
i=1
Zero crossings (ZC), slope sign changes (SSC) and Willison amplitude (WAMP) count, respectively, sign changes of the signal, sign changes of its slope, and sample-to-sample differ- ences exceeding a threshold , each subject to to suppress noise [14]:
(
vector: linear discriminant analysis (LDA), SVM with an RBF kernel, k-nearest neighbors (k = 5) and Random Forest (30 trees, maximum depth 8). Features were standardized for LDA, SVM and k-NN. Random Forest was the primary candidate because its footprint is small enough for microcontroller export (for example through micromlgen or emlearn), it needs far less data than deep networks, and its feature importances can be explained to clinicians. Two training strategies were compared: a generic model trained on windows from all recovery levels, and stage-specific models trained separately for each level, as
WAMP =
N 1
i=1
f (|xi xi+1|) , f (x) =
1 x >
0 otherwise
(4)
would be selected after calibration.
-
EXPERIMENTAL SETUP
With two channels this gives a 12-element feature vector. Time-domain features were chosen because they are inex- pensive to compute on a microcontroller and were found competitive with larger frequency-based sets in [6] and [14]; frequency-domain features such as mean and median fre- quency are left for later evaluation.
-
Patient-Normalized Muscle Effort
The effort score is the window RMS expressed relative to
the patients own calibrated maximum:
Effort (%) = RMSwindow × 100 (5)
RMSMVC
This makes the score comparable across patients of different recovery levels, unlike a fixed global threshold. Fig. 4 shows the score for a simulated session of alternating grip and rest, with a target zone at 60% of MVC.
Because patient recordings from the hardware are not yet available, the chain was evaluated on simulated two-channel sEMG (flexor and extensor) sampled at 1 kHz. Each signal was generated as band-limited Gaussian noise (30300 Hz) multiplied by a slowly varying amplitude envelope, with added white noise, a 50 Hz interference component and a low- frequency motion artifact. Four classes were simulated: rest, grip, wrist extension and pinch, each defined by its own flexor/extensor activation ratio. Recovery level was modeled by scaling amplitude, noise and the separation between gesture activation patterns (Table I). Twelve 3-second trials per gesture and level were generated, giving 1392 windows per level.
Evaluation used 5-fold grouped cross-validation in which all windows from one trial stay in the same fold, so that overlapping windows from a trial never appear in both training and test sets.
TABLE II
Stage-Specific Accuracy (%, mean ± SD over folds)
Classifier
Low
Medium
High
LDA
88.6±2.0
94.7±1.6
97.2±1.0
SVM (RBF)
91.3±1.6
97.4±1.2
99.3±0.4
k-NN
88.7±2.7
95.7±0.9
97.0±0.7
Random Forest
91.5±2.5
98.1±0.7
99.6±0.2
Fig. 5. Stage-specific classification accuracy of the four classifiers.
TABLE III
Generic vs. Stage-Specific Accuracy (%)
Classifier (generic / stage)
Low
Medium
High
LDA
70.6 / 88.6
92.7 / 94.7
90.5 / 97.2
SVM (RBF)
90.0 / 91.3
97.5 / 97.4
99.3 / 99.3
k-NN
79.9 / 88.7
94.4 / 95.7
98.6 / 97.0
Random Forest
91.0 / 91.5
97.4 / 98.1
99.1 / 99.6
-
-
RESULTS AND DISCUSSION
-
Classifier Comparison
Table II lists stage-specific accuracy. Random Forest was the best or tied for best at every level, and SVM was close behind. All four classifiers improved as recovery level increased, consistent with the stronger and better-separated signals of a more recovered hand; the low level was hardest for every method (Fig. 5).
-
Stage-Specific versus Generic Training
Table III compares pooled and stage-specific training. For Random Forest and SVM the difference is small (within about one percentage point), since these models can absorb the amplitude differences between levels by themselves. For LDA and k-NN, which are more sensitive to the amplitude shift, stage-specific training helped considerably, with LDA improving from 70.6% to 88.6% at the low level. The benefit of stage-specific models therefore depends on the classifier, and this simulation does not show a large gain for Random Forest (Fig. 6).
Fig. 6. Random Forest accuracy with generic (pooled) versus stage-specific training.
Fig. 7. Normalized confusion matrix (%) of the stage-specific Random Forest.
-
Gesture Confusion and Feature Importance
The confusion matrix of the stage-specific Random Forest, summed over the three levels, is given in Fig. 7. Rest is almost always identified correctly (99.6%), and the main confusions are between grip and wrist extension and between grip and pinch, which share activation of the same muscle group. Feature importances (Fig. 8) show that RMS, MAV and WL on both channels carry most of the discriminative information, while ZC, SSC and WAMP contribute little in this simulation; this suggests the feature set could be reduced to save computation, although that should be re-checked on real signals, where noise characteristics differ.
-
-
LIMITATIONS AND FUTURE WORK
The results are simulation-based: the signal model was written by the authors and therefore favors features that reflect amplitude and channel ratio, and accuracies are higher than those reported on real post-stroke data in [6] (6581%). They demonstrate that the processing chain works and indicate
Fig. 8. Random Forest feature importances (top eight).
how the classifiers behave relative to one another, but they cannot be interpreted as clinical performance. The calibration- based stage estimation and th on-device deployment were not evaluated here. Planned work includes: collecting sEMG from the hardware prototype, first from healthy volunteers and then from stroke patients under ethics approval; evaluating stage estimation against therapist Brunnstrom ratings; exporting the Random Forest to the ESP32 and measuring memory use and latency; adding frequency-domain features and LightGBM when a larger dataset is available; and validating the effort score against therapist assessment.
-
CONCLUSION
This paper proposed a low-cost, stage-aware EMG reha- bilitation system that combines patient-normalized effort esti- mation, Random Forest gesture recognition suited to ESP32 deployment, and a web application with a therapist dashboard. On simulated two-channel sEMG, stage-specific Random For- est models achieved 91.599.6% accuracy across recovery levels, and the choice between stage-specific and pooled training mattered mainly for LDA and k-NN. Hardware- based validation with patients is required before any clinical conclusion can be drawn.
ACKNOWLEDGMENT
The authors thank the Department of Electronics and Com- munication Engineering, Kings College of Engineering, for supporting this project.
-
Lin, Xu, Zhang, Woolley et al., A usability study on mobile EMG- guided wrist extension training in subacute stroke patients (MyoGuide),
J. NeuroEng. Rehabil., 2024.
-
Stage-specific EMG feature optimization for enhanced post-stroke hand
gesture recognition, J. NeuroEng. Rehabil., 2025.
-
On the deployment of edge AI models for surface electromyography- based hand gesture recognition, AI (MDPI), 2025.
-
Embedded machine learning on ESP32 for upper-limb exoskeletons
based on EMG, 2025.
-
An Internet of Things-enabled smart glove for brain stroke rehabilita-
tion, ScienceDirect, 20242025.
-
An advanced cost-efficient IoT method for stroke rehabilitation using
smart gloves, AIP Publishing, c. 2023.
-
A review on EMG/EEG based control scheme of upper limb rehabili- tation robots for stroke patients, ScienceDirect, 2023.
-
An IoT-enabled stroke rehabilitation system based on smart wearable
armband and machine learning.
-
Electromyography monitoring systems in rehabilitation: A review of clinical applications, wearable devices and signal acquisition method- ologies.
-
A. Phinyomark, P. Phukpattaranont and C. Limsakul, Feature reduction
and selection for EMG signal classification, Expert Syst. Appl., 2012.
-
A novel feature optimization for wearable human-computer interfaces
using surface electromyography sensors, Sensors.
-
Identification of neuromotor patterns associated with hand rehabilita- tion movements from EMG and EEG signals, in Proc. IEEE ICORR, 2025.
REFERENCES
-
Yuvaraj et al., Identification of patient-specific EMG detectors for robot-assisted therapy using rest and move state EMG data, IEEE Access, 2025.
-
Anand et al., An extensible platform for measurement and modification of muscle engagement during upper-limb robot-facilitated rehabilita- tion, in Proc. IEEE ICORR, 2025.
-
Kwok et al., Can EMG-derived upper limb muscle synergies serve as markers for post-stroke motor assessment and prediction of rehabilitation outcome?, Sensors, 2025.
-
Labib, Brust, Danoy et al., Lower limb motor function assessment with muscle synergy and interpretable machine learning, IEEE Access, 2025.
