Estimation of Continuous Joint Angles of Upper Limb Based on sEMG by Using GA-Elman Neural Network

,e estimation of continuous and simultaneous multijoint angle based on surface electromyography (sEMG) signal is of considerable significance in rehabilitation practice. However, there are few studies on the continuous joint angle of multiple joints at present. In this paper, the wavelet packet energy entropy (WPEE) of the special subspace was investigated as a feature of the sEMG signal. An Elman neural network optimized by genetic algorithm (GA) was established to estimate the joint angle of shoulder and elbow. First, the accuracy of the method is verified by estimating the angle of the shoulder joint. ,en, this method was used to simultaneously and continuously estimate the shoulder and elbow joint angle. Six subjects flexed and extended the upper limbs according to the intended movements of the experiment. ,e results show that this method can obtain a decent performance with a RMSE of 3.4717 and R2 of 0.8283 in shoulder movement and with a RMSE of 4.1582 and R2 of 0.8114 in continuous synchronous movement of the shoulder and elbow.


Introduction
Hemiplegia is a motor dysfunction caused by nerve damage [1,2]. Clinical treatment for hemiplegic patients is mainly treated by one-to-one manual treatment by therapists [3]. is approach is time-consuming and cannot be quantified and objectively evaluated. erefore, a new and efficient rehabilitation therapy is urgently needed to make up for the shortcomings of traditional rehabilitation training. Robots are used to participate in rehabilitation training, freeing therapists from major physical work, monitoring and evaluating the training process, and developing better rehabilitation programs for patients. e effect of rehabilitation has been greatly improved [4][5][6].
Surface electromyography (sEMG) signals can reflect neuromuscular activity to a certain extent, and its collection process is convenient and harmless to the human body. It can adapt to the particularity of the physiological condition of hemiplegic patients. erefore, it becomes one of the most vital signals that can directly reflect the intended movement of the human body. It is used as a tool to indicate the body's paralysis of the arm all the time [7].
Many researchers use forces, torques, and angles estimated from SEMG signals to predict movement, thus driving the upper limb movement of the rehabilitation device [8][9][10][11]. In the rehabilitation system, the movement intention of the human body must be continuously recognized from sEMG. Robots can match human intentions to perform effective assistance. Pan et al. [12] extracted the stationary component of sEMG and used the time domain feature set to characterize sEMG. Linear discriminant analysis classifier and state space model are used for action classification and angle estimation. Han et al. [13] integrated forward dynamics into the HMM and used the extended HMM to directly estimate the joint motion state. Zhang et al. [14] used principal component analysis and independent component analysis to decompose sEMG mode, respectively. e artificial neural network was used to continuously estimate four joint angles of shoulder joint and elbow joint at the same time. Huang et al. [15] proposed a Gaussian mixture model for clustering to achieve the purpose of divide and conquer in the simultaneous control of hand and wrist movements. Xiao et al. [16] proposed a multidelay feature signal of surface EMG and used random forest to improve the estimation of joint angle accuracy. Ding et al. [17] proposed a redundant segmentation method based on association.
ey established a state space frame of the motion model to estimate the angle of multiple joints. Liu et al. [18] established a nonlinear autoregressive exogenous model based on myoelectric signals to continuously estimate angles of shoulder, elbow, and wrist motions. However, the performance of the motion estimation in these documents is still unsatisfactory. Although the model structure is optimized, the training model process is complicated and the calculation amount is large [13,17]. In other literature, the model is simple and does not adjust the model structure to improve performance. erefore, this paper uses the Elman neural network with feedback. Considering that the BP algorithm is easy to fall into local optimization, genetic algorithm (GA) to optimize Elman is used.
ere are still some difficulties in synchronous motion intention recognition of shoulder and elbow joints. e movement of the shoulder and elbow is more extensive. And in the extensive movement of the upper limb, there are many changes in the shoulder and elbow. erefore, it is more meaningful to estimate the degree of freedom of shoulder joint and elbow joint continuously at the same time.
In this study, we studied the feature method of wavelet packet energy entropy for specific subspaces to alleviate the redundancy problem of adjacent subspaces. For proportional control of shoulder and wrist movements, GA-Elman is used to improve prediction accuracy. e sEMG signals and upper limb movements are recorded during various dynamic processes. In the continuous movement of the shoulder, the feature method and proportional control strategy are discussed and verified to improve the prediction accuracy. e reliability of using this method is discussed in shoulder and elbow synchronous continuous motion.

Data Acquisition.
Six healthy subjects (three males and three females, age 22-28, height 160-180 cm, weight 48-70 kg) were enrolled in this study. ey are right-handers. All the subjects read and signed an informed consent form approved by an institutional review board. Before the experiment, everyone was asked to practice as expected to adapt to the equipment until they felt comfortable. In this experiment, Trigno Wireless System (Delsys Inc, Natick, MA, USA) was used to record sEMG signals at a sampling frequency of 1600 Hz. e real angle measurement of shoulder and elbow joints is based on the Codamotion System (Charnwood Dynamics Ltd, UK), which is an active optical motion capture system introduced. e frequency of the acquisition angle is 200 Hz. e average subsampling processing method was used to make the frequency the same. Before collecting sEMG, the muscle surface of volunteers was wiped with alcohol. And the sensors were attached according to the standard manual. We selected eight muscle channels, which in order are biceps brachii, triceps brachii, deltoid (anterior), pectoralis major, deltoid (middle), brachioradialis, trapezius, and teres minor muscle. e sEMG sensors were placed over eight muscles and the markers of Codamotion were set over shoulders and elbows, as shown in Figure 1.
During the experiment, the subject sat quietly in the chair. e subject's right arm hanged naturally and the right hand relaxed. All movements started from where their arm fell naturally and returned to this position after the action was completed. e initial state is shown in Figure 2(a). e experimental movement is shown in Figure 2. In Figure 2(b), subjects were asked to touch their right shoulders in a direction perpendicular to the human body with their right hand. In Figure 2(c), the subject was required to lift the right arm as much as possible in a direction perpendicular to the human body. In Figure 2(d), the subject was required to lift the right arm as much as possible in the horizontal direction of the human body. After each movement, the right arm returned to the initial position. Each subject's four movements were performed in 10 s in sequence, and each subject performed a total of 120 groups of movements. Each experiment was timed with a stopwatch to ensure that one experiment was completed in about ten seconds. e experiment was completed in six days. Each group completed 20 experiments per day. To ensure that the results were not affected, the experimental environment was the same every day. e subjects rested for 10 s to reduce the effects of muscle fatigue after completing a group movement.

Data Processing.
e raw signal was denoised using a wavelet transform. Wavelet packet transform has good signal decomposition ability. erefore, a sEMG feature extraction method was studied based on that. Wavelet packet transform decomposes the low-frequency part and the high-frequency part of the subspace at the same time, which has better time-frequency localization analysis ability than the wavelet transform [19].
Six-layer wavelet packet decomposition is performed on eight-channel sEMG signals, and db4 wavelet was chosen as the wavelet base. e raw sEMG signal is very weak, and its energy is mainly distributed in the frequency range of 10-500 Hz [20,21]. Extracting the signal features in the 25-400 Hz band can filter out the high-frequency noise and unnecessary low-frequency information [22].
ere is a different degree of information redundancy between adjacent subspaces [23], due to the proximity of frequency. erefore, the entropy characteristics of nonadjacent subspace P j i (i is the i-th wavelet packet decomposition. j is the j-th subspace of the i-th layer) are selected in this paper. We extracted the wavelet packet energy entropy (WPEE) in the 25-400 Hz (P 2 6 : 25-50 Hz, P   . e raw signal is from brachioradialis muscle which mainly acts on elbow joint movement.

Structure of Elman Neural Network.
e general Elman NN has four layers: the input layer, the implicit layer, the bearing layer, and the output layer. e block diagram of Elman NN is shown in Figure 5. Its input node is 32, hidden node is 20, and output node is 1. e bearing layer of the Elman NN preserves the output of the hidden layer at the previous moment and then adds it to the input of the hidden layer at the next moment [24]. is self-connected mode can make the network have the memory function and sensitivity to the historical data, so it can model dynamically and strengthen the ability of the network to process the dynamic information.

Genetic Algorithm (GA) eory and GA-Elman.
BP algorithm is easy to fall into local minima [25]. Genetic algorithm (GA) can alleviate this problem. e fuzzy roulette wheel selection and a new mutation operator method in genetic algorithm were used to avoid falling into the optimal local problem [26]. e GA is chosen to train the parameters of Elman neural network (GA-Elman NN) model. Starting from any initial population, GA generates a new group of individuals through random selection, crossover, and mutation operations. It has evolved the population into areas that are getting better and better in the search space. In this way, after a generation of genetic optimization, the optimal solution is finally obtained. e flowchart of optimizing Elman neural network with GA is shown in Figure 6. e sEMG signals need to be preprocessed before network training. In GA-Elman NN, the parameters of the Elman NN are first initialized to determine the initial parameters and optimization goals of the genetic algorithm. en, the initial weights and thresholds of the Elman NN are genetically encoded, the fitness values of individuals in the population are calculated, and genetic operations such as cross-mutation are selected. Next, it is judged whether the optimal weight and threshold are obtained. If obtained, the Elman NN is trained using optimal weights and thresholds. If not obtained, multiple genetic manipulations are performed until they are obtained.  Figure 6: Flowchart of GA-Elman algorithm.

Mathematical Problems in Engineering
Elman NN training is performed again. Finally, the Elman NN training gets the training error that satisfies the condition, and the whole method ends. e parameters of GA-Elman are obtained according to a large number of experiments [26]. GA-Elman can be regarded as an adaptive system without manual intervention [27]. It can automatically adjust the connection weight and structure and realize the integration of GA and Elman. According to the relationship between the sEMG and the movement of the shoulder joint and the elbow joint, we use sEMG eigenvector as input of Elman NN, and shoulder joint angle and elbow joint angle were used as the output of the neural network.
rough the construction and training network, the mapping relationship between sEMG and the joint angle signal is established.

Results and Discussion
All assessments were based on data from 6 healthy subjects. K-fold validation (k � 6) is adopted, with 1 out of k repetitions of each movement as the test set and the rest as the training set. In this discussion, the angle estimation results of the shoulder joint are used to verify the accuracy and superiority of the method.
In this paper, average root mean square error (RMSE) and average coefficient of determination (R 2 ) are used to evaluate the estimation performance. e RMSE is calculated as follows: where N is the length of the joint angle, y n is the predicted joint angle, and y n is the real joint angle. R 2 is calculated as follows: where y n is the real joint angle, y n is the mean of y n , and y n is the estimated joint angle. R 2 is between 0 and 1. e closer to 1, the better the regression fitting effect. It is generally believed that the model with a fit of more than 0.8 has a higher degree of goodness of fit.

Estimation of Shoulder Joint
Angle. e GA-Elman network of upper limb shoulder movement was established for each subject. e comparison of the estimated shoulder joint angles and the actual shoulder joint angles of one subject by using GA-Elman with Feature A and Feature B is shown in Figure 7.
As can be seen from Figure 7, the fitting result using Feature A is better. Table 1 shows the average RMSE and R 2 of six subjects using Feature A (F.A) and Feature (F.B). It can be seen from Table 1 that R 2 of Feature A is higher than Feature B which indicates that Feature A has a better performance.

Mathematical Problems in Engineering
Taking one subject as an example, Figure 8 is the comparison of the actual shoulder joint angles and the estimated shoulder joint angles by using Feature A with GA-Elman, Elman, and GA-BP, respectively. Figure 9 shows the average RMSE and R 2 of different neural networks.
It can be seen from Figure 8 that prediction results of GA-Elman are the best. It can be seen from Figure 9 that GA-Elman has the lowest RMSE and highest R 2 . Comparing the three neural network prediction results shows that GA-Elman performance is best. By analysing the     error curve and fitness curve in the prediction process, GA-Elman showed the best performance. Figure 10 shows the network training error curves for different neural networks. Figure 11 is the fitness curve for two neural networks. e error continuously decreases until the target network training error is reached during the training process. Figures 10(b) and 10(c) show that the Elman NN error has a downward trend. However, the smallest errors are still higher than the error of GA-Elman.
As can be seen from Figure 11 with the increase of evolutionary algebra, the fitness of GA-Elman and GA-BP has decreased. e fitness of GA-Elman decreased rapidly during the 0-5 evolution. e fitness afterward did not change much. is shows that the error of GA-Elman is smaller during the evolution process. e estimated results are also more accurate.
e above conclusions show that GA-Elman is superior in both the prediction process and the prediction results. Figures 12 and 13 show the average RMSE and the average R 2 for every subject.
It is shown in Figures 12 and 13 that GA-Elman exhibits excellent estimation performance in each experiment of subjects.
e average RMSE of the B subject reaches the lowest, which was 2.95. e average R 2 of the D subject reaches the highest, which was 0.87.

Estimation of Shoulder and Elbow Joints.
e GA-Elman with Feature A estimates the continuous angle of the shoulder and elbow joints simultaneously and compares with the GA-BP and Elman neural networks. Table 2 shows the estimated RMSE and R 2 .
As can be seen from Table 2, the GA-Elman has the lowest RMSE and the highest R 2 , which shows that the prediction model also has the best performance for simultaneous continuous estimation. e estimated performance trends for the three models are consistent for the same subjects which indicate that the model does not differ from the individual. Compared with Table 1, Synchronous estimation is less effective than single joint estimation. But synchronization estimates are not bad. e highest R 2 is 0.7723 and RMSE is 7.1421 in synchronous estimation by using GA-Elman with Feature A.
So far, the reliability of the joint continuous motion estimation framework based on SEMG signals has been proved. e framework we introduced shows three comparative advantages. First, the selection of a specific subspace

Conclusions
In this paper, aiming at the rehabilitation training of patients with hemiplegia, the Elman neural network optimized by GA is proposed to predict the shoulder and elbow joint angle. e WPEE of the specific subspace is used to represent the sEMG as the input of the neural network. e results show that the method in this paper is effective for estimating the shoulder and elbow joint angle of the upper limb. In comparative experiments, it showed the best performance. However, the comparison of Tables 1 and 2 shows that the predictive performance of synchronous continuous motion is lower than that of single joint motion because of the effect of muscle synergy. In future work, to better improve the estimation performance, the impact of muscle synergy will be considered during synchronous exercise.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.