Lower Limb Activity Recognition Based on sEMG Using Stacked Weighted Random Forest

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.

riencing mobility impairments.The lack of mobility not only imposes burden on society and families, but also weakens the confidence in their daily life.Lower limb activity (LLA) is an essential daily behavior in human life, as the lower limb bears the majority of body and serves as a foundation for robust waking ability [1].To improve the walking ability of elderly and mobility-impaired individuals, a vast array of intelligent lower limb intelligent rehabilitation devices is employed.However, due to the lack of active participation intention of the wearer, traditional human computer interaction (HCI) based on fixed rehabilitation modalities has limited rehabilitation effect [2].Research indicates that active rehabilitation yields superior outcomes compared to passive rehabilitation.For exoskeleton robots, accurate and efficient LLA intention recognition is a prerequisite for effective rehabilitation training, and it directly affects the overall outcome.
Unlike the inefficient traditional HCI, the bioelectric signal-based control approach is capable of recognizing the wearer's rehabilitation intention.The wearer's intention is appropriately integrated into passive rehabilitation, thereby enhancing the wearer's subjective initiative, and improve the rehabilitation effect.The surface electromyography (sEMG)based pattern recognition system (sEMG-PRS) shows potential in providing stable and effective intention recognition for rehabilitation devices [3], [4].The sEMG signal is formed by the superposition of action potentials generated by all muscle fibers on the skin surface [5].Moreover, the sEMG signal exhibits a low amplitude range of 0-5 mV, a frequency spectrum spanning from 6 to 500 Hz, and a predominant energy distribution within the range of 10-250 Hz [6].The sEMG-PRS mainly includes four interrelated stages: sEMG data acquisition, pre-processing, feature extraction, and classification.Despite numerous experimental studies with good intention recognition [7], [8], the abandonment rate of lower limb rehabilitation devices remains high.The primary impediment to this phenomenon lies in the gradual decline of recognition performance exhibited by sEMG-PRS during extended periods of clinical application.Over extended periods of use, the performance of sEMG-PRS decreases dramatically due to various factors such as electrode shift, limb position, muscle fatigue, and skin sweating [9].Furthermore, the generalization across subjects is more complex issue due to factors such as inter-individual differences, variations in muscle strength, and disparities in skin organization [10].The issue of limited generalization leads to insufficient long-term availability and user adaptability of sEMG-PRS [11].Therefore, there is an urgent need to enhance the generalization of sEMG-PRS and bridge the translational gap between laboratory research and clinical applications.
Several approaches have been proposed to enhance the generalizability of sEMG-PRS.The most intuitive approach is to identify the optimal features with strong robustness.Jiang et al. [12] identified the optimal feature combination of sEMG features by searching and selecting among 50 different options, resulting in an impressive cross-day accuracy of 91.9 % for their 11-gesture classifications.Shen et al. [13] proposed a novel feature extraction method to diminish the influence of limb position on sEMG-based pattern recognition.As is often the case, reducting the dimensionality of features (including principal components analysis and linear discriminant analysis) and subsequent processing can generally lead to improved performance [14], [15].A potential approach for enhancing model generalization is to ensure sufficient training time and diverse training data from a large number of individuals, as this can significantly improve the recognition performance of the sEMG-PRS [16].By incorporating a substantial amount of disparity data, this approach enhances the comprehensiveness of system recognition.Waris et al. [17] demonstrated that increasing the time span of training data could improve the robustness of the sEMG-PRS over time.However, feature selection is subjective and prone to overestimation the results.Obtaining a substantial amount of training data is time-consuming and unrealistic.In fact, experimental data collection can be tedious and exhausting for individuals, and recruiting a large number of subjects can prove extremely challenging.
With the progress of deep learning, some studies have been introduced to the sEMG-PRS.Transfer learning (TL) is a widely accepted approach for addressing data scarcity while maintaining classification accuracy.In [18], the utilization of TL method was significantly outperformed the non-TL method in addressing the performance degradation caused by the instability of sEMG signals.Depth domain adaptation (DDA) is another widely investigated approach.DDA aligns the data distribution between source and target domains, utilizing limited labeled target data to provide a stable and reliable classification capacity for diverse target domains [19].Zhang et al. [20] proposed a multi-source synchronize domain adaptation framework that possesses both domain adaptation and domain generalization capability.Zhai et al. [21] proposed a CNN-based self-recalibrating unsupervised classifier to achieve 78.71 % classification ability under intersession scenarios.Shi et al. [22] proposed a new multi-task dual-stream supervised domain adaptation network based on convolutional neural network to realize the long-term reliability and user adaptability simultaneously.Experiments conducted on 12 non-disabled individuals have demonstrate that the proposed method surpasses both convolutional neural network and fine-tuning.Campbell et al. [23] expanded the adaptive domain adversarial neural network (ADANN) method to cross-subject networks.The accuracy of ADANN for intact limbs was shown to reach 86.8 -96.2% by three dissimilar evaluation.These methods have the potential to enhance the cross-subject and inter-session performance of the sEMG-PRS.However, TL and DDA are implemented from the perspective of global distribution alignment and lack semantic information on sEMG features.Although TL reduces the need for retraining and recalibration, a convolutional neural network still requires a large amount of data to achieve high performance and generalizability.Furthermore, these methods necessitate the utilization of source data and recalibration the trained model, which can cause inconvenience for sEMG-PRS.
In summary, despite the extensive research conducted to enhance the generalizability of sEMG-PRS for clinical applications.Unfortunately, few studies have investigated a simple model that exhibits both durability in long-term usage and widespread adoption by multiple users [24], [25].Here, this paper proposes novel classification method, namely stacked weighted random forest (SWRF), which is illustrated in Fig. 1.To validate the efficacy of SWRF, we selected four commonly lower limb activities and recruited four non-disabled subjects to carry out the experiment for five consecutive days.An LLA dataset was utilized to evaluate the robustness and adaptability of SWRF.Afterward, we evaluated the SWRF's generalization performance in three aspects, inter-subject offline dataset, inter-subject single-day, and subject multi-day.
The main contribution of the work is twofold.First, complements the existing sEMG-PRS approach and proposes a classification model with both long-term robustness and multi-subject adaptability, termed SWRF.Second, a multisubject sEMG signal acquisition experiment is designed to evaluate the performance of SWRF in three aspects, including inter-subject offline dataset, inter-subject single-day, subject multi-day.We noted that a shorter conference version of this paper appeared in [26].The initial conference paper online experiments were not sufficient, and no offline dataset experiments were performed.This manuscript addresses these issues and propose an improved approach based on the weighted random forest presented in the conference paper.
The remainder of the paper is organized as follows.Dataset and sEMG acquisition are presented in Section II.The proposed SWRF is elaborated in Section III.The experiment results and analysis are provided in Section IV.Finally, conclusions are drawn in the last section.

II. DATASET AND SEMG ACQUISITION A. Dataset Descriptions
The dataset utilized in this work was curated by Oscar Sanchez and Jose Sotelo [27] (http://archive.ics.uci.edu/dataset/278/emg+dataset+in+lower+limb).The dataset contained 11 samples of subjects with some abnormality in the knee previously diagnostic and 11 exhibiting normality.Subjects experienced three movements to analyze behaviors associated with knee muscles, gait, leg extension from a seated position, and flexion of the leg bending while performing sitting, standing and walking tasks.The acquisition process was conducted utilizing four electrodes (vastus medialis, biceps femoris, semitendinosus, and rectus femoris) and knee goniometers.This paper utilized sEMG data from 11 healthy individuals for analysis.

B. Subjects and Lower Limb Movements
Four subjects volunteered to participate in the experiment and the specific details are presented in Table I.None of the subjects claimed to have any motor impairment or disability, and each received comprehensive information regarding the experimental procedures and associated risks.All subjects signed an informed consent.
Rehabilitation exercises such as leg extension and bending are commonly employed for stroke patients.Based on this commonly used movement, we have formulated four leg movements: sitting position (ST), raise thigh (RT), raise calf (RC), straighten leg (SL), as illustrated in Fig. 2. Meanwhile, the sEMG are recorded form a total of five muscles involved in movement, namely: rectus femoris (RF), vastus medialis (VM), biceps femoris (BF), semitendinosus (SE), and gastrocnemius (GA) [28], as illustrated in Fig. 2. Both RF and VM muscles play a crucial role in knee extension movement [29].SE and BF play an important role in knee flexion movement [30].GA is related to the stability of standing and walking movement of lower limbs.The position of the sticker sensor corresponds to the muscle position.Due to their location on the opposite side of the lower limb, VM and BF are not depicted in Fig. 2. Prior to collection, all skin is wiped with medical alcohol and the sensor is affixed to the skin using double-sided adhesive tape.
The primary objective of this study is to investigate the generalization performance of classifier across subjects and time periods.Hence, we collect sEMG data of lower limb motions from diverse participants and distinct time points.The participants are instructed to perform the experiment thrice daily for five consecutive days.Each experiment consists of five sets of movements.Each set of movement contains four actions: ST, RT, RC, and SL.Each action is performed for a duration of 2 seconds followed by a rest interval of 1 minute to prevent muscle fatigue.Within 2 second of each action

D. sEMG Processing and Features
In the data preprocessing, sEMG are band-pass filtered by butter-worth band pass filter with forth order between 12 Hz and 500 Hz respectively low and high cutoff.Furthermore, a notch filter is used to remove the 50 Hz line interference [13].
sEMG cannot be directly used for training or testing because the data fluctuates seriously and contains abundant noise.After the pre-processing, we extract the sEMG features which are then inputted into the classifier for training or testing.Commonly utilized sEMG features encompass time domain, frequency domain and time-frequency domain features.Time domain features are widely employed due to their superior classification performance and low computational complexity [31].The widely utilized features are root mean square (RMS), mean absolute value (MAV), zero crossing (ZC), waveform length (WL), slope scope change (SSC), variance (VAR), mean frequency (MF).In previous work [13], we extracted time domain descriptor (TDD) features robust to sensor position changes to overcome the shortage of generalizing the existing sEMG-based pattern recognition.Different combinations of features and classifiers exhibit varying levels of generalization performance.In this paper, we select six features to participate in the experiment and explore the optimal feature combination using the proposed classifier.The five selected features are xikt P i, j j shown in Table II, and the other TDD feature is referred to [13].

III. METHODOLOGY
A. Random Forest and Weighted Random Forest 1) Random Forest: The decision tree, as the base learner of RF, plays a pivotal role in RF.The decision tree can be considered as a tree-like model consisting of root nodes, leaf nodes, and intermediate nodes.The process of constructing the decision tree involves the splitting of the root node, traversing through multiple intermediate nodes, and ultimately reaching the leaf node.Among them, nodes are regarded as various features of the sample.The RF consists of multiple unpruned decision trees [32].The advantages of RF, in comparison to other classifiers, are primarily attributed to the stochasticity of sample selection and feature selection.The RF initially constructs a predetermined number of decision tree classifiers.These classifiers are then utilized to vote on the test samples.Ultimately, the final decision is determined based on majority dominance.The RF has two crucial parameters: the number of trees (n_estimators) and the maximum number of selected features (max_features).The n_estimators parameter should be set sufficiently high and RF exhibits no overfitting tendencies even with an increasing number of trees [31].Furthermore, the insensitivity of RF to the value of max_features allows us to set the max_features as the square root of the total number of features.The utilization of out-of-bag (OOB) samples, which are excluded from the construction of individual decision trees, plays a pivotal role in enhancing the performance of RF.The individual decision tree predicts the OOB samples using the following formula [33]: where x i is the i-th observed sample in the OOB; k is the class (binary k = 0, 1); I is an indicator, taking a value of 1 when its parameters are true and 0 otherwise; y is the predicted class of the i-th decision tree to x i , and O O B i is the sets of decision trees.For a binary classification, the OOB prediction class is determined as 1 when p(x i ) > 0.5, and as 0 otherwise.The establishment of RF and the estimating of OOB probabilities can be simultaneously conducted.The main construction process of RF is outlined as follows: Step 1 Preparing the datasets.The original training sets are randomly sampled with replacement to generate the new training sets.
Step 2 Building decision tree.The building of each decision tree involves the utilization of the new training sets, thereby ensuring randomness.During the process of building the decision tree, each node randomly selects features for splitting without pruning techniques until the specified stopping condition is satisfied.
Step 3 Building random forest.After generating a significant number of decision trees, a majority voting strategy is utilized to predict new samples by aggregating the outcomes of all trees.
2) Weighted Random Forest: The number of decision trees utilized in RF has a significant impact, as the decision trees cannot be modified once created.The decision trees exhibit uneven classification performances.The weight assigned to each decision tree in traditional RF is uniform, disregarding the distinct performance of individual trees.When the performance of individual decision tree classifier in RF is unequal, it is reasonable to assign more weights to the decision tree that ultimately yields accurate predictions.The weighting schemes employed in the RF are not new [34].In previous work [26], we employed a weighted voting approach to ascertain the weight of each decision tree.Each decision tree is assumed to be independent with an accuracy of p 1 , p 2 , • • • , p L , respectively, in predicting OOB.The formula for obtaining p i is as follows: where y pre, j denotes the predicted value of the i-th decision tree for the j-th OOB sample; y r ea, j is the true value of the j-th OOB sample; m is the number of OOB samples.Kuncheva and Rodriguez [35] compared the weighted voting method with alternative approaches, including majority vote, recall combiner, naive Bayes combiner.The results indicated that the weighted voting method exhibited superior performance.Inspired by Rodgyruez, we utilized a weighted voting method to determine the weights of each decision tree.The weight ω i for each decision tree is obtained using the following formula: The final prediction result Out i, j for each decision tree can be obtained by a weighted voting method utilizing the following formula, where C is the number of classifications; Out j represents the predicted value of the j-th sample; O i, j is the predicted value of the j-th sample of the i-th decision tree.

B. Stacked Weighted Random Forest
Stacking is an efficient framework that employs a meta-learning algorithm to effectively integrate the predictions of multiple base learners.Stacking generally consists of two layers, namely the base model layer and the meta-learning layer [36].Specifically, stacking leverages the out-of-bag predictions of the base learner and actual labels from the training data to construct independent and dependent variables for the second level learning task, respectively [37].The general procedure for stacking is as follows.First, the initial dataset is divided into training and testing datasets.Then, the base learner in the base model layer generates predictions for a subset of the training dataset.The predicted values are utilized as additional training data to construct a new training dataset.Finally, the new training dataset is utilized for training the algorithmic model within the meta-learning layer.Stacking is an ensemble method that aims to enhance accuracy by leveraging the optimal combination of base learners.The stacking method has been widely employed by numerous researchers to effectively integrate multiple models and successfully applied in various scenarios, yielding favorable outcomes [36], [38], [39].
Inspired by the stacking method, we further combine WRF with stacking to propose the SWRF model.The standard RF is utilized as the base learner, while WRF serves as the meta-leaning layer algorithm.The RF has a robust performance on its own.When employing the stacking, WRF assigns more weight to the more powerful RF model, thereby enhancing the overall performance of the model.The implementation of SWRF is as follows: Step 1.A portion of the raw training data was employed for training and constructing initial RF models.
Step 2. K-fold cross-validation was utilized to obtain outof-bag predictions for each decision tree.
Step 3. A new dataset was generated by utilizing out-of-bag predictions as input variables and actual labels as dependent variables.
Step 4. The WRF method was utilized to train the new dataset obtained in Step 3, resulting in SWRF.

C. Comparing Classifier and Performance Evaluation
The four classifiers were utilized for comparison with our proposed method, including support vector machine (SVM) [40], standard RF, WRF [26], long short-term memory (LSTM) [41].The basic parameters of RF, WRF and SWRF are kept consistent to ensure a fair comparison.The basic parameters of RF, WRF and SWRF are n_trees=100, max_depth=5.The GridSearchCV was utilized to determine the optimal SVM parameters in order to ensure equitable comparisons.The parameters of SVM are C = 1.0, kernel='rbf'.Default values are selected for other unspecified parameters.The used contrastive LSTM was sourced from [41].The LSTM approach contains a 2-layer CNN and 2-layer LSTM.The initial CNN contains 32 units and the subsequent layer contains 16 units.The initial LSTM layer contains 64 units and the subsequent layer contains 32 units.Following each CNN layer, subsequent layers of fully connection layer and batch normalization layer are sequentially interconnected.Refer to [41] for other parameters.
The machine learning-based classification system generates four possible outcomes, true negative (TN), true positive (TP), false negative (FN) and false positive (FP).TN and TP are the correct predictions for positive and negative classes.FN and FP are mispredictions for positive and negative classes.In this paper, accuracy (Acc), precision (Pre), recall (Re) and F1-score (F1) are utilized to evaluate the classification model [42]: Pr ecision = T P T P + F P , F1 − scor e = 2 × Pr ecision × Recall Pr ecision + Recall .

IV. EXPERIMENTAL RESULTS AND ANALYSIS A. Experiments Design
This section details the design of evaluation experiments aimed at comprehensively assessing SWRF performance from Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.A total of four experiments are designed.The experiment is repeated three and the mean of the three trials is taken as the final result.Each result is calculated using five-fold cross validation.
1) Feature Generalizability Estimation: In this experiment, the generalizability of different features combinations with various classifier was investigated.We determined the optimal combination by investigating the classification performance of various classifiers combined with different features using multi-day data from a specific subject.The sEMG data of Subject 1 (S1) were randomly selected for this experiment.The model was trained using data obtained from S1 on the first day.The model was validated using data obtained from S1 on other time periods.
2) Offline Estimation on Inter-Subject: In this experiment, the generalizability of the classifier was investigated on the dataset.Data from the first subject were randomly selected to train the model.Data from other subjects was utilized to test the model.Results were shown as the mean of the five test results.
3) Multi-Day Estimation on a Subject: This experiment aimed to evaluate the long-term robustness of the classifier within the same subject.In this case, the training and testing data belonged to the same person at different times.The model was trained using data collected from a subject on the first day.Data from subsequent time points of the same subjects were utilized to validate the model.
4) Single-Day Estimation on Inter-Subject: This experiment aimed to assess the robustness of the classifier across subjects with in the same day.In this case, the training and testing data belonged to different individuals within the same day.The model was trained using data from a subject on a specific day.Data from other subjects in the same day were utilized to test the model.

B. Results of Feature Generalizability Estimation
In this scenario, the sEMG data was obtained from the same individual at different time.Thus, variations in sEMG signals mainly arisen from muscle fatigue, electrode displacement, and peripheral muscle crosstalk within the same subject.Tables III and IV shows the quantitative results for different feature combinations with classifiers.The SVM classification accuracy exhibited a ranged of 48.6 % to 98.87 % over 5 days.The combination of SVM and MAV yielded the lowest accuracy on the third day.The combination of SVM and MF yielded the highest accuracy on the fourth day.The RF classification accuracy exhibited a ranged of 74.48 % to 98.62 % over 5 days.The combination of RF and MF yielded the lowest accuracy on the third day.The combination of RF and TDD yielded the highest accuracy on the first day.The WRF classification accuracy exhibited a ranged of 75.64 % to 98.74 % over 5 days.The combination of WRF and MF yielded the lowest accuracy on the third day.The combination of WRF and TDD yielded the highest accuracy on the first day.The SWRF classification accuracy exhibited a ranged of 76.27 % to 98.99 % over 5 days.The combination of SWRF and MF yielded the lowest accuracy on the third day.The combination of SWRF and TDD yielded the highest accuracy on the fourth day.It was evident that all four classifiers achieved the lowest accuracy on the third day, conversely, the remaining accuracies were significantly higher than those of the third day.The subject's poor adaptation and adjustment to the collection of sEMG data on the third day is a matter of speculation.
Furthermore, the highest mean result achieved over 5 days of SVM was for the combination of SVM and MF (Acc: 80.63 %; Pre: 82.21 %; Re: 80.63 %; F1: 79.82 %).The highest mean result achieved over 5 days of RF was for the combination of RF and TDD (Acc: 97.35 %; Pre: 97.71 %; Re: 97.35 %; F1: 97.33 %).The highest mean result achieved over 5 days of WRF was for the combination of WRF and TDD (Acc: 97.28 %; Pre: 97.56 %; Re: 97.28 %; F1: 97.27 %).The highest mean result achieved over 5 days of SWRF was for the combination of SWRF and TDD (Acc: 97.78 %; Pre: 98.02 %; Re: 97.78 %; F1: 97.78 %).As observed, TDD achieved the highest average classification results in RF, WRF, and SWRF, while ranking second in terms of average classification results in SVM.These results validated that the TDD had significant robustness to time variation.Thereby, the TDD feature was utilized for calculation in subsequent experiments.
Although differences of sEMG signals observed in this experiment cannot include all the influencing factors, the same individual exhibits a high level of representation across different time.Similar results were also obtained through

C. Results of Offline Estimation on Inter-Subject
In this scenario, the sEMG data was obtained from various individuals within the dataset.Thus, variations in sEMG signals mainly arisen from individual variability.The training data was selected from S1, while the testing data was chosen from other subjects.All calculations utilize the TDD feature.Fig. 3 shows the quantification calculation results of different classifiers on the dataset.It can be observed that the robustness of LSTM is poor and the classification accuracy fluctuates more obviously.The LSTM exhibited the lowest classification accuracy of 34
From the results, SWRF achieved the highest mean classification accuracy across all subjects over 5 days and exhibited significant long-term usability.Compared with WRF, RF, SVM and LSTM, SWRF improved classification accuracy by an average of 0.60 %, 0.86 %, 13.71 %, 29.28 % across all subjects, respectively.
From the results, SWRF achieved the highest average recognition accuracy across all days among subjects and exhibited significant user adaptability.Compared to WRF, RF, SVM and LSTM, SWRF improved classification accuracy by an average of 0.36 %, 0.90 %, 13.41 %, 35.54 % across all days, respectively.

F. Further Analysis on SWRF Algorithm
The analysis of model allows us to gain valuable insights into its areas of expertise and challenges, thereby facilitating future enhancements in its performance.Fig. 10 shows the confusion matrix plots of the five algorithms.The model was trained using the data from the first day of subject 1, and all algorithm were tested with the data from the fifth day of subject1.The average accuracy of all models, as indicated by the confusion matrix result plot, closely aligned with the data presented in Table V

V. CONCLUSION
The SWRF algorithm is proposed in this paper to enhance the long-term usability and user adaptability of sEMG-PRS.The standard RF is utilized as the base learner, while WRF serves as the meta-leaning layer algorithm.The offline datasets are utilized to evaluate the SWRF.The offline experimental results demonstrate that the SWRF outperforms classical classification algorithms, exhibiting an average classification accuracy of 89.06 % (LSTM: 56.40%; SVM: 86.89%; RF: 86.75%; WRF: 87.35%).Moreover, two online experiments are conducted to evaluate the performance of SWRF: singleday on inter-subject and multi-day on a subject.The results of single-day on inter-subject online experiment indicate that the SWRF achieves the highest mean classification accuracy across all subjects over 5 days and exhibits significant longterm usability.Compared with WRF, RF, SVM and LSTM, SWRF improves classification accuracy by an average of 0.60 %, 0.86 %, 13.71 %, 29.28 % across all subjects, respectively.The results of multi-day on a subject online experiment indicate that the SWRF achieves the highest average recognition accuracy across all days among subjects and exhibits significant user adaptability.Compared to WRF, RF, SVM and LSTM, SWRF improves classification accuracy by an average of 0.36 %, 0.90 %, 13.41 %, 35.54 % across all days, respectively.
The RF demonstrates strong performance on its own.When employing the stacking, WRF assigns more weight to the more powerful RF model, thereby enhancing the overall performance of the algorithm.By conducting an analysis of the SWRF model, we can implement optimization measures to enhance its weak feature recognition capability, thereby further optimize the SWRF algorithm.Additionally, the performance Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
of the SWRF can be further improved by enhancing the diversity and quality of the training sets.

Fig. 1 .
Fig. 1.Entire frame of lower limb activity recognition sEMG-based.First, sEMG signals are acquired and preprocessed from five muscles in the lower limb.Second, the SWRF classifier is trained using the extracted features.Third, the trained SWRF model is employed for action label recognition.

Fig. 3 .
Fig. 3.The quantification calculation results of different classifiers on the dataset.
SCORESIN BOLD INDICATES THE BEST.S M-DAY N DENOTES THE EXPERIMENT FOR THE M-TH SUBJECT ON DAY N Authorized licensed use limited to terms of the applicable license agreement with IEEE.Restrictions apply.combined feature and classifier experiments conducted on different individuals within the same day.

TABLE II THE
CALCULATION OF FIVE FEATURES duration, a total of 10 consecutive samples are collected.Each sample contains 200 sEMG data.Procedures are conducted after the Declaration of Helsinki.

TABLE III ACCURACY
AND PRECISION RESULTS (%) OF DIFFERENT FEATURES COMBINED WITH DIFFERENT CLASSIFIER.SCORES IN BOLD INDICATES THE BEST

TABLE IV RECALL
AND F1-SCORE RESULTS (%) OF DIFFERENT FEATURES COMBINED WITH DIFFERENT CLASSIFIER.SCORES IN BOLD INDICATES THE BEST multiple perspectives.The long-term usability and user adaptability of the SWRF are assessed through these experiments.
.78 % in S4.The classification accuracy of SVM exhibited substantial fluctuations.The SVM exhibited the highest classification accuracy of 98.46 % among all algorithms at S10 and the lowest classification accuracy of 76.39 % at S4.The RF, WRF and SWRF have relatively stable classification accuracy.The RF achieved the lowest classification accuracy of 77.64 % in S6.The WRF achieved the lowest classification accuracy of 79.22 % in S6.The SWRF achieved the lowest classification accuracy of 79.51 % in S6.Due to inter-individual variability, the application of sEMG-PRS to a large population is challenging, as evidenced by this offline experiment.S4 and S6 had poor classification accuracy, illustrating that S4 and S6 were significantly different from S1.
. The SWRF achieved Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

TABLE VI QUANTITATIVE
RESULTS (%) OF INTER-SUBJECT FORA SINGLE DAY.SCORES IN BOLD INDICATES THE BEST.S M-DAY N DENOTES THE EXPERIMENT FOR THE M-TH SUBJECT ON DAY N Theoretically, the model's generalization can be improved by incorporating a diverse range of training sets and increasing the volume of data.Table VII shows the test comparison results of SVM and SWRF in the case of increasing the training set of days.The training and testing data were both sourced from subject 1.The data obtained from the fifth day was utilized for testing.The training data RC was the calf raising action, which was similar to the SL.The action became SL when the angle of calf lift was sufficiently large.We observed that the calf lift angle exhibited considerable variability during the execution of the RC action.The angle may occasionally exceed the optimal range, while at other times it may fall short.Subsequently, the accuracy of the model in recognizing RC action can be enhanced by

TABLE VII CLASSIFICATION
PERFORMANCE WITH VARIED TRAINING SETS (TS) ON THE SAME TEST SET

TABLE VIII CLASSIFICATION
PERFORMANCE WITH VARIED TRAINING SETS (TS)ON THE SAME TEST SET consisted of day 1 (D1), day 1 and day 2 (D1+D2), day 3 and day 4 (D3+D4), as well as the combination of day 1, day 2, and day 3 (D1+D2+D3).The model's performance was observed to improve with an increase in the richness of the training set, as shown in TableVII.TableVIIIshows the test comparison results of SVM and SWRF in the case of increasing the training set of subjects.The training and testing data were both sourced from day 3.The data obtained from the subject 4 was utilized for testing.The training data consisted of subject 1 (S1), subject 1 and subject 2 (S1+S2), subject 2 and subject 3 (S2+S3), as well as the combination of subject 1, subject 2, and subject 3 (S1+S2+S3).The model's performance was observed to improve as training set became more enriched, as shown in TableVIII.Subsequently, the model performance can improved by enhancing the diversity quality of the training sets.