Real-Time Human Intention Recognition of Multi-Joints Based on MYO

Hill musculoskeletal model (HMM) is commonly used to estimate human motion intentions. HMM utilizes electromyography (EMG) signals as the nonlinear model input to obtain muscle forces or torques. However, due to the fact that it contains many physiological parameters that are difficult to measure, HMM is generally applied in simple continuous intention estimation of a single joint. In this work, we aimed at recogonizing shoulder and elbow joints angles and their angular vecocities continuously in real time. Firstly, we used MYO armband as the EMG sensor. Then, a reasonable prediction model was deduced based on HMM and human dynamics to realize online continuous recognition of the four angles and angular velocities of shoulder and elbow joints. Nonlinear autoregressive with external input neural network (NARX) replaced the prediction equation. In addition, the framework of state space model was completed by constructing an observation equation. Thus, the closed-loop characteristic was realized to eliminate the influence of cumulative error and ensure good estimation performance. Experimental results verified the feasibility and accuracy of the algorithm. For predefined trajectory and random trajectory seperately, the RMSE were 0.955 and 1.15 (degree) for angles estimation and 2.8, 3.40 for angular velocities (degree/s). Compared with the normally used back-propagation neural network (BPNN), the method proposed in this paper obviously got more accurate and smooth results.


I. INTRODUCTION
Nowdays, intelligent robots that assist human in situations of daily life have always been among the most important visions in robotic research [1], [2]. The HRI (Human-Robot Interaction) does matter in the application of wearable assistive robots, such as rehabilitation exoskeleton, power-augment exoskeleton and intelligent prosthesis that contact with human body directly, because the key performance relies on the stability and nature HRI to ensure the subject's safety and comfort [3], [4]. The uncertainty of human activities must be taken into account because the human-in-loop control mode may cause many uncertainties that make an impact on control effect. Therefore, the recognition of MI (Motion Intention) is an important part of HRI and it performs an upper layer in intelligent robot control system as figure 1 shows. As the upper-level control layer, the intention recognition layer analyzes the motion intention of the human body, generates corresponding command signals and transmits them to the lower-level controller, so as to achieve a 'friendly' HRI.
The associate editor coordinating the review of this manuscript and approving it for publication was Kemal Polat. The MI can be explained as the human states of motion, such as the current step or specific physical motion information. It is still worth studying to get the effective information of human movement reasonably and accurately.
MI is usually defined as discrete or continuous modes. The discrete mode divides the human motion into several specific categories according to the target demand, and classifies the action into certain categories by characteristic data [5], [6]. Researchers may design different control strategies for each VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see http://creativecommons.org/licenses/by/4.0/ class of state, the intent estimation plays a role of controller switching at this circumstance. However, some problems may be met in the discrete pattern. Only limited number of motion can be classified, which makes it difficult to provide a rational control scheme when dealing with a complex situation. As for continuous motion mode, it could detect the condition information of the user in real time, such as the joint moment or the joint angles that can change at every step. During our research, it is suitable to use a continuous MI to translate human intention into control signals with time continuity, which serve as the upper control command to guide the robot movements. Normally, kinematics, dynamics and EMG signals can be the sources to estimate the MI. Force or position signals are commonly used in current commercial products [7], [8], but they usually hide the subjective initiative of human motion. In the face of relatively complex motion conditions or with an accelerated motion speed, it is difficult to ensure the desired accuracy and response speed. In essence, these signals have hysteresis characteristics so that cannot be consistent with movement. Fortunately, using EMG or EEG (Electroencephalo-graph) signals prior to the generation of motion can make up for the delay of the control system. Besides, they can reflect the subjective initiative of the human body to a certain extent. The generation of EEG is prior to the occurrence of EMG signals and motion but current methods of EEG acquisition, analysis and processing are relatively immature [9]. The generation of EMG also precedes movement. There are two acquisition approaches [19]. One is to insert needle electrodes into muscle for detection. This kind of EMG signals have small interference, good localization and are easy to be recognized. The other is to detect the EMG of human skin through surface electrodes. This method is prone to interference, while it is widely used because of its simple operation and non-invasive characteristics. Some studies have established the relationship between EMG and human joint angle, force or torque to observe human motion intention.
Estimating joint torque through musculoskeletal model is a widely used method. Firstly, the muscle activities are extracted from the original EMG signals, and muscle contractile force is calculated using the HMM, and the geometric model of skeletal muscle is applied to calculate the moment arm [10]. However, this model is very complex and involves a large number of unknown physiological parameters, which makes the analysis and application rather difficult, so only a few DOFs (Degree of Freedom) (1 or 2) of human joints have been successfully analyzed by the model [16]. For the reason that the model contains some complex human physiological parameters which are difficult to measure, [11] minimized the difference between muscle torque and reference torque by offline optimization. Reference [12] proposed a minimum neuromusculoskeletal model for the prediction of elbow and shoulder torque, and compared the linear optimization method with the non-linear method based on genetic algorithm.
Another estimation approach is to use the neural network to generate the network model by taking the electromyographic signal as the network input and the joint angle or torque to be predicted as the network output. This is a relatively direct and convenient way. After processing the original EMG signals by passing a low-pass filter, computing the root mean square and normalization, [13] used BPNN to identify the relationship between shoulder joint angles and EMG signals. Although it has been applied in many studies, there are still some problems in the prediction of using neural network at present. The online prediction output of the neural network is completely determined by training data. However, EMG is a typical unstable real-time signal, and there is inevitable deviation between test data and offline training data.
This paper proposes an algorithm to estimate four angles and angular velocities of shoulder and elbow joints. The chapters are arranged as follows. In section 2, the research targets and problems are clarified, and the MYO armband used in the experiment is briefly introduced. Section 3 deduces the state space model of the intention estimation based on HMM, and obtains the specific forms between EMG, kinematics signals and joint angles, in which a NARX neural network is constructed as the state model and BPNN serves as the measurement model. Besides, due to the coupling relationship between the signals of MYO channels, we classify the 8 channels based on correlation analysis as the input of prediction equation and measurement equation respectively. Experiments are presented in Section 4, in which a motion capture system is used to make contrast with the estimation results to verify the hole algorithm. Section 5 gives the conclusion and discussion.

II. PROBLEM RESTATEMENT A. ESTABLISHMENT OF COORDINATE SYSTEM
The MI should accurately and completely reflect the information of the user's direction, position and so on. As the upper control layer, the estimation algorithm transmits the torque, position and other information to the middle or the lower controller to perform corresponding actions. As for the upper limb of human body, we simplify the right arm into a 2-link structure, in which the shoulder joint is a ball-and-socket joint with 3 DOFs, and the elbow joint has a single rotation DOF. As figure 2 shows, the shoulder joint A is the origin, B and C are the elbow joint and the wrist seperately. The intention is defined as 4 joint movements including an elbow angle θ 1 and shoulder joint angles θ 2 , θ 3 , θ 4 and their velocities. The direction shown in the figure 2 is positive. The motion capture system will be used as the standard value of the joint angles and angular velocities for initial network training and for comparing estimated accuracy. The angles are as follows:  where l 1 , l 2 are the length of the two segments, (x A , y A , z A ), (x B , y B , z B ) and (x C , y C , z C ) are the coordinates of point A, B, C seperately. Therefore, . The state to be estimate is expressed as x k = [θ 1 , θ 2 , θ 3 , θ 4 ] T at the sample time k.

B. ANATOMICAL ANALYSIS OF HUMAN UPPER LIMBS
The unilateral upper limb is composed of 32 pieces of skeleton, 34 muscle groups and tendons that connect the bones [14]. Figure 3 represents the main acting muscle groups (Trapezius, Acromion of scapula, Deltoid, Insertion of deltiod, Triceps brachii and Biceps brachii) when moving the arm. The shoulder joint consists of the head of the humerus and the articular cavity of the scapula, which can realize the rotation movement around 3 axes (coronal axis, sagittal axis and vertical axis), as well as the up-down and backward-forward extension movement. For the convenience of research, it is usually simplified as an articulatio cotylica. The elbow joint is a hinge joint which is in fact made up of 2 joints, both of which are enclosed in a joint capsule and are essential to connect the forearm and the upper arm [14].
Joint movement is the result of contraction or extension of the corresponding muscle groups. During the experiment and the actual use, it is impractical to measure EMG signals of all contributed muscles, which may need lots of sensors. Therefore, we use the MYO armband that can acquire EMG  data from contributing muscle groups when wearing it on the upper arm. These muscles are associated with the movement of both two joints at the same time.

C. INTRODUCTION OF THE MYO ARMBAND
MYO is released by Thalmic Labs, a Canadian company, as shown in figure 4. It uses 8 electrodes to detect muscle activities and arm movements, gestures and even finger movements through the detection of biological electrical signal changes of the forearm. Meanwhile MYO also contains a 9-axis inertial sensor, which is used to detect the movement track, orientation and posture information of the arm [15]. The signals are transmitted through low-power bluetooth with low interference, high quality and low price. MYO is selected to replace the commonly used EMG sensors with electrodes to simplify the acquisition process and obtain real-time EMG signals with higher accuracy in our research. In the experiment, MYO is worn at the center of the upper arm, where the muscles could control the rotation of the two joints at the same time. Figure 5 shows the schematic map. In fact, the EMG of 8 channels are inevitably coupled, and not every pair of patched can only measure the data of one muscle.

III. STATE SPACE MODEL BASED ON HMM A. BRIEF INTRODUCTION OF HMM
This section introduced the traditional HMM for predictiing muscle torque. The model includes contraction element, series elastic element and parallel elastic element, by using which to reflect the function of muscles, as figure 6 shows. VOLUME 8, 2020 HMM consists of two elements: a contractile element producing the active muscle force F m A and a parallel elastic element producing the passive force F m P . Figure 6 represents the schematic of muscle-tendon and the muscle fiber with the contractile element and parallel elastic component. As for one muscle, the torque produced by it for a joint can be given as where f A (l), f V (v) and f P (l) are the normalized active force-length relationship, the force-velocity relationship and the passive elastic force-length relationship respectively. F m 0 represents the maximum isometric muscle force and a(k) = [a 1 (k), . . . , a 8 (k)] T is the muscle activation derived from EMG. l = l m /l m 0 is the normalized muscle fiber length, v = v m /v is the normalized muscle fiber velocity, in which l m and v m are the fiber length and the muscle contraction velocity, respectively. l m 0 represents the optimal fiber length and v m 0 is the maximum muscle contraction velocity. Besides, the musculotendon force F mt is calculated as where φ is the pennation angle.
For caculating the value of F mt , some researchers give simplifications to replace the complex biomechanical parameters: Furthermore, the musculotendon length l mt can be calculated as where l t is the length of the tendons. The physiological parameters can be set as constants.
In addition to the simplifications aboce, l mt is also simplified by a polynomial of the joint angle normally. We use a first-order polynomial to express it in this paper where b 0 , b 1 are constants. We can get the moment arm by Thus, the muscle's contribution to the joint moment is obtained by From the analysis in the former theorem, the moment of a muscle reacting on a joint can be written as where s i (i = 0, 1, . . . , 5) are constans given as:

CLASSIFICATION OF ACTIVITIES BASED ON COORELATION
There is a certain coupling relationship between the measurement signals of 8 channels of MYO, so it is unnecessary to use the signals of all channels as the input of the estimation, which may increase the calculation amount and even affect the final prediction structrue. Therefore, muscle activity is divided into a 1 and a 2 according to the results of correlation analysis. The correlation coefficient among different channels can be calculated as follows: where N is the number of samples; a i,k represents the muscle activity at time k of channel i. σ i is standard deviation of channel ith, and cov(i, j) is covariance coefficient; besides, r ij represents the correlation coefficient of the muscle activities between the ith and jth channels. The correlation coefficient reflects the degree of linear correlation between two sets of data. We choose 5 channels with the lowest correlation coefficient as the input of the prediction equation expressed as a 1 , which contain all the information with less data and simplify the calculation effectively. Other channel data are used as redundancy to serve as measurement output.

C. STATE SPACE MODEL DEDUCTION
In this section, the HMM and dynamic analysis are used to speculate the state space model for an accurate relationship between joint angles and muscle activities. As shown in figure 2, M , N are the centers of gravity of upper arm AB and forearm BC. For the two segments: where M in represents the interaction moment between two segments. M 1 and M 2 are the muscle torque reacted on the two segments seperately. Besides, are the gravitational moment. I 1 is the moment of inertia of AB that rotates around point A and I 2 is moment of inertia of BC that rotates around B. From equations 10 and 11, we can obtain (12) Therefore, we havë i.e.ẍ k = Aẍ k−1 + I 4×1 f ( * ) (13) in which The total joint torque M 1 and M 2 can be expressed as follows which can be obtained from equation 9. h 1 and h 2 represents the function relation between input and output.
Consequently, we get the EMG-driven joint motion model in discrete time. i.e.,  where T s is the sampling time.
Joint angles at the current moment is no only related to the current EMG signals, but also the state at the previous moment. It may not be accurate to use only muscle activities as input. Therefore, equation 15 can be rewrite as: where G is relationship deduced before; w k represents the process noise. EMG signal is a typical unstable signal, and the position of sensor eletrodes is related to condition of human skin sureface. The parameters in equation *** are not completely unchanged. Therefore, a NARX neural network is introduced to realize state estimation, so as to meet the requirement of robustness. NARX is a recursive dynamic neural network, which can take the estimated value of the last moment or several previous moment as the input of the network model. For continuous state estimation, this makes the algorithm have a consistency of time, and increases the accuracy and rationality for the estimation with time series requirements.

D. CLOSED-LOOP ESTIMATION
The above method form an open loop structure for estimation, and the error cannot be effectively corrected during the recursion of NARX network. More seriously, the accumulative error may result in large deviation. In addition, many parameters in the model may change with time, which is also one of the reasons for errors, In order to eliminate the influence of the errors, an observation equation is introduced here: where v k is the measurement noise. H represents the measurement equation that is established by BP (Back Propagation) nueral network. Then, we use UKF (unscented Kalman filter) algorithm to estimate the state online by assuming w k and v k as the Gaussian white noise. The UKF algorithm provides a closed-loop nature and [17] gives a detailed explanation.

IV. EXPERIMENT
In this section, experiments are given to verify the proposed algorithm above. An able-bodied subject participated in the experiments.

A. EXPERIMENT SETUP
In this part we analyze analyzes characteristics of the subject's upper limb movements through motion capture system. In the experiment, a set of preset motion trajectory is defined, as figure 7 shows, which starts from the natural droop of the arm and covers the motion range of elbow and shoulder joints in a comprehensive way. Before the test, network training is needed to obtain an initial network for data prediction. During the movement of the subject following defined trajectory, the training data of the initial network is obtained is acquired. The output is the joint angles calculated by the motion capture system, and the original EMG signal of the MYO armband is processed as the network input. The sampling frequency of the motion capture system and the EMG sensors of MYO armband are 60Hz and 200Hz seperately. The duration of each group is about 20s, which allows two groups of defined motion. VOLUME 8, 2020  During the first test group, the subject moves according to the preset trajectory, and the second group moves randomly within 20 seconds. Take one set of data as an example seperately, Table 1 lists the 4 angles and their angular velocities ranges.
In the experiments, muscle activities are calculated by raw EMG signals through the processes of high-pass filter, low-pass filter and normalization for every channel [20]. Take the signal of the first channel as an example, the raw signals and the processed results are shown in figure 8.

B. EXPERIMENT RESULTS AND ANALYSIS
In order to observe the effect of the algorithm intuitively, the results calculated by the motion capture system can be considered as the actual motion state of the subject during the movement. Figure 9 shows the estimation of state variables when the subject followed the predefined trajectory, in which the curves are derived from the motion capture system, the NARX network only and the closed-loop estimation seperately. We can see from figure 9, when using only the NARX neural network for estimation, the errors accumulated over time, which led to the divergence of the final results although it can follow the motion capture system results at the first 2 seconds. However, when using closed-loop   estimation algorithm, the errors could be corrected in time at every step to reduce the influence of accumulated errors on the experimental results and achive relatively stable estimation, due to the introduction of closed-loop structure.  In addition, the algorithm is also compared with the results of BPNN (all activity channels as network input). As can be seen from figure 11 and 12, for such data with strong time series characteristics, BPNN has a large estimation error and cannot fit the motion well.
In order to evaluate the algorithm performance quantitatively, evaluation indexes are introduced. The RMSE used in this paper is a commonly used index to evaluate the deviation between the predicted value and the true value. The RMSE is calculated as: where y k andŷ k represents the true value and the estimated value at time k seperately; and n is the number of sampling points. Table 2 shows the mean error and the RMSE of all the 5 groups (the motion capture data are substituted into the formula as the true value).
The estimation results of the random motion are shown in figure 13 and 14. The conclusion is similar to the above that the algorithm can estimate motion state of the two joints   within a reasonable error range, but the accuracy decreases compared with the predetermined motion prediction.
The mean errors and the RMSE are listed in Table 3. In addition to proving the superiority of this algorithm over BPNN, we combined the data from two tables. When moving along the predetermined trajectory, the average errors of real-time estimation values for the four joint angles using the method in this paper were 1.19, 0.77, 0.93 and 0.79 (degree) respectively, and the average values of RMSE were 1.1, 0.87,0.97 and 0.88 (degree) respectively. However, the estimation errors of joint angular velocity increase significantly,

V. CONCLUSION AND DISCUSSION
In this paper, the MYO armband of Thalmic Labs is used as a sensor to continuously estimate the angle, angular velocity, and angular acceleration of the four rotation DOFs of shoulder joint and elbow joint during the movement of the upper limb as the expression of human motion intention. Firstly, EMG signals of the upper limb are collected and the muscle activities are obtained through a series of processing for the subsequent estimation algorithm. Then, Hill-type musculoskeletal and dynamic equation are used to construct the estimation equation, and NARX neural network with autoregressive characteristics of time series is worked to replace the complex estimation function. At the same time, an observation equation is constructed by BP neural network. Meanwhile, UKF algorithm is employed to realize a closed-loop estimation which can eliminate the influence brought by accumulated errors, so as to obtain a complete state space model. The feasibility is verified by the experiment.
Compared with many researches that use EMG to calculate the muscle torque, the algorithm in this paper directly obtains the current state fo joint, providing a new idea of control framework. In addition, the introduction of time series neural network and closed-loop structure effectively improves the estimation performace, and the accuracy is significantly increased compared with the open loop estimation and BP network estimation.
Although the intention estimation algorithm has achieved some fruit, there is still room for further exploration. First of all, EMG is a typical unstable signal and will be interfered by many factors, such as the state of the skin surface and the position of the sensor patch, etc. Therefore, how to effectively shield the influence of interferers and maintain stable performance is a problem worthy of study. In addition, according to the HMM, there is a relatively accurate nonlinear relationship between EMG signal and muscle torque, which is independent of the initial state, hand movements, and the weight of load. However, for the estimation of joint information, the errors caused by these problems must be considered. Finally, applying the algorithm to exoskeleton robot or intelligent prosthesis, as the upper control layer to achieve stable and 'friendly' control is the ultimate goal.
[20] T. S. Buchanan, D. G. Lloyd, K. Manal, and T. F. Besier, ''Neuromusculoskeletal modeling: Estimation of muscle forces and joint moments and movements from measurements of neural command,'' J. Appl HONGXU MA received the B.S. degree in automatic control, the M.S. degree in intelligent control, and the Ph.D. degree in control science and control engineering from the National University of Defense Technology, in 1988, 1991, and 1995, respectively. In 1995, he stayed in the school for research work. In 2000, he realized the dynamic walking of Chinese two-legged robots for the first time. He is currently a Professor with the National University of Defense Technology. He has published more than 150 high-level academic articles and one monograph and holds more than ten patents. He is mainly engaged in the research of foot robots.
JIALONG GAO was born in Hangzhou, Zhejiang, China, in 1991. He received the B.S. degree from the National University of Defense Technology, Changsha, China, in 2014, where he is currently pursuing the M.S. degree with the College of Mechanics and Automation. His research interests include cooperative control, adaptive control and their applications to unmanned aerial vehicle (UAV), and robotic systems. VOLUME 8, 2020