{'fraction_non_alphanumeric': 0.03182920153280676, 'fraction_numerical': 0.009071713458981778, 'mean_word_length': 4.786199095022624, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Experimental Evaluation of Human Motion Prediction: Toward Safe and Efficient Human Robot Collaboration

Human motion prediction is non-trivial in modern industrial settings. Accurate prediction of human motion can not only improve efficiency in human robot collaboration, but also enhance human safety in close proximity to robots. Among existing prediction models, the parameterization and identification methods of those models vary. It remains unclear what is the necessary parameterization of a prediction model, whether online adaptation of the model is necessary, and whether prediction can help improve safety and efficiency during human robot collaboration. These problems result from the difficulty to quantitatively evaluate various prediction models in a closed-loop fashion in real human-robot interaction settings. This paper develops a method to evaluate the closed-loop performance of different prediction models. In particular, we compare models with different parameterizations and models with or without online parameter adaptation. Extensive experiments were conducted on a human robot collaboration platform. The experimental results demonstrated that human motion prediction significantly enhanced the collaboration efficiency and human safety. Adaptable prediction models that were parameterized by neural networks achieved the best performance.


I. INTRODUCTION
With the revolutionary development of manufacturing automation, there are increasing manufacturing tasks that are tedious and inefficient for human to perform [1]. Effective human-robot collaboration (HRC) has drawn increasing interest across large varieties of fields [2] [3] [4]. Moreover, many challenging HRC tasks, such as aircraft and electronics assembly [5], require human workers to work in close proximity to robots. To enable safe and efficient HRC, it is crucial for robots to be aware of current and future human movements, so that robots can quickly adapt their behavior to better collaborate with human workers [6]. However, it is inherently difficult to predict human motion, since human motion is stochastic in nature and subjected to nonlinear dynamics [7]. Human behavior is time-varying and individual differences are prominent. A prediction model that works for one person may not be applicable to another, or even the same person at a different time.
A prediction model can be parameterized in multiple ways, i.e., linear regression model, supported vector machine, Gassian mixture model, hidden Markov model [8], feed-forward neural network, recurrent neural networks (RNNs) [9], and etc. The parameters of a prediction model can either be fixed or online adaptable.
In terms of performance evaluation of a prediction model, the majority of existing works focus on prediction accuracy. Few of them evaluate the effectiveness of the prediction in real world experiments with human-robot systems. Without fully evaluating the effects of human motion prediction through real world experiments involving human, it is hard to determine whether a prediction model would lead to safe and efficient human robot collaboration.
This paper introduces a series of human-in-the-loop corobot experiments to compare different prediction models. The co-robot platform is based on the safe and efficient robot collaborative system (SERoCS) [10]. We investigate the following problems: 1) whether a complex parameterization (e.g., using a neural network) of a prediction model is necessary; 2) whether online adaptation of a prediction model is necessary; 3) whether active prediction improves safety and efficiency of human-robot collaboration. To answer the questions, we compare the following four types of prediction models: 1) a linear regression model without adaptation, 2) a linear regression model with adaptation, 3) a neural network model without adaptation, 4) a neural network model with adaptation, called a semiadaptable neural network model. In the experiments, the baseline for comparison is chosen to be the performance without active prediction, in which robot only considers real-time human constraints. The metrics for performance evaluation are defined by quantifying safety and efficiency during human robot collaboration. The experimental results demonstrate that safety score is doubled with active prediction. Prediction models with complex parameterizations and online adaptations achieve higher efficiency scores compared to prediction models without those. Among the four methods, the semi-adaptable neural network model has the best performance.
The remainder of the paper is organized as follows. Section II formulates the human motion prediction problem and describes the four motion prediction methods mathematically. Section III proposes three hypotheses about the effects of motion prediction on human robot collaboration. Section IV describes the details of experimental setup. Section V shows the performance of the four methods. Section VI discusses how the experimental results verify the three hypotheses and Section VII concludes the paper.

II. HUMAN MOTION PREDICTION METHODS
Following the formulation in [6], the transition model of human motion on a selected joint can be defined as: where x(k + 1) ∈ R 3M denotes human's M-step future trajectory of the joint, in which three dimensional joint position in Cartesian-space is included for each future step and M is the prediction horizon. x * (k) ∈ R 3N denotes human's past Nstep trajectory of the joint. a ∈ N 1 is a discrete action label representing different motion categories. w k ∈ R 3M is a zeromean white Gaussian noise. The function f (x * (k), a) : R 3N × N 1 → R 3M encodes the transition of the human motion, which takes historical joint trajectory and current action label as inputs, and outputs the future positions of the joints.
The following subsections summarize the four human motion prediction methods compared in the study. The four methods can be divided into two categories: offline schemes and online schemes. 1) Offline schemes: linear regression model without adaptation and neural network model without adaptation. 2) Online schemes: linear regression model with adaptation, and neural network model with adaptation.

A. Linear Regression Model without Adaption
A human is a complex dynamic system [11], whose dynamics (1) can be approximated by a linear regression model [12]: Here x(k + 1) is the output of the system, and Φ k is the regressor vector that contains the past observations of the system at time step k, and θ is the unknown model parameters. w is a white Gaussian stochastic noise. In terms of human motion prediction, x(k + 1) ∈ R 3M represents the future motion states, while the regressor vector Φ k ∈ R 3N+1 is an augmented vector containing the past states x * (k) and the action label a.
The parameter θ needs to be identified from human motion transition dataset. Linear regression is usually solved using the least square method [13], which is inefficient since it involves large scale matrix inverse. To speed up the computation, we adopt stochastic gradient descent (SGD) to perform the multi-variate linear regression, which has guaranteed convergence [14]. The main steps of the SGD algorithm can be summarized as that we first initialize parameter θ and white noise v. Next, for k-th motion trainsition sample (Φ k ,x(k + 1)) in dataset, we construct the error function as: Then the parameter is updated using the following rule: where θ (i) is the parameter in i-th iteration. θ (i) converges when i approaches infinity.

B. Neural Network Model without Adaptation
Since human's motion is inherently highly nonlinear, complex parameterization is favorable for motion prediction models. RNNs receives increasing interests in human motion prediction recently. However, RNNs is hard to train, many attempts to accelerate the speed have failed [6]. Moreover, since RNNs models are fixed, their recurrent network architectures are not compatible with online adaptation schemes. For comparison purpose, we need a feed-forward model with complex parameterization that is online adaptable. Hence, we use Artificial Neural Networks (ANNs) to approximate the motion transition model f in (1), which is fast to train and widely used in modeling human motion [15].
To train the transition model f , we define an n-layer ANN with ReLU activation function which takes the positive part of the input to a neuron as: where is the input vector, in which 1 denotes a bias term. g denotes (n − 1) -layer neural network, whose weights are packed in U. ε(s k ) ∈ R 3M is the function reconstruction error, which goes to zero when the neural network is fully trained. W ∈ R n h ×3M is the last layer parameter weights, where n h ∈ N is the number of neurons in the hidden layer of the neural network [16]. We also deploy stochastic gradient descent to train ANN model following the same procedure as (3) and (4).

C. Linear Regression Model with Adaptation
The prominent difficulty in human motion prediction lies in the individual difference. A fixed linear regression model as (2) is far from satisfying in accommodating the stochasity of human motion. To address the problem, We adapt the parameters of the linear regression model using the recursive least square parameter adaptation algorithm (RLS-PAA) [17]. Rewrite the regression model (2) as where θ k and w k denote the parameter and white noise at time step k. Letθ k denotes the parameter estimate at time step k, and letθ k = θ k −θ k be the parameter estimation error. We define the a priori estimate of the state and the estimation error as:x The main steps of RLS-PAA are to iteratively update the parameter estimationθ k and predict x(k + 1) when new measurements become available. The parameter update rule of RLS-PAA can be summarized as [17]: where F k is the learning gain updated by: where 0 < λ 1 (k) ≤ 1 and 0 < λ 2 (k) ≤ 2. Typical choices for λ 1 (k) and λ 2 (k) are: 1) λ 1 (k) = 1 and λ 2 (k) = 1 for standard typical least squares gain. 2) 0 < λ 1 (k) < 1 and λ 2 (k) = 1 for least squares gain with forgetting factor. 3) λ 1 (k) = 1 and λ 2 (k) = 0 for constant adaptation gain.

D. Neural Network Model with Adaptation
The last-layer weight W in the feed-forward neural network (5) is also adaptable online using RLS-PAA [6]. We call the new model the semi-adaptable neural network. The semiadaptable neural network is more computational effective than RNNs and can adapt time-varying human motion online. This method requires that the neural network be pre-trained offline. The pre-trained network will serve as an effective feature extractor when the last layer is removed [18]. To accommodate time-varying behaviors and individual differences in human motion, we just need to adjust W , weights in the last layer of the neural network.
To apply RLS-PAA on the adaptation of W in (5), we can stack all the column vectors of the matrix W to form a new parameter vector θ ∈ R 3Mn h . θ k denotes the value of the parameter vector at time step k. To represent the extracted features, we define a new data matrix Φ k ∈ R 3M×3Mn h as a diagonal concatenation of M pieces of max(0, g(U, s k )). Using Φ k and θ k , then (1) and (5) can be written into the same form as (6). The procedure of semi-adaptable neural network is summarized in Algorithm 1.

Algorithm 1: Semi-adaptable neural network for human motion prediction
Input : Offline trained neural network (5) with g, U and W Output : future trajectory x(k + 1) Variables : Adaptation gain F, neural network last layer parameters θ , variance of zero-mean white Gaussian noise Var(w k ) Wait for a new joint position p captured by Kinect and current action label a from action recognition module; Obtain Φ(k) by diagonal concatenation of max(0, g(U, s k )); 5 Update F by (10); 6 Adapt the parameters θ in last layer of neural network by (9); 7 Calculate future joint trajectory x(k + 1) by (6); 8 send x(k + 1) to robot control. 9 end III. HYPOTHESIS Based on the prediction models discussed in the previous section, we anticipate that active prediction will affect both safety and efficiency during human robot collaboration, and the effects varies for models with different parameterizations and models with or without online adaptation. Here we propose three main hypotheses, which will be verified in the experiments to be discussed in the following sections: Hypothesis 1 (Prediction Accuracy) Online adaptation of a prediction model improves the prediction accuracy. The prediction accuracy is higher for models that can encode nonlinear features.
Hypothesis 2 (Prediction and Safety) Active human motion prediction enables the robot motion planner to take human tendency into consideration, which improves human safety.

Hypothesis 3 (Prediction and Efficiency)
Collaboration efficiency should be higher for prediction models with higher prediction accuracy (e.g., adaptable prediction models).

IV. EXPERIMENT DESIGN
To quantitatively evaluate the effects of motion prediction on human robot collaboration, we conduct a series of experiments in which a human works in close proximity to a robot while the robot is performing predefined tasks.

A. Experiment Setup
The experiment platform is shown in Fig. 1. The robot manipulator is FANUC LR Mate 200iD/7L, a 6-degreeof-freedom industrial robot. There is one Kinect sensor to monitor the dynamic environment. We track the trajectory of the human's right wrist. The system update frequency is approximately 20 Hz. All the experiments are implemented in Matlab 2016 platform on a Windows desktop with 2.7 GHz Intel Core i5 Processor and 16 GB RAM. We also deploy robot controller on the Simulink RealTime target.

B. Safe and Efficient Robot Collaborative Systems
The experiment is built upon the safe and efficient robot collaboration system (SERoCS) [10]. SERoCS consists of three modules: (T1) the robust cognition module for environment monitoring and prediction, (T2) the optimal task planning module for efficient human-robot collaboration, and (T3) the motion planning and control module for safe human-robot interaction. In the experiment, the robot is only required to track a simple trajectory, which does not require task planning in T2. We then close the loop with only T1 and T3. The input of T1 is the real time visual information, while the output of T1 consists of the past human states x * (k), and the predicted trajectoryx(k + 1 | k). In the comparison experiments, we use the four prediction models described in previous Section II as the prediction algorithm in T1.
We also deploy the T3 module to plan and control the robot motion. The module input is the environment information and the prediction of human motion from T1, while the output is the desired robot motion trajectory x R . The robot is equipped with 1) a short-term safety-oriented planner based on the safe set algorithm [19] and 2) a long-term efficiency-oriented planner based on the convex feasible set algorithm [20]. The two planners run in parallel. The close-loop execution of the human robot collaboration system is summarized below, which is also shown in Fig. 2. 1) The T1 module estimates the past human states x * (k) and predicts the future trajectoryx(k + 1 | k) from the sensory data. 2) The T3 module plans the future robot trajectory given information from the T1 module. The short term planner runs in receding horizon for 1 Hz. The long term planner only replans in two scenarios: when a new task is specified, or when the distance between the human and the robot is below a threshold.
3) The planned trajectory is send to the robot hardware for execution. New states of the system will be obtained in the next time step, and the steps 1) -3) repeat until experiments end.

C. Human-Robot Collaboration Tasks
To effectively compare different types of motion prediction models, we need to design human-robot interactive tasks considering the following features.
1) Variety of human motions: To simulate the real factory scene, the improvement brought by motion prediction should be robust facing more than one type of complex human motions. Therefore, the task needs to emphasize the variety of human motions.
2) Responsiveness of the robot: We want to test if the robot can operate safely and efficiently in a worst case scenario, i.e., when the human completely ignores the robot.  Fig. 2. Safe and efficient robot collaboration system (SERoCS). In the way, the robot needs to react quickly to meet the human's needs.
3) Repeatability: All experiments should be repeatable. Robot should be required to perform the same task at each trial. The same motion planner should be applied. Different human motion types should also be designed and fixed across comparison experiments with different motion prediction models.
To meet these requirements, we design the tasks following a factory scenario and focus on the most common "Fetching" operation. As shown in Fig. 1, we allocate a Disk and a RAM for the robot to fetch, starting from its idle pose. To emphasize the variety of human motions, we design four different motion patterns, as shown in Fig. 3. Four motion patterns represent four different action labels a in eq. (1). The action label is pre-defined across experiments. To test the responsiveness of the robot, we instruct the human in the experiments not to respond to the robot as long as safety is under control with emergency brakes. To guarantee the repeatability, we fix the locations of the Disk and RAM across different experiments. 2) Data collection: In order to verify the effects of different motion prediction models, it is necessary to pre-train the prediction models before using them in online execution.
We collected human motion data. For each type of motion, 30 trajectories are obtained, and are used for four prediction models training. To smooth the noisy trajectories, we use a low-pass filter p s (k) = 0.6p(k − 1) + 0.4p(k). p s (k) ∈ R 3 is the smoothed position of the joint at time step k, which is the weighted average of joint positionsp(k − 1) andp(k − 2) measured at time step k −1 and k −2. We also set the number of past and future joint positions N and M both to be 3.
3) Pre-computation: We pre-train the prediction models using the collected data. For Linear Regression Model, we use a 10 × 9 matrix to represent transformation parameter θ , and apply SGD to optimize θ . For Neural Network Model, we apply a 3-layer neural network with 40 nodes in the hidden layer. The number of nodes in the input layer and the output layer is 11 and 9, respectively. The loss function is set to be L2 loss. All the learning rates are set to 0.001 and the number of epochs is 100. Note that the parameters of RLS model and semi-adaptable neural network model can be initiated with parameters of the pre-trained linear regression model and offline neural network model, respectively.

4) Experimental validation:
After the pre-trained phase, we start human robot interactions experiments by substituting the prediction module with different prediction models. For each human motion, 20 independent trials are conducted, and 80 trials are conducted for each prediction model. We also conduct 80 counterpart trials without prediction module as ground truth. Experiment data is also collected, including human position series, robot position series, human motion prediction series, and videos.
E. Evaluation Metrics 1) Prediction: Accuracy is a good indicator for prediction performance. We define the average prediction error using average distance between the predicted trajectory and ground truth trajectory. A smaller average prediction error implies better prediction performance.
2) Safety: Robot is supposed to keep the proper distance from human to avoid potential collision. We define the average closet distance between the human and the robot as the safety index for each trial: where n is the sample frame number for a trial, H i and R i denote human pose and robot pose at frame i, respectively. A higher safety index means the robot is farther from the human, hence safer.
3) Efficiency: Proper prediction of human motion can make the robot escape in advance when human is approaching, and continue with its task when the human tends to get away. In other words, good motion prediction can improve the efficiency of robot motion by making the robot keep as close to its target as possible. Denote the average robot-target distance without human interference as ground truth D RT . We define the efficiency index by comparing the average distance between the robot and its target with the ground truth D RT : where T denotes the target position. A higher efficiency index indicates that the robot completes tasks more efficiently.

A. Prediction accuracy
We first evaluate the performance of the four prediction methods according to the prediction error as shown in Fig. 4. Semi-adaptable neural network results in much smaller prediction error and less wild standard deviation on majority of 80 trials. The statistics are also summarized in Table I.

B. Safety and efficiency
We also compare the safety and efficiency scores for the four prediction methods and the scenario without prediction. Comparison results is shown in Fig. 5. Compared with the scenario without prediction, active prediction using either prediction model boosts the safety scores with a significant margin. Adaptable models achieve the same safety level as non-adaptable models, while the efficiency scores of adaptable models are not compromised. The mean and variance  of safety-efficiency score of the five methods are shown in Table II, Semi-adaptable neural network leads to the most robust performance with least variance, its performance is also well balanced in terms of safety and efficiency.

A. Hypothesis 1 -Online Adaptation Improves Accuracy
As shown in the results, the prediction error is reduced significantly for adaptable models, which supports that online adaptable of the prediction model can improve prediction performance (Hypothesis 1). The quantitative metrics of prediction error mean and variance indicate semi-adaptable neural network leads to the best performance (Hypothesis 1). Due to high non-linearity of human motion, models parameterized by NN performances better than models parameterized by LRM.
Encoding nonlinear features will improve the prediction performance. Linear regression model with adaptation model only takes small quantities of past joint positions as input, and fails to encode the nonlinear features from input. Thus, small input noise can cause large prediction variance. However, semi-adaptable neural network encodes enough nonlinear features for adaptation from the raw input. Large quantities of nonlinear feature make online adaptation less sensitive to noisy input. Thus we observe small prediction error variance for semi-adaptable neural network.

B. Hypothesis 2 -Effective Prediction Improves Safety
It is notable that the average human robot distance is only 0.255 m without prediction, which is less than the minimum threshold 0.3 m for safe human robot interaction. However, the average safety scores are doubled when prediction modules are applied (Hypothesis 2). It is very common that human might approach robot at a high speed, which leaves the robot less time to escape the potential collision, especially when robot system update frequency is low.
The prediction models predict the tendency of human motion, such that the robot can generate trajectories by taking the future constraints into consideration. When the human is moving fast toward robot, the potential collision will be detected by comparing the predicted human position and future robot trajectory. Thus replanner can be trigger in advance, and safe human robot distance is nicely kept.

C. Hypothesis 3 -Effective Prediction Improves Efficiency
Though safety score is largely enhanced with active prediction, efficiency scores of prediction models without online adaptation are greatly compromised, since the robot's behavior is too conservative. However, when online adaptation is applied, the safety score is well maintained and the efficiency score is greatly boosted to the same level as the scenario without prediction (Hypothesis 3).
Good human robot collaboration system should excel both in safety and efficiency. When human motion prediction is good, the robot will accurately capture the tendency when human is getting away. Thus, the robot can quickly resume fetching following a new path that bypasses the predicted human trajectory. In such scenario, human safety is guaranteed and the distance between the robot and the target is also kept as close as possible. However, if human motion prediction is inaccurate, unrealistic path planning will be produced. As a result, efficiency is deteriorated.

VII. CONCLUSION
In this paper, we quantitatively evaluated the effects of human motion prediction on human robot collaboration. We designed a series of human robot interaction experiments. We compared the models with different parameterizations , we also compared models with or without online parameter adaptation. The experiment results demonstrated that human motion prediction significantly enhanced the collaboration safety, and more accurate prediction led to better efficiency. Both complex parameterizations and online adaptation enhanced motion prediction performance. Adaptable prediction models that were parameterized by neural networks achieved the best and robustest performance.