Abstract
The existing surface electromyography-based pattern recognition system (sEMG-PRS) exhibits limited generalizability in practical applications. In this paper, we propose a stacked weighted random forest (SWRF) algorithm to enhance the long-term usability and user adaptability of sEMG-PRS. First, the weighted random forest (WRF) is proposed to address the issue of imbalanced performance in standard random forests (RF) caused by randomness in sampling and feature selection. Then, the stacking is employed to further enhance the generalizability of WRF. Specifically, RF is utilized as the base learner, while WRF serves as the meta-leaning layer algorithm. The SWRF is evaluated against classical classification algorithms in both online experiments and offline datasets. The offline experiments indicate that the SWRF achieves an average classification accuracy of 89.06%, outperforming RF, WRF, long short-term memory (LSTM), and support vector machine (SVM). The online experiments indicate that SWRF outperforms the aforementioned algorithms regarding long-term usability and user adaptability. We believe that our method has significant potential for practical application in sEMG-PRS.
Introduction
Surface electromyography (sEMG)—the electrical signals generated by muscle activity—serves as a critical interface for controlling smart rehabilitation devices like robotic exoskeletons and prosthetics. Despite high performance in controlled laboratory settings, a significant "translational gap" persists between research and clinical reality. Real-world performance often degrades due to electrode shift, muscle fatigue, and inter-individual physiological differences. Most current systems lack the generalizability required to handle these dynamic "noises" without frequent recalibration. This research introduces a Stacked Weighted Random Forest (SWRF) algorithm designed to bridge this gap by improving model robustness and user adaptability.
Methods
The proposed SWRF architecture enhances the standard Random Forest (RF) through two primary mechanisms:
- Weighted Random Forest (WRF): Standard RF treats all decision trees equally. However, due to random feature selection, some trees are more accurate than others. WRF calculates the "Out-of-Bag" (OOB) error for each tree and assigns higher weights to more accurate trees, ensuring a more reliable ensemble vote.
- Stacking Architecture: SWRF employs a meta-learning approach where standard RFs act as base learners in the first layer. Their predictions are then processed by a WRF meta-learner in the second layer. This hierarchical structure allows the model to learn from and correct the errors of the initial layer.
The system monitors five key lower-limb muscles: Vastus Medialis (VM), Rectus Femoris (RF), Semimembranosus (SE), Biceps Femoris (BF), and Gastrocnemius (GA). Six feature types are extracted, including a Time Domain Descriptor (TDD) specifically chosen for its resilience against sensor displacement.
Experimental Evaluation
The algorithm was validated using two datasets:
- Public Benchmark: The UCI "EMG dataset in lower limb," featuring 22 subjects performing various movements.
- Longitudinal Study: An in-house study where four subjects performed four movements (Sitting, Raise Thigh, Raise Calf, Straighten Leg) over five consecutive days to test long-term stability.
Results and Discussion
In offline testing on the UCI dataset, SWRF achieved a mean accuracy of 89.06%, significantly outperforming SVM (86.89%), standard RF (86.75%), and LSTM (56.40%). The performance of SWRF was consistently superior across different subjects, as shown in the accuracy metrics.
Crucially, SWRF demonstrated superior long-term usability. In the 5-day longitudinal study, it maintained high accuracy despite daily signal variations, improving inter-subject test accuracy by an average of 29.28% compared to LSTM. This suggests that ensemble methods like SWRF are more stable for stochastic sEMG signals than complex deep learning models like LSTMs, which may struggle with distribution shifts.
Conclusion
The SWRF algorithm provides a robust solution for lower-limb activity recognition, addressing key challenges in sEMG-PRS generalizability. While the model occasionally confuses similar movements like "Raise Calf" and "Straighten Leg," future work integrating sensor fusion (e.g., IMUs) and expanded training sets is expected to further refine performance. The results indicate significant potential for SWRF in enhancing the reliability of wearable robotic devices.
Summary updated