Robust Human Upper-Limbs Trajectory Prediction Based on Gaussian Mixture Prediction

Accurate prediction of human motion trajectory can improve the security of human-robot cooperation. Due to the unstructured nature of collaborative workspace and the uncertainty of sensor sensing data, the trajectory prediction accuracy of traditional prediction algorithms is low, and the uncertainty is difficult to estimate. Aiming at the complex characteristics of human upper limb movement patterns, this paper proposes a robust upper limb end trajectory prediction algorithm. The robust Gaussian mixture model was used to model the trajectory of human upper limb movement, and the statistical values of the future trajectory were obtained by combining Gaussian mixture regression. The advantage of this algorithm is that the prediction result is not only the predicted value of the position, but also the probability distribution of all possible future motion trajectories of the upper limb. The position prediction information in a specific motion mode can be obtained by using probability and statistical distribution characteristics. The algorithm is tested on both public and private datasets. Experimental results show that this method can predict human trajectories well.


I. INTRODUCTION
Many fields have benefited by applying human-robot collaboration (HRC) strategies since the creation of collaborative robots that can safely share tasks with humans [1], [2]. In the military field, cooperative robots are expected to work with military personnel in order for soldiers to better understand the dangers of the battlefield [3]. HRC strategies in agriculture can provide solutions to complex problems in crop The associate editor coordinating the review of this manuscript and approving it for publication was Tao Liu . production processes, providing safety, comfort, lower workload and better process productivity [4]. In industrial production, HRC can improve the efficiency of assembly tasks [5]. The application of HRC in the medical industry is also popular [6], [7], [8]. This paper focuses on the application of HRC in the pathology department. The main task of the pathology department is to determine the nature of the disease through biopsy of cell tissue or body fluid during the medical process and carry out pathological examination. In many cases, these robots will share the same physical space with people and work closely with people to complete common tasks as part of their daily work. The assistance of robots can reduce the probability of medical personnel being exposed to dangerous environments and improve the efficiency of the detection process [9], [10]. However, some of these tasks, such as separating tissues from cells to make pathological cell sections and other tasks requiring high details, are difficult to be fully automated, and human-robot cooperation can solve this problem. Humans can perform tasks with high flexibility, and robots can perform simple and repetitive tasks to assist humans to jointly perform the basic tasks of the pathology department. Deployment of human-robot cooperation in real-world applications requires the safety of cooperators and avoidance of collisions with robots [11]. In the previous work [12], [13], it has been shown that predicting human motion allows for smoother robot motion in the shared workspace.
Due to the regularity of the pathological examination process, the human follow similar trajectories in each work cycle, and we use statistical regression to model and predict human trajectories to exploit this property. Traditional prediction algorithms based on Gaussian mixture models first model the type of human upper limb motion trajectory using Gaussian mixture models (GMM), and then combine with Gaussian mixture regression (GMR) to predict the future human upper limb motion trajectory. The Gaussian mixture prediction algorithm has defects such as being sensitive to initial values, convergence slowly, falling into local convergence and requiring prior clustering components [14]. Some algorithms without considering the robustness of the initialization of the clustering components were proposed [15], [16], [17], which directly affect the clustering effect and thus the accuracy of prediction.
For solving these problems, a Gaussian mixture prediction framework that combines a robust GMM with GMR (RGMTP) is proposed.
The framework of the proposed model in this paper is shown in Fig.1, and its main contributions are as follows: (1) A dataset of human upper limb trajectory is generated, which focuses on the human-robot cooperation task in pathological examination. Compared with similar datasets, the proposed dataset matches better to the real human-robot collaborative scene, especially in the pathology examination.
(2) The robust GMM algorithm takes all data points in the dataset as initial values, which solves the problem of selecting initial values; adds penalty terms to the objective function to optimize the weight update, considers the global and local data structures, and obtains appropriate parameter estimates to achieve automatic clustering. Moreover, adaptively assign different weights to the extracted features for learning in response to different features of the data, to improve the accuracy and generalization ability of clustering.
(3) Combined with GMR for prediction, the future trajectories of the motion target are predicted based on the input history trajectory data, which can provide uncertainty information of the motion trajectory. This paper is organized as follows. In section II, we discuss the related works in the area of human motion prediction. Section III introduces some foundation knowledge used in this paper. Section IV introduces the improved robust GMM algorithm. Section V introduces the application of RGMTP in human motion prediction. Simulation results and the algorithm performance are analyzed in Section VI. Conclusions and future research directions are presented in Section VII.

II. RELATED WORK
Our work focuses on trajectory prediction of human upper limbs in HRC. In this section, we briefly summarize previous work on human trajectory prediction. Ernaga et al. proposed a constant acceleration dynamic obstacle prediction model based on Kalman filter, which solves the problem of trajectory prediction of moving objects in a time-varying environment [18]. Dutta V et al. proposed trajectory prediction based on the Bezier algorithm, which relies on four parameters to fit the upper limb trajectory, including the starting point of the trajectory, the target point, and two key points [19]. However, the prediction model based on physical methods increases rapidly with the increase of physical quantities, and its robustness is poor. Li et al. proposed a data-driven modelbased prediction system that combines multi-step Gaussian process regression and a representative trajectory algorithm to predict human motion trajectories in HRC, providing trajectory uncertainty [20]. Most recent approaches use neural networks that are trained directly with a strict assignment of data from input to output, which leads to surprisingly impressive results on similar data. Elflin et al. based on the history of trajectories, a hybrid framework that mixes hidden Markov models and social power methods can infer goals and predict a person's path toward the goal [21]. Pareek introduced an intelligent assistant for robotic therapy (IART) that provides robotic assistance in 3D trajectory tracking tasks. A new LSTM based robotic learning demonstration (LFD) paradigm is proposed to mimic therapists' assistance behaviors [22]. Considering the interaction between people and the workspace, some meaningful work on extending LSTMs can accurately predict human trajectories [23], [24], [25], [26]. The above work adopts the method of supervised learning, which requires a large number of training data of manual marking and depends on the accuracy of human marking. If the way of performing a given task is changed, or a new human is observed to perform a task in a different way, the pre trained model will not be able to predict the new sports style. Therefore, we seek a model that can be built and adapted to new trajectory patterns when they appear.
Different from the previous work, the unsupervised prediction algorithm does not depend on manually marked data sets. It is very similar to human learning through their own thinking, which makes it closer to real artificial intelligence. Gaussian mixture model is a probability statistical model, which can simulate the variability of human behavior in various experiments, and has been widely used in human trajectory prediction. J. Mainprice and D. Berenson combined Gaussian mixture model with Gaussian Mixture Regression to generate representative human motion and estimate the task space area occupied by the human body [27]. Pérez D'Arpino and Shah improved the GMM classification algorithm reported in [27], adding regularization to prevent singularities [28]. Cheng Q et al. proposed a method based on Gaussian mixture model, Gaussian mixture regression and probabilistic roadmap, which provides the distribution of all feasible motions of an agent [29]. A trajectory prediction algorithm based on Gaussian mixture model is proposed, which uses the Gaussian mixture model to calculate the probability distribution of different motion modes of complex motion modes, and combines Gaussian process regression to predict the most probable motion trajectory of moving objects [30]. In [31], the robot teaching based on impedance control is used to guide therapists to carry out robot assistance for the participants with drooping feet in the treadmill based treatment program. GMM and GMR are used as learning and regression algorithms required to train robots and mimic therapists at a later date. Mahdi T developed a learning from demonstration (LfD) framework and proposed a GMM based learning model, which can represent different rehabilitation tasks and provide help for patients [32].
Gaussian mixture models are also widely used in the prediction of human upper limb movement trajectories. Jie Kang and Kai Jia proposed a ROS-based real-time motion estimation framework based on human pose, using Gaussian mixture model and expectation maximization (EM) algorithm to cluster and estimate human motion trajectories [33]. Luo R proposed a two-layer Gaussian mixture model framework and Gaussian mixture regression algorithm to identify and predict human limb trajectories [34]. Hong Yan L et al. proposed single-layer unsupervised parallel GMMs-GMRs model to predict the motion trajectories of human palms, which predicts the remaining motion trajectories based on the observed motion trajectories [35]. Harish C and Ashwin P used an approximate EM algorithm as a parametric reasoning problem to reason about people's intentions [36].
When GMM clusters the trajectory data, it needs to artificially set a fixed component value, and then apply the EM algorithm to obtain the maximum likelihood (ML) parameter estimation of the model [37]. This method of parameter estimation has the following disadvantages: it must apply EM multiple times for each different initialization, and it only provides parameter estimates for fixed model complexity. If the complexity of the model cannot be determined in advance, the EM algorithm may converge to the boundaries of the parameter space, which means that the weight of one of the components may approach a small value and its covariance matrix becomes singular, making the likelihood value close to infinity, which affects the clustering effect. In the HRC task, the types of human upper limb motion trajectories are complex and uncertain, so it is difficult to determine the number of clustering categories. Unlike previous work, the RGMTP proposed in this paper can not only automatically obtain the optimal number of clusters according to different types of trajectories to obtain more accurate trajectories, but also calculate the probability distribution of all possible future trajectories of upper limbs.

III. THE FOUNDATION KNOWLEDGE A. THE KINEMATICS MODEL OF HUMAN UPPER LIMBS
This paper mainly studies the cooperation process between human upper limb motion and robot. First, it is necessary to model the human upper limb. The human upper limb motion system is a nonlinear, continuous and differentiable multi degree of freedom rigid body motion system. In the pathological examination task, the position of the human shoulder is stable, so we model the human upper limb system based on the shoulder joint, as shown in Fig. 2. The simplified limb defined in this paper has 3 degrees of freedom, L 1 , L 2 is the length of the upper limb and forearm. The Denavit Hartenberg(DH) parameters are given in Table 1. The DH  parameter is used to obtain the following general transformation matrix, as shown in the equation at the bottom of the page.
The final transformation matrix of upper limb is given by the following formula [38], [39]: 3 2 T are obtained by substituting the values of the DH parameters in the general transformation matrix. We can establish the kinematic relationship between the position information of wrist joint and other joints of upper limb according to (1). Therefore, next we focus on the prediction of wrist joint position.

B. GAUSSIAN MIXTURE REGRESSION PREDICTION ALGORITHM
Using GMM to represent human motion has an important advantage: it can not only cluster human upper-limbs trajectories but also combine GMR to perform prediction [16]. The Gaussian mixture regression prediction model is constructed as: where x is a random variable, M is the number of clusters, and α m is the weight of the α m th Gaussian component. g(x|µ m , ρ m ) is the mth multivariate normal distribution, and α m is a mixture coefficient that must satisfy 0 ≤ α m ≤ 1 and M m=1 α m = 1.
If the training set is D train = (x, y), the input data is x,and the output data is y. The test set is D test = (x * , y * ), the input test data is x * , and the output test data is y * , then [y, y * ] T joint probability density function follows the following GMM model: where The joint probability density function is expressed as: The marginal probability and conditional probability density can be obtained by (3) and (4). The marginal probability density of y is: The marginal probability density of y is: where the mixing weight φ m (y) = α m g(y,µ my ,ρ my ) M m=1 α m g(y,µ my ,ρ my ) . Therefore, the regression function of y * about y, that is, the predicted value of y * is: One important work of the prediction model is parameter estimation. The parameters. The parameters α and θ(µ, ρ) are usually determined by using the expectation-maximization (EM) algorithm. The EM algorithm improves model parameter estimates in iterations. Let z = z 1 , z 2 , · · · , z n be the missing data in which z i ∈ 1, 2, · · · , M . If z i = m, it means that the ith data point belongs to the mth class. Thus, the joint pdf of the complete data The log-likelihood function is obtained as follows: Since the latent variables z mi are unknown, according to Dempster et al. [37], the conditional expected value E(z mi |x i ; α, θ) is substituted for z mi . By Bayes' theorem, we have:ẑ M-step: Under the constraint M m=1 α m = 1, to maximize (10), We can obtain the updated equation for mixing proportions with: E-step assumes that the parameters of each Gaussian model are known, and then the weights of each Gaussian model are estimated. M-step is to determine the parameters of the Gaussian model based on the estimated weights. Repeat the above two steps until the set threshold fluctuates very little and approximately reaches the extreme value.
Traditional GMM requires a priori number of clusters, which is often given by human experience, making the algorithm sensitive to initial parameters and easy to fall into local extremes, limiting the application of GMM.

IV. THE ROBUST CLUSTERING GMM ALGORITHM
The robust GMM proposed in this paper optimizes the weight update method of Gaussian mixture term in the EM algorithm by adding a penalty term to the objective function of the traditional EM algorithm, and then changes the specific parameter update rules of the mixture model. According to different track types, the most suitable cluster number can be automatically obtained without manually setting the cluster number.
We know that the α m is the probability that a point belongs to mth class. Therefore, we can use −lnα m as the information when it appears as a data point belonging to mth class, and − M m=1 α m lnα m is the average of information, commonly referred to as the entropy. Entropy is a generalization of rather vague concepts such as disorder or chaos, uncertainty or randomness [40]. We need to minimize entropy to get α m more information. When α m = 1 M ,∀m = 1, 2, · · · , M , we say that there is no information about α m . At this point, the entropy reaches the maximum value. Therefore, we first add this term to the original EM objective function. Then, we use a learning process to estimate α m by minimizing the entropy to get the most information for α m . To minimize − M m=1 α m lnα m is equivalent to maximizing M m=1 α m lnα m . Therefore, we use − M m=1 α m lnα m as the penalty term for the EM objective function. Incorporating this as a penalty term into the objective function yields: The α m proportions can be derived by maximizing J (α, θ), the following update equation: will become smaller than the old. Thus, smaller proportions will decrease and larger proportions will increase in the next iteration, creating competition. After several iterations, we will discard the smaller portions and then update the M (old) to: To retain the constraints M (new) m ′ =1 α m ′ = 1 and M (new) m ′ =1ẑ m ′ i = 1, the following updates are required: The algorithm can reduce the number of clustering automatically and get the estimation of parameters in the competition mode. On the other hand, β can help us control the competition. To prevent β from being too large, let β ∈ (0, 1). If the difference between α m , then β will get smaller to keep it stable. Therefore, β is defined as: where η is min where d is the Gaussian variable dimension. Because the β can jump at any time, we let β = 0 when the cluster number M is stable.
Parameters µ m and ρ m can be updated as follows: Thus, the robust EM clustering algorithm can be summarized as Algorithm 1.  (11),and set t=1.

V. THE RGMTP ALGORITHM FOR HUMAN UPPER LIMBS TRAJECTORY PREDICTION
In actual prediction, the RGMTP model first clusters the historical trajectories and then regresses the prediction. We make predictions in the X,Y and Z directions respectively, and the obtained prediction function is: and D z = {(z i−1 , z i )} N i=2 for processing separately. Given the trajectory position information {x 1 , x 2 , · · · , x d }, predict the next position point x d+1 , the calculation formula is: is the trajectory noise, the calculation formula is: The key of this process is how to get the incremental regression estimation function f x ( x). From the regression (7), the following is obtained: where x)) . Through the historical trajectory {s 1 , s 2 , · · · , s d }, the predicted increment in the X , Y , Z directions of the future d +1 time position is x d+1 , y d+1 , z d+1 , and the predicted position of this point is: The prediction error is: The advantage of RGMTP is that there is no need to manually set the mixed components, and the robust GMM can automatically obtain the mixed components according to the historical trajectory, which more objectively reflects the essential characteristics of the data and obtains the predicted trajectory more accurately; and the variance of the predicted trajectory is calculated by GMR. It represents the uncertainty of human behavior and further improves the safety of humanrobot collaboration. Fig. 3 shows the prediction effect of the human upper limb motion trajectory of the pathological examination data set in the 2D world coordinate system. First, use Robust GMM to train the trajectory of human upper limbs to get the clustering results (as shown in Fig. 3(b)). Then, use GMR to predict future trajectories (as shown in Fig. 3(c)), red is the test trajectory, and blue is the predicted trajectory. The shaded area represents the variance at each time step.

VI. EXPERIMENTAL
In order to evaluate the prediction performance of RGMTP algorithm, tests were conducted on public data sets [26] and own dataset. Omission cross validation (LOOCV) is used as the validation method. All experiments were conducted on a platform equipped with a 1.5 GHz Intel Core I3 processor.

A. PATHOLOGICAL EXAMINATION DATASET
Because public datasets are not suitable for testing human upper limb movements, especially in pathological examination tasks. We simulated some tasks in the pathology lab and produced pathological examination dataset, which is closer to the actual scenario than before. The work cell was equipped with a collaborative robot dobot CR5 and used Kinect V2.0 to acquire human depth map and skeletal information to construct the human upper limb motion dataset, the Kinect was mounted at a height of 0.2 m relative to the robot VOLUME 11, 2023 base linkage. 13 healthy adults participated in data collection (9 males and 4 females, 10 right handed and 3 left handed, age: 23.7 ± 3.0 years, body height: 171.4 ± 7.9 cm, body mass: 70.3 ± 14.4 kg). All participants gave written informed consent before starting data collection. Participants are assigned a numeric ID (random number between 0 and 10000) for anonymous data.
The pathological examination data set includes upper limb trajectories during routine tasks of human pathological examination. Due to the high specialization of pathological examination, the pathologist first demonstrated the examination actions, and the experimental participants need to learn these actions before collecting the data set. We proposed several tasks related to actual pathological detection tasks: detection of pathological solution, transfer of test solution and preparation of cell sections. As shown in Fig. 4.

1) TASK 1 TO 8
In this detection task, the collaborator places the test tube containing the pathological test solution to be detected at the designated position on the table. The cooperative robot can identify the intention of human placing test tubes in advance, predict the future trajectory of human movement, reach the corresponding position in advance to act as the third arm to assist human to drop the corresponding test reagents. According to the 8 different positions where the tubes are placed on the table, we recorded 8 groups of tracks from Task 1 to 8. As shown in Fig. 5.

2) TASK9
Task 9 is the transfer between tubes. This task aims to show the typical tasks that may occur in the medical collaborative workspace. The robot can prevent collisions with humans through prediction.

3) TASK10
In this task, the collaborators take the reagents from the test tube rack to make cell sections on the workbench. Robots that predict the future trajectory of humans can plan safe routes in advance to prevent collisions and other safety accidents and ensure human safety.
One test includes all 10 tasks in a sequence. The order of task execution is randomly selected among the participants. Each subject has carried out 4 consecutive tests, and about 1 minute rest is allowed between each test to limit fatigue. Due to the regularity of the detection task, the collaborators follow similar tracks in each cycle. We believe that data-driven methods based on real trajectory data obtained from each human worker are effective in dealing with the impact of individual differences.

B. CLUSTERING
In this section, we discuss the clustering performance of the algorithm.
The number of clustering categories is very important for the RGMTP trajectory prediction model, which affects the quality of the training model and the accuracy of motion estimation. If the number of clusters is too small, the algorithm cannot model the data fully and express the characteristics of the trajectory adequately, which affects the prediction effect; if the number of clusters is too large, it will increase the complexity of the model and trajectory prediction time, which is not conducive to the safety of collaborators. To verify the accuracy of the algorithm clustering, we can use the Bayesian Information Criterion (BIC) [41] to find the optimal number of clusters. According to the BIC scoring scheme, the k that minimizes the BIC score is the optimal number of clusters. BIC = −2lnL + kln(n) (27) whereL is the maximum likelihood estimation,k is the number of free parameters for the model, and n is the number of collection values. kln(n) Penalty term can effectively avoid dimension disaster when the dimension is too large and the training sample data is relatively small. Fig. 6 shows the clustering process of the trajectories in Task2 using the robust GMM: with all data points as the initial clusters, the clusters drop rapidly from 862 to 66 after 10 iterations, and the dataset is classified into 6 classes after 194 iterations successfully. Furthermore, Fig. 7 shows the comparison of the clustering effect between traditional GMM [30] and robust GMM, and it can be seen that the latter divides the data set more carefully and clusters better compared to the former. We use BIC to evaluate the clustering effect of robust GMM, and we can find that the BIC value is low when the cluster is 6 from Fig. 8, which means that the clustering is close to the best effect, which also verifies that the clustering effect of the algorithm is real and effective.
To verify the robustness of RGMTP algorithm in more datasets, we use traditional GMM and robust GMM to cluster the two-dimensional four component Gaussian mixture distribution data set in [15]. As shown in Fig. 9, the clustering  effect of traditional GMM deviates from the original dataset. After 84 iterations of the robust GMM algorithm, 4 clusters were obtained (Fig. 10). The clustering performance of the algorithm is evaluated quantitatively using purity, which indicates the ratio of the number of points correctly assigned to the cluster to all points, and higher purity indicates better clustering performance. In this dataset, the purity of the traditional GMM algorithm is 71.6%, while the total accuracy of the algorithm in this paper is 94.8%, which is a 32.4% increase in purity. The clustering performance of this paper can perform better in different samples.
To further analyze the clustering effect, we used this Gaussian distribution to generate 100 data sets, and used the method of [15] to train these 100 data sets. Finally, 69 of the 100 data sets were correctly divided into 4 clusters. Robust GMM is used to train these 100 datasets, and 82 datasets are finally successfully divided into 4 clusters, 5 of 100 with 5 clusters, 13 of 100 with 3 clusters. As a whole, our robust GMM clustering algorithm presents better than the traditional GMM.

C. HUMAN TRAJECTORY PREDICTION
In this section, we will verify the prediction performance of the RGMTP algorithm.

1) TRAJECTORY PREDICTION ON A PUBLIC DATASET
We first verified the prediction ability of the algorithm in this paper on a public data set, which is derived from the VOLUME 11, 2023  driving vehicle data of the MIT parking lot, which collected 40453 real trajectory data [42]. We used the traditional Gaussian mixture trajectory prediction model (TGMTP) [30] and the RGMTP prediction model in this paper to carry out experiments on this data set.
The two prediction algorithms are analyzed under different test sets of 50-100 test trajectories, and the accuracy of the prediction is evaluated by the root mean square error (RMSE). As shown in Fig. 11, compared with the traditional algorithm, the prediction accuracy of RGMTP is improved by 6% on average. We analyzed the reasons for this result: The clustering numbers of traditional algorithms are often given empirically, mostly considering only the global data structure but not the local data structure, and are sensitive to parameters, easily falling into local convergence, which directly affects the accuracy of prediction. In contrast, the weight updating method of RGMTP by algorithmically optimizing Gaussian mixture terms can adaptively assign weights to each feature according to the importance of different features, which has better generality.

2) TRAJECTORY PREDICTION ON OWN DATASET
Although the performance of the RGMTP algorithm was tested in the public dataset, its effect on the task of pathological examination is still unknown. Therefore, we conducted simulation experiments in the pathological examination dataset and selected RMSE, prediction time, and interference resistance as evaluation metrics. We compared the prediction results generated from the simulation experiments with related work.

a: RME
To analyze the experimental results, we calculated the prediction errors of all trajectories of each of the four methods (i.e. the GPR algorithm, Bezier curve, BP-HMT model, and RGMTP algorithm). Fig. 12 shows the error comparison of the four prediction models. The x-axis represents the prediction time and the y-axis is RMSE.
Analysis of the experimental results shows that the error of the Bezier curve is higher than the other three. The reason is that the bezier algorithm relies on four parameters to fit the trajectory of the upper limb, but the joint position or speed will be affected by noise or sudden changes in the direction of limb movement, which will change the parameters of the model and produce large prediction errors. The GPR prediction model has better accuracy for the trajectory prediction of simple motion patterns relatively, but it is difficult to describe a single Gaussian process for more complex and diverse trajectory patterns such as grasping test tubes. The BP-HMT algorithm combines the improved GPR algorithm and the representative trajectory algorithm, the prediction effect is better in the early stage of the experiment, because the representative trajectory is the average value of multiple trajectories, but when the variance of the trajectory becomes larger in the later stage, the representative trajectory algorithm will also produce a high error. The RGMTP algorithm automatically clusters according to different trajectory types, mines more trajectory information, and the obtained parameters are used for GMR regression prediction with high prediction accuracy.
To further verify the performance advantages of the proposed algorithm, we compare the RGMTP algorithm with the existing trajectory prediction algorithms with better  performance, including the Kalman filter and LSTM algorithm. As shown in Fig. 13, the x-axis represents different test sets, the y-axis represents the RMSE of the algorithm, and the prediction of RGMTP is always better than the other two algorithms. The reasons for this case are analyzed: The trajectory prediction based on the Kalman filter only makes linear regression prediction for the trajectory without cluster analysis for different trajectory modes, so the prediction error is large. The LSTM algorithm needs a large number of parameters, the model is complex, the calculation cost is high, and the learning time is too long. In the humancomputer cooperation scene, it is necessary to accurately identify the human intention and predict the trajectory of human upper limb movement in a short time. Therefore, the LSTM prediction model is not suitable for the prediction of human upper limb movement trajectory. Table 2 shows the overall RMSE of 7 prediction algorithms in the time step range of 1s in 10 test sets. The prediction accuracy of the RGMTP algorithm is always higher than that of the other 5 algorithms and the overall mean error (across all datasets) is 12.9%, 30.6%, 36.87%, 48.6%,83.2%, and 87.1% lower than that of the TGMTP, LSTM, Kalman filter, BP-HMT, GPR, and Bezier curve respectively. The prediction accuracy of RGMTP is improved most obviously in task 1, task 5, and task 7. Compared with TGMTP, LSTM, Kalman filter, BP-HMT, GPR, and Bezier curve, the prediction accuracy is improved by 5%,36%, 40%,51%,83%, and 86%. The robot needs to accurately predict the trajectory of human upper limb movement in a short time in HRC. Therefore, this section compares the prediction time of RGMTP, Kalman, and GPR algorithms. As shown in Fig. 14. The prediction time of RGMTP is very small, which is reduced by 60% and 56% on average compared with GPR and Kalman filter algorithm. Because the Kalman filter predicts the next position of each trajectory by substituting the position information of the previous point into the regression analysis, when the number of predicted trajectories increases, the prediction time will increase linearly. Every inference optimization of the GPR algorithm requires matrix inversion of all training data points. The time complexity of n sample points is n 3 and the prediction time is long. RGMTP prediction can predict the trajectory with unified model parameters at the same time. The trajectory described by GMM only needs onetime prediction. When the number of predicted trajectories increases, as long as there is no more trajectory motion mode, the prediction time will not have a large increase and fluctuation. Our training set has a large number of trajectories and rich trajectory motion modes, which can include most motion modes. Therefore, RGMTP can deal with the trajectory prediction of various complex motion modes.

c: ALGORITHM ANTI-INTERFERENCE ANALYSIS
There are three sources of uncertainty in the human upper limb motion model: uncertain system dynamics, sensor measurement noise, and unknown human intention. The RGMTP algorithm can provide the variance of the predicted trajectory to deal with the uncertainty of human behavior (Fig. 15). Aiming at the problem of noise in collecting human upper limb trajectory data in the HRC scene, which interferes with the prediction model, this section selects the task2 data set to analyze the anti-interference of three prediction algorithms. The results are shown in Fig. 16.
The experimental results show that GPR algorithm has limited ability to describe complex trajectories and is more sensitive to changes in noise data. With the increase of noise, the prediction error also increases. BP-HMT algorithm uses representative trajectories. When the noise data increases,   the selection of representative trajectories will be affected, so the prediction error is large. RGMTP and TGMTP algorithms effectively classify the noise trajectory points before prediction, and can distinguish the noise trajectory well in the prediction process, making the algorithm less affected by noise data.

VII. CONCLUSION
In this paper, we propose an improved GMM-based trajectory prediction algorithm. By adding a penalty term to the objective function of the traditional EM algorithm comprehensive parameter information can be considered in the clustering process, and making it robust to the initial value and different mixture components. Furthermore, the optimal number of clusters is generated to obtain more trajectory information and improve the prediction accuracy. The predicted position value and the probability distribution of all possible future trajectories of the moving object can provide an estimation of the uncertainty of the trajectory and further improves the safety of human-robot collaboration.
In future work, we will investigate a broader range of tasks to explore the application of predictive algorithms in multi-robot collaborative work scenarios, while ensuring human safety. We hope that our work can enhance the safety and reliability of human-robot collaboration further. KAIYUE LIU is currently pursuing the B.D. degree in optoelectronic information science and engineering with the Qilu University of Technology (Shandong Academy of Sciences), Jinan. China. Her research interests include human-robot interaction and deep learning.
CHAO FENG received the Ph.D. degree in signal and information processing from Shandong University, in 2015. He is currently a Lecturer with the Qilu University of Technology (Shandong Academy of Sciences), Jinan, China. His current research interests include homomorphic encryption, remote data checking, and motion planning.