Lower Limb Motion Recognition Method Based on Improved Wavelet Packet Transform and Unscented Kalman Neural Network

Exoskeleton robot is a typical application to assist the motion of lower limbs. To make the lower extremity exoskeleton more flexible, it is necessary to identify various motion intentions of the lower limbs of the human body. Although more sEMG sensors can be used to identify more lower limbmotion intention, with the increase in the number of sensors, more andmore data need to be processed. In the process of human motion, the collected sEMG signal is easy to be interfered with noise. To improve the practicality of the lower extremity exoskeleton robot, this paper proposed a wavelet packet transform(WPT-) based sliding window difference average filtering feature extract algorithm and the unscented Kalman neural network (UKFNN) recognition algorithm. We established an sEMG energy feature model, using a sliding window difference average filtering method to suppress noise interference and extracted stable feature values and using UKF filtering to optimize the neural network weights to improve the adaptability and accuracy of the recognitionmodel. In this paper, we collected the sEMG signals of three muscles to identify six lower limb motion intentions. +e average accuracy of 94.83% is proposed in this paper. Experiments show that the algorithm improves the accuracy and anti-interference of motion intention recognition of lower limb sEMG signals. +e algorithm is superior to the backpropagation neural network (BPNN) recognition algorithm in the lower limb motion intention recognition and proves the effectiveness, novelty, and reliability of the method in this paper.


Introduction
Surface electromyography (sEMG) signals are bioelectrical signals recorded from the surface of the muscle through the electrode. It has the advantages of mature acquisition technology, high temporal resolution, and noninvasive recording [1][2][3]. In addition to some significant achievements in medical rehabilitation training, relevant research applications have gradually developed into a wider range of lower limb motion assist areas [4]. e most common lower extremity exoskeleton robots currently include HAL exoskeleton robot [5], MIT exoskeleton system [6], BLEEX lower limb exoskeleton [7], and NTULEE exoskeleton system [8]. e robot can walk horizontally, but it has few motion intention and low flexibility. erefore, identifying more lower limb motion intention is beneficial to improve flexibility and practicability. It can also enhance the user's athletic ability and improve people's quality of life.
Most of the current research is based on sEMG signals to identify multiple motion intentions in the lower extremities. Coelho and Lima extracted eight channels of sEMG signals to identify seven motion intentions for the lower extremities [9]. Toledo-Pérez et al. collected sEMG signals from four muscles of the lower extremities and identified ankle dorsiflexion and flexion [10]. Al-Quraishi et al. extracted the sEMG signal from the four muscles of the lower extremities and identified four motion intentions of the lower extremity ankle joint [7]. Tang et al. collected three channels of sEMG signals and identified three intentions of standing, flexing, and stretching [11]. Ma et al. collected sEMG signals of the rectus femoris (RF), semimembrane (SM), and the sphincter (SR) and identified two intentions of walking and obstacle crossing [12]. Li et al. recorded the sEMG signals of seven muscles of the lower extremities and recognized two motion intentions of the hip and knee joints of the lower extremities [13]. Ai et al. combined acceleration and sEMG signals to identify five motion intentions of the lower extremities [14]. To identify the lower extremity knee, ankle, and hip joint motions, Tapia et al. extracted sEMG signals from sixteen muscles of the lower extremities [15]. Zhang et al. extracted single channel sEMG signals for four motion intention recognition of lower limb knee joints [16]. ese studies did not simultaneously consider accuracy, stability, and realtime.
erefore, we proposed a method of using three electromyographic sensors to recognize six kinds of lower limb motion intention. e process of lower limb motion intention recognition mainly includes feature extraction and motion recognition. For example, some researchers used RMS [17,18], mean absolute value (MAV) [19], autoregressive (AR) [20], variance, and Willison amplitude method to extract surface muscle electrical signal features [21,22]. Some researchers used peak frequency and median frequency analysis [23,24] to convert sEMG signals to the frequency domain and extracted sEMG features.
However, the sEMG signal is easily disturbed by static electricity, muscle fatigue, and friction factors. Traditional feature analysis methods cannot accurately describe the time-varying process and spectrum distribution of the sEMG signal, which leads to low reliability of feature extraction. WPT is a common time-frequency analysis method, which can reflect the energy distribution of the sEMG signal in each frequency band [25]. Gokgoz et al. used the WPT method to extract time-frequency information of myoelectric signals and diagnosed the lower limb neuromuscular diseases. Chen et al. proposed a wavelet packet of local energy (ELF) method to accurately describe the complexity in the local frequency band of myoelectric signals [26]. Ji et al. used discrete wavelet transform to construct a time-invariant multiscale matrix based on wavelet transform coefficients to identify eight motion intentions of lower limbs [27]. However, due to noise interference, the feature extracted by the wavelet packet cannot accurately describe the motion intention of lower limbs. erefore, we proposed a sliding window differential average filtering method, analyzing the feature extracted by wavelet packet transform, suppressing noise interference, and extracting effective feature vector.
In the part of the lower extremity motion intent recognition, SEMG signal has complex nonlinear, strong coupling, and dynamic time-varying features [28]. In the aspect of motion intention recognition, researchers mainly studied the Bayesian network, neural network, multilayer perceptron, fuzzy approximation, support vector machine, and neural fuzzy system identification method [29,30]. Neural network has strong nonlinear approximation ability and the ability to deal with unknown internal mechanism problems [31][32][33]. However, the neural network model needs iterative learning in the training process [34], the convergence speed is slow, and the real-time performance needs to be improved [35,36]. e sEMG signal is susceptible to external environmental influences during the acquisition process, such as sweating, muscle fatigue, electrode offset, and power frequency noise [37,38]. e neural network model lacks stability when the environment changes. erefore, we proposed an unscented Kalman neural network (UKFNN) method for lower extremity motion intention recognition. We used the UKF method [39,40] to train the weight of the neural network to enhance the adaptive ability of the recognition model [41]. Our method improves the reliability, accuracy, and speed of the model.
We extracted sEMG signals from three channels and used the WPT method to extract features. We proposed a sliding window difference averaging filtering method to analyze the time-frequency domain feature, suppress noise interference, and extracted effective feature information. We constructed a UKFNN recognition model to recognize six lower limb motion intentions. Also, we compared the proposed recognition algorithm with the error backpropagation neural network (BPNN) recognition method [42] and evaluated the recognition accuracy of UKFNN.
is paper is structured as follows. e second part described the acquisition of myoelectric signals. e third part introduced the extraction method of sEMG signal features and explained the basic principle of the wavelet packet transform. Also, we proposed a feature analysis method for sliding window difference averaging filtering. e fourth part introduced the design of the UKFNN model. e fifth part gave the experimental results and compared them with the traditional BPNN method. e sixth part gives conclusions and future work.

sEMG Acquisition
Surface electromyography is recorded from the surface of human skeletal muscle through surface electromyography electrodes and contains many feature information related to limb motion. By analyzing these features, we can distinguish the different motion intentions of the limbs. Our goal is to use three sensors to identify six lower extremity motion intentions. We chose six common motion intentions of lower limbs, such as horizontal walking (HW), crossing obstacles (CO), standing up (SU), downstairs (DS), goupstairs (GU), and stop-rest (SR). We analyzed the kinematics and biological features of lower limb muscles [43,44]. e medial gastrocnemius (mg) is helpful for walking and running. e femoral muscle (VL) and the semitendinosus (ST) have the function of flexing the knee joint and stretching the hip joint [45]. erefore, we selected three muscles as the source of sEMG signal acquisition initially, as shown in Figure 1.
We used three sEMG sensors to identify six lower limb motion intentions. e six motion intentions were HW, CO, SU, DS, GU, and SR, as shown in Figure 2.
We used the RMS method to calculate the changing trend of the sEMG signal of three muscles in six motion intentions, as shown in Figure 3. LG MG Figure 1: sEMG signal sensor location. Channel A is located in the thigh semitendinosus, channel B is located in the lateral thigh muscle, and channel C is located in the calf gastrocnemius.  It can be seen that the selected three muscles have obvious signal changes during the motion of the lower limbs. e changing trend of sEMG signals in three channels of a motion mode is the same. However, the trend of sEMG signal changes in six motion intentions is different. is is helpful to distinguish different motion intentions and further verifies the correctness of the selection of sEMG signal acquisition location.
We used the sEMG sensor developed by Biometrics, UK. e sampling frequency is 2000 Hz, and the input impedance of the amplifier is more than 10,000,000 m ohms. Highquality signals can be obtained without adding conductive adhesive to the skin. Simply attach the electrode strip to the three muscles using medical double-sided tape and record the surface myoelectric signal. e experimental computing platform processor is Intel(R) Core(TM) i7-9750H CPU@ 2.60 GHz, the memory is 16G, and the data analysis software is Matlab, 2015b.
We selected five healthy subjects to participate in the experiment, five men aged 23, 23, 25, 26, and 24 years, with a body fat rate of 17 ± 3% and a height of 170 ± 5 cm. Healthy subjects circulate in the form of "relaxation-motion-relaxation" for each motion, completing six motion intentions. Each motion is limited to two seconds. We collected sEMG signals from six intentions of lower extremity motions per subject.

sEMG Feature Extraction Method
e acquired sEMG signals have nonperiodic, nonstationary, and nonlinear chaotic features. We need to extract stable eigenvectors from myoelectric signals. erefore, this paper used the wavelet packet transform analysis method, to describe the complex sEMG signal by an energy method. We proposed a sliding window difference average filtering method which can suppress the noise interference and extract the effective sEMG eigenvector.
(1) e research shows [26] that the sEMG signal should be decomposed into three layers. e decomposition structure is shown in Figure 4. (2) We used wavelet decomposition coefficients to reconstruct the signal and analyzed all nodes in the third layer. e raw signal can be restored to (3) Define wavelet packet energy as E i j , the coefficients of wavelet packet decomposition as f i j (t), and the constructed feature vector as [E j , E j−1 , ..., E 1 ]: where i � 3 represents the scale and j � 8 represents the node. (4) Normalizing the energy of eight nodes:

Wavelet Packet Transform.
e energy value of WPT can represent the changing trend of complex sEMG signals. e steps of the wavelet packet energy feature extraction algorithm are as follows. Figure 4: ree-layer wavelet packet decomposition tree, where S is the raw signal, A represents a low-frequency signal, and D represents a high-frequency signal. e number indicates the number of layers of the wavelet decomposition. We extracted the signal features of the third layer, a total of eight frequency components.

Mother Wave Function Selection.
Selecting different wavelet packet basis functions will get different eigenvalues, which will directly affect the recognition accuracy of lower limb motion intention. It is very important to select the appropriate basis function for extracting features. e energy feature values obtained by the wavelet packet transform should contain enough information on the raw signal to ensure the recognition accuracy. e larger the wavelet coefficient is, the similar the base function waveform is to the raw signal. Hence, selecting a basis function with high similarity to the raw signal contributes to the extraction of features. As shown in Figure 5, the raw signal is nonstationary and nonperiodic, with strong tightness.
We observed the wavelet packet basis function waveform in Figure 6. We can see the waveforms of sym3, sym5, cmor1-1.5, and the waveform of the myoelectric signal are different, and local performance is poor. e Harr wavelet is not continuous in the time domain and is not suitable for sEMG signal feature extraction. e attenuation rate of db8, db10, coif3, and fk22 is slow. It is easy to ignore the small change information in the raw sEMG signal [46]. e waveform of the dmey wavelet is similar to the raw sEMG signal, which has strong compactness and fast attenuation performance. erefore, using the dmey wavelet to extract feature values is beneficial to improve the recognition accuracy of motion intention.
To extract the raw signal features of sEMG accurately, the wavelet packet basis function is with the maximum energy value in all motions. As shown in Figure 7, the average energy value of the dmey wavelet packet basis function is the highest, which further verifies the correctness of the wavelet packet basis function selection.

sEMG Feature Selection.
At present, most studies choose the maximum absolute value of wavelet coefficients as the eigenvector of sEMG signals [25,26]. However, in different motion intentions, the amplitude of the sEMG signal on the same muscle is different. Choosing wavelet coefficients as eigenvalues cannot accurately reflect the motion intention. We used the wavelet packet to decompose the sEMG signal, normalizing the complex sEMG signal to different frequency bands, and analyzed the energy values of the projection sequences in each band. We used a three-layer wavelet packet to decompose the sEMG signal of the gastrocnemius, as shown in Figure 8. Also, we calculated the sEMG signal energy eigenvalues of three muscles in six motions, as shown in Table 1.
Observing the wavelet packet energy values of each node in Table 1, we analyzed the energy distribution of six motion intentions of the same muscle and the energy distribution of three muscles in the same motion mode. It can be concluded that the energy values of AAA 0 , DAA 1 , ADA 2 , and DDA 3 are significantly different from those of other frequency bands, as shown in Figure 9. erefore, we chose four subband energy values as eigenvectors. e eigenvector for each motion is twelve dimensions. We have extracted the 12dimensional eigenvectors and built a feature model to analyze the eigenvectors, as shown in Figure 10.
Considering that sEMG signals are susceptible to noise interference during motion, such as sweating, friction, and electrode deflection, as shown in Figure 11, the sEMG signals of different muscles fluctuate aperiodically [37,38].
We have built a feature model containing the interfering signals, as shown in Figure 12.
It can be seen from Figure 12 that the feature model of different motion intentions including interference signals is a periodic signal. But they have different peaks and troughs in the same period. We calculated the eigenvector to suppress the interference of noise. As shown in Figure 13, we set the width of the sliding window as M � 2 and the sliding step size as D � 4. Get three window feature values. We calculated the difference between the maximum value and the minimum value of the energy feature in each window and calculated the average values of the three differences.
We calculated and analyzed the difference average for each motion, as shown in Table 2.
rough the proposed sliding window difference average filtering algorithm, we calculated the eigenvalue in Figure 12 and analyzed the results of different noise interferences, as shown in Table 3. erefore, we can set a threshold. If the difference average of eigenvalues is greater than 90, it can be judged that the sEMG is interfered with noise. We extracted feature vector by judging the threshold and removed the disturbing feature vector.
Our proposed sliding window difference average filtering method suppresses the interference of noise and extracts a stable feature vector. e 12-dimensional feature vector filtered by the sliding window difference average can be the input of the UKFNN to improve the reliability of the recognition model.

Recognition Using UKFNN
In the lower limb motion intent recognition algorithm, because the neural network has a strong nonlinear fitting ability, it is widely used in the modeling and optimization of the motion intention recognition process [33]. However, the lower limb sEMG signal has complex nonlinearity, strong coupling, and dynamic time-varying features during motion. e signal is susceptible to noise such as sweating, electrode offset, and power frequency interference [37,38]. is leads to a lack of stability in the neural network model. Using UKF filtering for neural network learning can enhance the adaptive ability of the model and raise the accuracy of the model. Especially when the number of samples is increasing, it can speed up the convergence of the model [40]. erefore, we used the UKFNN algorithm [41,[47][48][49] to recognize the motion intention of lower limbs. We used the UKF algorithm to optimize the weight of the neural network, which can adapt to noise interference.
As shown in Figure 14, the UKFNN structure is a threelayer neural network. e input of UKFNN is an N-dimensional eigenvector, and the input in Figure 14 is defined as X: e output of the UKFNN network in Figure 14 is defined as Y: Mathematical Problems in Engineering Y � y 1 , y 2 , y 3 , . . . , y m .
We calculated the number of intermediate layers in Figure 14 from the following equation: where n represents the number of network input nodes. e extracted sEMG signal feature vector is n � 12, where m represents the six motion intention output prediction results of the lower limbs and l is a constant greater than 1 and less than 10. We used the UKF filtering algorithm to correct the threelayer neural network connection weights. e input to the neural network is X, constructing the state equation of the UKF filtering algorithm with the weight of the neural network.
e output of the neural network is taken as its measurement equation. erefore, the state equation and measurement equation of the UKF algorithm are as follows: where w k is the weight, x k is the input vector, y k is the output of the neural network, and f k is the transfer function of the neural network. And ω k and v k are the input noise and measurement noise of the neural network. All obey the mean value of 0, and the variance is the normal distribution of R W and R V .

Experiment Results and Discussion
In the process of extracting the features of the sEMG signal on the lower limb surface, we used the WPT algorithm and selected the best mother wave to extract the sEMG signal features. We analyzed the obtained distribution of features and determined the eigenvectors as AAA 3 , DAA 3 , ADA 3 , and DDA 3 . We established a feature model for different motion intentions, as shown in Figure 10. Considering that during the motion of the lower limbs of the human body, the sEMG signal will be affected by noise. e extracted features containing noise interference are different from the features in the motion, as shown in Figure 12. erefore, this paper proposed a sliding window difference averaging filtering method, verifying the feature model to extract stable eigenvectors, as shown in Figure 13.
In the recognition of lower limb motion intention, this paper designed the UKFNN algorithm, using the UKF filtering algorithm to establish a neural network state-space model and measurement model, optimizing the neural network weight vector, and solving the problem that the neural network has slow convergence speed and poor   Mathematical Problems in Engineering 9 adaptability to noise interference in the model training process. is paper constructed a 3-layer neural network, as shown in Figure 14. e input is a twelve-dimensional eigenvector, and the output is the predicted result of six motion intentions. e transfer function selected by the hidden layer is a nonlinear unipolar excitation function as Sigmoi d.
e output layer transfer function selected a linear function as Purelin, which can output an arbitrary value. e number of middle layer neurons is calculated by formula (7) to be 5 ≤ p ≤ 14. en, we verified through experiments that the number of middle-tier nodes is 14. e dimension of the UKFNN algorithm weight variable is 183.
We collected 600 sets of samples and divided that into training sets and testing sets, respectively, 480 sets and 120 sets. Both training sets and testing sets contain six motion data for five subjects. We trained the model with 480 sets of data. We selected each subject's own 24 testing sets to verify the accuracy of six lower extremity motion intention. We verified a total of five subjects. e lower limb motion recognition accuracy was defined as the ratio of the number of correct recognition results of each move to the     number of corresponding motion in the testing sets. e recognition accuracy is shown in Figure 15. e average accuracy of the UKFNN model is 94.83%. e average accuracy of the BPNN model is 90.8%. e minimum accuracy of the UKFNN model is 91.33%, and the accuracy of the BPNN model is 88.16%. It is concluded that the average accuracy of the UKFNN model is higher than the BPNN model.
Also, robustness is one of the important parameters to evaluate the performance of the algorithm, so we calculated the standard deviation based on the results of Figure 15 as an evaluation of robustness. As can be seen from Table 4, UKFNN is more robust than BPNN.
To graphically describe the distribution of the accuracy, a box plot is drawn, as shown in Figure 16. According to Figure 16, the accuracy rate of the UKFNN is higher than that of the BPNN, and the dispersion of the UKFNN is smaller than that of the BPNN. Tables 5 and 6 show the results of motion intention recognition accuracy of the UKFNN model and the BPNN model for five subjects with six lower limb motion intentions.
In the UKFNN algorithm, the highest average accuracy is the go-upstairs (GU) motion, with 97.8%. e lowest average accuracy is stop-rest (SR) motion, with 88.8%. In the BPNN algorithm, the highest average accuracy is the go-upstairs (GU) motion, with 94.6%. e lowest average accuracy is horizontal walking (HW) motion, with 87%. Experiments show that the accuracy of the UKFNN model is more stable than the BPNN model.
Besides, the anti-interference of the model is an important factor affecting the control performance of the lower extremity exoskeleton. Considering that the sEMG signal is susceptible to noise interference, we tested the collected noise sEMG signals (interference 1, interference 2, and interference 3) and verified the ability of the UKFNN model to track sEMG signals. As shown in Figure 17, under different interference conditions, the UKFNN model can still track the change of features in real-time.
We calculated the root mean square error of the model as metrics to evaluate the reliability of the model, as shown in Table 7. It is proved that the UKFNN model has a stronger anti-interference ability than the BPNN model.
We found that different numbers of sEMG signal feature samples affect the motion intention recognition accuracy and real-time. We collected another 600 sets of data for testing and using different numbers of testing samples, namely, 100, 200, 400, and 600 samples, to test the UKFNN model and the BPNN model. e result is shown in Table 8.
It is proved that the samples increase and the accuracy of the BPNN and the UKFNN model will also increase. In the process of sample size change, the UKFNN model has higher accuracy, stability, and real-time performance than the BPNN model.
When the user is wearing the lower extremity exoskeleton, it is necessary to avoid the wrong recognition of human motion intention by the lower extremity exoskeleton robots. e confusion matrix is an important evaluation method of model accuracy and reliability. It can count the      number of errors in the model recognition results and the correct number and also can analyze the correlation between different motion intentions of the lower limbs. In this paper, 400 sets of testing samples are selected to calculate the confusion matrix of six lower limb motion intentions and verified the accuracy of the method. Table 9 is the confusion matrix of the UKFNN model. e stop-rest (SR) motion intention has the lowest accuracy (88.8%). It is easy to misjudge the down-stairs (DS) motion intention, and the false-positive rate is 5.1%. Table 10 is the confusion matrix of the BPNN model. e horizontal walking (HW) motion intention has the lowest average accuracy (87%). It is easy to misjudge the motion intention of go-upstairs (GU), and the false-positive rate is 6.5%. We selected 600 testing sets to verify the sensitivity of the model. Table 11 shows the sensitivity metrics of the UKFNN model and the BPNN model. e UKFNN model has a higher sensitivity. It is proved that the UKFNN model has a lower false-positive rate, and accuracy and reliability are better than the BPNN model.
We used three myoelectric sensors to identify the six motion intentions of the lower extremities. Also, we       compared the results of previous studies to demonstrate the advancement of our recognition algorithm, as shown in Table 12. In these studies, most researchers used more sEMG sensors to identify more lower extremity motions. It can be seen from Table 12 that at least four muscle sEMG signals need to be acquired to identify five lower limb motion intentions. However, we only need three sensors to identify six lower limb motion intentions, and the accuracy reaches 94.83%.

Conclusion
We proposed a lower limb motion recognition method based on improved WPT and UKFNN. We analyzed the distribution of features and established a feature model. And we proposed a sliding window difference averaging filtering method to verify the eigenvalues and suppressed the interference of noise. en, we used UKF filtering to optimize the neural network weights to improve the adaptability and accuracy of the recognition model, and we used the UKFNN model to identify the six motion intentions of the lower limbs. e results showed that the method has achieved good results and the average accuracy was 94.83%. rough the noise interference tests, it was verified that the model has the anti-interference ability. Also, under the fluctuation of the sample size, the UKFNN model has achieved better results in recognition accuracy and real-time performance. Also, the confusion matrix calculated that the UFKNN model has a low falsepositive rate and the performance was better than the BPNN model. It showed that the method was advanced, reliable, and practical. erefore, our proposed new method was suitable for the recognition of complex motion intentions of lower limbs. It is beneficial to realize the wide application of the exoskeleton robots to assist the lower limb motion. In the next step, the paper will increase the types of lower limb motion intention recognition, improving the recognition accuracy of lower limb motion intention.

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 there are no conflicts of interest.